| CODE |
| //////////////////////////////////////////////////////////////////////////////// // main.cpp // // // // ties all files togethor & contains program entry-point // //////////////////////////////////////////////////////////////////////////////// #include "wx/wx.h" // wxWindows header file // class TextEditorApp // ~ app class for text editor applicarion class TextEditorApp : public wxApp { virtual bool OnInit(); }; // class MainWindow // ~ the program's parent window class MainWindow : public wxFrame { MainWindow(const wxString & title, const wxPoint & pos, const wxSize & size); void EventClose(wxCommandEvent & event); DECLARE_EVENT_TABLE() }; // enum // ~ command identifiers enum { ID_EXIT = 1, }; // define the event table BEGIN_EVENT_TABLE(MainWindow, wxFrame) EVT_MENU(ID_EXIT, MainWindow::EventClose) END_EVENT_TABLE() // dynamically construct TextEditorApp IMPLEMENT_APP(TextEditorApp) // TextEditorApp::OnInit // ~ handle initialization, create window, ect bool TextEditorApp::OnInit() { wxMessageBox("hello", "", wxOK, NULL, -1, -1); return true; } // MainWindow::MainWindow // ~ MainWindow's constructor MainWindow::MainWindow(const wxString & title, const wxPoint & pos, const wxSize & size) :wxFrame((wxFrame*)NULL, -1, title, pos, size) { wxMenu * MenuFile = new wxMenu; MenuFile->Append(ID_EXIT, "E&xit"); wxMenuBar * MenuBar = new wxMenuBar; MenuBar->Append(MenuFile, "&File"); SetMenuBar(MenuBar); } // MainWindow::EventClose // ~ close the window void MainWindow::EventClose(wxCommandEvent & WXUNUSED(event)) { Close(true); } |
| QUOTE |
| Deleting intermediate files and output files for project 'textedit - Debug' --------------------Configuration: textedit - Debug-------------------- Compiling source file(s)... main.cpp In file included from C:\MinGWStudio\Include\wx\wx.h:15, from main.cpp:7: C:\MinGWStudio\Include\wx\defs.h:179: error: redeclaration of C++ built-in type `bool' In file included from C:\MinGWStudio\Include\wx\memory.h:20, from C:\MinGWStudio\Include\wx\object.h:25, from C:\MinGWStudio\Include\wx\wx.h:16, from main.cpp:7: C:\MinGWStudio\Include\wx\string.h:160:4: #error "Please define string case-insensitive compare for your OS\compiler" In file included from C:\MinGWStudio\Include\wx\memory.h:20, from C:\MinGWStudio\Include\wx\object.h:25, from C:\MinGWStudio\Include\wx\wx.h:16, from main.cpp:7: C:\MinGWStudio\Include\wx\string.h: In function `int Stricmp(const char*, const char*)': C:\MinGWStudio\Include\wx\string.h:162: warning: no return statement in function returning non-void textedit.exe - 2 error(s), 1 warning(s) |
| QUOTE |
| --------------------Configuration: textedit - Debug-------------------- Compiling source file(s)... main.cpp Linking... textedit.exe - 0 error(s), 0 warning(s) |