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 "ExportDlg.h"
00036 #endif
00037
00038
00039 #include "mg/mgprec.h"
00040 #include <wx/filename.h>
00041
00042 #ifndef mgPRECOMP
00043 #include <wx/wxprec.h>
00044 #include "mg/ExportDlg.h"
00045 #include "mg/GUIUtils.h"
00046 #endif
00047
00048
00049
00050
00051
00052
00053 IMPLEMENT_ABSTRACT_CLASS(mgExportBasePanel, wxPanel)
00054
00055
00056
00057 IMPLEMENT_CLASS(mgExportBasicOpt, mgExportBasePanel)
00058 BEGIN_EVENT_TABLE(mgExportBasicOpt, mgExportBasePanel)
00059
00060
00061 EVT_BUTTON( IDC_EXPDLG_SHOWADV, mgExportBasicOpt::OnShowAdv )
00062 EVT_BUTTON( IDC_EXPDLG_BROWSE, mgExportBasicOpt::OnBrowse )
00063 EVT_TEXT( IDC_EXPDLG_TITLE, mgExportBasicOpt::OnTitleChanged )
00064 EVT_CHOICE( IDC_EXPDLG_BROWSER_LIST, mgExportBasicOpt::OnBrowserModeChanged )
00065
00066 END_EVENT_TABLE()
00067
00068
00069
00070
00071 IMPLEMENT_CLASS(mgExportAdvOpt, mgExportBasePanel)
00072 BEGIN_EVENT_TABLE(mgExportAdvOpt, mgExportBasePanel)
00073
00074
00075 EVT_CHECKBOX( IDC_EXPDLG_USE_NS, mgExportAdvOpt::OnUseNS )
00076 EVT_CHECKBOX( IDC_EXPDLG_UPPER, mgExportAdvOpt::OnPreviewChanged )
00077 EVT_CHECKBOX( IDC_EXPDLG_MATH_PLAYER, mgExportAdvOpt::OnMathPlayer )
00078
00079
00080 EVT_TEXT( IDC_EXPDLG_INDENTATION, mgExportAdvOpt::OnPreviewChanged )
00081 EVT_TEXT( IDC_EXPDLG_NS, mgExportAdvOpt::OnPreviewChanged )
00082
00083
00084 EVT_RADIOBUTTON( IDC_EXPDLG_XML, mgExportAdvOpt::OnTypeChanged )
00085 EVT_RADIOBUTTON( IDC_EXPDLG_XHTML, mgExportAdvOpt::OnTypeChanged )
00086
00087 END_EVENT_TABLE()
00088
00089
00090
00091
00092 IMPLEMENT_CLASS(mgExportDlg, wxDialog)
00093 BEGIN_EVENT_TABLE(mgExportDlg, wxDialog)
00094
00095
00096 EVT_BUTTON( IDC_EXPDLG_EXPORT_AND_OPEN, mgExportDlg::OnExportAndOpen )
00097 EVT_BUTTON( IDC_EXPDLG_EXPORT, mgExportDlg::OnExport )
00098
00099 END_EVENT_TABLE()
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 void mgExportBasicOpt::BuildCtrls()
00111 {
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 m_pFD = new wxFileDialog(this, wxT("Save as XHTML file"), wxT(""), wxT(""),
00129 wxT("XHTML files (*.htm; *.html)|*.htm;*.html"), wxSAVE | wxCHANGE_DIR |
00130 wxOVERWRITE_PROMPT);
00131
00132 wxString choices[] = { wxT("Internet Explorer (version 5.5 or higher) with MathPlayer"),
00133 wxT("Mozilla or Netscape (versions 1.2.x or higher)"),
00134 wxT("<do not use preset options>") };
00135
00136
00137 m_pDest = new wxTextCtrl(this, IDC_EXPDLG_FILE, wxT(""));
00138 m_pTitle = new wxTextCtrl(this, IDC_EXPDLG_TITLE, wxT(""));
00139
00140 #ifdef mgEXPDLG_STILL_NOT_WORKING
00141 m_pIndentation = new wxTextCtrl(this, IDC_EXPDLG_INDENTATION, wxT(""),
00142 wxDefaultPosition, wxSize(40, -1));
00143 #endif
00144
00145
00146 m_pChoice = new wxChoice(this, IDC_EXPDLG_BROWSER_LIST, wxDefaultPosition,
00147 wxDefaultSize, 3, choices);
00148
00149
00150 m_pShowAdv = new wxButton(this, IDC_EXPDLG_SHOWADV, GetShowAdvLabel());
00151
00152 }
00153
00154 void mgExportBasicOpt::BuildAll()
00155 {
00156
00157 BuildCtrls();
00158
00159
00160
00161 wxStaticBoxSizer *basic = new wxStaticBoxSizer(
00162 new wxStaticBox(this, -1, wxT("Basic export options")), wxVERTICAL);
00163
00164 wxBoxSizer *list = new wxBoxSizer(wxHORIZONTAL),
00165 *title = new wxBoxSizer(wxHORIZONTAL),
00166 *browse = new wxBoxSizer(wxHORIZONTAL);
00167
00168 basic->Add(
00169 new wxStaticText(this, -1,
00170 wxT("Changing the options in the BASIC panel, you will change ")
00171 wxT("ADVANCED panel options, too.")),
00172 0,
00173 wxALL | wxGROW,
00174 5);
00175 basic->Add(1, 1, 1, wxGROW);
00176
00177
00178 list->Add(
00179 new wxStaticText(this, -1,
00180 wxT("Adjust options to make the exported file compatible ")
00181 wxT("(i.e. viewable) with:")),
00182 0,
00183 wxALL | wxALIGN_CENTER,
00184 5);
00185 list->Add(
00186 m_pChoice,
00187 1,
00188 wxALL | wxGROW,
00189 5);
00190
00191 basic->Add(list, 0, wxGROW);
00192 basic->Add(1, 1, 1, wxGROW);
00193
00194 title->Add(
00195 new wxStaticText(this, -1,
00196 wxT("Title of the exported XHTML/XML file:")),
00197 0,
00198 wxALL | wxALIGN_CENTER,
00199 5);
00200 title->Add(
00201 m_pTitle,
00202 1,
00203 wxALL | wxGROW,
00204 5);
00205
00206 basic->Add(title, 0, wxGROW);
00207 basic->Add(1, 1, 1, wxGROW);
00208
00209 browse->Add(
00210 new wxStaticText(this, -1, wxT("Export in: ")),
00211 0,
00212 wxALL | wxALIGN_CENTER,
00213 5);
00214 browse->Add(
00215 m_pDest,
00216 1,
00217 wxALL | wxGROW,
00218 5);
00219 browse->Add(
00220 new wxButton(this, IDC_EXPDLG_BROWSE, wxT("Browse")),
00221 0,
00222 wxALL | wxGROW,
00223 5);
00224
00225 browse->Add(
00226 m_pShowAdv,
00227 0,
00228 wxALL | wxGROW,
00229 5);
00230
00231 basic->Add(browse, 0, wxGROW);
00232
00233
00234 SetSizer(basic);
00235 basic->SetSizeHints(this);
00236
00237
00238 m_pChoice->SetSelection(m_pChoice->GetCount()-1);
00239
00240 }
00241
00242
00243
00244
00245
00246
00247
00248 wxString mgExportBasicOpt::GetShowAdvLabel()
00249 {
00250 mgExportDlg *parent = wxDynamicCast(GetParent(), mgExportDlg);
00251
00252 mcASSERT(parent != NULL,
00253 wxT("mgExportBasicOpt can be created only inside a mgExportDlg..."));
00254
00255 if (parent->isShowingAdvOpt())
00256 return wxT("Show advanced options <<");
00257 return wxT("Show advanced options >>");
00258 }
00259
00260 void mgExportBasicOpt::OnShowAdv(wxCommandEvent &event)
00261 {
00262
00263 mgExportDlg *parent = wxDynamicCast(GetParent(), mgExportDlg);
00264 mcASSERT(parent != NULL,
00265 wxT("mgExportBasicOpt can be created only inside a mgExportDlg..."));
00266
00267
00268 parent->ShowAdv();
00269
00270
00271 m_pShowAdv->SetLabel(GetShowAdvLabel());
00272 }
00273
00274 void mgExportBasicOpt::OnBrowse( wxCommandEvent &event )
00275 {
00276
00277 if (m_pFD->ShowModal() == wxID_CANCEL) {
00278
00279
00280 return;
00281 }
00282
00283
00284 m_pDest->Clear();
00285 m_pDest->WriteText(m_pFD->GetPath());
00286 }
00287
00288 void mgExportBasicOpt::OnBrowserModeChanged( wxCommandEvent &event )
00289 {
00290
00291
00292 if (m_pAdv == NULL)
00293 return;
00294
00295
00296 if (m_pChoice->GetSelection() == 0) {
00297
00298
00299 m_pAdv->m_pMathPlayer->SetValue(TRUE);
00300 m_pAdv->OnMathPlayer(event);
00301
00302 m_pAdv->m_pNS->Clear();
00303 m_pAdv->m_pNS->WriteText(wxT("m"));
00304
00305 } else {
00306
00307
00308 m_pAdv->m_pXHTML->SetValue(FALSE);
00309 m_pAdv->m_pXML->SetValue(TRUE);
00310 m_pAdv->OnTypeChanged(event);
00311
00312
00313 m_pAdv->m_pUseNS->SetValue(FALSE);
00314 m_pAdv->OnUseNS(event);
00315
00316 m_pAdv->m_pMathPlayer->SetValue(FALSE);
00317 m_pAdv->OnMathPlayer(event);
00318 }
00319 }
00320
00321 void mgExportBasicOpt::OnTitleChanged(wxCommandEvent &event)
00322 {
00323
00324 if (m_pAdv)
00325 m_pAdv->OnPreviewChanged(event);
00326 }
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337 void mgExportAdvOpt::BuildCtrls()
00338 {
00339
00340 m_pPreview = new wxTextCtrl(this, IDC_EXPDLG_PREVIEW, wxT(""), wxDefaultPosition,
00341 wxSize(0, 0), wxTE_READONLY | wxTE_MULTILINE | wxTE_RICH2);
00342
00343 m_pNS = new wxTextCtrl(this, IDC_EXPDLG_NS, wxT("m"), wxDefaultPosition,
00344 wxSize(40, -1));
00345
00346
00347 m_pUseNS = new wxCheckBox(this, IDC_EXPDLG_USE_NS, wxT("Use namespace:"));
00348 m_pUpper = new wxCheckBox(this, IDC_EXPDLG_UPPER, wxT("Make tags UPPERCASE"));
00349 m_pMathPlayer = new wxCheckBox(this, IDC_EXPDLG_MATH_PLAYER,
00350 wxT("Add MathPlayer support"));
00351
00352
00353 m_pXHTML = new wxRadioButton(this, IDC_EXPDLG_XHTML, wxT("XHTML"), wxDefaultPosition,
00354 wxSize(-1,-1), wxRB_GROUP);
00355 m_pXML = new wxRadioButton(this, IDC_EXPDLG_XML, wxT("XML"));
00356 }
00357
00358 void mgExportAdvOpt::BuildAll()
00359 {
00360
00361 BuildCtrls();
00362
00363
00364 wxStaticBoxSizer *adv = new wxStaticBoxSizer(
00365 new wxStaticBox(this, -1, wxT("Advanced export options")), wxHORIZONTAL);
00366 wxBoxSizer *subadv1 = new wxBoxSizer(wxHORIZONTAL),
00367 #ifdef mgEXPDLG_STILL_NOT_WORKING
00368 *subadv2 = new wxBoxSizer(wxHORIZONTAL),
00369 #endif
00370 *subadv3 = new wxBoxSizer(wxHORIZONTAL);
00371 wxBoxSizer *subadv1container = new wxBoxSizer(wxVERTICAL),
00372 *column1 = new wxBoxSizer(wxVERTICAL),
00373 *column2 = new wxBoxSizer(wxVERTICAL),
00374 *column3 = new wxBoxSizer(wxVERTICAL);
00375
00376 column1->Add(
00377 new wxStaticText(this, -1, wxT("Export as:")),
00378 0,
00379 wxALL | wxALIGN_LEFT,
00380 5);
00381 column1->Add(1, 1, 1, wxGROW);
00382 column1->Add(
00383 m_pXHTML,
00384 0,
00385 wxALL | wxALIGN_LEFT,
00386 5);
00387 column1->Add(1, 1, 1, wxGROW);
00388 column1->Add(
00389 m_pXML,
00390 0,
00391 wxALL | wxALIGN_LEFT,
00392 5);
00393 column1->Add(1, 1, 1, wxGROW);
00394
00395
00396
00397 column2->Add(
00398 new wxStaticText(this, -1, wxT("Export:")),
00399 0,
00400 wxALL | wxALIGN_LEFT,
00401 5);
00402 column2->Add(1, 1, 1, wxGROW);
00403 column2->Add(
00404 new wxRadioButton(this, IDC_EXPDLG_EVERYTHING,
00405 wxT("Everything"), wxDefaultPosition,
00406 wxSize(-1,-1), wxRB_GROUP),
00407 0,
00408 wxALL | wxALIGN_LEFT,
00409 5);
00410 column2->Add(1, 1, 1, wxGROW);
00411 column2->Add(
00412 new wxRadioButton(this, IDC_EXPDLG_SELECTION, wxT("Only selection")),
00413 0,
00414 wxALL | wxALIGN_LEFT,
00415 5);
00416 column2->Add(1, 1, 1, wxGROW);
00417
00418
00419
00420 column3->Add(
00421 new wxStaticText(this, -1, wxT("Tag preview:")),
00422 0,
00423 wxALL | wxALIGN_LEFT,
00424 5);
00425 column3->Add(
00426 m_pPreview,
00427 1,
00428 wxALL | wxGROW,
00429 5);
00430
00431 #ifdef mgEXPDLG_STILL_NOT_WORKING
00432 subadv2->Add(
00433 new wxStaticText(this, -1, wxT("Indentation step:"))),
00434 0,
00435 wxALL | wxALIGN_CENTER,
00436 5);
00437 subadv2->Add(
00438 m_pIndentation,
00439 1,
00440 wxALL | wxGROW,
00441 5);
00442 #endif
00443
00444 subadv3->Add(
00445 m_pUseNS,
00446 1,
00447 wxALL | wxALIGN_CENTER,
00448 5);
00449 subadv3->Add(
00450 m_pNS,
00451 0,
00452 wxALL | wxGROW,
00453 5);
00454
00455
00456 subadv1->Add(column1, 1, wxGROW, 0);
00457 subadv1->Add(column2, 1, wxGROW, 0);
00458
00459
00460 subadv1container->Add(subadv1, 6, wxGROW, 0);
00461 #ifdef mgEXPDLG_STILL_NOT_WORKING
00462 subadv1container->Add(1, 1, 1, wxGROW);
00463 subadv1container->Add(subadv2, 0, wxALIGN_LEFT | wxLEFT, 5);
00464 #endif
00465
00466
00467 subadv1container->Add(1, 1, 1, wxGROW);
00468 subadv1container->Add(m_pMathPlayer, 0, wxALIGN_LEFT | wxLEFT | wxBOTTOM, 10);
00469 subadv1container->Add(m_pUpper, 0, wxALIGN_LEFT | wxLEFT, 10);
00470
00471
00472 subadv1container->Add(subadv3, 0, wxALIGN_LEFT | wxLEFT | wxBOTTOM, 5);
00473
00474
00475 adv->Add(subadv1container, 4, wxGROW, 0);
00476 adv->Add(column3, 7, wxGROW | wxLEFT, 10);
00477
00478 SetSizer(adv);
00479 adv->SetSizeHints(this);
00480
00481
00482 m_pUseNS->SetValue(FALSE);
00483 wxCommandEvent fake;
00484 OnUseNS(fake);
00485
00486 #ifdef mgEXPDLG_STILL_NOT_WORKING
00487 m_pIndentation->WriteText(wxT("2");
00488 #endif
00489 }
00490
00491 int mgExportAdvOpt::GetIndentation()
00492 {
00493 long tmp;
00494
00495
00496 #ifdef mgEXPDLG_STILL_NOT_WORKING
00497 m_pIndentation->GetValue().ToLong(&tmp, 0);
00498 #else
00499 tmp = 0;
00500 #endif
00501
00502 return tmp;
00503 }
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 void mgExportAdvOpt::OnUseNS( wxCommandEvent &event )
00514 {
00515
00516 if (!m_pUseNS->GetValue()) {
00517 m_pNS->Disable();
00518 m_pMathPlayer->SetValue(FALSE);
00519 OnMathPlayer(event);
00520 } else {
00521 m_pNS->Enable();
00522 }
00523
00524 OnPreviewChanged(event);
00525 }
00526
00527 void mgExportAdvOpt::OnMathPlayer( wxCommandEvent &event )
00528 {
00529
00530
00531 if (m_pMathPlayer->GetValue()) {
00532 m_pUseNS->SetValue(TRUE);
00533 OnUseNS(event);
00534
00535 } else {
00536
00537 if (m_pBasic == NULL)
00538 return;
00539
00540 if (m_pBasic->m_pChoice->GetSelection() == 0)
00541 m_pBasic->m_pChoice->SetSelection(-1);
00542 }
00543
00544 OnPreviewChanged(event);
00545 }
00546
00547 void mgExportAdvOpt::OnPreviewChanged( wxCommandEvent &event )
00548 {
00549 if (!m_bPreviewEnabled)
00550 return;
00551
00552 wxString title;
00553 if (m_pBasic)
00554 title = m_pBasic->m_pTitle->GetValue();
00555
00556
00557 m_pPreview->Clear();
00558 m_pPreview->WriteText(
00559 m_pBox->GetExportPreview(
00560 m_pXHTML->GetValue(),
00561 title,
00562 m_pMathPlayer->GetValue(),
00563 m_pUpper->GetValue(),
00564 m_pUseNS->GetValue(),
00565 m_pNS->GetValue(),
00566 m_strXSLPath,
00567 0));
00568
00569 m_pPreview->SetInsertionPoint(0);
00570 }
00571
00572 void mgExportAdvOpt::OnTypeChanged( wxCommandEvent &event )
00573 {
00574 wxString newstr;
00575 wxString dest;
00576
00577
00578 if (m_pBasic) {
00579 dest = m_pBasic->m_pDest->GetValue();
00580
00581 if (m_pXHTML->GetValue()) {
00582 newstr = dest.BeforeLast(wxT('.')) + wxT(".xhtml");
00583 } else {
00584 newstr = dest.BeforeLast(wxT('.')) + wxT(".xml");
00585 }
00586
00587
00588 m_pBasic->m_pDest->Clear();
00589 m_pBasic->m_pDest->WriteText(newstr);
00590 }
00591
00592
00593 OnPreviewChanged(event);
00594 }
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605 mgExportDlg::mgExportDlg(wxWindow *parent, mgMathWnd *mathwnd, mgMathBox *mathbox,
00606 const wxString &href, wxWindowID id, const wxString &title,
00607 const wxPoint &position, const wxSize& size, long style ) :
00608
00609 wxDialog(parent, id, title, position, size, style),
00610 mgMathBoxWndUser(mathwnd, mathbox)
00611 {
00612 wxCommandEvent fake;
00613
00614
00615 m_pMathWnd = mathwnd;
00616 m_pMathBox = mathbox;
00617
00618 #ifdef CEXPDLG_USE_BOLD_FONT
00619
00620 m_fBoldFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
00621 m_fBoldFont.SetWeight(wxBOLD);
00622 #endif
00623
00624 m_bBuildComplete = FALSE;
00625 m_strXSLPath = href;
00626
00627
00628
00629 m_bShowAdv = FALSE;
00630 BuildAll();
00631 m_bBuildComplete = TRUE;
00632
00633
00634
00635 m_bShowAdv = TRUE;
00636 ShowAdv();
00637
00638
00639 GetBasicOpt()->OnBrowse(fake);
00640 GetAdvOpt()->EnablePreview();
00641 GetAdvOpt()->OnPreviewChanged(fake);
00642
00643
00644
00645 switch (wxGetOsVersion()) {
00646
00647
00648 case wxWINDOWS:
00649 case wxWINDOWS_NT:
00650 case wxWIN95:
00651 case wxWIN32S:
00652 case wxWIN386:
00653 GetBasicOpt()->m_pChoice->SetSelection(0);
00654 mgLogDebug(wxT("mgExportDlg::mgExportDlg() - IE settings choosen"));
00655 break;
00656
00657
00658 case wxGTK:
00659 case wxMOTIF_X:
00660 GetBasicOpt()->m_pChoice->SetSelection(1);
00661 mgLogDebug(wxT("mgExportDlg::mgExportDlg() - Mozilla settings chosen"));
00662
00663
00664
00665
00666 default:
00667 GetBasicOpt()->m_pChoice->SetSelection(2);
00668 }
00669
00670
00671 GetBasicOpt()->OnBrowserModeChanged(fake);
00672 }
00673
00674 mgExportDlg::~mgExportDlg()
00675 {
00676
00677 }
00678
00679
00680
00681 wxSizer *mgExportDlg::BuildButtons()
00682 {
00684
00685 wxBoxSizer *bttn = new wxBoxSizer(wxHORIZONTAL);
00686 bttn->Add(
00687 new wxButton(this, wxID_CANCEL, wxT("Cancel")),
00688 1,
00689 wxALL | wxGROW,
00690 10);
00691 bttn->Add(
00692 new wxButton(this, IDC_EXPDLG_EXPORT, wxT("Export only")),
00693 1,
00694 wxALL | wxGROW,
00695 10);
00696 bttn->Add(
00697 new wxButton(this, IDC_EXPDLG_EXPORT_AND_OPEN,
00698 wxT("Export and open\nin default browser"),
00699 wxDefaultPosition, wxSize(1, 40)),
00700 1,
00701 wxALL | wxGROW,
00702 10);
00703
00704 return bttn;
00705 }
00706
00707 void mgExportDlg::BuildCtrls()
00708 {
00709
00710
00711 m_pBasicOptPanel = new mgExportBasicOpt(this);
00712 m_pAdvOptPanel = new mgExportAdvOpt(this, m_pBasicOptPanel,
00713 GetBox(), m_strXSLPath, -1);
00714
00715
00716 GetBasicOpt()->SetAdvPanel(GetAdvOpt());
00717
00718
00719 GetBasicOpt()->BuildAll();
00720 GetAdvOpt()->BuildAll();
00721 }
00722
00723 void mgExportDlg::BuildAll()
00724 {
00725 m_pMainPanel = new wxBoxSizer(wxVERTICAL);
00726
00728
00729 wxStaticText *hdr = new wxStaticText(this, -1,
00730 wxT("This dialog allows you to export as MathML 2.0 the document ")
00731 wxT("you have created with MathStudio.\n"), wxDefaultPosition,
00732 wxDefaultSize, wxALIGN_CENTRE),
00733
00734 *description = new wxStaticText(this, -1,
00735 wxT("The goal of MathML is to enable mathematics to be served, ")
00736 wxT("received,\nand processed on the World Wide Web, ")
00737 wxT("just as HTML has enabled this functionality ")
00738 wxT("for text.\nMathML is an XML extension and thus MathML can ")
00739 wxT("be saved in two different\nformats: pure XML or XHTML. ")
00740 wxT("XHTML is a flexible and powerful mix of HTML and XML which\n")
00741 wxT("allows you to embed math && formatted text in the same document.")
00742 wxT("\nThis is why it should be your preferred choice.\n"), wxDefaultPosition,
00743 wxDefaultSize, wxALIGN_CENTRE);
00744
00745 #ifdef CEXPDLG_USE_BOLD_FONT
00746 hdr->SetFont(m_fBoldFont);
00747 description->SetFont(m_fBoldFont);
00748 #endif
00749
00750 m_pMainPanel->Add(
00751 hdr,
00752 0,
00753 wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER,
00754 10);
00755
00756 m_pMainPanel->Add(
00757 description,
00758 0,
00759 wxLEFT | wxRIGHT | wxALIGN_CENTER,
00760 10);
00761
00762
00763 BuildCtrls();
00764
00765
00766 m_pMainPanel->Add(m_pBasicOptPanel, 2, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 10);
00767
00768
00769
00770
00771 m_pMainPanel->Add(m_pAdvOptPanel, 3, wxGROW | wxALL, 10);
00772
00773 m_pButtonsPanel = BuildButtons();
00774 m_pMainPanel->Add(m_pButtonsPanel, 1, wxGROW, 10);
00775
00776
00777 SetSizer(m_pMainPanel);
00778 m_pMainPanel->SetSizeHints(this);
00779
00780
00781
00782 wxString separator = wxFileName::GetPathSeparator();
00783 GetBasicOpt()->m_pDest->WriteText(wxGetCwd() + separator +
00784 wxT("Untitled document.html"));
00785
00786 wxString tmp = GetBasicOpt()->m_pDest->GetValue().BeforeLast(wxT('.'));
00787 GetBasicOpt()->m_pTitle->WriteText(
00788 tmp.AfterLast(separator.GetChar(0)));
00789
00790
00791 this->CentreOnScreen();
00792 }
00793
00794
00795
00796
00798
00799
00800 void mgExportDlg::OnExport( wxCommandEvent &event )
00801 {
00802 GetBox()->Export(
00803 GetAdvOpt()->m_pXHTML->GetValue(), GetBasicOpt()->m_pDest->GetValue(),
00804 GetBasicOpt()->m_pTitle->GetValue(), GetAdvOpt()->m_pMathPlayer->GetValue(),
00805 GetAdvOpt()->m_pUpper->GetValue(),
00806 GetAdvOpt()->m_pUseNS->GetValue(),
00807 GetAdvOpt()->m_pNS->GetValue(), m_strXSLPath,
00808 GetAdvOpt()->GetIndentation());
00809 EndModal(wxOK);
00810 }
00811
00812 void mgExportDlg::OnExportAndOpen( wxCommandEvent &event )
00813 {
00814 m_pMathBox->Export(
00815 GetAdvOpt()->m_pXHTML->GetValue(), GetBasicOpt()->m_pDest->GetValue(),
00816 GetBasicOpt()->m_pTitle->GetValue(), GetAdvOpt()->m_pMathPlayer->GetValue(),
00817 GetAdvOpt()->m_pUpper->GetValue(),
00818 GetAdvOpt()->m_pUseNS->GetValue(),
00819 GetAdvOpt()->m_pNS->GetValue(), m_strXSLPath,
00820 GetAdvOpt()->GetIndentation());
00821 wxViewHTMLFile(GetBasicOpt()->m_pDest->GetValue());
00822 EndModal(wxOK);
00823 }
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843 void mgExportDlg::ShowAdv()
00844 {
00845
00846 m_bShowAdv = !m_bShowAdv;
00847
00848 if (m_bShowAdv) {
00849
00850
00851 m_pAdvOptPanel->Show();
00852 m_pMainPanel->Show(m_pAdvOptPanel);
00853 m_pMainPanel->Layout();
00854
00855
00856 } else {
00857
00858
00859 m_pAdvOptPanel->Hide();
00860 m_pMainPanel->Hide(m_pAdvOptPanel);
00861
00862
00863 this->SetSize(-1, -1, 0, 0);
00864 m_pMainPanel->Layout();
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875 }
00876
00877
00878 m_pMainPanel->SetSizeHints(this);
00879 this->SetSize(-1, -1, 0, 0);
00880
00881 Refresh();
00882 }
00883
00884
00885
00886
00887
00889
00890
00891
00892
00894
00895
00896
00897
00898
00899
00900