개정판 91c5e7a1
KEY EVENT APP에 추가
Change-Id: Ibfa264faa1cee77bbd61a83d7868caed6dedff0f
KCOM/App.xaml.cs | ||
---|---|---|
21 | 21 |
using KCOM.Views; |
22 | 22 |
using System.Threading.Tasks; |
23 | 23 |
using Telerik.Windows.Controls; |
24 |
using System.Windows.Input; |
|
24 | 25 |
|
25 | 26 |
[assembly: log4net.Config.XmlConfigurator(Watch = true)] |
26 | 27 |
namespace KCOM |
... | ... | |
269 | 270 |
Current.ShutdownMode = ShutdownMode.OnMainWindowClose; |
270 | 271 |
|
271 | 272 |
UpdateCheck(e); |
273 |
|
|
274 |
System.Windows.Input.Keyboard.AddKeyDownHandler(this.MainWindow, KeyDownEvent); |
|
275 |
|
|
276 |
|
|
272 | 277 |
//this.MainWindow.Show(); |
273 | 278 |
//KeyValuePair<bool, string> updatecheck = UpdateCheck(e); |
274 | 279 |
} |
... | ... | |
282 | 287 |
} |
283 | 288 |
} |
284 | 289 |
|
290 |
private void KeyDownEvent(object sender, KeyEventArgs e) |
|
291 |
{ |
|
292 |
System.Diagnostics.Debug.WriteLine("app key Event"); |
|
293 |
Common.ViewerDataModel.Instance.SystemMain.KeyEventDownAction(sender, e); |
|
294 |
} |
|
295 |
|
|
285 | 296 |
private KeyValuePair<bool, string> UpdateCheck(StartupEventArgs startupEvents) |
286 | 297 |
{ |
287 | 298 |
bool isUpdateCheck = false; |
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
203 | 203 |
public AdornerFinal() |
204 | 204 |
{ |
205 | 205 |
InitializeComponent(); |
206 |
|
|
206 | 207 |
BorderSize = new Rect(); |
207 | 208 |
_dragData.Add(rotateTop, new DragData() { CursorAngle = 0, DragType = DragType.Rotate, RotateIsLeft = true, RotateIsTop = true }); |
208 | 209 |
} |
KCOM/MainWindow.xaml | ||
---|---|---|
13 | 13 |
navigation:RadWindowInteropHelper.ShowInTaskbar="True" |
14 | 14 |
Style="{StaticResource MainWindowStyle}" BorderBrush="#FF40568D" |
15 | 15 |
navigation:RadWindowInteropHelper.Icon="markup.ico" |
16 |
Background="{DynamicResource KCOMColor_TopMenubackgroundBrush}" PreviewKeyUp="KeyEventDownAction"
|
|
16 |
Background="{DynamicResource KCOMColor_TopMenubackgroundBrush}" |
|
17 | 17 |
Header="MARKUS" Foreground="White" > |
18 | 18 |
<telerik:RadWindow.Resources> |
19 | 19 |
<Style x:Key="NoMarginGrid" TargetType="{x:Type Grid}"> |
KCOM/MainWindow.xaml.cs | ||
---|---|---|
54 | 54 |
App.splashString(ISplashMessage.MAINWINDOW); |
55 | 55 |
this.Loaded += MainWindow_Loaded; |
56 | 56 |
|
57 |
//this.AddHandler(Keyboard.KeyDownEvent, |
|
58 |
//new KeyEventHandler((sender, e) =>KeyEventDownAction(sender, e)),false); |
|
57 |
this.AddHandler(Keyboard.KeyDownEvent, |
|
58 |
new KeyEventHandler((sender, e) => |
|
59 |
{ |
|
60 |
System.Diagnostics.Debug.WriteLine("Mainwindow event"); |
|
61 |
KeyEventDownAction(sender, e); |
|
62 |
}), false); |
|
59 | 63 |
|
60 | 64 |
//this.PreviewKeyDown += new KeyEventHandler(KeyEventDownAction); |
61 | 65 |
//this.SourceInitialized += new EventHandler(win_SourceInitialized); |
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
76 | 76 |
Base_TextBox.GotFocus += new RoutedEventHandler(Base_TextBox_GotFocus); |
77 | 77 |
Base_TextBox.LostFocus += new RoutedEventHandler(Base_TextBox_LostFocus); |
78 | 78 |
Base_TextBox.SelectionChanged += (sender, e) => MoveCustomCaret(); |
79 |
|
|
79 |
this.KeyDown += ArrowTextControl_KeyDown; |
|
80 | 80 |
SetArrowTextPath(); |
81 | 81 |
Base_TextBox.IsTabStop = true; |
82 | 82 |
} |
83 | 83 |
|
84 |
private void ArrowTextControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) |
|
85 |
{ |
|
86 |
if(e.Key == System.Windows.Input.Key.Escape) |
|
87 |
{ |
|
88 |
if(string.IsNullOrEmpty(Base_TextBox.Text)) |
|
89 |
{ |
|
90 |
this.Visibility = Visibility.Collapsed; |
|
91 |
} |
|
92 |
|
|
93 |
EditEnd(); |
|
94 |
} |
|
95 |
} |
|
96 |
|
|
84 | 97 |
public void SetFontFamily(FontFamily fontFamily) |
85 | 98 |
{ |
86 | 99 |
this.FontFamily = fontFamily; |
... | ... | |
194 | 207 |
|
195 | 208 |
void Base_TextBox_LostFocus(object sender, RoutedEventArgs e) |
196 | 209 |
{ |
197 |
|
|
210 |
EditEnd(); |
|
211 |
} |
|
212 |
|
|
213 |
private void EditEnd() |
|
214 |
{ |
|
198 | 215 |
this.ArrowText = Base_TextBox.Text; |
216 |
Base_TextBox.Focusable = false; |
|
199 | 217 |
this.BaseTextbox_Caret.Visibility = Visibility.Collapsed; |
200 | 218 |
this.IsEditingMode = false; |
201 | 219 |
ApplyOverViewData(); |
내보내기 Unified diff