Print Page | Close Window

XTPToolbar : Image is not showed

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23293
Printed Date: 27 November 2024 at 1:14am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XTPToolbar : Image is not showed
Posted By: hiro-ta
Subject: XTPToolbar : Image is not showed
Date 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);
}
}




Replies:
Posted By: hiro-ta
Date Posted: 26 March 2017 at 9:25pm


Posted By: hiro-ta
Date Posted: 26 March 2017 at 10:25pm
I resolved this issue.
I removed ImageManager in CMainFrame.

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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net