owner draw CReBarCtrl [modified]
-
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::OnCreateCRect 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;
toCMyReBarCtrl m_Bar;
and here is the problem, i cant create a CMyReBarCtrl that works. one of the implementation that i have tryed wasclass 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 -
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::OnCreateCRect 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;
toCMyReBarCtrl m_Bar;
and here is the problem, i cant create a CMyReBarCtrl that works. one of the implementation that i have tryed wasclass 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, 2006You 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. -
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::OnCreateCRect 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;
toCMyReBarCtrl m_Bar;
and here is the problem, i cant create a CMyReBarCtrl that works. one of the implementation that i have tryed wasclass 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