MarcoC Posted November 6, 2022 Share Posted November 6, 2022 Hi All. I'm a new user of Unigui (but a seasoned Delphi developer) and I have some problems with a form (MainForm) where I put, design time a scrollbox and, after, create runtime and put inside the scrollbox, a series of panels, top aligned, with a simple frame (3 labels and one button), client aligned, inside each panel. This, basically, is the code I use: procedure TMainForm.AggiungiPanACarrello(aindex: integer); var aPnl: TUniPanel; aFrame: TfrmCarrelloList; begin // First I create the UniPanel... aPnl := TUniPanel.Create(self); aPnl.Parent := UniScrollBox1; aPnl.Name := 'pnlCarrello' + aindex.tostring; aPnl.Align := TAlign.alTop; aPnl.Height := 92; aPnl.Visible := TRUE; aPnl.Tag := aindex - 1; aPnl.OnClick := TestPanelClick; // ...and after the UniFrame, inside it aFrame := TfrmCarrelloList.Create(self); aFrame.Parent := aPnl; aFrame.Name := 'frmPnlCarrello' + aindex.tostring; aFrame.Align := alClient; aFrame.btnEliminaCarrello.Tag := aindex - 1; aFrame.btnEliminaCarrello.OnClick := TestButtonClick; end; Panels and the connected frames seem to be created and rendered without problems on the scrollbox but.. Main problem is some (weird ?) behaviors with the mouse, first of all when I click on the btnEliminaCarrello tunibutton I never get what is normal with a Delphi desktop application, i.e. is only the button onclick event method that is called: 1) in one little test project I see always fired only the panel onclick event (also if I put panel+frame not into the scrollbox but simply top aligned into the form), 2) and in the real project both methods (panel+button) are called in sequence, though I clicked on button only... I stop here (i have another strange problem with mouse, but one thing at a time ) : here I'm a newbie so maybe I'm missing something really important for unigui frames, or unigui (events?) at all, and I hope that someone can help. Thanks a lot. Marco p.s. sorry, if you can tell me which is a pratical way to add a screenshoot to this forum posts I can show what I see on my browser Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 8, 2022 Share Posted November 8, 2022 On 11/6/2022 at 4:29 PM, cirirex said: Main problem is some Hello, Can you please make a simple testcase to see the issue? Quote Link to comment Share on other sites More sharing options...
MarcoC Posted November 9, 2022 Author Share Posted November 9, 2022 Hi Sherzod. I fixed the issue, apparently simply deleting the click event code for the panel , as the click event always seemed to go from button to parent panel under it (now I see correctly executed only the code linked to the buttons) So thanks, this should be Ok now. Marco 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.