#include <OptDlg.h>
Edit
| Options
dialog box: m_mainSizer window class.
The option's dialog box is made of:
mgOptBasePanel-
derived class window containing all applicable options, is displayed on the right side. The changes in any optionwxT('s value are made by the specialized option')s panel and not by this classTo use this class is very simple. In the Edit | Options menu event handler write something similar to this:
mgOptDlg* opt( frame, -1, 0 ); opt->ShowModal();
There is no need to test if the user selects OK or Cancel because it is mgOptDlg's responsability to store the changes permanently and to redraw the UI in case option's changes affect the UI appearance. For more info read How does the Options dialog box work.
Definition at line 147 of file OptDlg.h.
Public Types | |
enum | mgOptChangedType { OptChanged_None = 0, OptChanged_App = 1, OptChanged_MainWnd = 2, OptChanged_ParamWnd = 4, OptChanged_UnknonwWnd = 8, OptChanged_ConstWnd = 16 } |
The type of changes made by the user. More... | |
Public Member Functions | |
mgOptDlg (wxWindow *parent, wxWindowID id, wxConfig *config=0) | |
Constructor. | |
virtual | ~mgOptDlg () |
Destructor - It does nothing. | |
void | CreateLayout (wxWindow *parent) |
Creates the three child windows and the initial layout. | |
mgOptBasePanel * | CreatePanel (mgOptTreeCtrlItemData *itemData, const wxString &itemLabel) |
Creates the option's panel identified by its ID. | |
void | DisplayPanel (wxTreeItemId id) |
Display the option's panel related to the selected item. | |
void | CommitChanges () |
Commits the changes made by the user in the option's values. | |
void | SetClientEvtHandler (wxEvtHandler *p) |
Sets the event handler which will receive the notification events. | |
Protected Member Functions | |
void | OnOkButton (wxCommandEvent &ev) |
The event handler for the OK button. | |
void | OnCancelButton (wxCommandEvent &ev) |
The event handler for the Cancel button. | |
void | OnApplyButton (wxCommandEvent &ev) |
The event handler for the Apply button. | |
void | OnItemSelected (wxTreeEvent &ev) |
The event handler for a selection in the treelist control. | |
Protected Attributes | |
wxConfig * | m_config |
The configuration object in which changes are stored (not used). | |
mgOptionsBtnPanel * | m_buttonWnd |
The OK, Cancel, Apply button's panel. | |
mgOptionsTreeCtrl * | m_treeWnd |
The treelist control panel. | |
wxPanel * | m_actualPanel |
The actually displayed option's panel. | |
wxEvtHandler * | m_pClientEvtHandler |
The event handler which receives notification events. | |
wxBoxSizer * | m_mainSizer |
The main sizer of the entire dialog box. | |
wxBoxSizer * | m_optionSizer |
The sizer which contains the current active panel. |
|
The type of changes made by the user. This enum is used to let the application know what type of changes the user made in the options panel.
Changes may affect the UI (for example a font) or the application or the math engine of MathStudio. Instead of redrawing and re-initializing all the application when the user makes a change, each optionwxT('s panel')s
The main |
|
Constructor. Constructs the Options dialog box. The function simply creates the 2 panels: the button panel and the treelist panel and the constraints objects used to laying out the three panels. Option's panel are not created at dialog startup but on the fly when the user selectes one item in the tree list.
For example, if the user selects the Key-bindings item in the tree list then the
Definition at line 75 of file OptDlg.cpp. |
|
Commits the changes made by the user in the option's values. This function iterates through all itemData structure of the treelist control and obtains the pointer of the mgOptBasePanel -derived class for every option item. The function calls the mgOptBasePanel::CommitChange function of all option's panels which are responsible of doing the actual work. Definition at line 317 of file OptDlg.cpp. References mgOptBasePanel::CommitChanges(), m_config, mgOptTreeCtrlItemData::m_panel, m_pClientEvtHandler, and m_treeWnd. Referenced by OnApplyButton(), and OnOkButton(). |
|
Creates the three child windows and the initial layout.
This function creates the three
The layout for the option's panel is not set for the panel because there is no option's panel yet: they are created on request. The layout for the option's panel is stored in the
Definition at line 109 of file OptDlg.cpp. References m_buttonWnd, m_mainSizer, m_optionSizer, and m_treeWnd. |
|
Creates the option's panel identified by its ID.
The panel is created and constrained with a newly created copy of the The function uses a switch statement to create the correct mgOptionsBanePanel -derived class that handles the options for the selected item in the treelist control. Returns the pointer of the created panel window or NULL if the panel could not be created.
Definition at line 179 of file OptDlg.cpp. References mgOptBasePanel::Setup(). Referenced by DisplayPanel(). |
|
Display the option's panel related to the selected item. The function hides the actually displayed option's panel and shows the panel associated in the selected item in the treelist control.
If the relevant panel class was not yet created, the
Definition at line 247 of file OptDlg.cpp. References CreatePanel(), m_actualPanel, mgOptTreeCtrlItemData::m_className, m_mainSizer, m_optionSizer, mgOptTreeCtrlItemData::m_panel, and m_treeWnd. Referenced by OnItemSelected(). |
|
The event handler for the Apply button.
Calls Definition at line 409 of file OptDlg.cpp. References CommitChanges(). |
|
The event handler for the Cancel button.
Calls Definition at line 404 of file OptDlg.cpp. |
|
The event handler for a selection in the treelist control.
The function obtains the itemID of the selected item in the treelist control and calls the Definition at line 414 of file OptDlg.cpp. References DisplayPanel(). |
|
Sets the event handler which will receive the notification events. By default, the client event handler is set by constructor as the parent window. Use NULL to disable event notification. |
[ Top ] |