Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to disable CDockablePane context menu?

How to disable CDockablePane context menu?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eight
    wrote on last edited by
    #1

    Whenever I right-click on my CDockablePane, a context menu (Floating, Docking, Tabbed Document, Auto Hide, Hide) appear. How do I disable this?

    L S 2 Replies Last reply
    0
    • E eight

      Whenever I right-click on my CDockablePane, a context menu (Floating, Docking, Tabbed Document, Auto Hide, Hide) appear. How do I disable this?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your in luck! I am currently working on a CDockablePane derived class. You need to overide CPane::OnShowControlBarMenu[^] Just tested it and it works. The really wierd thing is... the MSDN says:

      TRUE if the menu can be displayed; otherwise, FALSE.

      But... I had to do the exact opposite! Can you confirm this in your code? Best Wishes, -David Delaune

      E 1 Reply Last reply
      0
      • L Lost User

        Your in luck! I am currently working on a CDockablePane derived class. You need to overide CPane::OnShowControlBarMenu[^] Just tested it and it works. The really wierd thing is... the MSDN says:

        TRUE if the menu can be displayed; otherwise, FALSE.

        But... I had to do the exact opposite! Can you confirm this in your code? Best Wishes, -David Delaune

        E Offline
        E Offline
        eight
        wrote on last edited by
        #3

        CFieldPane is derived from CDockablePane.

        BOOL CFieldPane::OnShowControlBarMenu(CPoint point)
        {
        return TRUE;
        }

        Nothing happens. The context menu still appear :doh:

        E 1 Reply Last reply
        0
        • E eight

          CFieldPane is derived from CDockablePane.

          BOOL CFieldPane::OnShowControlBarMenu(CPoint point)
          {
          return TRUE;
          }

          Nothing happens. The context menu still appear :doh:

          E Offline
          E Offline
          eight
          wrote on last edited by
          #4

          I did this.

          BOOL CFieldPane::OnShowControlBarMenu(CPoint point)
          {
          return FALSE;
          }

          .. and the context menu doesn't appear anymore. Thanks David :)

          1 Reply Last reply
          0
          • E eight

            Whenever I right-click on my CDockablePane, a context menu (Floating, Docking, Tabbed Document, Auto Hide, Hide) appear. How do I disable this?

            S Offline
            S Offline
            severin0
            wrote on last edited by
            #5

            I simply overrode CDockablePane::OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/) to have the function do nothing and just return. Now when I right-click, the only context menu I see is the one from my CDialog window that I have embedded into my CDockablePane window. Before I did this, the CDockablePane context menu would pop up immediately after I selected an item from my CDialog window's context menu.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups