--- wxCpuThrottle/src/wxcputhrottle.cpp 2007/08/08 19:04:07 19 +++ wxCpuThrottle/src/wxcputhrottle.cpp 2007/08/08 21:00:34 20 @@ -1,52 +1,23 @@ #include #include "wxcputhrottle.h" -BEGIN_EVENT_TABLE( wxCpuThrottleFrame, wxFrame ) - EVT_MENU( Menu_File_Quit, wxCpuThrottleFrame::OnQuit ) - EVT_MENU( Menu_File_About, wxCpuThrottleFrame::OnAbout ) -END_EVENT_TABLE() +#include "wxcputhrottleframe.h" IMPLEMENT_APP(wxCpuThrottleapp) -bool -wxCpuThrottleapp::OnInit() +bool wxCpuThrottleapp::OnInit() { wxCpuThrottleFrame *frame = new wxCpuThrottleFrame( wxT( "Hello World" ), wxPoint(50,50), wxSize(450,340) ); - frame->Show(TRUE); + frame->Show(false); SetTopWindow(frame); + + return TRUE; } -wxCpuThrottleFrame::wxCpuThrottleFrame( 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 -wxCpuThrottleFrame::OnQuit( wxCommandEvent& WXUNUSED( event ) ) -{ - Close(TRUE); -} -void -wxCpuThrottleFrame::OnAbout( wxCommandEvent& WXUNUSED( event ) ) -{ - wxMessageBox( wxT( "This is a wxWidgets Hello world sample" ), - wxT( "About Hello World" ), wxOK | wxICON_INFORMATION, this ); -} +