Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KenPanCS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QCD
Tools
KenPanCS
Commits
933feca2
Commit
933feca2
authored
Dec 09, 2021
by
tsuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NumericUpDownメニューをFormから参照したメニューに修正
parent
eb78f75a
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
275 deletions
+43
-275
CSRender.csproj
Code/CSRender/CSRender/CSRender.csproj
+2
-0
MainWindow.xaml
Code/CSRender/CSRender/MainWindow.xaml
+41
-59
MainWindow.xaml.cs
Code/CSRender/CSRender/MainWindow.xaml.cs
+0
-40
NumericUpDown.cs
Code/CSRender/CSRender/NumericUpDown.cs
+0
-176
No files found.
Code/CSRender/CSRender/CSRender.csproj
View file @
933feca2
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
</Reference>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Windows.Forms"
/>
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Core"
/>
...
@@ -58,6 +59,7 @@
...
@@ -58,6 +59,7 @@
<Reference
Include=
"WindowsBase"
/>
<Reference
Include=
"WindowsBase"
/>
<Reference
Include=
"PresentationCore"
/>
<Reference
Include=
"PresentationCore"
/>
<Reference
Include=
"PresentationFramework"
/>
<Reference
Include=
"PresentationFramework"
/>
<Reference
Include=
"WindowsFormsIntegration"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ApplicationDefinition
Include=
"App.xaml"
>
<ApplicationDefinition
Include=
"App.xaml"
>
...
...
Code/CSRender/CSRender/MainWindow.xaml
View file @
933feca2
This diff is collapsed.
Click to expand it.
Code/CSRender/CSRender/MainWindow.xaml.cs
View file @
933feca2
...
@@ -33,46 +33,6 @@ namespace CSRender
...
@@ -33,46 +33,6 @@ namespace CSRender
{
{
InitializeComponent
();
InitializeComponent
();
//解像度選択UpDownバーの設定
this
.
Title
=
this
.
ToString
();
ResolutionBox
.
MouseWheel
+=
NumericTextBox_MouseWheel
;
ResolutionBox
.
GotFocus
+=
NumericTextBox_GotFocusSelectAll
;
ResolutionBox
.
TextChanged
+=
NumericTextBox_TextChanged
;
ResolutionBox
.
TextChanged
+=
NumericTextBox_NumChanged
;
NumericScroll1
.
MouseWheel
+=
NumericScroll1_MouseWheel
;
//位置ズレ許容量選択UpDownバーの設定
this
.
Title
=
this
.
ToString
();
PositionBox
.
MouseWheel
+=
NumericTextBox_MouseWheel
;
PositionBox
.
GotFocus
+=
NumericTextBox_GotFocusSelectAll
;
PositionBox
.
TextChanged
+=
NumericTextBox_TextChanged
;
PositionBox
.
TextChanged
+=
PosiTextBox_NumChanged
;
PosiScroll1
.
MouseWheel
+=
PosiScroll1_MouseWheel
;
//諧調差許容量選択UpDownバーの設定
this
.
Title
=
this
.
ToString
();
GradationBox
.
MouseWheel
+=
NumericTextBox_MouseWheel
;
GradationBox
.
GotFocus
+=
NumericTextBox_GotFocusSelectAll
;
GradationBox
.
TextChanged
+=
NumericTextBox_TextChanged
;
GradationBox
.
TextChanged
+=
GradTextBox_NumChanged
;
GradScroll
.
MouseWheel
+=
GradScroll_MouseWheel
;
//微小誤差許容量選択UpDownバーの設定
this
.
Title
=
this
.
ToString
();
SmallDiffBox
.
MouseWheel
+=
NumericTextBox_MouseWheel
;
SmallDiffBox
.
GotFocus
+=
NumericTextBox_GotFocusSelectAll
;
SmallDiffBox
.
TextChanged
+=
NumericTextBox_TextChanged
;
SmallDiffBox
.
TextChanged
+=
SmallDiffTextBox_NumChanged
;
SmallDiffScroll
.
MouseWheel
+=
SmallDiffScroll_MouseWheel
;
//視覚的あいまい量選択UpDownバーの設定
this
.
Title
=
this
.
ToString
();
VisualBox
.
MouseWheel
+=
NumericTextBox_MouseWheel
;
VisualBox
.
GotFocus
+=
NumericTextBox_GotFocusSelectAll
;
VisualBox
.
TextChanged
+=
NumericTextBox_TextChanged
;
VisualBox
.
TextChanged
+=
VisualTextBox_NumChanged
;
VisualScroll
.
MouseWheel
+=
VisualScroll_MouseWheel
;
//ページ入力メニューの設定
//ページ入力メニューの設定
PagePattern
.
Add
((
new
ComboBoxSet
{
Id
=
1
,
Item
=
"全ページ"
}));
PagePattern
.
Add
((
new
ComboBoxSet
{
Id
=
1
,
Item
=
"全ページ"
}));
PagePattern
.
Add
((
new
ComboBoxSet
{
Id
=
2
,
Item
=
"指定"
}));
PagePattern
.
Add
((
new
ComboBoxSet
{
Id
=
2
,
Item
=
"指定"
}));
...
...
Code/CSRender/CSRender/NumericUpDown.cs
View file @
933feca2
...
@@ -20,181 +20,5 @@ namespace CSRender
...
@@ -20,181 +20,5 @@ namespace CSRender
public
partial
class
MainWindow
:
Window
public
partial
class
MainWindow
:
Window
{
{
////////////////////////////////////////////////////////////////////////////
// 解像度のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//TextBoxフォーカス時にテキスト全選択
private
void
NumericTextBox_GotFocusSelectAll
(
object
sender
,
RoutedEventArgs
e
)
{
TextBox
ResolutionBox
=
(
TextBox
)
sender
;
//box.SelectAll();
this
.
Dispatcher
.
InvokeAsync
(()
=>
{
Task
.
Delay
(
10
);
ResolutionBox
.
SelectAll
();
});
}
//正規表現で数値以外は削除using System.Text.RegularExpressions;
private
void
NumericTextBox_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
ResolutionBox
=
(
TextBox
)
sender
;
double
d
;
if
(!
double
.
TryParse
(
ResolutionBox
.
Text
,
out
d
))
{
ResolutionBox
.
Text
=
Regex
.
Replace
(
ResolutionBox
.
Text
,
"[^0-9-]"
,
""
);
}
}
//数字の下限;
private
void
NumericTextBox_NumChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
ResolutionBox
=
(
TextBox
)
sender
;
if
(
ResolutionBox
.
Text
==
""
)
{
ResolutionBox
.
Text
=
"72"
;
}
NumericScroll1
.
Value
=
Int32
.
Parse
(
ResolutionBox
.
Text
);
}
//TextBox上でマウスホイールを回転させた時にスクロールバーの値を上下させる
private
void
NumericTextBox_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
TextBox
ResolutionBox
=
(
TextBox
)
sender
;
Binding
binding
=
BindingOperations
.
GetBinding
(
ResolutionBox
,
TextBox
.
TextProperty
);
ScrollBar
NumericScroll1
=
(
ScrollBar
)
this
.
FindName
(
binding
.
ElementName
);
//名前から取得
NumericScroll1
.
Value
=
Int32
.
Parse
(
ResolutionBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
NumericScroll1
.
Value
++;
}
else
{
NumericScroll1
.
Value
--;
}
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private
void
NumericScroll1_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
ScrollBar
NumericScroll1
=
(
ScrollBar
)
sender
;
NumericScroll1
.
Value
=
Int32
.
Parse
(
ResolutionBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
NumericScroll1
.
Value
++;
}
else
{
NumericScroll1
.
Value
--;
}
}
////////////////////////////////////////////////////////////////////////////
// 位置ズレ許容量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private
void
PosiTextBox_NumChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
PositionBox
=
(
TextBox
)
sender
;
if
(
PositionBox
.
Text
==
""
)
{
PositionBox
.
Text
=
"2"
;
}
PosiScroll1
.
Value
=
Int32
.
Parse
(
PositionBox
.
Text
);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private
void
PosiScroll1_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
ScrollBar
PosiScroll1
=
(
ScrollBar
)
sender
;
PosiScroll1
.
Value
=
Int32
.
Parse
(
PositionBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
PosiScroll1
.
Value
++;
}
else
{
PosiScroll1
.
Value
--;
}
}
////////////////////////////////////////////////////////////////////////////
// 諧調差許容量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private
void
GradTextBox_NumChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
GradationBox
=
(
TextBox
)
sender
;
if
(
GradationBox
.
Text
==
""
)
{
GradationBox
.
Text
=
"60"
;
}
GradScroll
.
Value
=
Int32
.
Parse
(
GradationBox
.
Text
);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private
void
GradScroll_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
ScrollBar
GradScroll
=
(
ScrollBar
)
sender
;
GradScroll
.
Value
=
Int32
.
Parse
(
GradationBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
GradScroll
.
Value
++;
}
else
{
GradScroll
.
Value
--;
}
}
////////////////////////////////////////////////////////////////////////////
// 微小差異許容量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private
void
SmallDiffTextBox_NumChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
SmallDiffBox
=
(
TextBox
)
sender
;
if
(
SmallDiffBox
.
Text
==
""
)
{
SmallDiffBox
.
Text
=
"60"
;
}
SmallDiffScroll
.
Value
=
Int32
.
Parse
(
SmallDiffBox
.
Text
);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private
void
SmallDiffScroll_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
ScrollBar
SmallDiffScroll
=
(
ScrollBar
)
sender
;
SmallDiffScroll
.
Value
=
Int32
.
Parse
(
SmallDiffBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
SmallDiffScroll
.
Value
++;
}
else
{
SmallDiffScroll
.
Value
--;
}
}
////////////////////////////////////////////////////////////////////////////
// 視覚的あいまい量のUpDownメニュー機能の記述
////////////////////////////////////////////////////////////////////////////
//数字の下限;
private
void
VisualTextBox_NumChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
VisualBox
=
(
TextBox
)
sender
;
if
(
VisualBox
.
Text
==
""
)
{
VisualBox
.
Text
=
"60"
;
}
VisualScroll
.
Value
=
Int32
.
Parse
(
VisualBox
.
Text
);
}
//ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
private
void
VisualScroll_MouseWheel
(
object
sender
,
MouseWheelEventArgs
e
)
{
ScrollBar
VisualScroll
=
(
ScrollBar
)
sender
;
VisualScroll
.
Value
=
Int32
.
Parse
(
VisualBox
.
Text
);
if
(
e
.
Delta
>
0
)
{
VisualScroll
.
Value
++;
}
else
{
VisualScroll
.
Value
--;
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment