Logo Search packages:      
Sourcecode: xchm version File versions

CHMFontDialog::CHMFontDialog ( wxWindow *  parent,
wxArrayString *  normalFonts,
wxArrayString *  fixedFonts,
const wxString &  normalFont,
const wxString &  fixedFont,
const int  fontSize 
)

Constructs a CHMFontDialog.

Parameters:
parent The parent window.
normalFonts Array of strings denoting all the normal font faces' names available on the system. Managed by the caller.
fixedFonts Array of strings denoting all the fixes fonts faces' names available on the system. Managed by the caller.
normalFont The normal font currently in use by the caller.
fixedFont The fixed font currently in use by the caller.
fontSize The size of the font currently selected.

Definition at line 49 of file chmfontdialog.cpp.

References InitDialog().

      : wxDialog(parent, -1, wxString(_("Change fonts.."))), _test(NULL),
        _fontSizeControl(NULL), _normalFControl(NULL), _fixedFControl(NULL),
      _normalFont(normalFont), _fixedFont(fixedFont), _fontSize(fontSize)
{
      wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
      wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5);

      sizer->Add(new wxStaticText(this, -1, _("Normal font:")));
      sizer->Add(new wxStaticText(this, -1, _("Fixed font:")));
      sizer->Add(new wxStaticText(this, -1, _("Font size:")));

      sizer->Add(_normalFControl = 
               new wxComboBox(this, -1, wxEmptyString, 
                          wxDefaultPosition, wxSize(200, -1),
                          0, NULL, wxCB_DROPDOWN | wxCB_READONLY));

      sizer->Add(_fixedFControl = 
               new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition,
                          wxSize(200, -1),
                          0, NULL, wxCB_DROPDOWN | wxCB_READONLY));

      sizer->Add(_fontSizeControl = new wxSpinCtrl(this, -1));

      _fontSizeControl->SetRange(2, 100);
      
      topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10);

      topsizer->Add(new wxStaticText(this, -1, _("Preview:")),
                               0, wxLEFT | wxTOP, 10);
      topsizer->Add(_test = 
                  new wxHtmlWindow(this, -1, wxDefaultPosition, 
                               wxSize(20, 150),
                               wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER),
                  1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10);

      wxBoxSizer *sizer2 = new wxBoxSizer(wxHORIZONTAL);
      wxButton *ok;
      sizer2->Add(ok = new wxButton(this, wxID_OK, _("OK")), 0, wxALL, 10);
      ok->SetDefault();
      sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 
                0, wxALL, 10);
      topsizer->Add(sizer2, 0, wxALIGN_RIGHT);
                  
      SetAutoLayout(TRUE);
      SetSizer(topsizer);
      topsizer->Fit(this);
      Centre(wxBOTH);

      InitDialog(normalFonts, fixedFonts);
}


Generated by  Doxygen 1.6.0   Back to index