Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Using CExtPageNavigatorWnd inside CExtResizableDialog Collapse All
Subject Author Date
Neville Franks Oct 15, 2008 - 9:28 PM

Q1) I have a class derived from CExtResizableDialog which includes a Toolbar and Tree control. I want to change this to use CExtPageNavigatorWnd inside the CExtResizableDialog and have my Tree control as a Pane inside the CExtPageNavigatorWnd. I have this working but need to get the CExtPageNavigatorWnd to be the same size as as its parent  CExtResizableDialog and to resize when it resizes. How do I do this?


Q2) Can I use a Toolbar CSGExtToolControlBar as a CExtPageNavigatorWnd Pane?


Thanks,


Neville

Technical Support Oct 17, 2008 - 8:47 AM

You should create a CExtPageNavigatorWnd window as a child of the dialog window in the dialog’s OnInitDialog() method. Please invoke the dialog’s GetClientRect() and use the obtained rectangle when creating the page navigator control. Then add anchors to the just created page navigator control using the pYourDialog->AddAnchor( pWndPageNavigator->m_hWnd, __RDA_LT, __DRA_RB ); code. This code should be invoked immediately after the page navigator has been created and it will make the page navigator control automatically covering the entire dialog’s surface.

Yes, you can use a Prof-UIS toolbar as a child of any kind of window. It’s possible to make a toolbar having a multi row layout of buttons (so it looks like a palette window with a set of tools). But the CExtToolBoxWnd control demonstrated in the FormEditor sample is a better implementation of the palette control and it supports categories. The most often case of non-redockable toolbar usage is demonstrated in many resizable bars of the ProfStudio sample where a static toolbar is present at top of a dialog window created as a child of a resizable bar. The Solution Explorer and Class View bars contain such toolbars.

Neville Franks Oct 17, 2008 - 2:20 AM

To place the Toolbar inside a CExtPageNavigatorWnd Pane I have created a CExtResizableDialog derived class and insert this in the pane. The RC entry is:


IDD_KnowledgeTreePageDLG DIALOG DISCARDABLE  0, 0, 101, 82

STYLE WS_CHILD | WS_VISIBLE

FONT 8, "MS Sans Serif"

BEGIN

    CONTROL         "",IDR_KnowledgeTreeToolbar,"ProfUIS-ControlBar",0x2034,8,4,57,14

END


The Toolbar is displayed but the buttons are bank. If I hover over them the Status Bar displays the correct Tooltips. Clicking on a button does nothing. Looking at CExtBarButton::OnDeliverCmd(), g_CmdManager->CmdGetPtr() returns NULL. The name returned from g_CmdManager->ProfileNameFromWnd()  is " PageNavigator-132513112-2708-6032".


The ON_UPDATE_COMMAND_UI( ) functions are called for each Toolbar button. The ON_COMMAND_EX() functions are not called.


The same Toolbar worked perfectly inside the original CExtResizableDialog I used before embedding a CExtPageNavigatorWnd inside it.

Technical Support Oct 17, 2008 - 8:39 AM

Please make your child dialog, which is inside a page navigator, is using its own command manager’s profile. You should invoke the following code in the dialog’s OnInitDialog() virtual method:

static TCHAR g_strCommandProfileNameOfYourDialog[] = _T("MyDialogInisdePageNavigator");
            if( ! g_CmdManager->ProfileSetup( g_strCommandProfileNameOfYourDialog, m_hWnd ) )
            {
                        VERIFY( g_CmdManager->ProfileWndAdd( g_strCommandProfileNameOfYourDialog, m_hWnd ) );
            }
Then invoke the below code before creating your toolbars in the dialog’s OnInitDialog() virtual method so that you can register all the toolbar icons in the appropriate command manager profile.
g_CmdManager->UpdateFromToolBar( g_strCommandProfileNameOfYourDialog, ID_YOUR_TOOLBAR_RESOURCE );

Neville Franks Oct 17, 2008 - 6:15 PM

Thank you very much, that solved the Toolbar problem.


Neville http://www.surfulater.com

Neville Franks Oct 16, 2008 - 9:17 PM

I have resolved issue 1 with resizing, but would still like help with using a Toolbar as a CExtPageNavigatorWnd Pane.


Thanks,

Neville http://www.surfulater.com