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 » Toolbar in CExtNCW Collapse All
Subject Author Date
John Ritzenthaler Feb 4, 2009 - 2:35 PM

I’m trying to put a toolbar in a resizable dialog.  In the resource I have:


IDD_DOX_LIST DIALOGEX 0, 0, 296, 222

STYLE DS_SETFONT | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME

CAPTION "Measurement List"

FONT 8, "MS Sans Serif", 0, 0, 0x1

BEGIN

    CONTROL         "Incr",IDC_BTN_DEC_INCR,"Button",BS_OWNERDRAW | WS_TABSTOP,4,28,16,14

    CONTROL         "Decr",IDC_BTN_DEC_DECR,"Button",BS_OWNERDRAW | WS_TABSTOP,20,28,16,14

    CONTROL         "Print",IDC_BTN_PRINT_DOX,"Button",BS_OWNERDRAW | WS_TABSTOP,42,28,16,14

    COMBOBOX        IDC_CMB_DRAG_LINK,62,28,135,64,CBS_DROPDOWNLIST | WS_TABSTOP,WS_EX_CLIENTEDGE

    CONTROL         "Float",IDC_BTN_FLOAT_DOX,"Button",BS_OWNERDRAW | WS_TABSTOP,239,28,50,14

    GROUPBOX        "",IDC_ST_BTNS,1,23,292,20,WS_DISABLED

    CONTROL         "",IDC_GRID_DOX,"RGuiRoot",WS_CLIPCHILDREN | WS_TABSTOP,1,46,292,162

    CONTROL         "",IDR_DOXLST_BAR,"ProfUIS-ControlBar",WS_DLGFRAME | 0x2034,0,0,294,14

END

and


IDR_DOXLST_BAR TOOLBAR  16, 16

BEGIN

    BUTTON      ID_DOXLST_DEC_INCR

    BUTTON      ID_DOXLST_DEC_DECR

    SEPARATOR

    BUTTON      ID_DOXLST_PRINT

    SEPARATOR

    BUTTON      ID_DOXLST_CMB_DRAG

    SEPARATOR

    BUTTON      ID_DOXLST_FLOAT

END


In OnInitDIalog I have the following:


 CExtNCW<CExtResizableDialog>::OnInitDialog();

 m_wndToolBar.LoadToolBar(IDR_DOXLST_BAR);

 RepositionBars(0, 0xFFFF, IDR_DOXLST_BAR);


RepositionBars is also called in OnSize()


The toolbar appears but it takes up the entire height of the dialog.


ALSO, how do I set the toolbar button status?  Do I just add ON_UPDATE_COMMAND_UI entires to the dialog message map?


I’m guessing on the style flags in the ProfUIS-ControlBar. I just copied it from examples.

Technical Support Feb 5, 2009 - 1:15 PM

CExtToolControlBar windows are always based on the MFC’s command updating mechanism. Yes, you should add command updating methods for toolbar buttons if you want to change enabled/checked/radio states of toolbar buttons. Any MFC/Prof-UIS control bars can be re-dockable only inside frame windows. The control bars created inside dialogs and other non-frame windows always take up some space in their parent window as the status bar does.

John Ritzenthaler Feb 4, 2009 - 4:42 PM

I forgot to mention, I added this to the data map:


 DDX_Control(pDX, IDR_DOXLST_BAR, m_wndToolBar);


 

John Ritzenthaler Feb 4, 2009 - 4:16 PM

I forgot to mention, I added this to the data map:


 DDX_Control(pDX, IDR_DOXLST_BAR, m_wndToolBar);