<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : popupmenu aligned with butt&#111;n</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : popupmenu aligned with butt&#111;n]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 14:30:01 +0000</pubDate>
  <lastBuildDate>Mon, 21 Mar 2005 05:14:15 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=1942</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : Hi SuperMario, thanks a lot for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5837&amp;title=popupmenu-aligned-with-button#5837</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1020">Superpippo</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 21 March 2005 at 5:14am<br /><br /><P>Hi SuperMario,</P><P>thanks a lot for your time. </P><P>May be that I don't explain well my problem so I resume.</P><P>I have an old application that use ActiveBar from DataDynamics and i want to change ActiveBar with XtremeSuite. I want to change the activex but, if possible, i don't want to change the application architecture.</P><P>The application have a main menu, the buttons on the main menu can launch procedures or can drop down submenus. For the submenus the application create at runtime context menus and show it (showpopup). The context menu (submenu) are moved in the position of a standard submenu (shopopup x,y parameter) to give the user the look of a standard submenu.</P><P>Change context menu with standard submenu it's not applicable because the code of my application are tied for showpopup.&nbsp; Showpopup stop the code execution and wait for user input, standard submenu or execute method don't. My application must wait the user input or crash.</P><P>The&nbsp;code must move on this path. Your code doesn't apply to me: </P><P>You have standard submenu showed with execute method and Control.CloseSubMenuOnClick = False. This stop the menu on the screen but don't stop the code execution, yes you have an exit sub after execute method but my applicaton haven't. The rigth way is to show the menu with showpopup method, the Control.CloseSubMenuOnClick must be true.</P><P>But with showpopup method i have&nbsp;this problem: </P><P>1) In ActiveBar i can get the position of a button on mainmenu and starting from this i can give to showpopup the rigth x,y parameter. In XtremeCommandBar i have not a GetWindowRect for the button on main menu. So how i can get the correct x,y ? In attachment i give you a modified release of my last code sample. Here i get the correct position with this workaround: </P><P>1st) show&nbsp;the submenu as a&nbsp;standard menu&nbsp;with execute method</P><P>2nd) call GetWindowRect to get the rigth x,y of the submenu</P><P>3rd) show again the submenu as a context menu with showpop x,y</P><P>Look at the code. This work but it' s not so good because&nbsp;the&nbsp;double show.</P><P>2) With this code when i click&nbsp;an item on submenu (context menu) i&nbsp;don't get an execute event!!! So my submenu are useless!!!</P><P>I hope that this long message can help.</P><P>Thank a lot.</P><P>Maurizio</P><P>&nbsp;<A href="http://forum.codejock.com/uploads/Superpippo/2005-03-21_051210_popupmenu3.zip" target="_blank">2005-03-21_051210_popupmenu3.zip</A></P>]]>
   </description>
   <pubDate>Mon, 21 Mar 2005 05:14:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5837&amp;title=popupmenu-aligned-with-button#5837</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : Sorry for the delayed response.  1....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5747&amp;title=popupmenu-aligned-with-button#5747</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 15 March 2005 at 3:00pm<br /><br />Sorry for the delayed response.<br><br>1.&nbsp; You must set this for each control added to the popup.&nbsp;For example, here is some modified code from the sample I postedearlier.<br><br>&nbsp;&nbsp;&nbsp; Dim PopupMenu1 As CommandBarPopup<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Set PopupMenu1 = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&amp;File", -1, False)<br>&nbsp;&nbsp;&nbsp; PopupMenu1.Visible = False<br>&nbsp;&nbsp;&nbsp; PopupMenu1.Id = ID_MnuSub_1<br>&nbsp;&nbsp;&nbsp; With PopupMenu1.CommandBar.Controls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Control = .Add(xtpControlButton, ID_FILE_NEW, "&amp;New", -1, False)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control.CloseSubMenuOnClick = False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Control = .Add(xtpControlButton, ID_FILE_OPEN, "&amp;Open", -1, False)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control.CloseSubMenuOnClick = False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ................<br>&nbsp;&nbsp;&nbsp; End With<br><br>I have attached a sample that I think is closer to what you want.&nbsp;First click on the menu button to see it act like a normal button, thenclick the toggle button to see it act like a popup.&nbsp; Repeat toswitch back and forth.<br><a href="uploads/SuperMario/2005-03-15_150026_Popups.zip" target="_blank">2005-03-15_150026_Popups.zip</a>]]>
   </description>
   <pubDate>Tue, 15 Mar 2005 15:00:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5747&amp;title=popupmenu-aligned-with-button#5747</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : Hi SuperMario, thanks a lot for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5685&amp;title=popupmenu-aligned-with-button#5685</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1020">Superpippo</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 11 March 2005 at 2:25am<br /><br /><P>Hi SuperMario,</P><P>thanks a lot for your time.</P><P>I have made a simple project following your guidelines.</P><P>In this project on form load i create a main menu with some block of control. Every block have a control button and a popup button. At startup only the controls button are visible.</P><P>When user click on a item (visible control button) on main menu i get the "execute" event&nbsp;and here I change the visible state of control button with the popup on the same block&nbsp;I created on form load.</P><P>I set the CloseSubMenuOnClick&nbsp;= false for the popup button and&nbsp;populate the popup with a control.</P><P>After all i call popup.execute method to open popup.</P><P>Following i put in the code a debug.print message to assure that the code stopped opening the popup and at last i reset the original visible status of control button and popup.</P><P>Well the code is not working as we hope! </P><P>1st) The CloseSubMenuOnClick have no effect. The code follow to be executed after the opening of the popup. </P><P>2nd) The popup itself it's not in correct position</P><P>3rd) If you click more and more on the same item on main menu the popup move it self to walk on screen.</P><P>So&nbsp;i think that only popup.showpopup stop code execution waiting for user selection. If you use popup.execute the code&nbsp;does not stop.</P><P>The 2nd and 3rd problem are linked to 1st, following the code after .execute i have the reset of visible status, but this reset comes&nbsp;when the popup is still on screen (the code does'nt stop)&nbsp;and i think that this reset give&nbsp;me&nbsp;2nd and 3rd problem.</P><P>Some other ideas ?</P><P>Why we can't get a function like getwindowrect for the controlbutton ? I think with this i can solve everything.....</P><P>I send you my simple project in attachment.</P><P>Thank you.</P><P><A href="http://forum.codejock.com/uploads/Superpippo/2005-03-11_022239_popupmenus.ZIP" target="_blank">2005-03-11_022239_popupmenus.ZIP</A></P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Fri, 11 Mar 2005 02:25:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5685&amp;title=popupmenu-aligned-with-button#5685</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : To keep the menu open until the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5673&amp;title=popupmenu-aligned-with-button#5673</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 10 March 2005 at 2:59pm<br /><br />To keep the menu open until the user makes a selection when displayinga popup menu you can change the CloseSubMenuOnClick property.<br><br>About the other problem.&nbsp; All I can suggest is that you first usea ControlButton,&nbsp; If you determine that a popup is needed, thenyou will need to remove the control button and insert a ControlPopup inthe same location.&nbsp; <br>]]>
   </description>
   <pubDate>Thu, 10 Mar 2005 14:59:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5673&amp;title=popupmenu-aligned-with-button#5673</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : Hi SuperMario, thank you for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5672&amp;title=popupmenu-aligned-with-button#5672</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1020">Superpippo</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 10 March 2005 at 2:50pm<br /><br /><P>Hi SuperMario,</P><P>thank you for the support, but my&nbsp;application structure&nbsp;is different.</P><P><FONT color=#cc0000>1ST)</FONT></P><P>In your code you create at form load&nbsp;a main menu as follow:</P><P>&nbsp;&nbsp;&nbsp; With CommandBars.ActiveMenuBar.Controls<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Control = .Add(xtpControlPopup, ID_MnuMain_1, "MnuMain&amp;1")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control.Id = ID_MnuMain_1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control.CommandBar.Title = "PopupMenu1"<BR>&nbsp;&nbsp;&nbsp; End With<BR></P><P>here the control type is xtpControlPopup. </P><P><FONT color=#cc0000>In my code when i load the form i don't know if the control is xtpControlPopup or xtpControlButton. </FONT><FONT color=#cc0000>When the user click an item on main menu (ActiveMenuBar)&nbsp;my code scan some memory structure and only at this moment I really know if I have a submenu or if I must do something other. </FONT></P><P><FONT color=#cc3300></FONT>&nbsp;</P><P><FONT color=#cc3300>2ND) </FONT></P><P>Your code load submenu at runtime in InitCommandsPopup event and the show of submenu it's automatically operated. The code show submenu and go further away....(the show of a submenu isn't modal).</P><P><FONT color=#cc3300>In my code I must&nbsp;use a&nbsp;context menu via showpopup method as submenu because in this way the code stop&nbsp;execution and wait for user input&nbsp;(in other word the showpopup is modal). <BR></P><P></FONT><FONT color=#009900>The code in my sample it's fully working, the only problem is the position of submenu. But to have the correct position i need to know the position and dimension of the item on main menu, how can i get it ? Someother workaround ?</FONT></P><P><FONT color=#009900></FONT><FONT color=#cc3300>&nbsp;</P></FONT>]]>
   </description>
   <pubDate>Thu, 10 Mar 2005 14:50:19 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5672&amp;title=popupmenu-aligned-with-button#5672</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : Ok, I think this is what you are...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5640&amp;title=popupmenu-aligned-with-button#5640</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 10 March 2005 at 8:34am<br /><br />Ok, I think this is what you are looking for.&nbsp; To be clear, youare looking to dynamically display a popup menu in theActiveMenuBar?&nbsp; I assume you want to show popups in the menubarand not in the ToolBars, if thats the case, then you would use a popuptoolbar.<br><br>In the modified attached sample I display 3 different popup menus, 1for each main menu item.&nbsp; Notice that I changed the type toControlPopup (If you don't like this then I think I might have a messyworkaround).&nbsp; The first 2 popup menus were created in the formload and I simply copy them when needed, the 3rd popup menu it createddynamically.&nbsp; You can use either method.<br><br><a href="uploads/SuperMario/2005-03-10_082839_PopupMenus.zip" target="_blank">2005-03-10_082839_PopupMenus.zip</a>]]>
   </description>
   <pubDate>Thu, 10 Mar 2005 08:34:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5640&amp;title=popupmenu-aligned-with-button#5640</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : Escuse me, may be i am not so...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5638&amp;title=popupmenu-aligned-with-button#5638</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1020">Superpippo</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 10 March 2005 at 4:11am<br /><br /><P>Escuse me, may be i am not so clear on my explanations.</P><P>I am evaluating the migration of&nbsp;my application from other gui products (activebar).</P><P>In my application all the menu (main menu and submenu)&nbsp;are runtime defined.</P><P>The Main menu is loaded on form load event but at this time i don't know if the&nbsp;item of the main menu&nbsp;link or not a submenu. So all my item are CommandbarButton object.</P><P>When the user click an item of main menu the application&nbsp;can start with specific procedure or can load and show a submenu. So to load a submenu i use a Popup object.</P><P>But the Popup show it self in the mouse coordinates, that is not the same position of a standard submenu defined as CommandBarPopup object.</P><P>To workaround this problem in activebar i use showpopup method with the x,y parameter, i can calculate the screen coordinates x,y to show popup with a simple function starting from the position (top, left) and dimension (width, heigth) properties of a button in the main menu. </P><P>But in XtremeCommandbar how can i&nbsp;know the position and dimension of a button ? </P><P>And if i can't, here is some other workaround to show the popup in the same coordinates of a standard CommandBarPopup object ?</P><P>In attachment i send a simple project to better explain the problem.</P><P>Thank you.</P><P><A href="http://forum.codejock.com/uploads/Superpippo/2005-03-10_040926_PopupMenu.zip" target="_blank">2005-03-10_040926_PopupMenu.zip</A></P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Thu, 10 Mar 2005 04:11:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5638&amp;title=popupmenu-aligned-with-button#5638</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : If they are clicking on a button...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5635&amp;title=popupmenu-aligned-with-button#5635</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 09 March 2005 at 7:18pm<br /><br />If they are clicking on a button in the menu, why not make it a splitbutton popup instead?]]>
   </description>
   <pubDate>Wed, 09 Mar 2005 19:18:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5635&amp;title=popupmenu-aligned-with-button#5635</guid>
  </item> 
  <item>
   <title><![CDATA[popupmenu aligned with butt&#111;n : In my application i have a main...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5634&amp;title=popupmenu-aligned-with-button#5634</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1020">Superpippo</a><br /><strong>Subject:</strong> 1942<br /><strong>Posted:</strong> 09 March 2005 at 5:42pm<br /><br /><P>In my application i have a main menu with button. The main menu is runtime loaded and updated. </P><P>I&nbsp;want to create and show at runtime a popupmenu when the user click on the buttons of the main menu. And I want it in the same coordinates of a standard submenu.</P><P>So far it's ok,i can create the main menu at form load and create and show the popupmenu at execute event of commandbars.</P><P>When i show popupmenu via showpopup method&nbsp;the popupmenu is popped on mouse position,&nbsp;but i want it displayed in the same coordinates as a standard submenu.</P><P>I think to use showpopup method with x,y position parameter, but how i can get the position of the button control on the main menu ?</P><P>Why we can't have left, top, width, height position of the button control ?</P><P>I hope someone can help.</P><P>Bye</P><P>Maurizio</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Wed, 09 Mar 2005 17:42:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1942&amp;PID=5634&amp;title=popupmenu-aligned-with-button#5634</guid>
  </item> 
 </channel>
</rss>