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. I want to Write CToolBar class from the scratch

I want to Write CToolBar class from the scratch

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialhelpquestion
5 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.
  • A Offline
    A Offline
    Abhishek Narula
    wrote on last edited by
    #1

    Is it a Big deal to do that stuff ?? See my problem is our Art director has given me a task to create a fancy shaped toolbar which is a mixture of Office2K type Flat toolbars and Mac os type round edges etc. I tried to study some of the very good toolbar classes available on CodeProject, but it seems that I can Draw only within the buttons area. not on the edges or Title bar of the toolbar(when its floating) so I need some guidance of how to go about this kind of a stuff. Gurus please guide me .. I dont mind working hard to write a Toolbar class from the scratch. Abhishek Narula "Learn to appreciate others ... World would appreciate you"

    C 1 Reply Last reply
    0
    • A Abhishek Narula

      Is it a Big deal to do that stuff ?? See my problem is our Art director has given me a task to create a fancy shaped toolbar which is a mixture of Office2K type Flat toolbars and Mac os type round edges etc. I tried to study some of the very good toolbar classes available on CodeProject, but it seems that I can Draw only within the buttons area. not on the edges or Title bar of the toolbar(when its floating) so I need some guidance of how to go about this kind of a stuff. Gurus please guide me .. I dont mind working hard to write a Toolbar class from the scratch. Abhishek Narula "Learn to appreciate others ... World would appreciate you"

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The NCPAINT message lets you draw around the edges. If you decide to roll your own, look through the MFC source first to see how it all works. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

      A 1 Reply Last reply
      0
      • A Abhishek Narula

        Ya I am trying to do some drawing in NCPAINT handler ... But some how I am not able to draw in the full rectangle .. Just look at the following code and please what is wrong in the code.. CWindowDC cpDC (this); CRect rcClip; GetClientRect(&rcClip); cpDC.FillSolidRect (rcClip,RGB(255,0,0)); the above code does not fill the full rectangle , it still leaves so many margins .. Also please tell me the differnce between GetWindowRect and GetClientRect .. Thank you very much Abhishek Narula "Learn to appreciate others ... World would appreciate you"

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        1 - GetClientRect is the problem 2 - GetWindowRect gets the whole window area, usually in screen coordinates ( i.e. relative to the top left ), and GetClientRect gets the client area only ( the bit you can draw in OnPaint ). Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

        A 1 Reply Last reply
        0
        • C Christian Graus

          The NCPAINT message lets you draw around the edges. If you decide to roll your own, look through the MFC source first to see how it all works. Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

          A Offline
          A Offline
          Abhishek Narula
          wrote on last edited by
          #4

          Ya I am trying to do some drawing in NCPAINT handler ... But some how I am not able to draw in the full rectangle .. Just look at the following code and please what is wrong in the code.. CWindowDC cpDC (this); CRect rcClip; GetClientRect(&rcClip); cpDC.FillSolidRect (rcClip,RGB(255,0,0)); the above code does not fill the full rectangle , it still leaves so many margins .. Also please tell me the differnce between GetWindowRect and GetClientRect .. Thank you very much Abhishek Narula "Learn to appreciate others ... World would appreciate you"

          C 1 Reply Last reply
          0
          • C Christian Graus

            1 - GetClientRect is the problem 2 - GetWindowRect gets the whole window area, usually in screen coordinates ( i.e. relative to the top left ), and GetClientRect gets the client area only ( the bit you can draw in OnPaint ). Christian The tragedy of cyberspace - that so much can travel so far, and yet mean so little. "I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002

            A Offline
            A Offline
            Abhishek Narula
            wrote on last edited by
            #5

            Thanks a lot you have been a great help. Abhishek Narula "Learn to appreciate others ... World would appreciate you"

            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