Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuHelpPanel.cpp

Go to the documentation of this file.
00001 #include "vuHelpPanel.h"
00002 #include "../vuUtilityWindow.h"
00003 
00004 #include <iostream>
00005 
00006 enum {
00007   idHelpText
00008 };
00009 
00010 BEGIN_EVENT_TABLE(vuHelpPanel, wxDialog)
00011 END_EVENT_TABLE();
00012 
00013 //----------------------------------------------------------------------------
00014 //------------------------- The constructor ----------------------------------
00015 //----------------------------------------------------------------------------
00016 
00017 vuHelpPanel::vuHelpPanel(wxWindow *parent)
00018     : wxDialog(parent, -1, wxString("Help"), wxDefaultPosition,
00019                wxSize(400, 400),wxSTAY_ON_TOP|wxCAPTION/*|wxRESIZE_BORDER*/)
00020 {
00021     wxSizer *sizer;
00022 
00023     sizer      = new wxBoxSizer(wxHORIZONTAL);
00024     m_textCtrl = new wxTextCtrl(this, idHelpText, wxString(""),
00025                                 wxDefaultPosition, wxSize(380,380),
00026                                 wxTE_MULTILINE|wxHSCROLL|wxTE_READONLY,
00027                                 wxDefaultValidator, wxString("helpText"));
00028     sizer->Add(m_textCtrl);
00029     SetSizer(sizer);
00030     SetAutoLayout(true);
00031     sizer->Layout();
00032     sizer->SetSizeHints(this);
00033     sizer->Fit(this);
00034 
00035     _initFont();
00036 }
00037 
00038 vuHelpPanel::~vuHelpPanel()
00039 {
00040   if (m_textCtrl != NULL) {
00041     delete m_textCtrl;
00042     m_textCtrl = NULL;
00043   }
00044   
00045 }
00046 
00047 void vuHelpPanel::setTitle(const wxString& _title)
00048 {
00049   wxDialog::SetTitle(wxString("Help: ") + _title);
00050 }
00051 
00052 void vuHelpPanel::setHelpText(const wxString& _helpText)
00053 {
00054   m_textCtrl->SetValue(_helpText);
00055 }
00056 
00057 // this does not seem to work
00058 // Does anybody have an idea, how to apply a fixed font to a wxTextCtrl? -ms-
00059 void vuHelpPanel::_initFont()
00060 {
00061   wxFont myFont(10, wxMODERN, wxNORMAL, wxNORMAL,
00062                 false, "", wxFONTENCODING_DEFAULT);
00063   m_textCtrl->SetFont(myFont);
00064 }

Generated on Wed Dec 15 21:20:34 2004 for vuVolume by  doxygen 1.3.9.1