Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPCommandBar in CDialog derived class
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPCommandBar in CDialog derived class

 Post Reply Post Reply
Author
Message
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post Topic: CXTPCommandBar in CDialog derived class
    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

Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post 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


 

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: 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
Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post 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!

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.156 seconds.