diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/cpp/app_templates/wxhello/app.cpp | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/app_templates/wxhello/app.cpp')
-rw-r--r-- | languages/cpp/app_templates/wxhello/app.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/wxhello/app.cpp b/languages/cpp/app_templates/wxhello/app.cpp new file mode 100644 index 00000000..6bcb3d47 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/app.cpp @@ -0,0 +1,52 @@ +#include <wx/wx.h> +#include "%{APPNAMELC}.h" + +BEGIN_EVENT_TABLE( %{APPNAME}Frame, wxFrame ) + EVT_MENU( Menu_File_Quit, %{APPNAME}Frame::OnQuit ) + EVT_MENU( Menu_File_About, %{APPNAME}Frame::OnAbout ) +END_EVENT_TABLE() + +IMPLEMENT_APP(%{APPNAME}app) + + +bool +%{APPNAME}app::OnInit() +{ + %{APPNAME}Frame *frame = new %{APPNAME}Frame( wxT( "Hello World" ), wxPoint(50,50), wxSize(450,340) ); + + frame->Show(TRUE); + SetTopWindow(frame); + return TRUE; +} + +%{APPNAME}Frame::%{APPNAME}Frame( const wxString& title, const wxPoint& pos, const wxSize& size ) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ + wxMenu *menuFile = new wxMenu; + + menuFile->Append( Menu_File_About, wxT( "&About..." ) ); + menuFile->AppendSeparator(); + menuFile->Append( Menu_File_Quit, wxT( "E&xit" ) ); + + wxMenuBar *menuBar = new wxMenuBar; + menuBar->Append( menuFile, wxT( "&File" ) ); + + SetMenuBar( menuBar ); + + CreateStatusBar(); + SetStatusText( wxT( "Welcome to Kdevelop wxWidgets app!" ) ); +} + +void +%{APPNAME}Frame::OnQuit( wxCommandEvent& WXUNUSED( event ) ) +{ + Close(TRUE); +} + +void +%{APPNAME}Frame::OnAbout( wxCommandEvent& WXUNUSED( event ) ) +{ + wxMessageBox( wxT( "This is a wxWidgets Hello world sample" ), + wxT( "About Hello World" ), wxOK | wxICON_INFORMATION, this ); +} + |