Print Page | Close Window

CXTPCommandBar in CDialog derived class

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3090
Printed Date: 11 May 2024 at 6:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPCommandBar in CDialog derived class
Posted By: Martin
Subject: CXTPCommandBar in CDialog derived class
Date Posted: 25 October 2005 at 3:44am

Hi all,

I don't know if this topic has been discussed before but here goes:

Is it possible to use the commandbars in a CDialog derived class which I cannot derive from CXTResizeDialog (because I am already deriving from another CDialog based class which I just can't replace)?

How do I get a pointer to the GetCommandBars() member function in my scenario (if possible)?

TIA,

Martin




Replies:
Posted By: Martin
Date Posted: 26 October 2005 at 2:08am

Another one:

I have defined a dialog based class as follows:

#define CDlgBase CXTPDialogBase<CXTResizeDialog>

class CMyDlg: public CDlgBase
{
}

I now try to create a toolbar in the OnInitDialog function as follows:

VERIFY(InitCommandBars());

CXTPCommandBars* pCommandBars = GetCommandBars();

CXTPToolBar* pToolBar = pCommandBars->Add(_T("Standard"), xtpBarTop);
 pToolBar->LoadToolBar(IDR_MAINFRAME);

Only the commandbar doesn't show.

Any ideas why not? I looked at the example "DialogSample" but I just can't figure it out.

Additional info: it's created as a child window of a tabcontrol, with no borders. But I also tried the code on a "normal" popup dialog with the same result.

Any help is greatly appreciated!

TIA,

Martin


 



Posted By: Oleg
Date Posted: 27 October 2005 at 7:21am

Add

RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);

to OnSize handler.



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


Posted By: Martin
Date Posted: 27 October 2005 at 7:27am

Thanks a lot Oleg! That works!

Do you also know the answer to my first question (see above)?

Thanks!




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