CXTPToolBar in a _USRDLL |
Post Reply |
Author | |
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 650 |
Post Options
Thanks(0)
Posted: 09 January 2006 at 8:49am |
Hi, I'm trying to have a CXTPToolBar in a docking command bar window created in a separate _USRDLL. The creation of the toolbar works fine, and it finds the resources ok. But, the CmdUI routing is not working. I can manually force changes to the toolbar buttons by calling OnIdleUpdateCmdUI(NULL, NULL), but I'm sure that this is not the correct way. E.g. I can't get the tooltips to display, and when I click a toolbar button it stays pressed. I also noticed that when calling a context popupmenu I need to make a command handler using ON_COMMAND in the messagemap even I specify the TPM_RETURNCMD flag, and have enables all items using the AppendMenu call? Thanks, -cpede |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
1. Yes, in external window OnIdleUpdateCmdUI can be not called, you must route it as we do in our DialogSample. 2. use additional TPM_NONOTIFY flag. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 650 |
Post Options
Thanks(0)
|
1. I have looked at the dialog sample. I can see that the toolbar is created from the command bars (like we normal do in the mainframe). But in my case I have to use a CWnd class since this must be embedded as a docking pane. I use the same code as for the CPanePropertyGrid class e.g. in the DrawClient sample. In that sample the toolbar is created directly from the CXTPToolBar class. The only difference is that my class is placed inside a DLL. 2. This does the trick, thanks. -cpede |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 650 |
Post Options
Thanks(0)
|
Any idea how to get the tool tips working when derived from CXTPToolBar. In xtptoolbar.cpp the following code exist: if ((m_dwStyle & CBRS_TOOLTIPS) && m_pCommandBars == 0)EnableToolTips(); So someone has thought of something? -cpede |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
So you use CBRS_TOOLTIPS style for CreateToolBar method? |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 650 |
Post Options
Thanks(0)
|
Yes, but since "m_pCommandBars == 0" no tooltips are displayed, as far as I could see in the code. Fustrating so close to get it to work. I could offcause try to place everything inside a CXTPDialog, and then move the dialog to fit the docking pane?? -cpede |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
You can try CXTPCommandBarsSiteBase instead CXTPDialog class CYourWindow : public CXTPCommandBarsSiteBase<CWnd>
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 650 |
Post Options
Thanks(0)
|
Yes I can subclass from CXTPCommandBarsSiteBase, and then use InitCommandBars, GetCommandBars, Add etc. But I can't figure out to position the bar in the window. Nothing is displayed even the xtpBarTop is set. I can't see the bar? Maybe something should be done in OnSize? -cpede |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Yes, in OnSize call RepositionBars, see Advanced sample: void CHeroesView::OnSize(UINT nType, int cx, int cy) RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposDefault); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |