XTPToolbar : Image is not showed |
Post Reply |
Author | |
hiro-ta
Groupie Joined: 11 July 2013 Status: Offline Points: 61 |
Post Options
Thanks(0)
Posted: 26 March 2017 at 9:23pm |
Hi,I want to add toolbar to pane window(CWnd class). I referred to the sample(DockingContainers). but toolbar image is not showed. (The button works) Please tell me how to show images. class XXXXCtrl : public CWnd { DECLARE_DYNAMIC(XXXXCtrl) public: XXXXCtrl(); virtual ~XXXXCtrl(); private: CXTPToolBar m_toolBar; CTreeCtrl m_xxxxCtrl; : }; int XXXXCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CWnd::OnCreate(lpCreateStruct) == -1) { return -1; } m_toolBar.GetPaintManager()->m_bAutoResizeIcons = TRUE; m_toolBar.CreateToolBar(WS_VISIBLE | WS_CHILD | CBRS_TOOLTIPS | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, this); m_toolBar.LoadToolBar(IDR_TOOLBAR_ANNOTLIST); m_toolBar.SetButtonSize(XTP_DPI(CSize(23, 23))); } void XXXXCtrl::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); CSize sz(0); if (m_toolBar.GetSafeHwnd()) { sz = m_toolBar.CalcDockingLayout(cx, /*LM_HIDEWRAP|*/ LM_HORZDOCK|LM_HORZ | LM_COMMIT); m_toolBar.MoveWindow(0, 0, cx, sz.cy); m_toolBar.Invalidate(FALSE); } if (m_xxxxCtrl && ::IsWindow(m_xxxxCtrl->GetSafeHwnd())) { m_xxxxCtrl->MoveWindow(0, sz.cy, cx, cy - sz.cy); } } |
|
hiro-ta
Groupie Joined: 11 July 2013 Status: Offline Points: 61 |
Post Options
Thanks(0)
|
|
|
hiro-ta
Groupie Joined: 11 July 2013 Status: Offline Points: 61 |
Post Options
Thanks(1)
|
I resolved this issue.
I removed ImageManager in CMainFrame. pCommandBars->GetImageManager()->RemoveAll(); |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |