Print Page | Close Window

CXTPToolBar in a _USRDLL

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3488
Printed Date: 13 July 2025 at 6:11pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPToolBar in a _USRDLL
Posted By: cpede
Subject: CXTPToolBar in a _USRDLL
Date 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




Replies:
Posted By: Oleg
Date Posted: 09 January 2006 at 10:32am

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


Posted By: cpede
Date Posted: 09 January 2006 at 1:46pm

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



Posted By: cpede
Date Posted: 10 January 2006 at 2:38am

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



Posted By: Oleg
Date Posted: 11 January 2006 at 11:33am

So you use CBRS_TOOLTIPS style for CreateToolBar method?



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: cpede
Date Posted: 12 January 2006 at 7:06am

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



Posted By: Oleg
Date Posted: 12 January 2006 at 11:11am

You can try CXTPCommandBarsSiteBase instead CXTPDialog

class CYourWindow : public CXTPCommandBarsSiteBase<CWnd>

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: cpede
Date Posted: 15 January 2006 at 8:11am

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



Posted By: Oleg
Date Posted: 16 January 2006 at 12:21am

 

Yes, in OnSize call RepositionBars, see Advanced sample:

void CHeroesView::OnSize(UINT nType, int cx, int cy)
{
 CWnd::OnSize(nType, cx, cy);

 RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposDefault);
}
 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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