Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
潘栩锋
Thick-Common
Commits
212a0cb8
Commit
212a0cb8
authored
Nov 08, 2022
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 专为名字而设定的虚拟键盘
parent
1da75c4d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
437 additions
and
1 deletion
+437
-1
FLY.ControlLibrary.csproj
...ntrolLibrary/FLY.ControlLibrary/FLY.ControlLibrary.csproj
+7
-0
KeyboardBehavior.cs
...trolLibrary/FLY.ControlLibrary/UI.OSK/KeyboardBehavior.cs
+6
-1
WdNameKeyboard.xaml
...trolLibrary/FLY.ControlLibrary/UI.OSK/WdNameKeyboard.xaml
+292
-0
WdNameKeyboard.xaml.cs
...lLibrary/FLY.ControlLibrary/UI.OSK/WdNameKeyboard.xaml.cs
+132
-0
No files found.
Project.FLY.ControlLibrary/FLY.ControlLibrary/FLY.ControlLibrary.csproj
View file @
212a0cb8
...
...
@@ -118,6 +118,9 @@
<Compile
Include=
"Rules\FileNameRule.cs"
/>
<Compile
Include=
"NoToggleButton.cs"
/>
<Compile
Include=
"ToggleButtonOnOff.cs"
/>
<Compile
Include=
"UI.OSK\WdNameKeyboard.xaml.cs"
>
<DependentUpon>
WdNameKeyboard.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"UI.OSK\WdFullKeyboard.xaml.cs"
>
<DependentUpon>
WdFullKeyboard.xaml
</DependentUpon>
</Compile>
...
...
@@ -269,6 +272,10 @@
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Resource>
<Page
Include=
"UI.OSK\WdNameKeyboard.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"UI.OSK\WdFullKeyboard.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
...
...
Project.FLY.ControlLibrary/FLY.ControlLibrary/UI.OSK/KeyboardBehavior.cs
View file @
212a0cb8
...
...
@@ -171,9 +171,14 @@ namespace FLY.ControlLibrary.UI.OSK
kb
=
fkb
;
}
else
if
(
param
.
Contains
(
"name"
))
{
kb
=
new
WdNameKeyboard
();
}
else
{
kb
=
new
WdNumKeyboard
();
}
Window
w
=
(
Window
)
kb
;
Window
window
=
COMMON
.
GetWindow
(
tb
);
w
.
Owner
=
window
;
...
...
Project.FLY.ControlLibrary/FLY.ControlLibrary/UI.OSK/WdNameKeyboard.xaml
0 → 100644
View file @
212a0cb8
This diff is collapsed.
Click to expand it.
Project.FLY.ControlLibrary/FLY.ControlLibrary/UI.OSK/WdNameKeyboard.xaml.cs
0 → 100644
View file @
212a0cb8
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
using
System.Windows.Threading
;
namespace
FLY.ControlLibrary.UI.OSK
{
/// <summary>
/// WdPNameKeyboard.xaml 的交互逻辑
/// </summary>
public
partial
class
WdNameKeyboard
:
Window
,
INotifyPropertyChanged
,
IVirtualKeyboard
{
private
DispatcherTimer
timer
;
private
TextBox
textbox
=
null
;
private
bool
press1st
=
true
;
public
WdNameKeyboard
()
{
InitializeComponent
();
timer
=
new
DispatcherTimer
();
timer
.
Tick
+=
new
EventHandler
(
timer_Tick
);
timer
.
Interval
=
TimeSpan
.
FromMilliseconds
(
1
);
}
void
timer_Tick
(
object
sender
,
EventArgs
e
)
{
timer
.
Stop
();
this
.
ShowDialog
();
}
public
void
Open
(
TextBox
textbox
)
{
this
.
textbox
=
textbox
;
this
.
Result
=
textbox
.
Text
;
timer
.
Start
();
//不能直接showdialog(), 要让事件继续传递,直到有个框出来!!!
//this.ShowDialog();
}
private
void
Window_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
textblock_result
.
DataContext
=
this
;
}
private
void
button_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
press1st
)
{
press1st
=
false
;
Result
=
""
;
}
string
text
=
((
sender
as
Button
).
Content
as
TextBlock
).
Text
;
Result
+=
text
;
}
private
void
button_backspace_Click
(
object
sender
,
RoutedEventArgs
e
)
{
Result
=
""
;
}
private
void
button_close_Click
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
Close
();
}
private
void
button_space_Click
(
object
sender
,
RoutedEventArgs
e
)
{
Result
+=
" "
;
}
private
void
button_enter_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
this
.
textbox
!=
null
)
{
this
.
textbox
.
Text
=
Result
;
//触发失去焦点事件!!!!!!!
//让 绑定的 property 生效
this
.
textbox
.
RaiseEvent
(
new
RoutedEventArgs
(
TextBox
.
LostFocusEvent
));
}
this
.
Close
();
}
private
string
result
;
/// <summary>
/// 结果
/// </summary>
public
string
Result
{
get
{
return
result
;
}
set
{
if
(
result
!=
value
)
{
result
=
value
;
this
.
ResultView
=
this
.
Result
;
}
}
}
/// <summary>
/// 正常模式时, ResultView 与 Result 一样, 密码模式时, ResultView 显示*******
/// </summary>
public
string
ResultView
{
get
;
set
;
}
/// <summary>
/// 属性改变事件
/// </summary>
public
event
PropertyChangedEventHandler
PropertyChanged
;
private
void
Border_MouseDown
(
object
sender
,
MouseButtonEventArgs
e
)
{
this
.
DragMove
();
}
}
}
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