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 EXPORTDLG_H 00033 #define EXPORTDLG_H 00034 00035 // optimization for GCC compiler 00036 #ifdef __GNUG__ 00037 #pragma interface "ExportDlg.h" 00038 #endif 00039 00040 // required because export dlg is able to integrate 00041 // both with mgMathBox and with mgMathWnd... 00042 #include "mg/MathBoxWndUser.h" 00043 00044 00045 00046 00048 00049 // these are some defines used to compile out some portions of code 00050 //#define CEXPDLG_STILL_NOT_WORKING 00051 #define CEXPDLG_USE_BOLD_FONT 00052 00053 00054 00055 // radio button & groups 00056 #define IDC_EXPDLG_XML mgEXPDLG_BASEID+1 00057 #define IDC_EXPDLG_XHTML mgEXPDLG_BASEID+2 00058 00059 // choices 00060 #define IDC_EXPDLG_BROWSER_LIST mgEXPDLG_BASEID+3 00061 #define IDC_EXPDLG_IE mgEXPDLG_BASEID+4 00062 #define IDC_EXPDLG_MOZILLA mgEXPDLG_BASEID+5 00063 00064 #define IDC_EXPDLG_EVERYTHING mgEXPDLG_BASEID+6 00065 #define IDC_EXPDLG_SELECTION mgEXPDLG_BASEID+7 00066 00067 // checkboxes 00068 #define IDC_EXPDLG_USE_NS mgEXPDLG_BASEID+8 00069 #define IDC_EXPDLG_UPPER mgEXPDLG_BASEID+9 00070 #define IDC_EXPDLG_MATH_PLAYER mgEXPDLG_BASEID+10 00071 00072 // textctrls 00073 #define IDC_EXPDLG_INDENTATION mgEXPDLG_BASEID+11 00074 #define IDC_EXPDLG_NS mgEXPDLG_BASEID+12 00075 #define IDC_EXPDLG_PREVIEW mgEXPDLG_BASEID+13 00076 #define IDC_EXPDLG_FILE mgEXPDLG_BASEID+14 00077 #define IDC_EXPDLG_TITLE mgEXPDLG_BASEID+15 00078 00079 // buttons 00080 #define IDC_EXPDLG_EXPORT_AND_OPEN mgEXPDLG_BASEID+16 00081 #define IDC_EXPDLG_EXPORT mgEXPDLG_BASEID+17 00082 #define IDC_EXPDLG_BROWSE mgEXPDLG_BASEID+18 00083 #define IDC_EXPDLG_SHOWADV mgEXPDLG_BASEID+19 00084 00085 00086 // these will be defined later... 00087 class mgExportDlg; 00088 class mgExportAdvOpt; 00089 00090 00093 class mgExportBasePanel : public wxPanel 00094 { 00095 protected: 00096 00102 virtual void BuildCtrls() = 0; 00103 00104 public: 00105 mgExportBasePanel(wxWindow* parent, wxWindowID id = -1) 00106 : wxPanel(parent, id) {} 00107 virtual ~mgExportBasePanel() {} 00108 00109 00113 virtual void BuildAll() = 0; 00114 00115 private: 00116 DECLARE_ABSTRACT_CLASS(mgExportBasePanel) 00117 }; 00118 00119 00120 00137 class mgExportBasicOpt : public mgExportBasePanel 00138 { 00139 friend class mgExportDlg; 00140 friend class mgExportAdvOpt; 00141 00142 protected: // member variables 00143 00145 wxChoice *m_pChoice; 00146 00148 wxTextCtrl *m_pDest; 00149 00151 wxTextCtrl *m_pTitle; 00152 00157 wxButton *m_pShowAdv; 00158 00161 wxFileDialog *m_pFD; 00162 00167 mgExportAdvOpt *m_pAdv; 00168 00169 00170 protected: // functions 00171 00173 void OnShowAdv( wxCommandEvent &event ); 00174 void OnBrowserModeChanged( wxCommandEvent &event ); 00175 void OnTitleChanged( wxCommandEvent &event ); 00176 void OnBrowse( wxCommandEvent &event ); 00178 00181 virtual wxString GetShowAdvLabel(); 00182 00183 virtual void BuildCtrls(); 00184 00185 public: 00186 00195 mgExportBasicOpt(wxWindow* parent, 00196 mgExportAdvOpt *adv = NULL, 00197 wxWindowID id = -1) 00198 : mgExportBasePanel(parent, id), m_pAdv(adv) {} 00199 00200 virtual ~mgExportBasicOpt() { 00201 // delete all windows not managed by sizers 00202 if (m_pFD) delete m_pFD; 00203 } 00204 00205 00209 void SetAdvPanel(mgExportAdvOpt *adv) { 00210 m_pAdv = adv; 00211 } 00212 00213 virtual void BuildAll(); 00214 00215 private: 00216 DECLARE_CLASS(mgExportBasicOpt) 00217 DECLARE_EVENT_TABLE() 00218 }; 00219 00220 00221 00222 00237 class mgExportAdvOpt : public mgExportBasePanel 00238 { 00239 friend class mgExportDlg; 00240 friend class mgExportBasicOpt; 00241 00242 protected: // member variables 00243 00247 wxCheckBox *m_pUseNS, *m_pUpper, *m_pMathPlayer; 00248 wxTextCtrl *m_pNS, *m_pIndentation, *m_pPreview; 00249 wxRadioButton *m_pXHTML, *m_pXML; 00250 00252 00254 mgExportBasicOpt *m_pBasic; 00255 00257 mgMathBox *m_pBox; 00258 00260 wxString m_strXSLPath; 00261 00263 bool m_bPreviewEnabled; 00264 00265 00266 protected: // functions 00267 00269 void OnUseNS( wxCommandEvent &event ); 00270 void OnPreviewChanged( wxCommandEvent &event ); 00271 void OnTypeChanged( wxCommandEvent &event ); 00272 void OnMathPlayer( wxCommandEvent &event ); 00274 00275 virtual void BuildCtrls(); 00276 00277 public: 00278 00287 mgExportAdvOpt(wxWindow* parent, mgExportBasicOpt *basic = NULL, 00288 mgMathBox *box = NULL, const wxString &xslpath = wxEmptyString, 00289 wxWindowID id = -1) 00290 : mgExportBasePanel(parent, id), m_pBasic(basic), 00291 m_pBox(box), m_strXSLPath(xslpath) { 00292 m_bPreviewEnabled = FALSE; 00293 } 00294 00295 virtual ~mgExportAdvOpt() {} 00296 00297 00299 virtual void EnablePreview(bool enable = TRUE) { 00300 m_bPreviewEnabled = enable; 00301 } 00302 00305 int GetIndentation(); 00306 00307 virtual void BuildAll(); 00308 00309 private: 00310 DECLARE_CLASS(mgExportAdvOpt) 00311 DECLARE_EVENT_TABLE() 00312 }; 00313 00314 00315 00316 00325 class mgExportDlg : public wxDialog, public mgMathBoxWndUser 00326 { 00327 protected: // member variables 00328 00334 00335 wxFont m_fBoldFont; 00336 wxSizer *m_pMainPanel, *m_pButtonsPanel; 00337 00338 mgExportBasicOpt *m_pBasicOptPanel; 00339 mgExportAdvOpt *m_pAdvOptPanel; 00340 00342 00343 00345 wxString m_strXSLPath; 00346 00347 00350 bool m_bBuildComplete; 00351 00353 bool m_bShowAdv; 00354 00355 00356 protected: // functions 00357 00358 // button event handlers 00359 void OnExport( wxCommandEvent &event ); 00360 void OnExportAndOpen( wxCommandEvent &event ); 00361 00363 virtual void BuildAll(); 00364 00366 virtual wxSizer *BuildButtons(); 00367 00371 virtual void BuildCtrls(); 00372 00373 public: 00374 00377 mgExportDlg(wxWindow *parent, 00378 mgMathWnd *mathwnd, 00379 mgMathBox *mathbox, 00380 const wxString &href, 00381 wxWindowID id = -1, 00382 const wxString &title = wxT("Export options"), 00383 const wxPoint& pos = wxDefaultPosition, 00384 const wxSize& size = wxDefaultSize, 00385 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); 00386 00387 virtual ~mgExportDlg(); 00388 00389 00391 virtual mgExportBasicOpt *GetBasicOpt() { 00392 return m_pBasicOptPanel; 00393 } 00394 00396 virtual mgExportAdvOpt *GetAdvOpt() { 00397 return m_pAdvOptPanel; 00398 } 00399 00401 virtual bool isShowingAdvOpt() { 00402 return m_bShowAdv; 00403 } 00404 00408 virtual void ShowAdv(); 00409 00410 private: 00411 DECLARE_CLASS(mgExportDlg) 00412 DECLARE_EVENT_TABLE() 00413 }; 00414 00415 00416 #endif // EXPORTDLG_H 00417
[ Top ] |