Jump to content

Problems with TUniFrame (newbie)


MarcoC

Recommended Posts

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

 

Link to comment
Share on other sites

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

 

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