How to construct a popup Menu with Icons and text

Find and share HowTos to various installations / configurations!
Search

Post Reply
10 posts • Page 1 of 1
GerrieF
Posts: 9
Joined: Tue Sep 29, 2020 1:57 am

How to construct a popup Menu with Icons and text

Post by GerrieF »

How can I use the popupMenuXY to construct a contextual menu with buttons and Cascade buttons having an icon as well as a text label?
This is done for the Gedi menu bar, but I am unable to find an example for the construction.

gschijndel
Posts: 225
Joined: Tue Jan 15, 2019 3:12 pm

Re: How to construct a popup Menu with Icons and text

Post by gschijndel »

There is a hidden feature, which makes it possible to set a 'popup' flag for child panels. If this flag is set the child panel is closed if a mouse click occurs outside the child panel.
Perhaps 3.18 contains an example using this 'popup' flag.

GerrieF
Posts: 9
Joined: Tue Sep 29, 2020 1:57 am

Re: How to construct a popup Menu with Icons and text

Post by GerrieF »

Thank you for your reply to my post!
Last edited by GerrieF on Wed Mar 31, 2021 12:15 am, edited 1 time in total.

GerrieF
Posts: 9
Joined: Tue Sep 29, 2020 1:57 am

Re: How to construct a popup Menu with Icons and text

Post by GerrieF »

gschijndel wrote: Mon Mar 29, 2021 1:28 pm There is a hidden feature, which makes it possible to set a 'popup' flag for child panels. If this flag is set the child panel is closed if a mouse click occurs outside the child panel.
Perhaps 3.18 contains an example using this 'popup' flag.
Thank you for your reply to my post!

Can you tell me a little more about the hidden "popup" flag?

I am fairly new to OA and I am trying to construct a contextual menu for a client's CMS system based on Google Material design guidelines.

My problem is that I cannot add the icons to the buttons when I create the menu using "popupMenyXY".
Any help on this will greatly be appreciated.

User avatar
leoknipp
Posts: 2645
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to construct a popup Menu with Icons and text

Post by leoknipp »

In the upcoming version 3.18 a new reference object (objects/popupMenu/MenuButton.pnl) is available which can open a popup menu with text and icon.
You can possibly wait for the release of 3.18 and then have a look at the new reference object.

Best Regards
Leopold Knipp
Senior Support Specialist

GerrieF
Posts: 9
Joined: Tue Sep 29, 2020 1:57 am

Re: How to construct a popup Menu with Icons and text

Post by GerrieF »

leoknipp wrote: Thu Apr 01, 2021 8:42 am In the upcoming version 3.18 a new reference object (objects/popupMenu/MenuButton.pnl) is available which can open a popup menu with text and icon.
You can possibly wait for the release of 3.18 and then have a look at the new reference object.

Best Regards
Leopold Knipp
Senior Support Specialist
Good day Leopold
Thank you for this reply.
Do you know when version 3.18 will be released?

User avatar
leoknipp
Posts: 2645
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to construct a popup Menu with Icons and text

Post by leoknipp »

The release of 3.18 is planned for May 2021.
Information for the future releases you can find in the following pdf document:
https://www.winccoa.com/downloads/detai ... 14b76451d0

Best Regards
Leopold Knipp
Senior Support Specialist

emanuel.b
Posts: 1
Joined: Wed Dec 17, 2014 10:13 am

Re: How to construct a popup Menu with Icons and text

Post by emanuel.b »

Hello,

I was searching for something similiar too and found the solution with that "hidden feature" (see the windowFlags -> Popup below), see following snippet.


Code: Select all

  int x, y;
  getValue(this, "position", x, y); // just an example ...
  dyn_string dollars = makeDynString(); // whatever to pass ...
  
  dyn_anytype da = makeDynAnytype(myModuleName(), "yourPanelToShow.xml", myPanelName(), "somePanelName",  
                                  x, y , 1.0, true, dollars, false, makeMapping("windowFlags", "Popup"));

  dyn_anytype results;
  childPanel(da, results);
BR
Emanuel

GerrieF
Posts: 9
Joined: Tue Sep 29, 2020 1:57 am

Re: How to construct a popup Menu with Icons and text

Post by GerrieF »

emanuel.b wrote: Wed Apr 14, 2021 4:55 pm Hello,

I was searching for something similiar too and found the solution with that "hidden feature" (see the windowFlags -> Popup below), see following snippet.


Code: Select all

  int x, y;
  getValue(this, "position", x, y); // just an example ...
  dyn_string dollars = makeDynString(); // whatever to pass ...
  
  dyn_anytype da = makeDynAnytype(myModuleName(), "yourPanelToShow.xml", myPanelName(), "somePanelName",  
                                  x, y , 1.0, true, dollars, false, makeMapping("windowFlags", "Popup"));

  dyn_anytype results;
  childPanel(da, results);
BR
Emanuel

This will work great if I create a child panel, thanks.
I will defiantly keep this in mind for the design.

tpjctrl
Posts: 89
Joined: Tue May 08, 2018 10:30 am

Re: How to construct a popup Menu with Icons and text

Post by tpjctrl »

emanuel.b wrote: Wed Apr 14, 2021 4:55 pm Hello,

I was searching for something similiar too and found the solution with that "hidden feature" (see the windowFlags -> Popup below), see following snippet.


Code: Select all

  int x, y;
  getValue(this, "position", x, y); // just an example ...
  dyn_string dollars = makeDynString(); // whatever to pass ...
  
  dyn_anytype da = makeDynAnytype(myModuleName(), "yourPanelToShow.xml", myPanelName(), "somePanelName",  
                                  x, y , 1.0, true, dollars, false, makeMapping("windowFlags", "Popup"));

  dyn_anytype results;
  childPanel(da, results);
BR
Emanuel
Thanks for this example Emanuel, the only issue with this solution when creating context menus is the fact that a click outside the child panel is required to close it, but that click in itself is a "wasted" click. For example, say you create a main menu with a few main buttons and each one of those opens a context menu created using the above code (so with the popup windowFlag). If you click on one of the main menu buttons, a popup / context menu panel is shown (with whatever you want in it, it can contain buttons with icons + text for example), but if you then click on another main menu button to navigate the main menu, the only thing that will happen is the previously open context menu closing. So you need to click again on the main menu button you've selected to "open" that one, then you need to click away outside the context menu to close it, click another main menu button to "open" that one and so on...So basically it now requires two clicks to operate the menu which is counter intuitive and something you don't get with the "built in" context menu available via popupMenuXY.

Or is there a way to somehow bypass this behavior?

Post Reply
10 posts • Page 1 of 1