to insert image or icon to CXTPControl; |
Post Reply |
Author | |
copycdx2
Groupie Joined: 17 September 2008 Status: Offline Points: 20 |
Post Options
Thanks(0)
Posted: 01 October 2008 at 6:21am |
I would like to insert icon to CXTPControl. CXTPControl* pCtrl = m_pPopupBar->GetControls()->Add( xtpControlButton, ID_FILE_TEST01 ); and, I hope to catch message of button click. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You need add image to image manager for ID_FILE_TEST01 id:
pCommandBars->GetImageManager()->SetIcons(,,);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
copycdx2
Groupie Joined: 17 September 2008 Status: Offline Points: 20 |
Post Options
Thanks(0)
|
my class don't have CXTPFrameWnd. class Cg3OutlookBarContainer : public CTaskPanelBase. so, i created CXTPPopupBar by CreateObject(); how get commandbar point ? m_pPopupBar = (CXTPPopupBar*)CXTPPopupToolBar::CreateObject(); ----------------------------------------------------------------------------------------------- Cg3OutlookBarContainer::~Cg3OutlookBarContainer() { if( m_pPopupBar ) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); // when create code. // insert below code and kill. not insert below code and not kill. // pCtrl->GetImageManager()->SetIcons(IDR_TOOLBAR1); m_pPopupBar->InternalRelease(); <= error; m_pPopupBar = NULL; } } if( m_pPopupBar == NULL ) { CXTPControl* pCtrl = NULL; HICON hIcon = ::LoadIcon( AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ANALYSIS01) ); CXTPControlButton* pButton01 = new CXTPControlButton(); pButton01->SetCaption(_T("hello")); pButton01->SetStyle(xtpButtonIcon); pButton01->SetHeight( 48 ); pButton01->SetWidth( 48 ); //pButton01->SetCustomIcon(hIcon); m_pPopupBar = (CXTPPopupBar*)CXTPPopupToolBar::CreateObject(); m_pPopupBar->SetOwner(this); // m_pPopupBar->SetTearOffPopup(_T("Text Color"), IDR_TOOLBAR1, 0); m_pPopupBar->GetControls()->Add( pButton01); pCtrl = m_pPopupBar->GetControls()->Add( xtpControlButton, ID_FILE_TEST01 ); pCtrl->SetCaption(_T("555")); pCtrl->SetHeight(48); pCtrl->SetWidth(48); pCtrl->GetImageManager()->SetIcons(IDR_TOOLBAR1); pCtrl->SetIconId( ID_BUTTON40007 ); } if( m_pPopupBar ) { CRect rc; this->GetWindowRect(&rc); this->ScreenToClient(&rc); POINT pp; GetCursorPos(&pp); m_pPopupBar->Popup( pp.x-100, pp.y, NULL ); } |
|
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 |