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 EXPORTDLG_H
00033 #define EXPORTDLG_H
00034
00035
00036 #ifdef __GNUG__
00037 #pragma interface "ExportDlg.h"
00038 #endif
00039
00040
00041
00042 #include "mg/MathBoxWndUser.h"
00043
00044
00045
00046
00048
00049
00050
00051 #define CEXPDLG_USE_BOLD_FONT
00052
00053
00054
00055
00056 #define IDC_EXPDLG_XML mgEXPDLG_BASEID+1
00057 #define IDC_EXPDLG_XHTML mgEXPDLG_BASEID+2
00058
00059
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
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
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
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
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:
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:
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
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:
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:
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:
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:
00357
00358
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
00417