]> git.saurik.com Git - wxWidgets.git/commitdiff
reverted the last 2 changes to this file, the border stuff has nothing to do with...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 2 Mar 2008 23:21:36 +0000 (23:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 2 Mar 2008 23:21:36 +0000 (23:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/toolbar/toolbar.cpp

index 98cf74b127f2553eca0844e7408779595ba6d9d7..687dab791ba495317239c4cf06ce00bb1f99e7e9 100644 (file)
@@ -84,57 +84,6 @@ enum Positions
 // classes
 // ----------------------------------------------------------------------------
 
-class MyMiniControl: public wxControl
-{
-public:
-    MyMiniControl( wxWindow *parent ) :
-      wxControl( parent, -1, wxDefaultPosition, wxSize(80,22), wxBORDER_SUNKEN, wxDefaultValidator, "MyMiniControl" )
-    {
-        m_hasFocus = false;
-    }
-    void OnPaint(wxPaintEvent &WXUNUSED(event))
-    {
-       wxPaintDC dc(this);
-       dc.SetPen( *wxTRANSPARENT_PEN );
-       dc.SetBrush( *wxWHITE_BRUSH );
-       wxSize size = GetClientSize();
-       dc.DrawRectangle( 0,0,size.x,size.y );
-       if (m_hasFocus)
-          dc.DrawText( "Focussed", 1,1 );
-    }
-    void OnSetFocus(wxFocusEvent &WXUNUSED(event))
-    {
-       m_hasFocus = true;
-       Refresh();
-    }
-    void OnKillFocus(wxFocusEvent &WXUNUSED(event))
-    {
-       m_hasFocus = false;
-       Refresh();
-    }
-    virtual wxSize GetBestSize()
-    {
-        return wxSize(80,22);
-    }
-    virtual bool AcceptsFocus()
-    {
-        return true;
-    }
-    
-    bool m_hasFocus;
-
-private:
-    DECLARE_EVENT_TABLE()
-};
-
-BEGIN_EVENT_TABLE(MyMiniControl, wxControl)
-    EVT_PAINT(MyMiniControl::OnPaint)
-    EVT_SET_FOCUS(MyMiniControl::OnSetFocus)
-    EVT_KILL_FOCUS(MyMiniControl::OnKillFocus)
-END_EVENT_TABLE()
-
-
-
 // Define a new application
 class MyApp : public wxApp
 {
@@ -339,7 +288,7 @@ bool MyApp::OnInit()
     // Create the main frame window
     MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY,
                                  _T("wxToolBar Sample"),
-                                  wxPoint(100, 100), wxSize(550, 500));
+                                  wxPoint(100, 100), wxSize(550, 300));
 
     frame->Show(true);
 
@@ -489,8 +438,6 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar)
 
         wxSearchCtrl *srch = new wxSearchCtrl( toolBar, -1, wxT("xx"), wxDefaultPosition, wxSize(80,wxDefaultCoord), wxSUNKEN_BORDER );
         toolBar->AddControl( srch );
-        
-        toolBar->AddControl( new MyMiniControl( toolBar) );
     }
 #endif // toolbars which don't support controls
 
@@ -677,25 +624,7 @@ MyFrame::MyFrame(wxFrame* parent,
     m_panel->SetSizer(sizer);
     if (m_extraToolBar)
         sizer->Add(m_extraToolBar, 0, wxEXPAND, 0);
-    sizer->Add(0,0,6);
     sizer->Add(m_textWindow, 1, wxEXPAND, 0);
-
-    wxControl *control;    
-    control = new wxControl( m_panel, -1, wxPoint(30,20), wxSize(50,50), wxBORDER_SUNKEN );
-    control = new wxControl( m_panel, -1, wxPoint(130,20), wxSize(50,50), wxBORDER_SIMPLE );
-    control = new wxControl( m_panel, -1, wxPoint(230,20), wxSize(50,50), wxBORDER_RAISED );
-    control = new wxControl( m_panel, -1, wxPoint(330,20), wxSize(50,50), wxBORDER_THEME );
-    
-    wxScrolledWindow *scrolled;
-    scrolled = new wxScrolledWindow( m_panel, -1, wxPoint(30,120), wxSize(80,80), wxHSCROLL|wxVSCROLL | wxBORDER_SUNKEN );
-    scrolled->SetVirtualSize(400,400);
-    scrolled->SetScrollRate(10,10);
-    scrolled = new wxScrolledWindow( m_panel, -1, wxPoint(130,120), wxSize(80,80), wxHSCROLL|wxVSCROLL | wxBORDER_SIMPLE );
-    scrolled->SetVirtualSize(400,400);
-    scrolled->SetScrollRate(10,10);
-    scrolled = new wxScrolledWindow( m_panel, -1, wxPoint(230,120), wxSize(80,80), wxHSCROLL|wxVSCROLL | wxBORDER_RAISED );
-    scrolled->SetVirtualSize(400,400);
-    scrolled->SetScrollRate(10,10);
 }
 
 void MyFrame::LayoutChildren()