00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00030
00031
00032 #ifndef GREEKDLG_H
00033 #define GREEKDLG_H
00034
00035
00036 #include "mg/MathWnd.h"
00037 #include "mg/MathBox.h"
00038 #include "mg/PaletteDlg.h"
00039 #ifdef mgUSE_PALETTEFRM
00040 #include <wx/palettefrm.h>
00041 #else
00042 #include <wx/minifram.h>
00043 #endif
00044
00045
00046
00047 #ifdef __GNUG__
00048 #pragma interface "GreekDlg.h"
00049 #endif
00050
00051
00052
00055 #define GREEKDLG_ALPHABET_LENGHT 24//(0x03C9 - 0x03B1)
00056
00059 #define GREEKDLG_GRID_COLUMNS 12
00060 #define GREEKDLG_GRID_ROWS (GREEKDLG_ALPHABET_LENGHT/GREEKDLG_GRID_COLUMNS)
00061
00065 #define GREEKDLG_FONT_POINTSIZE 13
00066
00068 #define GREEKDLG_BUTTON_MINWIDTH 20
00069 #define GREEKDLG_BUTTON_MINHEIGHT 24
00070
00071
00073 #define IDC_GREEKDLG_SMALLBUTTONS mgGREEKDLG_BASEID
00074 #define IDC_GREEKDLG_CAPITALBUTTONS mgGREEKDLG_BASEID+GREEKDLG_ALPHABET_LENGHT
00075
00076
00077
00078
00080 class mgSmallGreekPanel : public mgButtonListPanel
00081 {
00082 friend class mgCapitalGreekPanel;
00083
00085 static wxString strSmallAlphabet;
00086
00089 static wxString strLetterNames[GREEKDLG_ALPHABET_LENGHT];
00090
00091 protected:
00092
00094 void OnButtons( wxCommandEvent &event );
00095
00096 virtual wxString GetButtonLabel(int i) {
00097 return strSmallAlphabet.GetChar(i);
00098 }
00099
00100 virtual wxString GetButtonTooltip(int i) {
00101 return wxT("Small ") + strLetterNames[i];
00102 }
00103
00104 public:
00105
00112 mgSmallGreekPanel(
00113 wxWindow *parent,
00114 wxWindow *client,
00115 mgMathWnd *mathwnd,
00116 mgMathBox *mathbox,
00117 wxWindowID id = -1,
00118 const wxPoint& pos = wxDefaultPosition,
00119 const wxSize& size = wxDefaultSize,
00120 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
00121
00122 virtual ~mgSmallGreekPanel() {}
00123
00124 private:
00125 DECLARE_EVENT_TABLE()
00126 };
00127
00128
00129
00131 class mgCapitalGreekPanel : public mgButtonListPanel
00132 {
00134 static wxString strCapitalAlphabet;
00135
00136 protected:
00137
00139 void OnButtons( wxCommandEvent &event );
00140
00141 virtual wxString GetButtonLabel(int i) {
00142 return strCapitalAlphabet.GetChar(i);
00143 }
00144
00145 virtual wxString GetButtonTooltip(int i) {
00146 return wxT("Capital ") + mgSmallGreekPanel::strLetterNames[i];
00147 }
00148
00149 public:
00150
00157 mgCapitalGreekPanel(
00158 wxWindow *parent,
00159 wxWindow *client,
00160 mgMathWnd *mathwnd,
00161 mgMathBox *mathbox,
00162 wxWindowID id = -1,
00163 const wxPoint& pos = wxDefaultPosition,
00164 const wxSize& size = wxDefaultSize,
00165 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
00166
00167 virtual ~mgCapitalGreekPanel() {}
00168
00169 private:
00170 DECLARE_EVENT_TABLE()
00171 };
00172
00173
00174
00176 class mgGreekPalette : public wxPaletteFrame
00177 {
00178 protected:
00179
00182 void Build(wxWindow *client, mgMathWnd *mathwnd, mgMathBox *mathbox);
00183
00184 public:
00185
00186 mgGreekPalette(
00187 wxMainFrame *parent,
00188 wxWindow *client,
00189 mgMathWnd *mathwnd,
00190 mgMathBox *mathbox,
00191 wxWindowID id = -1,
00192 const wxString &title = wxT("Greek alphabet"),
00193 const wxPoint &pos = wxDefaultPosition,
00194 const wxSize &size = wxDefaultSize,
00195 long style = wxPALETTEFRM_DEFAULT_STYLE,
00196 const wxString &name = wxT("mgGreekPalette")) :
00197 wxPaletteFrame(parent, id, title, pos, size, style, name) {
00198
00199
00200 Build(client ? client : parent, mathwnd, mathbox);
00201 }
00202
00203 virtual ~mgGreekPalette() {}
00204 };
00205
00206
00207
00208 #endif // GREEKDLG_H
00209