MFC Dialog Boxes: Dialog Bars |
|
Overview |
A dialog bar is an object of the family of Control Bars. These are objects used to complete an interface when the frame needs extra real estate to carry the desired controls of an application. One of the main justifications of control bars is that the user can display or hide them at will. A dialog bar is a sort of intermediary between a dialog box and a toolbar. Like a dialog box or a toolbar, a dialog bar is mainly used as a container or host of other controls. |
Like a dialog box, a dialog bar is created from a dialog-based resource. To create a dialog box, toolbar, you can display the Add Resource dialog box, expand the Dialog node and double-click Dialog bar. This would add a border-less dialog resource to your application. You have two options: you can keep the dialog bar as is or you can derive a class from it. Keeping the dialog bar as created is probably easier because it is ready to be recognized by the other classes, namely the frame and the document, of your application. To add a dialog bar to your project, in the frame header class, you can declare a CDialogBar variable. To display and attach it to your interface, you can programmatically create it in the OnCreate() event of your frame class using one of the overloaded CDialog::Create() method: virtual BOOL Create( CWnd* pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID ); virtual BOOL Create( CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID );
|
Practical Learning: Introducing Dialog Bars |
|
|
Copyright © 2004-2010 FunctionX, Inc. |
|