#include <OptKeyBindings.h>
Inheritance diagram for mgOptKeyBindingsPanel:
To allow the presence of the menu-shortcuts in this panel, the application using MathGUI must use wxCustomMenu instead of wxMenu when creating the menu bar:
// get a pointer to the global (static) key binder wxKeyProfile *main = mgOptKeyBindingsPanel::GetBinder(); // then, all your menus can be created, maybe using also // the mgMathMenu class... wxCustomMenu *file = new wxCustomMenu(); file->Append(id, wxT("menu item name"), "menu help string"); mgMathMenu *p = new mgMathMenu(wnd, box, this, &wxGetApp()); p->AppendFileCommands(file); // and finally, the menu must be appended to the wxKeyProfile // (instead of wxMenuBar). main->Append(file, "&File"); // VERY IMPORTANT: this call must be // done AFTER all menu items have been // appended to 'file' // last, we ask our wxKeyProfile to create the menu bar for this frame... main->CreateMenuBar(this);
Definition at line 93 of file OptKeyBindings.h.
Public Member Functions | |
virtual bool | Show (bool show=TRUE) |
Shows this panel. | |
Static Public Member Functions | |
static void | Setup () |
Creates the wxKeyProfile. | |
static void | Cleanup () |
Deletes the wxKeyProfile associated with this panel. | |
static void | SetBinder (wxKeyProfile *p) |
Replaces the current global key binder with the given one. | |
static wxKeyProfile * | GetBinder () |
Returns the STATIC instance of the wxKeyProfile associated to this panel. | |
static void | ImportMenuBarCmd (wxMenuBar *p) |
Static Public Attributes | |
static wxMenuBar * | m_pMenuBar = NULL |
Protected Member Functions | |
virtual mgOptDlg::mgOptChangedType | CommitChanges (wxConfig *config) |
Commits the changes made by the user. | |
virtual void | Setup (const wxString &itemLabel) |
The alter ego of the constructor. | |
Protected Attributes | |
wxKeyConfigPanel * | m_pKeyConfig |
The panel which modifies key bindings. | |
wxFrame * | m_pFrame |
The frame whose menu bar is handled by this panel. | |
Static Protected Attributes | |
static wxKeyProfile * | m_pBinder = NULL |
The key binder handler. |
|
Commits the changes made by the user.
The virtual function is called with a pointer to a The function should change the variables used by MathCore and MathGUI in order to reflect changes in the configuration. In other words, if the user changed the font family and / or size this function should delete the font object used by the application and replace it with a new font ehich caracteristics are those specified by the user and store the pointer of the newly created font object in the MathCore library. There is no need for the function to store the settings in the configuration objevt because they will be stored automatically at program exit in CMathApp::OnExit() function. In order to refresh the application apareance when the user changes options settings (such as a font), the function returns a constant value, which is an enum, that represent what aspect of the application is to be refreshed. It is the caller responsability to do the actual work.
Implements mgOptBasePanel. Definition at line 94 of file OptKeyBindings.cpp. References m_pKeyConfig. |
|
Returns the STATIC instance of the wxKeyProfile associated to this panel. The user of MathGUI should use it to append menu items; see the class description of mgOptKeyBindingsPanel for more info. Definition at line 141 of file OptKeyBindings.h. References m_pBinder. |
|
Replaces the current global key binder with the given one. This function can be used to force mgOptKeyBindingsPanel to use a wxKeyProfile-derived class instead of wxKeyProfile. Definition at line 133 of file OptKeyBindings.h. References m_pBinder, and mgSAFE_DELETE. Referenced by Setup(). |
|
Creates the wxKeyProfile. Use the Cleanup() function to delete it when it's no longer necessary; this is an important step to avoid huge memory leaks. Definition at line 121 of file OptKeyBindings.h. References SetBinder(). |
|
The alter ego of the constructor.
This function is the real ctor of the class. It is called from As you cannot set properies for the panel such as fonts, background color atc. in the class's ctor you have to set them in this function.
The The default implementation of this class just creates a wxStaticBoxSizer equal to the size of the panel and sets its label as the treelist's item's label. Specialized derived classes should construct the child controls and the sizer or layout constarints objects to be bounded to childs. Implements mgOptBasePanel. Definition at line 71 of file OptKeyBindings.cpp. References m_pBinder, and m_pKeyConfig. |
|
The key binder handler. Use the Setup/SetBinder function to create/set it and don't forget to use the Cleanup function to delete it !!! Definition at line 56 of file OptKeyBindings.cpp. Referenced by Cleanup(), GetBinder(), SetBinder(), and Setup(). |
[ Top ] |