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. Toolbar with two columns how

Toolbar with two columns how

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++
3 Posts 2 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.
  • S Offline
    S Offline
    sharp_k
    wrote on last edited by
    #1

    i would like to create a toolbar which is docked to the left side of the SDI window but which has two column instead of one which is the default. What i already know is: 1. Derive a class from toolbar 2. Include a handler for WM_SIZEPARENT, which is MFC's private message. 3. Overwrite the virtual functions CalcDyanamicLayout and CalcFixedLayout in my derived class. 4. Write code in CalcDynamicLayout and CalcFixedlayout to set the flags of each button in the toolbar. 5. Use my derived Toolbar to replece the original toolbar. I need help in 3 and 4 especially 4. I am also getting some kind of error when i close my application. Anyone who can help me out would be great. If you have better idea, please advise so. Mark

    M 1 Reply Last reply
    0
    • S sharp_k

      i would like to create a toolbar which is docked to the left side of the SDI window but which has two column instead of one which is the default. What i already know is: 1. Derive a class from toolbar 2. Include a handler for WM_SIZEPARENT, which is MFC's private message. 3. Overwrite the virtual functions CalcDyanamicLayout and CalcFixedLayout in my derived class. 4. Write code in CalcDynamicLayout and CalcFixedlayout to set the flags of each button in the toolbar. 5. Use my derived Toolbar to replece the original toolbar. I need help in 3 and 4 especially 4. I am also getting some kind of error when i close my application. Anyone who can help me out would be great. If you have better idea, please advise so. Mark

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You shouldn't need step 2. I personally use a CControlBar with CToolbars embedded (members of the control bar). Here's 3 reasons why... In the CControlBar class Calc____Layout() override(s) I can return a CSize that has the appropriate dimensions to fill a side of the parent frame window. In the CControlBar class Calc____Layout() override(s) I can resize the embedded toolbar(s) to force it to wrap the rows/columns of buttons into multiple rows or columns (depending on orientation). With CControlBa, it's easy to mix toolbars and any other windows/controls and wrap them all nicely in one bar docked to the frame. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • M Mark Salsbery

        You shouldn't need step 2. I personally use a CControlBar with CToolbars embedded (members of the control bar). Here's 3 reasons why... In the CControlBar class Calc____Layout() override(s) I can return a CSize that has the appropriate dimensions to fill a side of the parent frame window. In the CControlBar class Calc____Layout() override(s) I can resize the embedded toolbar(s) to force it to wrap the rows/columns of buttons into multiple rows or columns (depending on orientation). With CControlBa, it's easy to mix toolbars and any other windows/controls and wrap them all nicely in one bar docked to the frame. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        S Offline
        S Offline
        sharp_k
        wrote on last edited by
        #3

        I got your idea. But i am not sure if i can not do it the way i am doing it. That is derive my class directly from CToolBar. I think you are saying that derive my class from CControlBar, which has CMyToolBar class embedded in it which is more flexible. I would need CControlBar the way you described it as an option bar in my application which will be horizonal. My vertical bar needs not to be moved and will be fixed. Depening on which button you press in ver bar, the right option bar should show. It is more like adobe photoshop type application that i am trying to develop. You said i do not need step 2. That is using WM_SIZEPARENT. Is that what you really meant. Please explain a little. And thanks for the help. Mark

        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