#include <OptFontSettings.h>
Inheritance diagram for mgOptFontSettingsPanel:
This panel contains a great number of controls due to the high number of customizable variables regarding the fonts, their foreground and background colors. The panel also contains a preview window which helps the user to choose its preferred settings.
Definition at line 122 of file OptFontSettings.h.
Protected Member Functions | |
virtual void | Setup (const wxString &itemLabel) |
The alter ego of the constructor. | |
virtual mgOptDlg::mgOptChangedType | CommitChanges (wxConfig *config) |
Commits the changes made by the user. | |
void | BuildCtrls () |
Creates all the controls contained in this panel; specially the font settings rows. | |
void | BuildFontSettings (wxFlexGridSizer *table, const wxString &label, int id) |
Builds a font settings row, which contains these controls: | label | wxComboBox with facename list | pointsize | fg colour | bg colour |. | |
void | ReadSettings (int id, const mcTextSettings &p) |
Updates the controls of the font settings row whose base ID matches the given ID, reading the informations from the given mcTextSettings object. | |
void | SaveSettings (int id, mcTextSettings &p) |
Stores inside the given mcTextSettings object, the informations of the controls of the font settings row whose base ID matches the given ID. | |
void | OnExpDepthChange (wxCommandEvent &) |
Handles changes in the exponent depth combo box. | |
void | OnActiveElemChange (wxCommandEvent &ev) |
Handles the change of the active element of the preview window. | |
const mcTextSettings & | GetSettingsFromBaseID (const mcStyle *p, int id) |
Returns the mcTextSettings object associated with the font settings row whose base ID matches the given ID. | |
const mcTextSettings & | GetSettingsFromBaseID (int expdepth, int id) |
Returns the mcTextSettings object associated with the font settings row whose base ID matches the given ID. | |
Protected Attributes | |
int | m_nBaseID [OPTIONSDLG_FONTPANEL_NUMSETTINGS] |
The IDs usd for the first control placed in each font settings row (see BuildFontSettings for more info). | |
mgMathBox * | m_pPreviewBox |
The mgMathBox which is used to show a preview of the fonts to the user. | |
wxChoice * | m_pExpDepthChoice |
The listbox with the exponent depth codes which can be chosen. | |
wxString * | m_pFontFaces |
The last array retrieved by m_pExpDepthChoice. | |
mgOptFontEnumerator | m_fntEnumerator |
The font list available on this system. | |
Static Protected Attributes | |
static wxString | m_strSettingsLabel [OPTIONSDLG_FONTPANEL_NUMSETTINGS] |
The labels of the font settings rows. |
|
Builds a font settings row, which contains these controls: | label | wxComboBox with facename list | pointsize | fg colour | bg colour |. The ID of the first control of the new font settings row is the given one. All the controls are added inside the given sizer. Definition at line 150 of file OptFontSettings.cpp. References mgOptFontEnumerator::GetCount(), m_fntEnumerator, and m_pFontFaces. Referenced by Setup(). |
|
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 262 of file OptFontSettings.cpp. References GetSettingsFromBaseID(), m_nBaseID, and SaveSettings(). |
|
Returns the mcTextSettings object associated with the font settings row whose base ID matches the given ID.
Definition at line 115 of file OptFontSettings.cpp. References mgMathBox::GetMathObj(), GetSettingsFromBaseID(), and m_pPreviewBox. |
|
Returns the mcTextSettings object associated with the font settings row whose base ID matches the given ID.
Definition at line 102 of file OptFontSettings.cpp. References m_nBaseID. Referenced by CommitChanges(), GetSettingsFromBaseID(), and OnExpDepthChange(). |
|
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 173 of file OptFontSettings.cpp. References BuildCtrls(), BuildFontSettings(), mgOptFontEnumerator::GetFacenamesArray(), m_fntEnumerator, m_nBaseID, m_pExpDepthChoice, m_pFontFaces, m_pPreviewBox, m_strSettingsLabel, and OnExpDepthChange(). |
|
The IDs usd for the first control placed in each font settings row (see BuildFontSettings for more info). All the following controls in the same font settings panel uses their entry in this array as base id, incrementing it (using the OPTIONSDLG_FONTPANEL_*****_IDOFFSET defines). All the entries of this array contains OPTIONSDLG_FONTPANEL_SETTING_IDOFFSET multiples, so this is the maximum number of IDs which can be used inside each row. Definition at line 134 of file OptFontSettings.h. Referenced by CommitChanges(), GetSettingsFromBaseID(), OnExpDepthChange(), and Setup(). |
|
The mgMathBox which is used to show a preview of the fonts to the user. The input-system and the selection system of this box is diabled so it works in read-only mode. Definition at line 143 of file OptFontSettings.h. Referenced by BuildCtrls(), GetSettingsFromBaseID(), OnActiveElemChange(), OnExpDepthChange(), and Setup(). |
|
Initial value: { wxT("Operators"), wxT("Numbers"), wxT("Functions"), wxT("Subscripts"), wxT("Symbols"), wxT("Specials") } This array is trictly tied to the mcStyle::GetGetIndexFor() function. Definition at line 55 of file OptFontSettings.cpp. Referenced by Setup(). |
[ Top ] |