Jump to content

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


Recommended Posts

Posted

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

Posted

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

  • 2 weeks later...
Posted

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();'+
                        '}'+
                    '})'+
                '}'
);
Posted

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

Posted

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(...)'+
'};'+

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...