X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3e2dd3db30d58838809be5419ca1e5d014e14fc2..0dfef5a8124ac0f1bb2aed6ef5ddfa833e8e2c6e:/samples/controls/controls.cpp diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 81e65a023a..8fc5a7ca9f 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -105,7 +105,7 @@ public: #endif // wxUSE_SPINBTN #if wxUSE_SPINCTRL - void OnSpinCtrl(wxCommandEvent& event); + void OnSpinCtrl(wxSpinEvent& event); #endif // wxUSE_SPINCTRL void OnEnableAll(wxCommandEvent& event); @@ -393,7 +393,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_text = new wxTextCtrl(this, -1, "This is the log window.\n", wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE); - // m_text->SetBackgroundColour("wheat"); + m_text->SetBackgroundColour("wheat"); wxLog::AddTraceMask(_T("focus")); m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text)); @@ -632,11 +632,14 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) (void)new wxBitmapButton(panel, -1, bitmap, wxPoint(100, 20)); -#if 0 +#ifdef __WXMSW__ // test for masked bitmap display bitmap = wxBitmap("test2.bmp", wxBITMAP_TYPE_BMP); - bitmap.SetMask(new wxMask(bitmap, *wxBLUE)); - (void)new wxBitmapButton(panel, -1, bitmap, wxPoint(300, 120)); + if (bitmap.Ok()) + { + bitmap.SetMask(new wxMask(bitmap, *wxBLUE)); + (void)new wxStaticBitmap /* wxBitmapButton */ (panel, -1, bitmap, wxPoint(300, 120)); + } #endif wxBitmap bmp1(wxTheApp->GetStdIcon(wxICON_INFORMATION)), @@ -655,6 +658,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_label = new wxStaticText(panel, -1, "Label with some long text", wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT | wxST_NO_AUTORESIZE); + m_label->SetForegroundColour( *wxBLUE ); m_notebook->AddPage(panel, "wxBitmapXXX"); @@ -750,13 +754,13 @@ void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event)) SetBackgroundColour(s_colOld); s_colOld = wxNullColour; - m_lbSelectThis->SetForegroundColour("yellow"); - m_lbSelectThis->SetBackgroundColour("blue"); + m_lbSelectThis->SetForegroundColour("red"); + m_lbSelectThis->SetBackgroundColour("white"); } else { - s_colOld = GetBackgroundColour(); - SetBackgroundColour("green"); + s_colOld = wxColour("red"); + SetBackgroundColour("white"); m_lbSelectThis->SetForegroundColour("white"); m_lbSelectThis->SetBackgroundColour("red"); @@ -1065,7 +1069,7 @@ void MyPanel::OnSliderUpdate( wxCommandEvent &WXUNUSED(event) ) #if wxUSE_SPINCTRL -void MyPanel::OnSpinCtrl(wxCommandEvent& event) +void MyPanel::OnSpinCtrl(wxSpinEvent& event) { wxString s; s.Printf(_T("Spin ctrl changed: now %d (from event: %d)\n"),