markus / KCOM / Events / Event_KeyEvent.cs @ 51c6ce90
이력 | 보기 | 이력해설 | 다운로드 (24.1 KB)
1 | 787a4489 | KangIngu | using KCOM.Common; |
---|---|---|---|
2 | 8118ba81 | swate0609 | using KCOM.Controls; |
3 | f816dd63 | humkyung | using KCOM.Events; |
4 | 787a4489 | KangIngu | using MarkupToPDF.Common; |
5 | 8118ba81 | swate0609 | using MarkupToPDF.Controls.Cad; |
6 | using MarkupToPDF.Controls.Line; |
||
7 | 036650a0 | humkyung | using MarkupToPDF.Controls.Parsing; |
8 | 8118ba81 | swate0609 | using MarkupToPDF.Controls.Polygon; |
9 | using MarkupToPDF.Controls.Shape; |
||
10 | 38d69491 | taeseongkim | using MarkupToPDF.Controls.Text; |
11 | 787a4489 | KangIngu | using System; |
12 | using System.Collections.Generic; |
||
13 | using System.ComponentModel; |
||
14 | using System.Linq; |
||
15 | using System.Text; |
||
16 | using System.Windows; |
||
17 | using System.Windows.Controls; |
||
18 | using System.Windows.Input; |
||
19 | 53880c83 | ljiyeon | using System.Windows.Media; |
20 | using System.Windows.Media.Imaging; |
||
21 | 787a4489 | KangIngu | using Telerik.Windows.Controls; |
22 | |||
23 | namespace KCOM |
||
24 | { |
||
25 | 68302e9d | taeseongkim | public partial class MainWindow : KCOM.Controls.CustomizedWindow.CustomWindow |
26 | 787a4489 | KangIngu | { |
27 | b2d0f316 | humkyung | /// <summary> |
28 | /// 입력한 키 처리 |
||
29 | /// </summary> |
||
30 | /// <param name="sender"></param> |
||
31 | /// <param name="e"></param> |
||
32 | 91e84544 | taeseongkim | public async void KeyEventDownAction(object sender, KeyEventArgs e) |
33 | 787a4489 | KangIngu | { |
34 | 91e84544 | taeseongkim | await this.Dispatcher.InvokeAsync(() => { |
35 | 787a4489 | KangIngu | switch (e.Key) |
36 | { |
||
37 | 5a65e058 | taeseongkim | //강인구 추가 |
38 | 787a4489 | KangIngu | #region 단축키 선택 |
39 | |||
40 | 872b94b9 | taeseongkim | case Key.I: |
41 | 5a65e058 | taeseongkim | { |
42 | if (ViewerDataModel.Instance.IsPressCtrl && ViewerDataModel.Instance.IsPressShift) |
||
43 | { |
||
44 | c206d293 | taeseongkim | if (!ViewerDataModel.Instance.IsAdmin) |
45 | 872b94b9 | taeseongkim | { |
46 | c206d293 | taeseongkim | EventHandler<WindowClosedEventArgs> closeEventHandler = (snd, evt) => |
47 | { |
||
48 | if (evt.PromptResult == "markus01#") |
||
49 | { |
||
50 | ViewerDataModel.Instance.IsAdmin = true; |
||
51 | } |
||
52 | }; |
||
53 | |||
54 | var parameters = new DialogParameters() |
||
55 | { |
||
56 | ContentStyle = (Style)this.FindResource("RadPasswordPromptStyle"), |
||
57 | Content = "Enter password: ", |
||
58 | Closed = closeEventHandler |
||
59 | }; |
||
60 | |||
61 | RadWindow.Prompt(parameters); |
||
62 | 872b94b9 | taeseongkim | } |
63 | else |
||
64 | { |
||
65 | ViewerDataModel.Instance.IsAdmin = false; |
||
66 | } |
||
67 | } |
||
68 | 5a65e058 | taeseongkim | } |
69 | break; |
||
70 | |||
71 | b2d0f316 | humkyung | #region 전체 선택(Ctrl + A) |
72 | 787a4489 | KangIngu | case Key.A: |
73 | { |
||
74 | 53393bae | KangIngu | if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)) |
75 | 787a4489 | KangIngu | { |
76 | f959ea6f | humkyung | this.dzMainMenu.ConvertInkControlToPolygon(); |
77 | 787a4489 | KangIngu | |
78 | if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0) |
||
79 | { |
||
80 | 92c9cab8 | taeseongkim | var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).IsEditingMode == true).FirstOrDefault(); |
81 | if (text_item_ != null) |
||
82 | { |
||
83 | 2a2e72c2 | swate0609 | //2024-04-25 IRON |
84 | //TextBox가 편집중일 때 Control + A (전체 선택) 하면 전체 텍스트가 선택되도록 수정. |
||
85 | return; |
||
86 | 92c9cab8 | taeseongkim | (text_item_ as TextControl).Base_TextBlock.Visibility = Visibility.Visible; |
87 | (text_item_ as TextControl).Base_TextBox.Visibility = Visibility.Collapsed; |
||
88 | 2a2e72c2 | swate0609 | //(text_item_ as TextControl).UnEditingMode(); |
89 | 92c9cab8 | taeseongkim | |
90 | 2a2e72c2 | swate0609 | //SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu); |
91 | |||
92 | |||
93 | //return; |
||
94 | 92c9cab8 | taeseongkim | } |
95 | |||
96 | var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as ArrowTextControl) != null && (data as ArrowTextControl).IsEditingMode == true).FirstOrDefault(); |
||
97 | c4a8d205 | swate0609 | //if (Arrowtext_item_ != null && ((Arrowtext_item_ as ArrowTextControl).IsNew == false)) |
98 | if(Arrowtext_item_ != null) |
||
99 | 92c9cab8 | taeseongkim | { |
100 | 8e924295 | swate0609 | //2024-04-25 IRON |
101 | //TextBox가 편집중일 때 Control + A (전체 선택) 하면 전체 텍스트가 선택되도록 수정. |
||
102 | return; |
||
103 | //(Arrowtext_item_ as ArrowTextControl).IsEditingMode = false; |
||
104 | //(Arrowtext_item_ as ArrowTextControl).Base_TextBox.Focusable = false; |
||
105 | //(Arrowtext_item_ as ArrowTextControl).UnEditingMode(); |
||
106 | 92c9cab8 | taeseongkim | |
107 | 8e924295 | swate0609 | //SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu); |
108 | 92c9cab8 | taeseongkim | } |
109 | |||
110 | /// 전체 선택 시 선택된 토글 해제 |
||
111 | 787a4489 | KangIngu | var TogList = this.dzTopMenu.Parent.ChildrenOfType<RadToggleButton>(); |
112 | this.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
113 | this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
114 | |||
115 | 92c9cab8 | taeseongkim | if (text_item_ == null && Arrowtext_item_ == null) |
116 | { |
||
117 | /// 컨트롤을 그리는 도중일 경우 컨트롤 삭제 |
||
118 | ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl); |
||
119 | } |
||
120 | |||
121 | 787a4489 | KangIngu | this.dzMainMenu.currentControl = null; |
122 | |||
123 | foreach (var tog in TogList) |
||
124 | { |
||
125 | tog.IsChecked = false; |
||
126 | } |
||
127 | 077896be | humkyung | |
128 | b37ef4b3 | humkyung | SelectionSet.Instance.SelectAll(); |
129 | 787a4489 | KangIngu | } |
130 | } |
||
131 | } |
||
132 | break; |
||
133 | #endregion |
||
134 | |||
135 | #region 복사하기(Ctrl + C) |
||
136 | case Key.C: |
||
137 | { |
||
138 | b37ef4b3 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl) CopyCommand.Instance.Execute(); |
139 | 787a4489 | KangIngu | } |
140 | break; |
||
141 | #endregion |
||
142 | |||
143 | #region 잘라내기(Ctrl + X) |
||
144 | case Key.X: |
||
145 | { |
||
146 | b37ef4b3 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl) CutCommand.Instance.Execute(); |
147 | 787a4489 | KangIngu | } |
148 | break; |
||
149 | #endregion |
||
150 | |||
151 | #region 붙여넣기(Ctrl + V) |
||
152 | case Key.V: |
||
153 | { |
||
154 | 53393bae | KangIngu | if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)) |
155 | 787a4489 | KangIngu | { |
156 | b37ef4b3 | humkyung | PasteCommand.Instance.Execute(); |
157 | 37b65344 | humkyung | } |
158 | 787a4489 | KangIngu | } |
159 | break; |
||
160 | #endregion |
||
161 | |||
162 | #region 저장하기(Ctrl + S) |
||
163 | case Key.S: |
||
164 | { |
||
165 | 37b65344 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)) |
166 | 787a4489 | KangIngu | { |
167 | fd19a116 | humkyung | var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(data => data is TextControl && (data as TextControl).IsEditingMode); |
168 | 38d69491 | taeseongkim | if (text_item_ != null) |
169 | { |
||
170 | (text_item_ as TextControl).Base_TextBlock.Visibility = Visibility.Visible; |
||
171 | (text_item_ as TextControl).Base_TextBox.Visibility = Visibility.Collapsed; |
||
172 | (text_item_ as TextControl).UnEditingMode(); |
||
173 | |||
174 | SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu); |
||
175 | } |
||
176 | |||
177 | fd19a116 | humkyung | var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(data => data is ArrowTextControl && (data as ArrowTextControl).IsEditingMode); |
178 | 38d69491 | taeseongkim | if (Arrowtext_item_ != null && ((Arrowtext_item_ as ArrowTextControl).IsNew == false)) |
179 | { |
||
180 | (Arrowtext_item_ as ArrowTextControl).IsEditingMode = false; |
||
181 | (Arrowtext_item_ as ArrowTextControl).Base_TextBox.Focusable = false; |
||
182 | (Arrowtext_item_ as ArrowTextControl).UnEditingMode(); |
||
183 | |||
184 | SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu); |
||
185 | } |
||
186 | |||
187 | if (text_item_ == null && Arrowtext_item_ == null) |
||
188 | { //컨트롤을 그리는 도중일 경우 컨트롤 삭제 |
||
189 | ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl); |
||
190 | } |
||
191 | |||
192 | 787a4489 | KangIngu | this.dzMainMenu.currentControl = null; |
193 | |||
194 | 65eb8dd6 | ljiyeon | if (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission) |
195 | { |
||
196 | 5ba8f2d5 | taeseongkim | ViewerDataModel.Instance.IsMarkupUpdate = true; |
197 | cb5c7f06 | humkyung | this.dzTopMenu.SaveEventCallback(new object(), null); |
198 | 65eb8dd6 | ljiyeon | } |
199 | 37b65344 | humkyung | } |
200 | 787a4489 | KangIngu | } |
201 | break; |
||
202 | #endregion |
||
203 | |||
204 | #region 프린트하기(Ctrl + P) |
||
205 | case Key.P: |
||
206 | { |
||
207 | if (ViewerDataModel.Instance.IsPressCtrl) |
||
208 | { |
||
209 | this.dzTopMenu.Print_Start("Print"); |
||
210 | } |
||
211 | } |
||
212 | break; |
||
213 | e1b36bc0 | humkyung | #endregion |
214 | case Key.G: |
||
215 | { |
||
216 | #region Grouping 해제 |
||
217 | if (ViewerDataModel.Instance.IsPressCtrl && ViewerDataModel.Instance.IsPressShift) |
||
218 | { |
||
219 | 8118ba81 | swate0609 | if (ViewerDataModel.Instance.UndoDataList == null) |
220 | { |
||
221 | return; |
||
222 | } |
||
223 | |||
224 | UndoCommand.Instance.Push(EventType.Operation, SelectionSet.Instance.SelectedItems); |
||
225 | |||
226 | e1b36bc0 | humkyung | SelectionSet.Instance.SelectedItems.ForEach(x => x.GroupID = string.Empty); |
227 | } |
||
228 | #endregion |
||
229 | #region Grouping |
||
230 | else if (ViewerDataModel.Instance.IsPressCtrl) |
||
231 | { |
||
232 | 8118ba81 | swate0609 | if (ViewerDataModel.Instance.UndoDataList == null) |
233 | { |
||
234 | return; |
||
235 | } |
||
236 | |||
237 | UndoCommand.Instance.Push(EventType.Operation, SelectionSet.Instance.SelectedItems); |
||
238 | |||
239 | e1b36bc0 | humkyung | string GroupID = Guid.NewGuid().ToString(); |
240 | SelectionSet.Instance.SelectedItems.ForEach(x => x.GroupID = GroupID); |
||
241 | } |
||
242 | #endregion |
||
243 | } |
||
244 | break; |
||
245 | 787a4489 | KangIngu | |
246 | #region Undo(Ctrl + Z) |
||
247 | e1b36bc0 | humkyung | case Key.Z: |
248 | 787a4489 | KangIngu | { |
249 | f816dd63 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl) UndoCommand.Instance.Execute(); |
250 | 787a4489 | KangIngu | } |
251 | break; |
||
252 | #endregion |
||
253 | |||
254 | #region Redo(Ctrl + Y) |
||
255 | case Key.Y: |
||
256 | { |
||
257 | f816dd63 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl) RedoCommand.Instance.Execute(); |
258 | 787a4489 | KangIngu | } |
259 | break; |
||
260 | #endregion |
||
261 | |||
262 | #region 삭제하기(Delete) |
||
263 | case Key.Delete: |
||
264 | { |
||
265 | 8e6884a5 | taeseongkim | List<CommentUserInfo> selectItems = SelectionSet.Instance.SelectedItems; |
266 | 85132173 | humkyung | SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
267 | f816dd63 | humkyung | this.dzMainMenu.SelectLayer.Children.Clear(); |
268 | 8e6884a5 | taeseongkim | |
269 | 34ac8db7 | humkyung | UndoCommand.Instance.Push(EventType.Delete, selectItems); |
270 | 787a4489 | KangIngu | } |
271 | break; |
||
272 | #endregion |
||
273 | |||
274 | #region 선택된 컨트롤 모두 해제 하기(ESC) |
||
275 | case Key.Escape: |
||
276 | { |
||
277 | //캡쳐모드 일 경우 초기화 |
||
278 | 37b65344 | humkyung | if (this.dzMainMenu.mouseHandlingMode == IKCOM.MouseHandlingMode.Capture) |
279 | 787a4489 | KangIngu | { |
280 | //dzMainMenu.PN_Navi.IsEnabled = true; |
||
281 | this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
282 | ViewerDataModel.Instance.Capture_Opacity = 0; |
||
283 | } |
||
284 | |||
285 | b74a9c91 | taeseongkim | if (Common.ViewerDataModel.Instance.SelectedControl == "Batch" |
286 | || Common.ViewerDataModel.Instance.SelectedControl == "MACRO") |
||
287 | 787a4489 | KangIngu | { |
288 | this.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
289 | this.dzMainMenu.txtBatch.Visibility = Visibility.Collapsed; |
||
290 | this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
291 | var TogList = this.dzTopMenu.Parent.ChildrenOfType<RadToggleButton>(); |
||
292 | foreach (var tog in TogList) |
||
293 | { |
||
294 | tog.IsChecked = false; |
||
295 | } |
||
296 | } |
||
297 | |||
298 | 077896be | humkyung | SelectionSet.Instance.UnSelect(this.dzMainMenu); |
299 | 787a4489 | KangIngu | |
300 | //코멘트 그리는 도중일 경우 코멘트 삭제 및 초기화 |
||
301 | 49b217ad | humkyung | if (this.dzMainMenu.currentControl != null) |
302 | { |
||
303 | ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl); |
||
304 | this.dzMainMenu.currentControl = null; |
||
305 | } |
||
306 | 787a4489 | KangIngu | |
307 | 2eac4f76 | KangIngu | //모든 컨트롤 초기화 하고 Selection모드로 변경 |
308 | dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting; |
||
309 | dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
310 | |||
311 | var toggleList = this.ChildrenOfType<RadToggleButton>(); |
||
312 | var toggleList2 = this.ChildrenOfType<RadRibbonToggleButton>(); |
||
313 | |||
314 | 17a22987 | KangIngu | foreach (var item in toggleList) |
315 | { |
||
316 | if (item.Name == "btnSelection") |
||
317 | 2eac4f76 | KangIngu | { |
318 | item.IsChecked = true; |
||
319 | } |
||
320 | 17a22987 | KangIngu | else |
321 | 2eac4f76 | KangIngu | { |
322 | item.IsChecked = false; |
||
323 | } |
||
324 | 17a22987 | KangIngu | } |
325 | 9f473fb7 | KangIngu | dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
326 | b643fcca | taeseongkim | //foreach (var item in toggleList2) |
327 | //{ |
||
328 | // item.IsChecked = false; |
||
329 | //} |
||
330 | ViewerDataModel.Instance.SetAngleVisible(Visibility.Collapsed); |
||
331 | 787a4489 | KangIngu | } |
332 | break; |
||
333 | 992a98b4 | KangIngu | #endregion |
334 | |||
335 | #region FIND(Ctrl + F) |
||
336 | case Key.F: |
||
337 | { |
||
338 | 469b2bbf | KangIngu | if (ViewerDataModel.Instance.IsPressCtrl) |
339 | 992a98b4 | KangIngu | { |
340 | 469b2bbf | KangIngu | if (!this.dzMainMenu.searchPane.IsPinned) |
341 | 992a98b4 | KangIngu | { |
342 | 469b2bbf | KangIngu | this.dzMainMenu.searchPane.IsPinned = true; |
343 | if (ViewerDataModel.Instance.searchPDF != null) |
||
344 | { |
||
345 | 8bd25583 | taeseongkim | Application.Current.Dispatcher.BeginInvoke(new Action(() => |
346 | { |
||
347 | this.dzMainMenu.searchPanel_Instance.tbSearch.Focusable = true; |
||
348 | this.dzMainMenu.searchPanel_Instance.tbSearch.Focus(); |
||
349 | Keyboard.Focus(this.dzMainMenu.searchPanel_Instance.tbSearch); |
||
350 | }), System.Windows.Threading.DispatcherPriority.Render); |
||
351 | 469b2bbf | KangIngu | } |
352 | else |
||
353 | { |
||
354 | this.dzMainMenu.searchPanel_Instance.btnSearch.Focus(); |
||
355 | } |
||
356 | 992a98b4 | KangIngu | } |
357 | else |
||
358 | { |
||
359 | 469b2bbf | KangIngu | this.dzMainMenu.searchPane.IsPinned = false; |
360 | this.dzMainMenu.searchPane.IsActive = false; |
||
361 | //this.dzMainMenu.searchPane.IsHidden = true; |
||
362 | 992a98b4 | KangIngu | } |
363 | } |
||
364 | } |
||
365 | break; |
||
366 | #endregion |
||
367 | 787a4489 | KangIngu | |
368 | #endregion |
||
369 | |||
370 | //강인구 추가 |
||
371 | #region Control Move |
||
372 | 1edefbdf | taeseongkim | //case Key.NumPad4: |
373 | //case Key.NumPad5: |
||
374 | //case Key.NumPad6: |
||
375 | //case Key.NumPad8: |
||
376 | d543f923 | ljiyeon | case Key.Right: |
377 | case Key.Left: |
||
378 | case Key.Up: |
||
379 | case Key.Down: |
||
380 | { |
||
381 | d60f94ee | taeseongkim | if(System.Windows.Input.Keyboard.FocusedElement is System.Windows.Controls.TextBox) |
382 | { |
||
383 | return; |
||
384 | } |
||
385 | |||
386 | 91e84544 | taeseongkim | if(sender is UIElement) |
387 | { |
||
388 | (sender as UIElement).SetValue(TabNavigationExtensions.IsTabStopProperty, false); |
||
389 | } |
||
390 | |||
391 | f87dfb18 | taeseongkim | Point? MovePoint = null; |
392 | if ((e.Key == Key.NumPad5) || (e.Key == Key.Down)) |
||
393 | d543f923 | ljiyeon | { |
394 | f87dfb18 | taeseongkim | MovePoint = new Point(0, 5); |
395 | } |
||
396 | else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up)) |
||
397 | { |
||
398 | MovePoint = new Point(0, -5); |
||
399 | } |
||
400 | else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left)) |
||
401 | { |
||
402 | MovePoint = new Point(-5, 0); |
||
403 | } |
||
404 | else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right)) |
||
405 | { |
||
406 | MovePoint = new Point(5, 0); |
||
407 | } |
||
408 | |||
409 | if (MovePoint != null && MovePoint.HasValue) |
||
410 | { |
||
411 | if (this.dzMainMenu.SelectLayer.Children.Count > 0 && ViewerDataModel.Instance.IsPressShift) |
||
412 | 37b65344 | humkyung | { |
413 | f87dfb18 | taeseongkim | |
414 | this.TranslateOrRotateItems(MovePoint.Value, this.dzMainMenu.rotate.Angle); |
||
415 | 37b65344 | humkyung | } |
416 | f87dfb18 | taeseongkim | else |
417 | 37b65344 | humkyung | { |
418 | 5bec847f | humkyung | bool IsMovePossibility = false; |
419 | f87dfb18 | taeseongkim | |
420 | 5bec847f | humkyung | var instance = ViewerDataModel.Instance; |
421 | f87dfb18 | taeseongkim | |
422 | 5bec847f | humkyung | if ((e.Key == Key.NumPad5) || (e.Key == Key.Down)) |
423 | { |
||
424 | if (instance.ContentHeight > instance.ContentOffsetY + instance.ContentViewportHeight) |
||
425 | f87dfb18 | taeseongkim | { |
426 | 5bec847f | humkyung | IsMovePossibility = true; |
427 | f87dfb18 | taeseongkim | } |
428 | 5bec847f | humkyung | } |
429 | else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up)) |
||
430 | { |
||
431 | if (0 < instance.ContentOffsetY) |
||
432 | f87dfb18 | taeseongkim | { |
433 | 5bec847f | humkyung | IsMovePossibility = true; |
434 | f87dfb18 | taeseongkim | } |
435 | 5bec847f | humkyung | } |
436 | else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left)) |
||
437 | { |
||
438 | if (0 < instance.ContentOffsetX) |
||
439 | f87dfb18 | taeseongkim | { |
440 | 5bec847f | humkyung | IsMovePossibility = true; |
441 | f87dfb18 | taeseongkim | } |
442 | 5bec847f | humkyung | } |
443 | else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right)) |
||
444 | { |
||
445 | if (instance.ContentWidth > instance.ContentOffsetX + instance.ContentViewportWidth) |
||
446 | f87dfb18 | taeseongkim | { |
447 | 5bec847f | humkyung | IsMovePossibility = true; |
448 | f87dfb18 | taeseongkim | } |
449 | 5bec847f | humkyung | } |
450 | f87dfb18 | taeseongkim | |
451 | 5bec847f | humkyung | if (IsMovePossibility) |
452 | { |
||
453 | Vector dragOffset = new Vector(MovePoint.Value.X * -10, MovePoint.Value.Y * -10); |
||
454 | f87dfb18 | taeseongkim | |
455 | 5bec847f | humkyung | this.dzMainMenu.MoveZoomAndPanControl(dragOffset); |
456 | f87dfb18 | taeseongkim | |
457 | 5bec847f | humkyung | this.dzMainMenu.MainDocumentPanel.Focus(); |
458 | f87dfb18 | taeseongkim | |
459 | 5bec847f | humkyung | System.Diagnostics.Debug.WriteLine(this.dzMainMenu.zoomAndPanControl.ContentOffsetX); |
460 | } |
||
461 | 37b65344 | humkyung | } |
462 | d543f923 | ljiyeon | } |
463 | } |
||
464 | break; |
||
465 | da92cfb7 | ljiyeon | #endregion |
466 | case Key.PageUp: |
||
467 | 2d584f1a | djkim | |
468 | da92cfb7 | ljiyeon | this.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) - 1); |
469 | break; |
||
470 | case Key.PageDown: |
||
471 | this.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) + 1); |
||
472 | break; |
||
473 | b2d0f316 | humkyung | #region ZIndex 설정 |
474 | case Key.Add: |
||
475 | foreach (var item in SelectionSet.Instance.SelectedItems) |
||
476 | { |
||
477 | fd19a116 | humkyung | if (item.ZIndex < CommentUserInfo.MaxZIndex) |
478 | b2d0f316 | humkyung | { |
479 | item.ZIndex++; |
||
480 | Canvas.SetZIndex(item, item.ZIndex); |
||
481 | } |
||
482 | } |
||
483 | ViewerDataModel.Instance.IsMarkupUpdate = true; |
||
484 | break; |
||
485 | case Key.Subtract: |
||
486 | foreach(var item in SelectionSet.Instance.SelectedItems) |
||
487 | { |
||
488 | if (item.ZIndex > 0) |
||
489 | { |
||
490 | item.ZIndex--; |
||
491 | Canvas.SetZIndex(item, item.ZIndex); |
||
492 | } |
||
493 | } |
||
494 | ViewerDataModel.Instance.IsMarkupUpdate = true; |
||
495 | break; |
||
496 | #endregion |
||
497 | } |
||
498 | 91e84544 | taeseongkim | }); |
499 | 787a4489 | KangIngu | } |
500 | |||
501 | f87dfb18 | taeseongkim | |
502 | 37b65344 | humkyung | /// <summary> |
503 | /// translate or rotate items by given pt and angle |
||
504 | /// </summary> |
||
505 | /// <author>humkyung</author> |
||
506 | /// <date>2019.07.03</date> |
||
507 | /// <param name="pt">control point</param> |
||
508 | /// <param name="dAngle">angle in degree</param> |
||
509 | private void TranslateOrRotateItems(Point pt, double dAngle) |
||
510 | { |
||
511 | Point control = MarkupToPDF.Controls.Common.MathSet.RotateAbout(new Point(0, 0), pt, dAngle); |
||
512 | foreach (var item in this.dzMainMenu.SelectLayer.Children) |
||
513 | { |
||
514 | if (item.GetType().Name == "AdornerFinal") |
||
515 | { |
||
516 | if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) |
||
517 | { |
||
518 | (item as Controls.AdornerFinal).MoveRotate(new System.Windows.Controls.Primitives.DragDeltaEventArgs(control.X * 2, control.Y * 2)); |
||
519 | } |
||
520 | else |
||
521 | { |
||
522 | 6b6e937c | taeseongkim | (item as Controls.AdornerFinal).TranslateItems(control.X, control.Y); |
523 | 37b65344 | humkyung | } |
524 | |||
525 | } |
||
526 | } |
||
527 | } |
||
528 | 787a4489 | KangIngu | } |
529 | } |