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