Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - XTPToolbar : Image is not showed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

XTPToolbar : Image is not showed

 Post Reply Post Reply
Author
Message
hiro-ta View Drop Down
Groupie
Groupie


Joined: 11 July 2013
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote hiro-ta Quote  Post ReplyReply Direct Link To This Post Topic: XTPToolbar : Image is not showed
    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);
}
}

Back to Top
hiro-ta View Drop Down
Groupie
Groupie


Joined: 11 July 2013
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote hiro-ta Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2017 at 9:25pm
Back to Top
hiro-ta View Drop Down
Groupie
Groupie


Joined: 11 July 2013
Status: Offline
Points: 61
Post Options Post Options   Thanks (1) Thanks(1)   Quote hiro-ta Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2017 at 10:25pm
I resolved this issue.
I removed ImageManager in CMainFrame.

pCommandBars->GetImageManager()->RemoveAll();

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.