markus / KCOM / Events / Event_KeyEvent.cs @ 5bec847f
이력 | 보기 | 이력해설 | 다운로드 (24.3 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 | 38d69491 | taeseongkim | var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).IsEditingMode == true).FirstOrDefault(); |
168 | 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 | var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as ArrowTextControl) != null && (data as ArrowTextControl).IsEditingMode == true).FirstOrDefault(); |
||
178 | 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 | 316d0f5c | KangIngu | //this.dzTopMenu.SaveEvent(null, null); |
195 | 65eb8dd6 | ljiyeon | if (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission) |
196 | { |
||
197 | 5ba8f2d5 | taeseongkim | ViewerDataModel.Instance.IsMarkupUpdate = true; |
198 | cb5c7f06 | humkyung | this.dzTopMenu.SaveEventCallback(new object(), null); |
199 | 65eb8dd6 | ljiyeon | } |
200 | 6707a5c7 | ljiyeon | |
201 | //저장완료후 임시파일 삭제 |
||
202 | 2b1f30fe | taeseongkim | //TempFile.Remove(); |
203 | 37b65344 | humkyung | } |
204 | 787a4489 | KangIngu | } |
205 | break; |
||
206 | #endregion |
||
207 | |||
208 | #region 프린트하기(Ctrl + P) |
||
209 | case Key.P: |
||
210 | { |
||
211 | if (ViewerDataModel.Instance.IsPressCtrl) |
||
212 | { |
||
213 | this.dzTopMenu.Print_Start("Print"); |
||
214 | } |
||
215 | } |
||
216 | break; |
||
217 | e1b36bc0 | humkyung | #endregion |
218 | case Key.G: |
||
219 | { |
||
220 | #region Grouping 해제 |
||
221 | if (ViewerDataModel.Instance.IsPressCtrl && ViewerDataModel.Instance.IsPressShift) |
||
222 | { |
||
223 | 8118ba81 | swate0609 | if (ViewerDataModel.Instance.UndoDataList == null) |
224 | { |
||
225 | return; |
||
226 | } |
||
227 | |||
228 | UndoCommand.Instance.Push(EventType.Operation, SelectionSet.Instance.SelectedItems); |
||
229 | |||
230 | e1b36bc0 | humkyung | SelectionSet.Instance.SelectedItems.ForEach(x => x.GroupID = string.Empty); |
231 | } |
||
232 | #endregion |
||
233 | #region Grouping |
||
234 | else if (ViewerDataModel.Instance.IsPressCtrl) |
||
235 | { |
||
236 | 8118ba81 | swate0609 | if (ViewerDataModel.Instance.UndoDataList == null) |
237 | { |
||
238 | return; |
||
239 | } |
||
240 | |||
241 | UndoCommand.Instance.Push(EventType.Operation, SelectionSet.Instance.SelectedItems); |
||
242 | |||
243 | e1b36bc0 | humkyung | string GroupID = Guid.NewGuid().ToString(); |
244 | SelectionSet.Instance.SelectedItems.ForEach(x => x.GroupID = GroupID); |
||
245 | } |
||
246 | #endregion |
||
247 | } |
||
248 | break; |
||
249 | 787a4489 | KangIngu | |
250 | #region Undo(Ctrl + Z) |
||
251 | e1b36bc0 | humkyung | case Key.Z: |
252 | 787a4489 | KangIngu | { |
253 | f816dd63 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl) UndoCommand.Instance.Execute(); |
254 | 787a4489 | KangIngu | } |
255 | break; |
||
256 | #endregion |
||
257 | |||
258 | #region Redo(Ctrl + Y) |
||
259 | case Key.Y: |
||
260 | { |
||
261 | f816dd63 | humkyung | if (ViewerDataModel.Instance.IsPressCtrl) RedoCommand.Instance.Execute(); |
262 | 787a4489 | KangIngu | } |
263 | break; |
||
264 | #endregion |
||
265 | |||
266 | #region 삭제하기(Delete) |
||
267 | case Key.Delete: |
||
268 | { |
||
269 | 8e6884a5 | taeseongkim | List<CommentUserInfo> selectItems = SelectionSet.Instance.SelectedItems; |
270 | 85132173 | humkyung | SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
271 | f816dd63 | humkyung | this.dzMainMenu.SelectLayer.Children.Clear(); |
272 | 8e6884a5 | taeseongkim | |
273 | 34ac8db7 | humkyung | UndoCommand.Instance.Push(EventType.Delete, selectItems); |
274 | 787a4489 | KangIngu | } |
275 | break; |
||
276 | #endregion |
||
277 | |||
278 | #region 선택된 컨트롤 모두 해제 하기(ESC) |
||
279 | case Key.Escape: |
||
280 | { |
||
281 | //캡쳐모드 일 경우 초기화 |
||
282 | 37b65344 | humkyung | if (this.dzMainMenu.mouseHandlingMode == IKCOM.MouseHandlingMode.Capture) |
283 | 787a4489 | KangIngu | { |
284 | //dzMainMenu.PN_Navi.IsEnabled = true; |
||
285 | this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
286 | ViewerDataModel.Instance.Capture_Opacity = 0; |
||
287 | } |
||
288 | |||
289 | b74a9c91 | taeseongkim | if (Common.ViewerDataModel.Instance.SelectedControl == "Batch" |
290 | || Common.ViewerDataModel.Instance.SelectedControl == "MACRO") |
||
291 | 787a4489 | KangIngu | { |
292 | this.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
293 | this.dzMainMenu.txtBatch.Visibility = Visibility.Collapsed; |
||
294 | this.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
||
295 | var TogList = this.dzTopMenu.Parent.ChildrenOfType<RadToggleButton>(); |
||
296 | foreach (var tog in TogList) |
||
297 | { |
||
298 | tog.IsChecked = false; |
||
299 | } |
||
300 | } |
||
301 | |||
302 | 077896be | humkyung | SelectionSet.Instance.UnSelect(this.dzMainMenu); |
303 | 787a4489 | KangIngu | |
304 | //코멘트 그리는 도중일 경우 코멘트 삭제 및 초기화 |
||
305 | 49b217ad | humkyung | if (this.dzMainMenu.currentControl != null) |
306 | { |
||
307 | ViewerDataModel.Instance.MarkupControls_USER.Remove(this.dzMainMenu.currentControl); |
||
308 | this.dzMainMenu.currentControl = null; |
||
309 | } |
||
310 | 787a4489 | KangIngu | |
311 | 2eac4f76 | KangIngu | //모든 컨트롤 초기화 하고 Selection모드로 변경 |
312 | dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Selecting; |
||
313 | dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None; |
||
314 | |||
315 | var toggleList = this.ChildrenOfType<RadToggleButton>(); |
||
316 | var toggleList2 = this.ChildrenOfType<RadRibbonToggleButton>(); |
||
317 | |||
318 | 17a22987 | KangIngu | foreach (var item in toggleList) |
319 | { |
||
320 | if (item.Name == "btnSelection") |
||
321 | 2eac4f76 | KangIngu | { |
322 | item.IsChecked = true; |
||
323 | } |
||
324 | 17a22987 | KangIngu | else |
325 | 2eac4f76 | KangIngu | { |
326 | item.IsChecked = false; |
||
327 | } |
||
328 | 17a22987 | KangIngu | } |
329 | 9f473fb7 | KangIngu | dzMainMenu.isLeftMouseButtonDownOnWindow = false; |
330 | b643fcca | taeseongkim | //foreach (var item in toggleList2) |
331 | //{ |
||
332 | // item.IsChecked = false; |
||
333 | //} |
||
334 | ViewerDataModel.Instance.SetAngleVisible(Visibility.Collapsed); |
||
335 | 787a4489 | KangIngu | } |
336 | break; |
||
337 | 992a98b4 | KangIngu | #endregion |
338 | |||
339 | #region FIND(Ctrl + F) |
||
340 | case Key.F: |
||
341 | { |
||
342 | 469b2bbf | KangIngu | if (ViewerDataModel.Instance.IsPressCtrl) |
343 | 992a98b4 | KangIngu | { |
344 | 469b2bbf | KangIngu | if (!this.dzMainMenu.searchPane.IsPinned) |
345 | 992a98b4 | KangIngu | { |
346 | 469b2bbf | KangIngu | this.dzMainMenu.searchPane.IsPinned = true; |
347 | if (ViewerDataModel.Instance.searchPDF != null) |
||
348 | { |
||
349 | 8bd25583 | taeseongkim | Application.Current.Dispatcher.BeginInvoke(new Action(() => |
350 | { |
||
351 | this.dzMainMenu.searchPanel_Instance.tbSearch.Focusable = true; |
||
352 | this.dzMainMenu.searchPanel_Instance.tbSearch.Focus(); |
||
353 | Keyboard.Focus(this.dzMainMenu.searchPanel_Instance.tbSearch); |
||
354 | }), System.Windows.Threading.DispatcherPriority.Render); |
||
355 | 469b2bbf | KangIngu | } |
356 | else |
||
357 | { |
||
358 | this.dzMainMenu.searchPanel_Instance.btnSearch.Focus(); |
||
359 | } |
||
360 | 992a98b4 | KangIngu | } |
361 | else |
||
362 | { |
||
363 | 469b2bbf | KangIngu | this.dzMainMenu.searchPane.IsPinned = false; |
364 | this.dzMainMenu.searchPane.IsActive = false; |
||
365 | //this.dzMainMenu.searchPane.IsHidden = true; |
||
366 | 992a98b4 | KangIngu | } |
367 | } |
||
368 | } |
||
369 | break; |
||
370 | #endregion |
||
371 | 787a4489 | KangIngu | |
372 | #endregion |
||
373 | |||
374 | //강인구 추가 |
||
375 | #region Control Move |
||
376 | 1edefbdf | taeseongkim | //case Key.NumPad4: |
377 | //case Key.NumPad5: |
||
378 | //case Key.NumPad6: |
||
379 | //case Key.NumPad8: |
||
380 | d543f923 | ljiyeon | case Key.Right: |
381 | case Key.Left: |
||
382 | case Key.Up: |
||
383 | case Key.Down: |
||
384 | { |
||
385 | d60f94ee | taeseongkim | if(System.Windows.Input.Keyboard.FocusedElement is System.Windows.Controls.TextBox) |
386 | { |
||
387 | return; |
||
388 | } |
||
389 | |||
390 | 91e84544 | taeseongkim | if(sender is UIElement) |
391 | { |
||
392 | (sender as UIElement).SetValue(TabNavigationExtensions.IsTabStopProperty, false); |
||
393 | } |
||
394 | |||
395 | f87dfb18 | taeseongkim | Point? MovePoint = null; |
396 | if ((e.Key == Key.NumPad5) || (e.Key == Key.Down)) |
||
397 | d543f923 | ljiyeon | { |
398 | f87dfb18 | taeseongkim | MovePoint = new Point(0, 5); |
399 | } |
||
400 | else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up)) |
||
401 | { |
||
402 | MovePoint = new Point(0, -5); |
||
403 | } |
||
404 | else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left)) |
||
405 | { |
||
406 | MovePoint = new Point(-5, 0); |
||
407 | } |
||
408 | else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right)) |
||
409 | { |
||
410 | MovePoint = new Point(5, 0); |
||
411 | } |
||
412 | |||
413 | if (MovePoint != null && MovePoint.HasValue) |
||
414 | { |
||
415 | if (this.dzMainMenu.SelectLayer.Children.Count > 0 && ViewerDataModel.Instance.IsPressShift) |
||
416 | 37b65344 | humkyung | { |
417 | f87dfb18 | taeseongkim | |
418 | this.TranslateOrRotateItems(MovePoint.Value, this.dzMainMenu.rotate.Angle); |
||
419 | 37b65344 | humkyung | } |
420 | f87dfb18 | taeseongkim | else |
421 | 37b65344 | humkyung | { |
422 | 5bec847f | humkyung | bool IsMovePossibility = false; |
423 | f87dfb18 | taeseongkim | |
424 | 5bec847f | humkyung | var instance = ViewerDataModel.Instance; |
425 | f87dfb18 | taeseongkim | |
426 | 5bec847f | humkyung | if ((e.Key == Key.NumPad5) || (e.Key == Key.Down)) |
427 | { |
||
428 | if (instance.ContentHeight > instance.ContentOffsetY + instance.ContentViewportHeight) |
||
429 | f87dfb18 | taeseongkim | { |
430 | 5bec847f | humkyung | IsMovePossibility = true; |
431 | f87dfb18 | taeseongkim | } |
432 | 5bec847f | humkyung | } |
433 | else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up)) |
||
434 | { |
||
435 | if (0 < instance.ContentOffsetY) |
||
436 | f87dfb18 | taeseongkim | { |
437 | 5bec847f | humkyung | IsMovePossibility = true; |
438 | f87dfb18 | taeseongkim | } |
439 | 5bec847f | humkyung | } |
440 | else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left)) |
||
441 | { |
||
442 | if (0 < instance.ContentOffsetX) |
||
443 | f87dfb18 | taeseongkim | { |
444 | 5bec847f | humkyung | IsMovePossibility = true; |
445 | f87dfb18 | taeseongkim | } |
446 | 5bec847f | humkyung | } |
447 | else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right)) |
||
448 | { |
||
449 | if (instance.ContentWidth > instance.ContentOffsetX + instance.ContentViewportWidth) |
||
450 | f87dfb18 | taeseongkim | { |
451 | 5bec847f | humkyung | IsMovePossibility = true; |
452 | f87dfb18 | taeseongkim | } |
453 | 5bec847f | humkyung | } |
454 | f87dfb18 | taeseongkim | |
455 | 5bec847f | humkyung | if (IsMovePossibility) |
456 | { |
||
457 | Vector dragOffset = new Vector(MovePoint.Value.X * -10, MovePoint.Value.Y * -10); |
||
458 | f87dfb18 | taeseongkim | |
459 | 5bec847f | humkyung | this.dzMainMenu.MoveZoomAndPanControl(dragOffset); |
460 | f87dfb18 | taeseongkim | |
461 | 5bec847f | humkyung | this.dzMainMenu.MainDocumentPanel.Focus(); |
462 | f87dfb18 | taeseongkim | |
463 | 5bec847f | humkyung | System.Diagnostics.Debug.WriteLine(this.dzMainMenu.zoomAndPanControl.ContentOffsetX); |
464 | } |
||
465 | 37b65344 | humkyung | } |
466 | d543f923 | ljiyeon | } |
467 | } |
||
468 | break; |
||
469 | da92cfb7 | ljiyeon | #endregion |
470 | case Key.PageUp: |
||
471 | 2d584f1a | djkim | |
472 | da92cfb7 | ljiyeon | this.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) - 1); |
473 | break; |
||
474 | case Key.PageDown: |
||
475 | this.dzMainMenu.pageNavigator.GotoPage(Convert.ToInt32(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber) + 1); |
||
476 | break; |
||
477 | b2d0f316 | humkyung | #region ZIndex 설정 |
478 | case Key.Add: |
||
479 | foreach (var item in SelectionSet.Instance.SelectedItems) |
||
480 | { |
||
481 | 5bec847f | humkyung | if (item.ZIndex < 99) |
482 | b2d0f316 | humkyung | { |
483 | item.ZIndex++; |
||
484 | Canvas.SetZIndex(item, item.ZIndex); |
||
485 | } |
||
486 | } |
||
487 | ViewerDataModel.Instance.IsMarkupUpdate = true; |
||
488 | break; |
||
489 | case Key.Subtract: |
||
490 | foreach(var item in SelectionSet.Instance.SelectedItems) |
||
491 | { |
||
492 | if (item.ZIndex > 0) |
||
493 | { |
||
494 | item.ZIndex--; |
||
495 | Canvas.SetZIndex(item, item.ZIndex); |
||
496 | } |
||
497 | } |
||
498 | ViewerDataModel.Instance.IsMarkupUpdate = true; |
||
499 | break; |
||
500 | #endregion |
||
501 | } |
||
502 | 91e84544 | taeseongkim | }); |
503 | 787a4489 | KangIngu | } |
504 | |||
505 | f87dfb18 | taeseongkim | |
506 | 37b65344 | humkyung | /// <summary> |
507 | /// translate or rotate items by given pt and angle |
||
508 | /// </summary> |
||
509 | /// <author>humkyung</author> |
||
510 | /// <date>2019.07.03</date> |
||
511 | /// <param name="pt">control point</param> |
||
512 | /// <param name="dAngle">angle in degree</param> |
||
513 | private void TranslateOrRotateItems(Point pt, double dAngle) |
||
514 | { |
||
515 | Point control = MarkupToPDF.Controls.Common.MathSet.RotateAbout(new Point(0, 0), pt, dAngle); |
||
516 | foreach (var item in this.dzMainMenu.SelectLayer.Children) |
||
517 | { |
||
518 | if (item.GetType().Name == "AdornerFinal") |
||
519 | { |
||
520 | if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) |
||
521 | { |
||
522 | (item as Controls.AdornerFinal).MoveRotate(new System.Windows.Controls.Primitives.DragDeltaEventArgs(control.X * 2, control.Y * 2)); |
||
523 | } |
||
524 | else |
||
525 | { |
||
526 | 6b6e937c | taeseongkim | (item as Controls.AdornerFinal).TranslateItems(control.X, control.Y); |
527 | 37b65344 | humkyung | } |
528 | |||
529 | } |
||
530 | } |
||
531 | } |
||
532 | 787a4489 | KangIngu | } |
533 | } |