Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - [Closed] Dialog Problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Closed] Dialog Problem

 Post Reply Post Reply
Author
Message
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Topic: [Closed] Dialog Problem
    Posted: 17 September 2006 at 2:49pm
I have a dialog inside a pane, I cannot for the life of me get the toolbar to have any size - it is not displayed, GetClientRect returns 0.

From the class declaration:


#define CLogbookBase CXTPDialogBase<CXTResizeDialog>

class CLogbookDlg : public CLogbookBase

CXTPToolBar*    m_pToolBar;


Here's the code in OnInitDialog, aim is to have the toolbar displayed on the left, I have tried top, everywhere!:


    //
    //    Initialise.
    //
    VERIFY(InitCommandBars());

    //
    //    Commadbars.
    //
    CXTPCommandBars* pCommandBars = GetCommandBars();

    m_pToolBar = pCommandBars->Add(_T("Standard"), xtpBarLeft);

    m_pToolBar->LoadToolBar(IDR_TOOLBAR_LOGBOOK_DLG);

    m_pToolBar->SetVisible(TRUE);
    m_pToolBar->EnableDocking(xtpFlagAlignLeft | xtpFlagHideWrap /* | xtpFlagStretched */);
    m_pToolBar->ModifyBarStyle(CBRS_GRIPPER, 0);

    if (pCommandBars->GetToolTipContext()->IsBalloonStyleSupported())
    {
        pCommandBars->GetToolTipContext()->SetStyle(xtpToolTipBalloon);
        pCommandBars->GetToolTipContext()->ShowTitleAndDescription(TRUE);
    }

    pCommandBars->GetCommandBarsOptions()->bShowPopupBarToolTips = FALSE;
    pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
    pCommandBars->GetCommandBarsOptions()->bShowExpandButtonAlways = false;

    RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_STATUS_BAR, 0);
   
    pCommandBars->RedrawCommandBars();


Simon HB9DRV
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2006 at 3:17am
BTW -  project is too big to send but I can supply classes etc.
Simon HB9DRV
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: 18 September 2006 at 3:57am
Hi,
 
Did you catch WM_SIZE?
 
need to catch, call base method, and call
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2006 at 4:02am


Forgot RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);

Have 8 hero points
Simon HB9DRV
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.