01: #include <wx/wx.h> 02: 03: /** 04: A frame that contains a text control. 05: */ 06: class TextFrame : public wxFrame 07: { 08: public: 09: /** 10: Constructs the text control. 11: */ 12: TextFrame(); 13: private: 14: wxTextCtrl* text; 15: }; 16: 17: /** 18: An application that shows a frame with a text control. 19: */ 20: class TextApp : public wxApp 21: { 22: public: 23: /** 24: Constructs the frame. 25: */ 26: TextApp(); 27: /** 28: Shows the frame. 29: @return true 30: */ 31: virtual bool OnInit(); 32: private: 33: TextFrame* frame; 34: }; 35: 36: DECLARE_APP(TextApp) 37: 38: IMPLEMENT_APP(TextApp) 39: 40: TextFrame::TextFrame() 41: : wxFrame(NULL, -1, "TextFrame") 42: { 43: text = new wxTextCtrl(this, -1, "Type some text here!", 44: wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); 45: } 46: 47: TextApp::TextApp() 48: { 49: frame = new TextFrame(); 50: } 51: 52: bool TextApp::OnInit() 53: { 54: frame->Show(true); 55: return true; 56: }