Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "test.h"
  2.  
  3. IMPLEMENT_APP(TestApp)
  4.  
  5. bool TestApp::OnInit()
  6. {
  7.     TestDialog *win=new TestDialog(NULL,wxID_ANY,wxT("Hello World!"),wxDefaultPosition,wxSize(236,88));
  8.     win->Show(true);
  9.     SetTopWindow(win);
  10.     return true;
  11. }
  12.  
  13. TestDialog::TestDialog(wxWindow *parent,wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style,const wxString& name) : wxDialog(parent,id,title,pos,size,style,name)
  14. {
  15.     HelloWorld=new wxButton(this,HelloWorld_ID,wxT("Zmień tekst!"),wxPoint(10,10),wxSize(100,40));
  16.     CloseWindow=new wxButton(this,CloseWindow_ID,wxT("Zamknij okno!"),wxPoint(120,10),wxSize(100,40));
  17. }
  18.  
  19. void TestDialog::HelloWorld_Click(wxCommandEvent &event)
  20. {
  21.     HelloWorld->SetLabel(wxT("Tekst zmieniony!"));
  22. }
  23.  
  24. void TestDialog::CloseWindow_Click(wxCommandEvent &event)
  25. {
  26.     wxMessageBox(wxT("Zamykam okno..."),wxT("Hello World!"));
  27.     Close(true);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement