Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPToolBar in a _USRDLL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPToolBar in a _USRDLL

 Post Reply Post Reply
Author
Message
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 650
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: CXTPToolBar in a _USRDLL
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 650
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 650
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2006 at 11:33am

So you use CBRS_TOOLTIPS style for CreateToolBar method?

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 650
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2006 at 11:11am

You can try CXTPCommandBarsSiteBase instead CXTPDialog

class CYourWindow : public CXTPCommandBarsSiteBase<CWnd>

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 650
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.