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. lock toolbar position after docking

lock toolbar position after docking

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 18 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    how do i lock the position of two toolbars after docking them side by side?

    C J 2 Replies Last reply
    0
    • L Lost User

      how do i lock the position of two toolbars after docking them side by side?

      C Offline
      C Offline
      Cristi Posea
      wrote on last edited by
      #2

      You have 2 options: 1. Implement state persistence - in CMainFrame::OnCreate() call LoadBarState(), and in OnClose() or DestroyWindow() call SaveBarState(). You have to make sure the toolbars have different IDs. (see the toolbars & docking windows section for related info). 2. Derive your own classes from CToolbar or whatever, and block WM_LBUTTONDOWN and WM_LBUTTONDBLCLK (handle the messages and do nothing in the handlers' implementations). The drawback is thath the user will no longer able to drag the toolbars around, nor to float them, but you can control them programmatically (using CFrameWnd's ShowControlBar(), DockControlBar(), FloatControlBar(), etc.). Another problem of this approach is that the bars will be arranged on different rows if the user resizes the main window in a way the second toolbar is completely invisible. Personally, I preffer (1). Cristi ================== The original message was: how do i lock the position of two toolbars after docking them side by side?

      1 Reply Last reply
      0
      • L Lost User

        how do i lock the position of two toolbars after docking them side by side?

        J Offline
        J Offline
        Jesse Ezell
        wrote on last edited by
        #3

        The whole point of Dockable toolbars is so that they can be moved. The best thing to do is not to lock them. I can't see any reason why it would ultimately benefit the user in the end. Users like to be able to arrange things any way they want.

        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