Arquem Posted September 2, 2019 Share Posted September 2, 2019 Hello use unigui web application Framework 1.90.0 build 1505 I have this function that returns the position of the mouse click and positions the panel at the x and y coordinate. But I want to take a certain object that I will enter the name, then I want it to position next to it. Could you give me an example? procedure TMainForm.UniPanel2Click(Sender: TObject); var i: integer; begin for i := 1 to 3 do begin pStatus := TUniPanel.Create(MainForm); with pStatus do begin Name := 'Option_' + inttostr(i); caption := name; Parent := sb; Top := i * 41; Height := 40; align := altop; color := RGB(Random(255), Random(255), Random(255)); OnAjaxEvent := pAjaxEvent; ClientEvents.ExtEvents.Values['mousedown'] := 'function mousedown(sender, x, y, eOpts){ajaxRequest(sender, "_mousedown", ["x="+parseInt(x+sender.getX()), "y="+parseInt(y+sender.getY())])}'; end; end; end; procedure TMainForm.pAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var p: TUniPanel; x,y: Integer; begin if EventName = '_mousedown' then begin x := Params.Values['x'].ToInteger(); y := Params.Values['y'].ToInteger(); p := findcomponent((Sender as TComponent).Name) as TUniPanel; unilabel2.Caption := p.Caption; UniPanel3.Top := y; UniPanel3.Left := x; end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 2, 2019 Share Posted September 2, 2019 55 minutes ago, Arquem said: Hello use unigui web application Framework 1.90.0 build 1505 Hello, Which edition are you using? Are you using a trial edition? Quote Link to comment Share on other sites More sharing options...
Arquem Posted September 2, 2019 Author Share Posted September 2, 2019 last paid version, bought and email is already in the register you requested 1.90.0 build 1505. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 3, 2019 Share Posted September 3, 2019 Thank you for the update. 5 hours ago, Arquem said: But I want to take a certain object that I will enter the name, then I want it to position next to it. Could you give me an example? Can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
Arquem Posted September 3, 2019 Author Share Posted September 3, 2019 I want to get the position of these components in yellow at runtime. Like a function that scrolls around and brings their position and names. I don't know how to do this, can you help me please? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 3, 2019 Share Posted September 3, 2019 18 hours ago, Arquem said: I want to get the position of these components in yellow at runtime. Like a function that scrolls around and brings their position and names. I don't know how to do this, can you help me please? Sorry to clarify. It would be better to clarify where, when you want to get it and why? Quote Link to comment Share on other sites More sharing options...
Arquem Posted September 3, 2019 Author Share Posted September 3, 2019 O problema sao os PARENTs... preciso pegar a POSICAO ABSOLUTA do componente... se um LABEL estiver DENTRO de um PANEL q ta dentro de outro etc... a posicao dele vai vir diferente da REAL. O componente é passado em tempo de execução. Gostaria de saber exatamente a posição do UniPanel2 ao aparecer o mainform para fazer aparecer outro unipanel3 bem proximo dele, no unipanel3 vai ter um botão que ao clicar ira levar para bem proximo do outro componente por exemplo unibutton4 e assim por diante. Vou mandar outra imagem para tentar explicar a ideia. 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.