Jump to content

TUniImage.Draggable.Enabled:=true; -> wrong position in UniScrollbox1


erich.wanker

Recommended Posts

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

post-1295-0-69325900-1504106131_thumb.jpg

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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();'+
                        '}'+
                    '})'+
                '}'
);
Link to comment
Share on other sites

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 ...

Link to comment
Share on other sites

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(...)'+
'};'+
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...