]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dataview/dataview.cpp
Add a unit test for wxAffineMatrix2D class and its support in wxDC.
[wxWidgets.git] / samples / dataview / dataview.cpp
index 8556ca8e28b5c72e90f0ba67032550ca20c27cb4..b9d424622aed188f16748bc7dfa0589692cb23be 100644 (file)
@@ -119,7 +119,6 @@ private:
 
     void OnContextMenu( wxDataViewEvent &event );
 
-    void OnRightClick( wxMouseEvent &event );
     void OnGoto( wxCommandEvent &event);
     void OnAddMany( wxCommandEvent &event);
     void OnHideAttributes( wxCommandEvent &event);
@@ -190,7 +189,7 @@ public:
         return true;
     }
 
-    virtual bool Activate( wxRect WXUNUSED(cell),
+    virtual bool Activate( const wxRect& WXUNUSED(cell),
                            wxDataViewModel *WXUNUSED(model),
                            const wxDataViewItem &WXUNUSED(item),
                            unsigned int WXUNUSED(col) )
@@ -199,7 +198,8 @@ public:
         return false;
     }
 
-    virtual bool LeftClick( wxPoint cursor, wxRect WXUNUSED(cell),
+    virtual bool LeftClick(const wxPoint& cursor,
+                           const wxRect& WXUNUSED(cell),
                            wxDataViewModel *WXUNUSED(model),
                            const wxDataViewItem &WXUNUSED(item),
                            unsigned int WXUNUSED(col) )
@@ -243,7 +243,6 @@ bool MyApp::OnInit()
 
     MyFrame *frame =
         new MyFrame(NULL, "wxDataViewCtrl sample", 40, 40, 1000, 540);
-    SetTopWindow(frame);
 
     frame->Show(true);
     return true;
@@ -359,8 +358,6 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_DATAVIEW_ITEM_DROP( ID_MUSIC_CTRL, MyFrame::OnDrop )
 #endif // wxUSE_DRAG_AND_DROP
 
-    EVT_RIGHT_UP(MyFrame::OnRightClick)
-
     EVT_DATAVIEW_COLUMN_HEADER_CLICK(ID_ATTR_CTRL, MyFrame::OnAttrHeaderClick)
 
 END_EVENT_TABLE()
@@ -656,6 +653,10 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l
                                         wxDefaultSize, style );
             m_ctrl[2] = lc;
 
+            MyListStoreDerivedModel* page2_model = new MyListStoreDerivedModel();
+            lc->AssociateModel(page2_model);
+            page2_model->DecRef();
+
             lc->AppendToggleColumn( "Toggle" );
             lc->AppendTextColumn( "Text" );
             lc->AppendProgressColumn( "Progress" );
@@ -1089,12 +1090,6 @@ void MyFrame::OnSorted( wxDataViewEvent &event )
     wxLogMessage( "wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, Column position: %d", pos );
 }
 
-void MyFrame::OnRightClick( wxMouseEvent &event )
-{
-    wxLogMessage( "wxEVT_MOUSE_RIGHT_UP, Click Point is X: %d, Y: %d",
-                 event.GetX(), event.GetY() );
-}
-
 void MyFrame::OnDataViewChar(wxKeyEvent& event)
 {
     if ( event.GetKeyCode() == WXK_DELETE )