A common base class for dialog boxes. The wxBaseDialog class provides a common look and feel to all classes derived from it. This allows a consistent UI across the entire application and even across different OS platforms. By default, wxBaseDialog provides a black background, with bitmapped title and text, and a resizable, custom-drawn frame. Default OK and Cancel button are also provided, though they may be hidden or altered by derived classes. There are also virtual functions available for derived classes to do their own specialized handling on OK, Cancel, and Size events. Derived classes may also do their own customized painting and window sizing, if desired.
wxDialog (see http://www.wxwindows.org/manuals/2.4.2/wx109.htm)
BaseDialog.h
A common base class for dialog boxes. | |
The wxBaseDialog constructor. | |
Prevents users from resizing the dialog. | |
Allows derived classes to handle the OK event. | |
Allows derived classes to handle the Cancel event. | |
Allows derived classes to handle the Size event. | |
The OK button. | |
The Cancel button. | |
The wxWidgets event table declaration. | |
Sizing and movement flags. | |
Draws a sizing rectangle in the desktop window. | |
Calculates what stretch mode should be set when the user starts dragging the edge of the dialog to resize the dialog. | |
Calculates the new rectangle size for the window based on the current stretch mode and the amount of mouse movement that has occurred. | |
Calculates the best available size for the window, preventing it from being sized too small, if it has constraints. | |
Sets the window cursor correctly based on the given stretch/move mode. | |
Allows custom painting. | |
On Win32, sets the curved window region. | |
Handles the OK button being clicked. | |
Handles the Cancel button being clicked. | |
Paints the window. | |
Erases the window. | |
Resizes the window. | |
Handles the left mouse down event. | |
Handles the left mouse up event. | |
Handles the mouse moving. | |
The memory bitmap for the window. | |
The title bar bitmap. | |
The title text for the dialog window. | |
The current stretch/move mode. | |
The origin point for window movement. | |
The origin point for calculating mouse delta values. | |
The last drawn sizing/movement rectangle. | |
Whether the window is resizable. |
The wxBaseDialog constructor. | |
Prevents users from resizing the dialog. | |
Allows derived classes to handle the OK event. | |
Allows derived classes to handle the Cancel event. | |
Allows derived classes to handle the Size event. | |
The OK button. | |
The Cancel button. | |
The wxWidgets event table declaration. |
|
The wxBaseDialog constructor. Creates the dialog and then calls the CreateSizers function of the given ISizer pointer, which creates the specific layout for that dialog window.
| parent | The parent window of the dialog. |
| sizer | The ISizer that will create the dialog layout. Must not be NULL. |
| label | The caption of the dialog. |
| wxClearButton *mpOK |
The OK button. See wxClearButton.
| wxClearButton *mpCancel |
The Cancel button. See wxClearButton.
Sizing and movement flags. | |
Draws a sizing rectangle in the desktop window. | |
Calculates what stretch mode should be set when the user starts dragging the edge of the dialog to resize the dialog. | |
Calculates the new rectangle size for the window based on the current stretch mode and the amount of mouse movement that has occurred. | |
Calculates the best available size for the window, preventing it from being sized too small, if it has constraints. | |
Sets the window cursor correctly based on the given stretch/move mode. | |
Allows custom painting. | |
On Win32, sets the curved window region. | |
Handles the OK button being clicked. | |
Handles the Cancel button being clicked. | |
Paints the window. | |
Erases the window. | |
Resizes the window. | |
Handles the left mouse down event. | |
Handles the left mouse up event. | |
Handles the mouse moving. | |
The memory bitmap for the window. | |
The title bar bitmap. | |
The title text for the dialog window. | |
The current stretch/move mode. | |
The origin point for window movement. | |
The origin point for calculating mouse delta values. | |
The last drawn sizing/movement rectangle. | |
Whether the window is resizable. |
Sizing and movement flags. Used when the window is being resized by a user or moved on the screen to properly interpret the mouse events and adjust the window in response. Flags are: ModeNone, ModeMove, ModeStretchN, ModeStretchS, ModeStretchE, ModeStretchW, ModeStretchNE, ModeStretchSW, ModeStretchNW, ModeStretchSE.
|
Calculates the new rectangle size for the window based on the current stretch mode and the amount of mouse movement that has occurred.
| delta | The amount of mouse movement that has occurred. |
| rect | The rectangle to store the new window size. |
|
Calculates the best available size for the window, preventing it from being sized too small, if it has constraints.
| delta | The amount of mouse movement that has occurred. |
| size | The size of the window after stretching. |
| overflow | Any amount the desired size is different from the actual possible size. |
|
| virtual ~wxBaseDialog() |
| void DisableResize() |
| virtual void Ok() |
| virtual void Cancel() |
|
| wxClearButton *mpOK |
| wxClearButton *mpCancel |
|
|
|
|
|
|
| virtual void SetRegion() |
|
|
|
|
|
|
|
|
| wxBitmap mMemBitmap |
| wxBitmap mTitleBitmap |
| wxString mLabel |
| Mode mMode |
| wxPoint mMoveOrigin |
| wxPoint mMouseOrigin |
| wxRect mLastRect |
| bool mResizable |