Guest User

Untitled

a guest
Apr 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include "wx/wx.h"
  2.  
  3. class MyApp: public wxApp
  4. {
  5. virtual bool OnInit();
  6. };
  7.  
  8. class MyFrame: public wxFrame
  9. {
  10. public:
  11. MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
  12.  
  13. wxButton *howMuchButton;
  14. void justHowMuch(wxCommandEvent& event);
  15.  
  16. DECLARE_EVENT_TABLE()
  17.  
  18. };
  19.  
  20.  
  21. enum
  22. {
  23. BUTTON_Hello = wxID_HIGHEST + 1
  24. };
  25.  
  26. BEGIN_EVENT_TABLE(MyFrame, wxFrame)
  27. EVT_BUTTON ( BUTTON_Hello, MyFrame::justHowMuch)
  28. END_EVENT_TABLE()
  29.  
  30. IMPLEMENT_APP(MyApp)
  31.  
  32. bool MyApp::OnInit()
  33. {
  34. MyFrame *frame = new MyFrame(_T("How much I hate papers"), wxPoint(50, 50), wxSize(450, 340) );
  35. frame->Show(true);
  36. SetTopWindow(frame);
  37. return true;
  38. }
  39.  
  40. void MyFrame::justHowMuch (wxCommandEvent& event)
  41. {
  42. wxMessageBox( wxT("SOOO MUCH") );
  43. }
  44.  
  45. MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
  46. : wxFrame( NULL, -1, title, pos, size )
  47. {
  48. wxPanel *panel = new wxPanel(this, wxID_ANY);
  49. howMuchButton = new wxButton(panel, BUTTON_Hello, _T("How much?"), wxPoint(50, 50), wxDefaultSize, 0);
  50. }
Add Comment
Please, Sign In to add comment