NIREP
|
00001 00002 // Name: EditTextPanels.cpp 00003 // Purpose: 00004 // Author: 00005 // Modified by: 00006 // Created: 12/01/2010 12:04:14 00007 // RCS-ID: 00008 // Copyright: 00009 // Licence: 00011 00012 // For compilers that support precompilation, includes "wx/wx.h". 00013 #include "wx/wxprec.h" 00014 00015 #ifdef __BORLANDC__ 00016 #pragma hdrstop 00017 #endif 00018 00019 #ifndef WX_PRECOMP 00020 #include "wx/wx.h" 00021 #endif 00022 00025 00026 #include "EditTextPanels.h" 00027 #include "NIREPDisplay.h" 00028 00031 00032 00037 IMPLEMENT_CLASS( EditTextPanels, wxFrame ) 00038 00039 00040 00044 BEGIN_EVENT_TABLE( EditTextPanels, wxFrame ) 00045 00047 EVT_FONTPICKER_CHANGED( ID_FONTCTRL, EditTextPanels::OnFontctrlFontPickerChanged ) 00048 00049 EVT_BUTTON( ID_CHANGE_VIEW, EditTextPanels::OnChangeViewClick ) 00050 00052 00053 END_EVENT_TABLE() 00054 00055 00060 EditTextPanels::EditTextPanels() 00061 { 00062 Init(); 00063 } 00064 00065 EditTextPanels::EditTextPanels( wxWindow* parent, int Row, int Col, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) 00066 { 00067 displayParent = (NIREPDisplay*)parent; 00068 row = Row; 00069 col = Col; 00070 Init(); 00071 Create( parent, id, caption, pos, size, style ); 00072 } 00073 00074 00079 bool EditTextPanels::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) 00080 { 00082 wxFrame::Create( parent, id, caption, pos, size, style ); 00083 00084 CreateControls(); 00085 Centre(); 00087 return true; 00088 } 00089 00090 00095 EditTextPanels::~EditTextPanels() 00096 { 00099 } 00100 00101 00106 void EditTextPanels::Init() 00107 { 00110 } 00111 00112 00117 void EditTextPanels::CreateControls() 00118 { 00120 EditTextPanels* itemFrame1 = this; 00121 00122 wxPanel* itemPanel2 = new wxPanel( itemFrame1, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); 00123 00124 wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); 00125 itemPanel2->SetSizer(itemBoxSizer3); 00126 00127 wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); 00128 itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00129 00130 wxStaticText* itemStaticText5 = new wxStaticText( itemPanel2, wxID_STATIC, _("Change font"), wxDefaultPosition, wxDefaultSize, 0 ); 00131 itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00132 00133 wxFontPickerCtrl* itemFontPickerCtrl6 = new wxFontPickerCtrl( itemPanel2, ID_FONTCTRL, wxFont(), wxDefaultPosition, wxDefaultSize, wxFNTP_DEFAULT_STYLE|wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL ); 00134 itemBoxSizer4->Add(itemFontPickerCtrl6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); 00135 00136 wxButton* itemButton7 = new wxButton( itemPanel2, ID_CHANGE_VIEW, _("Change View"), wxDefaultPosition, wxDefaultSize, 0 ); 00137 itemBoxSizer3->Add(itemButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); 00138 00140 } 00141 00142 00147 bool EditTextPanels::ShowToolTips() 00148 { 00149 return true; 00150 } 00151 00156 wxBitmap EditTextPanels::GetBitmapResource( const wxString& name ) 00157 { 00158 // Bitmap retrieval 00160 wxUnusedVar(name); 00161 return wxNullBitmap; 00163 } 00164 00169 wxIcon EditTextPanels::GetIconResource( const wxString& name ) 00170 { 00171 // Icon retrieval 00173 wxUnusedVar(name); 00174 return wxNullIcon; 00176 } 00177 00178 00183 void EditTextPanels::OnChangeViewClick( wxCommandEvent& event ) 00184 { 00185 displayParent->EditPanel(this->row,this->col,true); 00186 this->Close(); 00187 } 00188 00189 00194 void EditTextPanels::OnFontctrlFontPickerChanged( wxFontPickerEvent& event ) 00195 { 00196 displayParent->GetPanel(this->row,this->col); 00197 } 00198