erich.wanker Posted August 30, 2017 Share Posted August 30, 2017 Hello, if i make a TUniImage draggable - it works fine in a form if TUniImage.Parent:=UniScrollBox1; -> then the draggable TUniImage has sometimes a wrong position - if the scrollbox-area is scrolled... i made a testcase .. see Posting below ThanX Erich Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted August 31, 2017 Author Share Posted August 31, 2017 i made a TestCase for better understanding .... Info: Please save the "image.png" in uniservermodule.FilesFolderPath if you scroll to the right side - the draggable image has a strange behavior Info: I use "uniImage.OnEndDrag := UniPanelMouseEnd;" - in this procedure - i recalc the position, write new position in database and refresh differnt DB-Tables ... a important event for me.... Hope - someone can help :-) ThanX Erich testCase.zip Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted September 4, 2017 Author Share Posted September 4, 2017 push ;-) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 5, 2017 Share Posted September 5, 2017 Hi Erich, We need to analyze it Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted September 14, 2017 Author Share Posted September 14, 2017 push :-) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2017 Share Posted September 14, 2017 Hi Erich, You need to pay attention to the constrainTo method Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2017 Share Posted September 14, 2017 Or you can try to use this approach for now: //meine_marker[meine_marker_anzahl].Draggable.Enabled:=true; meine_marker[meine_marker_anzahl].JSInterface.JSAddListener( 'afterrender', 'function(me) {'+ 'Ext.onReady(function() {'+ 'me.dd=new Ext.dd.DDProxy(me, "");'+ 'me.constrain=true;'+ 'me.dd.startDrag=function() {'+ 'this.constrainX=true;'+ 'this.maxX=MainForm.display_image.el.getRight()-me.width;'+ 'this.minX=MainForm.form.getX();'+ 'this.constrainY=true;'+ 'this.maxY=MainForm.display_image.el.getBottom()-me.height;'+ 'this.minY=MainForm.form.getY();'+ '}'+ '})'+ '}' ); Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted September 15, 2017 Author Share Posted September 15, 2017 Hello DelphiDeveloper :-) Perfect !! ThanX ! :-= Just one question .. sorry ;-) How can i start a procedure "OnEndDrag" .. to recalc the new position and store the position in database? ... delphi does not "see" the new position ... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 15, 2017 Share Posted September 15, 2017 Just one question .. sorry ;-) How can i start a procedure "OnEndDrag" .. to recalc the new position and store the position in database? ... delphi does not "see" the new position ... 'me.dd.afterDrag=function() {'+ 'ajaxRequest(...)'+ '};'+ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.