Jump to content

read uniForm position


erich.wanker

Recommended Posts

Hello :-) ...

 

how can i read the uniForm position ?

procedure TUniForm4.UniContainerPanel11Click(Sender: TObject);
var x:Integer;
begin
showmessage(inttostr(uniForm4.Top));

... is allways "0" ... and i think this is normal - because just client-side knows the actual position of a moveable form 

 
i think i must use Javascript like .. "UniSession.AddJS" or soemthing ..
 
Can someone make a suggestion how to read the top-value of uniForm4 ?
 
ThanX
Erich

 

Link to comment
Share on other sites

how can i read the uniForm position ?

... is allways "0" ... and i think this is normal - because just client-side knows the actual position of a moveable form 

 

Hi Erich.

 

At least, in version 0.97.0.1079 works fine.

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  ShowMessage(IntToStr(UniForm1.Top));
end;

post-906-0-22696700-1413971136_thumb.png

 

Best regards.

Link to comment
Share on other sites

perfect :-) .. i got allways fast and professional answers from you - thanX

 

.. short question:

 i have buyed licence 0.97.0.1074 ...  how can i update this license? .. i only found the "trial" version to download.

 

ThanX

Link to comment
Share on other sites

Thanx for the Link ... everything worked fine after update ..

 

 

Now - i use   0.97.0.1085

.. first of all i deinstalled components in delphi / removed FM-Software via windwos controll panel / delete programm-folder FMSoft .. 

.. the Delphi installation was fine - all components are working

.. ObjectInspector / Servermodule / UniGUIVersion is showing: 0.97.0.1085

.. on Webserver - i cleared cache folder

.. on Webserver - i copied ext-4.2.2.1144 -folder

.. on Webserver - i copied uni-0.97.0.1085 -folder

 

i recompiled uniGui-DLL ..

 

but 

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  ShowMessage(IntToStr(UniForm4.Top));
end;

still brings "0" as result - also

procedure TUniForm4.UniContainerPanel11Click(Sender: TObject);
var x:Integer;
begin
showmessage(inttostr(UniForm4.Top));

any idea why ?

 

ThanX

Erich

Link to comment
Share on other sites

ok .. i found the problem:

 

if my UniForm is create - i use:

function window.beforeshow(sender, eOpts)
{
 sender.animate({ duration: 400, to: { y:100} });
}

and i use for moving the uniForm:

function window.afterrender(sender, eOpts)
{
  sender.dd = new Ext.dd.DDProxy(sender, '');
  sender.dd.afterDrag = (function (){sender.doLayout()});


  Ext.onReady(function ()
    {       
      Ext.get(sender.id).select(".x-form-field").each(function (el) {sender.dd.addInvalidHandleId(el.dom.id)})
    }
  );
}

so your UNIGUI-Code thinks, the form is still on Top-position: 0 

 

and my form-movement-methode also sends no event to your unigui-code .

 

.. can i read the position of a UniForm (borderStyle = bsNone) with javascript ?  

 

Thanx

Erich

Link to comment
Share on other sites

.. can i read the position of a UniForm (borderStyle = bsNone) with javascript ?  

 

 

Hi Erich.

 

Try:

//JS
UniForm1.window.getY(); //Top
UniForm1.window.getX(); //Left

or rewrite: //sender.dd.afterDrag = (function (){sender.setPosition(sender.getX(), sender.getY())});

function window.afterrender(sender, eOpts)
{
  sender.dd = new Ext.dd.DDProxy(sender, '');  
  sender.dd.afterDrag = (function (){sender.setPosition(sender.getX(), sender.getY())});

  Ext.onReady(function ()
    {       
      Ext.get(sender.id).select(".x-form-field").each(function (el) {sender.dd.addInvalidHandleId(el.dom.id)})
    }
  );
}

now it should work!

 

Best regards.

Link to comment
Share on other sites

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