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 #ifndef MATHWND_H
00034 #define MATHWND_H
00035
00036
00037 #include "mg/GUIUtils.h"
00038 #include "mg/MathBox.h"
00039
00040
00041
00042 #ifdef __GNUG__
00043 #pragma interface "MathWnd.h"
00044 #endif
00045
00047 WX_DECLARE_OBJARRAY(mgResizeableBox, wxMathBoxArray);
00048
00049
00050
00052 class mgMathWnd : public wxScrolledWindow
00053 {
00055 wxMathBoxArray m_arrMathBox;
00056
00057
00058
00059 wxSize m_szClient;
00060 int m_nSelBox;
00061 int m_nActiveElemID;
00062
00065 wxMemoryDC m_hMemDC;
00066
00068 wxPoint m_ptOrigin;
00069
00071 wxRect m_rcSelection;
00072
00074
00075
00076 public:
00077
00079 mgMathWnd(wxWindow *parent,
00080 wxWindowID id = -1,
00081 const wxPoint &pos = wxPoint(0, 0));
00082
00084 virtual ~mgMathWnd();
00085
00086
00087
00088
00090 void UpdateScrollRange();
00091
00094 void Clean();
00095
00097 wxString GetDebug();
00098
00100 void SetStyleArray(mcStyleArray *) {}
00101
00120 bool Export(bool bXHTML, const wxString &filename, const wxString &title,
00121 bool bUpperTag = FALSE, bool bMathPlayerSupport = FALSE, bool bUseNS = FALSE,
00122 const wxString &ns = wxEmptyString, const wxString &href = wxEmptyString,
00123 int indentstep = 2);
00124
00125 bool Export(bool bXHTML, wxOutputStream &stream, const wxString &title, bool bPreview,
00126 bool bUpperTag = FALSE, bool bMathPlayerSupport = FALSE, bool bUseNS = FALSE,
00127 const wxString &ns = wxEmptyString, const wxString &href = wxEmptyString,
00128 int indentstep = 2);
00129
00130 wxString GetExportPreview(bool bXHTML, const wxString &title,
00131 bool bUpperTag = FALSE, bool bMathPlayerSupport = FALSE,
00132 bool bUseNS = FALSE, const wxString &ns = wxEmptyString,
00133 const wxString &href = wxEmptyString, int indentstep = 2);
00134
00135 bool Import(int type, const wxString &filename, wxString *pDesc = NULL);
00136
00137
00138
00139
00143
00144 void OnSetFocus(wxFocusEvent &);
00145 void OnFocusLost(wxFocusEvent &);
00146
00147 void OnTimer(wxTimerEvent &);
00148 void OnPaint(wxPaintEvent &);
00149
00150 void OnLDown(wxMouseEvent &);
00151 void OnRDown(wxMouseEvent &);
00152 void OnLUp(wxMouseEvent &);
00153 void OnRUp(wxMouseEvent &);
00154 void OnMouseMove(wxMouseEvent &);
00155
00156 void OnCtxMenuItem(wxCommandEvent &);
00157
00158 void OnChar(wxKeyEvent &);
00159 void OnSize(wxSizeEvent &);
00160
00162 void OnChildWindowChange(wxCommandEvent &);
00163
00165
00166
00167
00168
00172
00178 void SelectBox(int n);
00179
00182 void SelectBoxByPoint(wxPoint &pt);
00183
00191 void AddBox(bool bMath, bool bCopyLast);
00192
00194 void DeleteBox(int n);
00195
00197
00198
00199
00204
00205
00206
00207
00208
00209
00210 int GetSelBoxId() { return m_nSelBox; }
00211 int GetBoxCount() { return m_arrMathBox.GetCount(); }
00212 mgResizeableBox *GetBox(int n) { return &(m_arrMathBox.Item(n)); }
00213 mgResizeableBox *GetSelBox() { return GetBox(m_nSelBox); }
00214
00216
00217
00218
00219 DECLARE_CLASS(mgMathWnd)
00220 DECLARE_EVENT_TABLE()
00221 };
00222
00223
00224 #endif
00225