00001 00002 // MathGUI = a WYSIWYG equation editor + a powerful math engine // 00003 // Copyright (C) 2003 by Francesco Montorsi // 00004 // // 00005 // This library is free software; you can redistribute it and/or // 00006 // modify it under the terms of the GNU Lesser General Public // 00007 // License as published by the Free Software Foundation; either // 00008 // version 2.1 of the License, or (at your option) any later // 00009 // version. // 00010 // // 00011 // This library is distributed in the hope that it will be useful, // 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of // 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 00014 // GNU Lesser General Public License for more details. // 00015 // // 00016 // You should have received a copy of the GNU Lesser General Public // 00017 // License along with this program; if not, write to the Free // 00018 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, // 00019 // MA 02111-1307, USA. // 00020 // // 00021 // For any comment, suggestion or feature request, please contact // 00022 // the administrator of the project at frm@users.sourceforge.net // 00023 // // 00030 00031 00032 #ifndef GREEKDLG_H 00033 #define GREEKDLG_H 00034 00035 // required includes 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 // optimization for GCC compiler 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 // build everything... 00200 Build(client ? client : parent, mathwnd, mathbox); 00201 } 00202 00203 virtual ~mgGreekPalette() {} 00204 }; 00205 00206 00207 00208 #endif // GREEKDLG_H 00209
[ Top ] |