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. CToolBar and/or CDialogBar

CToolBar and/or CDialogBar

Scheduled Pinned Locked Moved C / C++ / MFC
questioncareer
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.
  • K Offline
    K Offline
    kylur
    wrote on last edited by
    #1

    Greetings all! I'd like to create a bar which will have a mixture of the tool buttons and controls (combo, pushbutton, edit, etc). The CToolBar class will work for the tool buttons but the job of implementing the controls is too involved. The CDialogBar class will work for the controls but how do I get the tool buttons to work? I've tried a standard button with the BS_ICON style; two problems: 1) button is 16x16, icon is 16x16 but the display lops off part of the icon and 2) how do I get the button to stay "depressed"? I've tried a standard button with the BS_BITMAP style but it: 1) loses the 'transparency' feature of icons, and 2) I still cannot get the button to stay "depressed". The BS_PUSHLIKE style does cause the button to appear to be pushed in on mouse click but does not remain pushed in. The CReBar class will allow for the wrapping of a CToolBar in one band and the CDialogBar in another band but I'd really like to mix the tool buttons and controls in a more logical order. So, the upshot is, I'd like to use the CDialogBar with BS_ICON style if the following problems can be fixed: 1) how do I display the full (standard sized) icon? 2) how do I simulate the icon being "depressed"? Regards, Kylur.

    O 1 Reply Last reply
    0
    • K kylur

      Greetings all! I'd like to create a bar which will have a mixture of the tool buttons and controls (combo, pushbutton, edit, etc). The CToolBar class will work for the tool buttons but the job of implementing the controls is too involved. The CDialogBar class will work for the controls but how do I get the tool buttons to work? I've tried a standard button with the BS_ICON style; two problems: 1) button is 16x16, icon is 16x16 but the display lops off part of the icon and 2) how do I get the button to stay "depressed"? I've tried a standard button with the BS_BITMAP style but it: 1) loses the 'transparency' feature of icons, and 2) I still cannot get the button to stay "depressed". The BS_PUSHLIKE style does cause the button to appear to be pushed in on mouse click but does not remain pushed in. The CReBar class will allow for the wrapping of a CToolBar in one band and the CDialogBar in another band but I'd really like to mix the tool buttons and controls in a more logical order. So, the upshot is, I'd like to use the CDialogBar with BS_ICON style if the following problems can be fixed: 1) how do I display the full (standard sized) icon? 2) how do I simulate the icon being "depressed"? Regards, Kylur.

      O Offline
      O Offline
      ovidiucucu
      wrote on last edited by
      #2
      • set BS_OWNERDRAW style, and draw yourself in CButton::DrawItem overridden function (you need in this case to create your own class derived from CButton), or an easier alternative is to use CBitmapButton class.
      • add BS_AUTOCHECKBOX and BS_PUSHLIKE styles.

      Ovidiu Cucu Microsoft MVP - Visual C++

      K 1 Reply Last reply
      0
      • O ovidiucucu
        • set BS_OWNERDRAW style, and draw yourself in CButton::DrawItem overridden function (you need in this case to create your own class derived from CButton), or an easier alternative is to use CBitmapButton class.
        • add BS_AUTOCHECKBOX and BS_PUSHLIKE styles.

        Ovidiu Cucu Microsoft MVP - Visual C++

        K Offline
        K Offline
        kylur
        wrote on last edited by
        #3

        Thanks! I appreciate the advise. Regards, Kylur

        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