<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Popup Menu on AcPane in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485921#M9753</link>
    <description>&lt;P&gt;Some partial solutions...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my first method it seems to be setting the &lt;STRONG&gt;TrackMenuPopup&lt;/STRONG&gt; owner to&amp;nbsp;&lt;STRONG&gt;acedGetAcadFrame&lt;/STRONG&gt;&amp;nbsp;that causes the menu to be disabled. However, setting it to something else causes other problems (i.e., the menu doesn't work). Of course, it's still in the wrong place too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I fix my second method to modify the strings in the sub-menu (d'oh!) it almost does the right thing. It is enabled, it works and appears in the correct place - but AutoCAD's theming hasn't implemented menu tabs correctly. The Windows standard is that putting a tab in the menu text aligns everything after the tab to the right, regardless of the length of the menu text - AutoCAD isn't doing that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/261521i3E1D7FC593F9EC98/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Menu2.png" title="Menu2.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead it looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/261522i524B0C147047A65F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Menu1.png" title="Menu1.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, that's probably close enough for now.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2016 00:09:54 GMT</pubDate>
    <dc:creator>Kyudos</dc:creator>
    <dc:date>2016-08-09T00:09:54Z</dc:date>
    <item>
      <title>Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6483191#M9749</link>
      <description>&lt;P&gt;I'm having problems displaying a popup menu from the &lt;STRONG&gt;OnRButtonDown&lt;/STRONG&gt; handler of my AcPane derived class. The first problem is positioning the menu I'm using this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//------------------------------------------------------------------------------
void MyPane::OnRButtonDown(UINT nFlags, CPoint pt)
//------------------------------------------------------------------------------
{
    CMenu Menu;
    AcApStatusBar* pStatus = acedGetApplicationStatusBar();
    if (pStatus != NULL)
    {
        HWND hwndStatusBar = NULL;
        HWND hwndStatusBarHost = ::GetDlgItem(adsw_acadMainWnd(), 0xE801);
        if (hwndStatusBarHost != NULL)
        {
            hwndStatusBar = GetWindow(hwndStatusBarHost, GW_CHILD);
        }

        ::ClientToScreen(hwndStatusBar, &amp;amp;pt);&lt;/PRE&gt;
&lt;P&gt;This doesn't give the correct coordinates on my multi-monitor system. Does anyone know how to convert between the results of ClientToScreen and the virtual desktop?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second problem is that all my popup menu items are disabled, despite being enabled in the resources. Even if I iterate through them and specifically enable them, they are still disabled. How can I fix that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 04:56:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6483191#M9749</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-08T04:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6483884#M9750</link>
      <description>&lt;P&gt;Have you tried using AcPane::DisplayPopupPaneMenu() instead?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:11:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6483884#M9750</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2016-08-08T13:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485399#M9751</link>
      <description>&lt;P&gt;Yeah &amp;nbsp;- I tried that first, but I can't get it to hit the handler. The docs seem to suggest it will only work for &lt;STRONG&gt;ACSB_POPUP&lt;/STRONG&gt; panels, so I use &lt;STRONG&gt;SetStyle&lt;/STRONG&gt; in my constructor, but it doesn't seem to work.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 20:56:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485399#M9751</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-08T20:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485813#M9752</link>
      <description>&lt;P&gt;Ok...progress of sorts. I'm trying to modify the menu before I display it. So I have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (Menu.LoadMenu(IDR_DIALOGBAR))
{
    CMenu* pSubMenu = Menu.GetSubMenu(3);

    // Show all info on menu
    CString strInfoMode = _T("");
    CString strMenuItem = _T("");
    CString strNewMenu = _T("");
    UINT nID = 0;
    if (pSubMenu != NULL)
    {
        for (int i = 0; i &amp;lt; 7; i++)
        {
            pSubMenu-&amp;gt;GetMenuString(i, strMenuItem, MF_BYPOSITION);
            strInfoMode = GetInfoModeString((AEI_InfoPane::eInfoMode)i);
            strNewMenu.Format(_T("%s\t(%s)"), strMenuItem, strInfoMode);
            nID = pSubMenu-&amp;gt;GetMenuItemID(i);
            pSubMenu-&amp;gt;ModifyMenu(i, MF_BYPOSITION | MF_STRING, nID, strNewMenu);
        }

        pSubMenu-&amp;gt;CheckMenuRadioItem(0, 7, m_eInfoMode, MF_BYPOSITION);
        CWnd* pWnd = acedGetAcadFrame();
        UINT nMenuID = pSubMenu-&amp;gt;TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, pWnd);

        if (nMenuID != 0)
        {
            OnInfoMenu(nMenuID);
        }
    }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IDR_DIALOGBAR is a menu resource containing the definitions of multiple popup menus. The above code shows the menu with the modified strings, but in the wrong place with all items disabled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I change it to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if (Menu.LoadMenu(IDR_INFOMENU))
{
    // Show all info on menu
    CString strInfoMode = _T("");
    CString strMenuItem = _T("");
    CString strNewMenu = _T("");
    UINT nID = 0;

    for (int i = 0; i &amp;lt; 7; i++)
    {
        Menu.GetMenuString(i, strMenuItem, MF_BYPOSITION);
        strInfoMode = GetInfoModeString((AEI_InfoPane::eInfoMode)i);
        strNewMenu.Format(_T("%s\t(%s)"), strMenuItem, strInfoMode);
        nID = Menu.GetMenuItemID(i);
        Menu.ModifyMenu(i, MF_BYPOSITION | MF_STRING, nID, strNewMenu);
    }

    Menu.CheckMenuRadioItem(0, 7, m_eInfoMode, MF_BYPOSITION);
    UINT nMenuID = pStatus-&amp;gt;DisplayPopupPaneMenu(this, Menu);
&lt;BR /&gt;    if (nMenuID != 0)
    {
        OnInfoMenu(nMenuID);
    }
}&lt;/PRE&gt;
&lt;P&gt;Now IDR_INFOMENU is a copy of the submenu from the first instance 'promoted' to a menu resource in it's own right. Here the menu modification fails, but the menu displays enabled in the correct place (and the menu works).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Note my &lt;STRONG&gt;AcPane::DisplayPopupPaneMenu&lt;/STRONG&gt; handler is still never called).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So it seems like AutoCAD is interfering with my menu, whether I like it or not...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 23:17:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485813#M9752</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-08T23:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485921#M9753</link>
      <description>&lt;P&gt;Some partial solutions...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my first method it seems to be setting the &lt;STRONG&gt;TrackMenuPopup&lt;/STRONG&gt; owner to&amp;nbsp;&lt;STRONG&gt;acedGetAcadFrame&lt;/STRONG&gt;&amp;nbsp;that causes the menu to be disabled. However, setting it to something else causes other problems (i.e., the menu doesn't work). Of course, it's still in the wrong place too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I fix my second method to modify the strings in the sub-menu (d'oh!) it almost does the right thing. It is enabled, it works and appears in the correct place - but AutoCAD's theming hasn't implemented menu tabs correctly. The Windows standard is that putting a tab in the menu text aligns everything after the tab to the right, regardless of the length of the menu text - AutoCAD isn't doing that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/261521i3E1D7FC593F9EC98/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Menu2.png" title="Menu2.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead it looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/261522i524B0C147047A65F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Menu1.png" title="Menu1.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, that's probably close enough for now.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 00:09:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6485921#M9753</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-09T00:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6637224#M9754</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I also encountered the same problem,Did you find a solution?&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Kyudos&amp;nbsp;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 12:18:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6637224#M9754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-21T12:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Menu on AcPane</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6640232#M9755</link>
      <description>&lt;P&gt;Only in as far as I've described here - my menu displays in the correct place, with the correct strings but doesn't handled the tabs correctly. I suspect that is a failure in AutoCAD's theming routines. It's a pretty minor display problem so I didn't try to fix it myself (since it would be fairly involved).&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2016 21:00:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/popup-menu-on-acpane/m-p/6640232#M9755</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-10-23T21:00:55Z</dc:date>
    </item>
  </channel>
</rss>

