![]() |
CXTPToolBar |
Post Reply
|
| Author | |
Sergio
Senior Member
Joined: 18 September 2006 Status: Offline Points: 216 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPToolBarPosted: 28 September 2006 at 5:59am |
|
Hi everybody, How could I know the CXTPControl* pointer from within a notification command ?
![]() I need this functionality for a dynamic contextual menu in the ToolBar, that route to one function giving the menu item user data.
My mainframe is doesn't use Codejock, I have used the ToolBar CXTPToolBar in a standard CView :
MyView.h
MyView.cpp
this ) ); CXTPControl* pControl; CXTPControls* pControls = m_XTPToolBar.GetControls();
pControl = pControls->Add( ...data of button test... );
if ( pControl )
{
}
CMyView::OnButtonTest()
CXTPControl* pControl = m_XTPToolBar.GetCurrentActionControl();
if ( pControl )
{
} Could you please help me as soon as possible
? This is the last thing to complete my project. I need the feature in red.Thank you in advance !
|
|
|
Sergio
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 September 2006 at 8:54am |
|
Hi,
You can catch WM_XTP_COMMAND instead to get pointer of control. WM_COMMAND have no additional parameters.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sergio
Senior Member
Joined: 18 September 2006 Status: Offline Points: 216 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 September 2006 at 9:30am |
|
Hi Oleg,
Thank you for your prompt answer, the WM_XTP_COMMAND doesn't reach the WindowProc(...) of my CView class.
Here is the main reason : the WM_XTP_COMMAND notification message is sent only if the m_pOwner member variable of the CXTPToolBar (in fact of the CXTPCommandBar) is set to the CWnd* (a pointer to my CView).
There is a method called GetOwnerSite() that return this pointer, but there is no method called SetOwnerSite(CWnd*), and the m_pOwner member variable is declared as protected.
Perhaps I should create my own ToolBar class derived from your CXTPToolBar and add this method, is it safe ?
Sergio
|
|
|
Sergio
|
|
![]() |
|
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 |