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. ATL / WTL / STL
  4. owner draw CReBarCtrl [modified]

owner draw CReBarCtrl [modified]

Scheduled Pinned Locked Moved ATL / WTL / STL
helpquestionc++
3 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.
  • M Offline
    M Offline
    Max Santos
    wrote on last edited by
    #1

    Hi all, can anyone help with this... I have allready made my own owner draw menu (CCommandBar) however, i cant create owner draw CReBarCtrl , and so, the menu bar get to be the default. Is something missing, but i cant find what it is. Lets look at some code: if i declare this in mainfrm.h: CReBarCtrl m_Bar; and then in CMainFrame::OnCreate CRect rc( 0,0,100,100); m_Bar.Create( m_hWnd,rc, L"WebRebar", WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|CCS_TOP | RBS_BANDBORDERS | CCS_NODIVIDER ,0 ); //--------SET MENU----------------- HWND hWndMenu = m_Menu.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE); m_Menu.AttachMenu(GetMenu()); m_Menu.LoadImages(IDR_MAINFRAME); SetMenu(NULL); //--------------------------------- m_Bar.m_hWnd,rc,NULL,CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|WS_CHILD | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT | TBSTYLE_TOOLTIPS ); AddSimpleReBarBandCtrl(m_Bar.m_hWnd,hWndMenu); Every thing works, execpt i whant to use a owner drae rebar so: I change: CReBarCtrl m_Bar; to CMyReBarCtrl m_Bar; and here is the problem, i cant create a CMyReBarCtrl that works. one of the implementation that i have tryed was class CMyReBarCtrl: public CWindowImpl<CMyReBarCtrl, CReBarCtrl>, public CCustomDraw<CMyReBarCtrl> { public: BEGIN_MSG_MAP(CMyReBarCtrl) CHAIN_MSG_MAP(CCustomDraw<CMyReBarCtrl> ) END_MSG_MAP() . . . } But it dosent work. Something is missing on my WTL knowledge. Do anyone have any ideia of what is missing? Thanks -- modified at 12:22 Saturday 26th August, 2006

    J C 2 Replies Last reply
    0
    • M Max Santos

      Hi all, can anyone help with this... I have allready made my own owner draw menu (CCommandBar) however, i cant create owner draw CReBarCtrl , and so, the menu bar get to be the default. Is something missing, but i cant find what it is. Lets look at some code: if i declare this in mainfrm.h: CReBarCtrl m_Bar; and then in CMainFrame::OnCreate CRect rc( 0,0,100,100); m_Bar.Create( m_hWnd,rc, L"WebRebar", WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|CCS_TOP | RBS_BANDBORDERS | CCS_NODIVIDER ,0 ); //--------SET MENU----------------- HWND hWndMenu = m_Menu.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE); m_Menu.AttachMenu(GetMenu()); m_Menu.LoadImages(IDR_MAINFRAME); SetMenu(NULL); //--------------------------------- m_Bar.m_hWnd,rc,NULL,CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|WS_CHILD | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT | TBSTYLE_TOOLTIPS ); AddSimpleReBarBandCtrl(m_Bar.m_hWnd,hWndMenu); Every thing works, execpt i whant to use a owner drae rebar so: I change: CReBarCtrl m_Bar; to CMyReBarCtrl m_Bar; and here is the problem, i cant create a CMyReBarCtrl that works. one of the implementation that i have tryed was class CMyReBarCtrl: public CWindowImpl<CMyReBarCtrl, CReBarCtrl>, public CCustomDraw<CMyReBarCtrl> { public: BEGIN_MSG_MAP(CMyReBarCtrl) CHAIN_MSG_MAP(CCustomDraw<CMyReBarCtrl> ) END_MSG_MAP() . . . } But it dosent work. Something is missing on my WTL knowledge. Do anyone have any ideia of what is missing? Thanks -- modified at 12:22 Saturday 26th August, 2006

      J Offline
      J Offline
      Justin Tay
      wrote on last edited by
      #2

      You meant custom drawn rebar correct? Your rebar message map should look like this BEGIN_MSG_MAP(CMyReBarCtrl)   CHAIN_MSG_MAP_ALT(CCustomDraw<CMyReBarCtrl>, 1)   DEFAULT_REFLECTION_HANDLER() END_MSG_MAP() Make sure you have REFLECT_NOTIFICATIONS() in your CMainFrame message map.

      1 Reply Last reply
      0
      • M Max Santos

        Hi all, can anyone help with this... I have allready made my own owner draw menu (CCommandBar) however, i cant create owner draw CReBarCtrl , and so, the menu bar get to be the default. Is something missing, but i cant find what it is. Lets look at some code: if i declare this in mainfrm.h: CReBarCtrl m_Bar; and then in CMainFrame::OnCreate CRect rc( 0,0,100,100); m_Bar.Create( m_hWnd,rc, L"WebRebar", WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|CCS_TOP | RBS_BANDBORDERS | CCS_NODIVIDER ,0 ); //--------SET MENU----------------- HWND hWndMenu = m_Menu.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE); m_Menu.AttachMenu(GetMenu()); m_Menu.LoadImages(IDR_MAINFRAME); SetMenu(NULL); //--------------------------------- m_Bar.m_hWnd,rc,NULL,CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|WS_CHILD | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT | TBSTYLE_TOOLTIPS ); AddSimpleReBarBandCtrl(m_Bar.m_hWnd,hWndMenu); Every thing works, execpt i whant to use a owner drae rebar so: I change: CReBarCtrl m_Bar; to CMyReBarCtrl m_Bar; and here is the problem, i cant create a CMyReBarCtrl that works. one of the implementation that i have tryed was class CMyReBarCtrl: public CWindowImpl<CMyReBarCtrl, CReBarCtrl>, public CCustomDraw<CMyReBarCtrl> { public: BEGIN_MSG_MAP(CMyReBarCtrl) CHAIN_MSG_MAP(CCustomDraw<CMyReBarCtrl> ) END_MSG_MAP() . . . } But it dosent work. Something is missing on my WTL knowledge. Do anyone have any ideia of what is missing? Thanks -- modified at 12:22 Saturday 26th August, 2006

        C Offline
        C Offline
        count0
        wrote on last edited by
        #3

        It would be interesting if someone write a article about how to custom/owner draw ReBar in WTL.

        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