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
00033
00034 #ifdef __GNUG__
00035 #pragma implementation "SpecialSymDlg.h"
00036 #endif
00037
00038
00039 #include "mg/mgprec.h"
00040
00041 #ifndef mgPRECOMP
00042
00043 #include "mg/GUIUtils.h"
00044 #include "mg/SpecialSymDlg.h"
00045 #endif
00046
00047
00048
00049
00050 #if wxUSE_UNICODE
00051
00052
00053
00054
00055 wxString mgSpecialSymPanel::strSymbols =
00056 wxString((wxChar)mcMMRO_LESS_OR_EQUAL, 1) +
00057 wxString((wxChar)mcMMRO_LESS, 1) +
00058 wxString((wxChar)mcMMRO_EQUAL, 1) +
00059 wxString((wxChar)mcMMRO_NOT_EQUAL, 1) +
00060 wxString((wxChar)mcMMRO_GREATER, 1) +
00061 wxString((wxChar)mcMMRO_GREATER_OR_EQUAL, 1);
00062 #else
00063
00064
00065 wxString mgSpecialSymPanel::strSymbols = wxT("<=>");
00066 #endif
00067
00068 wxString mgSpecialSymPanel::strSymbolsTooltip[] = { wxT("Less or equal than"),
00069 wxT("Less than"), wxT("Equal to"), wxT("Different from"), wxT("Greater than"),
00070 wxT("Greater or equal than") };
00071
00072
00073
00074 BEGIN_EVENT_TABLE(mgSpecialSymPanel, mgButtonListPanel)
00075
00076
00077 EVT_COMMAND_RANGE(IDC_SPECIALSYMDLG_BUTTONS,
00078 (IDC_SPECIALSYMDLG_BUTTONS+mgSpecialSymPanel::strSymbols.Len()),
00079 wxEVT_COMMAND_BUTTON_CLICKED, mgSpecialSymPanel::OnButtons)
00080
00081 END_EVENT_TABLE()
00082
00083
00084
00085
00086
00087
00088
00089
00090 mgSpecialSymPanel::mgSpecialSymPanel(wxWindow *parent, wxWindow *client,
00091 mgMathWnd *mathwnd,
00092 mgMathBox *mathbox, wxWindowID id,
00093 const wxPoint &position,
00094 const wxSize& size, long style) :
00095
00096 mgButtonListPanel(parent, client, mathwnd, mathbox,
00097 SPECIALSYMDLG_COLUMNS, SPECIALSYMDLG_ROWS, IDC_SPECIALSYMDLG_BUTTONS,
00098 id, position, size, style)
00099 {
00100
00101 m_fButtons = mcElementHelpers::gui_GetDefaultStyle(0)->GetTextSettingsFor(mcET_ADDOP)->m_hFont;
00102
00103 m_fButtons.SetPointSize(SPECIALSYMDLG_FONT_POINTSIZE);
00104
00105
00106 BuildSizer();
00107 BuildButtons();
00108 BuildPanel();
00109 }
00110
00111 void mgSpecialSymPanel::BuildButtons()
00112 {
00113
00114 wxSize size = FindBiggestLetter(strSymbols);
00115 size.x = (int)(size.x*1.5);
00116 size.y = (int)(size.y/2.0);
00117 AddButtonsToSizer(0, strSymbols.Len(), size);
00118 }
00119
00120 void mgSpecialSymPanel::OnButtons( wxCommandEvent &ev )
00121 {
00122
00123 SendSpecialKeyEvent(this, strSymbols.GetChar(GetButtonID(ev)));
00124 }
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 void mgSpecialSymPalette::Build(wxWindow *client, mgMathWnd *mathwnd, mgMathBox *mathbox)
00135 {
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153 #ifdef mgUSE_PALETTEFRM
00154 SetClient(new mgSpecialSymPanel(this, client, mathwnd, mathbox));
00155 AddMiniButton(new wxCollapseBox(this));
00156 SetSizeHintsUsingClientHints();
00157 #else
00158 new mgSpecialSymPanel(this, client, mathwnd, mathbox);
00159 SetSize(200, 130);
00160 #endif
00161 }