Jump to content

TUniPopupMenu, Slow response to popup/popupBy at runtime


M.Ammar

Recommended Posts

Hi

I have one TUniPopupMenu that I want to use with many Unbuttons/or Unipanel on the same form "Card Type of form" I have found some solutions in the forum but it is slow and have to click 2or3 times for the menu to show

procedure TfraCardView.UniCPBaseMouseUp(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   if Button = mbRight then
   begin
      UniPopupMenu1.Popup(X, Y, Sender);
   end;
end;

//  examble to use it on a panel
for I := 1 to 50 do 
Begin
            PanelInfo := TUniContainerPanel.Create(Self); 
            with PanelRoomInfo do
            begin
               Parent := PanelCenter;
               Name := 'UniPanelInfo_' + I;
               OnMouseUp := UniCPBaseMouseUp;
            end;
End;

and the same result with PopupBy

 

procedure TfraCardView.UniMenuButton1Click(Sender: TObject);
begin
   UniPopupMenu1.PopupBy(Sender as TUniMenuButton);
End;

and use it like this

           MenuButton := TUniMenuButton.Create(Self);
            with MenuButton do
            begin
               Parent := PanelTop;
               width := 100;
               MenuButton.OnClick := UniMenuButton1Click;
               MenuButton.ArrowBottom := True;
            end;

the problem is that some times the user have to click 2 or 3 times in order for the menu to show,   

I have also tried to create separate menu with menu items for every card it works better, but the form takes Much longer to load and not easy to manage.

any suggestions or alternatives? 

Best Regards

Link to comment
Share on other sites

1 hour ago, Sherzod said:

Hello,

Sorry, can you make a simple testcase for this?!

Actually after making the testcase I found out that it is misunderstanding from my side ,

you see the first menu opens up fast then the 2nd open up after 2 clicks because the first click is used to close the first menu 

thanks for reply

Card Test.rar

Link to comment
Share on other sites

 

2 minutes ago, Sherzod said:

So, "problem" solved?

if this is normal behaviour then I think it is not a problem unless you can find away to close the menu on a panel and open it on another panel is the same click it will be better user experience.

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