@@ -131,6 +131,87 @@ public string Dir
131131 }
132132 }
133133
134+ public bool movable { get ; set ; }
135+ [ ContextProperty ( "Перемещаемый" , "Movable" ) ]
136+ public bool Movable
137+ {
138+ get { return movable ; }
139+ set
140+ {
141+ movable = value ;
142+ string strFunc ;
143+ if ( value )
144+ {
145+ strFunc = "mapKeyEl.get('" + ItemKey + "')['movable'] = " + movable . ToString ( ) . ToLower ( ) + ";" ;
146+ strFunc += @"
147+ mapKeyDraggableEl.set('" + ItemKey + "', mapKeyEl.get('" + ItemKey + @"'));
148+ function dragElement" + ItemKey + @"() {
149+ let elmnt = mapKeyDraggableEl.get('" + ItemKey + @"');
150+ //alert('' + elmnt);
151+ if (elmnt != undefined)
152+ {
153+ var pos1 = 0;
154+ var pos2 = 0;
155+ var pos3 = 0;
156+ var pos4 = 0;
157+ elmnt.onmousedown = dragMouseDown;
158+ function dragMouseDown(e)
159+ {
160+ e = e || window.event;
161+ e.preventDefault();
162+ pos3 = e.clientX;
163+ pos4 = e.clientY;
164+ document.onmouseup = closeDragElement;
165+ document.onmousemove = elementDrag;
166+ }
167+ function elementDrag(e)
168+ {
169+ e = e || window.event;
170+ e.preventDefault();
171+ pos1 = pos3 - e.clientX;
172+ pos2 = pos4 - e.clientY;
173+ pos3 = e.clientX;
174+ pos4 = e.clientY;
175+ elmnt.style.top = (elmnt.offsetTop - pos2) + 'px';
176+ elmnt.style.left = (elmnt.offsetLeft - pos1) + 'px';
177+ }
178+ function closeDragElement()
179+ {
180+ document.onmouseup = null;
181+ document.onmousemove = null;
182+ }
183+ }
184+ else
185+ {
186+ mapKeyEl.get('" + ItemKey + @"').onmousedown = null;
187+ }
188+ }
189+ dragElement" + ItemKey + "();" ;
190+ }
191+ else
192+ {
193+ strFunc = @"
194+ mapKeyDraggableEl.delete('" + ItemKey + @"');
195+ function dragElement" + ItemKey + @"() { mapKeyEl.get('" + ItemKey + @"').onmousedown = null; }
196+ dragElement" + ItemKey + "();" ;
197+ }
198+ DeclarativeForms . SendStrFunc ( strFunc ) ;
199+ }
200+ }
201+
202+ public bool draggable { get ; set ; }
203+ [ ContextProperty ( "Перетаскиваемый" , "Draggable" ) ]
204+ public bool Draggable
205+ {
206+ get { return draggable ; }
207+ set
208+ {
209+ draggable = value ;
210+ string strFunc = "mapKeyEl.get('" + ItemKey + "')['draggable'] = " + draggable . ToString ( ) . ToLower ( ) + ";" ;
211+ DeclarativeForms . SendStrFunc ( strFunc ) ;
212+ }
213+ }
214+
134215 public int tabIndex { get ; set ; }
135216 [ ContextProperty ( "ПорядокОбхода" , "TabIndex" ) ]
136217 public int TabIndex
@@ -243,6 +324,20 @@ public ArrayImpl Children
243324 get { return children ; }
244325 }
245326
327+ public DfAction drop { get ; set ; }
328+ [ ContextProperty ( "Бросить" , "Drop" ) ]
329+ public DfAction Drop
330+ {
331+ get { return drop ; }
332+ set
333+ {
334+ drop = value ;
335+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 drop\u0022 , doEvent);" ;
336+ strFunc += "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 dragover\u0022 , doEvent);" ;
337+ DeclarativeForms . SendStrFunc ( strFunc ) ;
338+ }
339+ }
340+
246341 public DfAction dblclick { get ; set ; }
247342 [ ContextProperty ( "ДвойноеНажатие" , "DoubleClick" ) ]
248343 public DfAction DoubleClick
@@ -256,6 +351,19 @@ public DfAction DoubleClick
256351 }
257352 }
258353
354+ public DfAction dragend { get ; set ; }
355+ [ ContextProperty ( "КонецПеретаскивания" , "DragEnd" ) ]
356+ public DfAction DragEnd
357+ {
358+ get { return dragend ; }
359+ set
360+ {
361+ dragend = value ;
362+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 dragend\u0022 , doEvent);" ;
363+ DeclarativeForms . SendStrFunc ( strFunc ) ;
364+ }
365+ }
366+
259367 public DfAction mouseover { get ; set ; }
260368 [ ContextProperty ( "МышьНадЭлементом" , "MouseOver" ) ]
261369 public DfAction MouseOver
@@ -282,6 +390,19 @@ public DfAction MouseOut
282390 }
283391 }
284392
393+ public DfAction dragenter { get ; set ; }
394+ [ ContextProperty ( "НадЦелью" , "DragEnter" ) ]
395+ public DfAction DragEnter
396+ {
397+ get { return dragenter ; }
398+ set
399+ {
400+ dragenter = value ;
401+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 dragenter\u0022 , doEvent);" ;
402+ DeclarativeForms . SendStrFunc ( strFunc ) ;
403+ }
404+ }
405+
285406 public DfAction click { get ; set ; }
286407 [ ContextProperty ( "Нажатие" , "Click" ) ]
287408 public DfAction Click
@@ -295,6 +416,32 @@ public DfAction Click
295416 }
296417 }
297418
419+ public DfAction dragstart { get ; set ; }
420+ [ ContextProperty ( "НачалоПеретаскивания" , "DragStart" ) ]
421+ public DfAction DragStart
422+ {
423+ get { return dragstart ; }
424+ set
425+ {
426+ dragstart = value ;
427+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 dragstart\u0022 , doEvent);" ;
428+ DeclarativeForms . SendStrFunc ( strFunc ) ;
429+ }
430+ }
431+
432+ public DfAction mousedown { get ; set ; }
433+ [ ContextProperty ( "ПриНажатииМыши" , "MouseDown" ) ]
434+ public DfAction MouseDown
435+ {
436+ get { return mousedown ; }
437+ set
438+ {
439+ mousedown = value ;
440+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 mousedown\u0022 , doEvent);" ;
441+ DeclarativeForms . SendStrFunc ( strFunc ) ;
442+ }
443+ }
444+
298445 public DfAction mouseup { get ; set ; }
299446 [ ContextProperty ( "ПриОтпусканииМыши" , "MouseUp" ) ]
300447 public DfAction MouseUp
@@ -308,6 +455,19 @@ public DfAction MouseUp
308455 }
309456 }
310457
458+ public DfAction mousemove { get ; set ; }
459+ [ ContextProperty ( "ПриПеремещенииМыши" , "MouseMove" ) ]
460+ public DfAction MouseMove
461+ {
462+ get { return mousemove ; }
463+ set
464+ {
465+ mousemove = value ;
466+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 mousemove\u0022 , doEvent);" ;
467+ DeclarativeForms . SendStrFunc ( strFunc ) ;
468+ }
469+ }
470+
311471 public DfAction focus { get ; set ; }
312472 [ ContextProperty ( "ФокусПолучен" , "Focused" ) ]
313473 public DfAction Focused
@@ -334,6 +494,19 @@ public DfAction LostFocus
334494 }
335495 }
336496
497+ public DfAction dragleave { get ; set ; }
498+ [ ContextProperty ( "ЦельПокинута" , "DragLeave" ) ]
499+ public DfAction DragLeave
500+ {
501+ get { return dragleave ; }
502+ set
503+ {
504+ dragleave = value ;
505+ string strFunc = "mapKeyEl.get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 dragleave\u0022 , doEvent);" ;
506+ DeclarativeForms . SendStrFunc ( strFunc ) ;
507+ }
508+ }
509+
337510 [ ContextMethod ( "Анимация" , "Animation" ) ]
338511 public DfAnimation Animation ( DfFrames p1 , DfAnimationOptions p2 )
339512 {
0 commit comments