]> git.saurik.com Git - wxWidgets.git/commitdiff
1. added test for wxTreeCtrl::Insert(size_t index)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Dec 1999 10:29:26 +0000 (10:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Dec 1999 10:29:26 +0000 (10:29 +0000)
2. temporary test code for wxCalendarCtrl in controls.cpp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp
samples/treectrl/treetest.cpp
samples/treectrl/treetest.h

index 7dab094d533990410576dd727038be693979d653..a29183cd19397579ba242fd941381acdf15d1d9c 100644 (file)
@@ -65,6 +65,8 @@
     #include "wx/spinctrl.h"
 #endif // wxUSE_SPINCTRL
 
+#include "wx/generic/calctrl.h"
+
 //----------------------------------------------------------------------
 // class definitions
 //----------------------------------------------------------------------
@@ -258,7 +260,7 @@ bool MyApp::OnInit()
     frame->Show(TRUE);
     frame->SetCursor(wxCursor(wxCURSOR_HAND));
 
-    //frame->GetPanel()->m_notebook->SetSelection(3);
+    frame->GetPanel()->m_notebook->SetSelection(5);
 
     SetTopWindow(frame);
 
@@ -641,6 +643,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
 
     m_notebook->AddPage(panel, "wxBitmapXXX");
 
+    panel = new wxPanel(m_notebook);
+    (void)new wxCalendarCtrl(panel, -1);
+    m_notebook->AddPage(panel, "wxCalendar");
+
 // --------------- TEST CODE ----------------------
 
   // layout constraints
index 4da9681fc0b5d9edcb04e7941ed529598009a990..a29db54296ad99ce6618fa10ae439332bce9e241 100644 (file)
@@ -85,6 +85,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(TreeTest_CollapseAndReset, MyFrame::OnCollapseAndReset)
     EVT_MENU(TreeTest_EnsureVisible, MyFrame::OnEnsureVisible)
     EVT_MENU(TreeTest_AddItem, MyFrame::OnAddItem)
+    EVT_MENU(TreeTest_InsertItem, MyFrame::OnInsertItem)
     EVT_MENU(TreeTest_IncIndent, MyFrame::OnIncIndent)
     EVT_MENU(TreeTest_DecIndent, MyFrame::OnDecIndent)
     EVT_MENU(TreeTest_IncSpacing, MyFrame::OnIncSpacing)
@@ -153,6 +154,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
     tree_menu->Append(TreeTest_CollapseAndReset, "C&ollapse and reset");
     tree_menu->AppendSeparator();
     tree_menu->Append(TreeTest_AddItem, "Append a &new item");
+    tree_menu->Append(TreeTest_InsertItem, "&Insert a new item");
     tree_menu->Append(TreeTest_Delete, "&Delete this item");
     tree_menu->Append(TreeTest_DeleteChildren, "Delete &children");
     tree_menu->Append(TreeTest_DeleteAll, "Delete &all items");
@@ -284,7 +286,7 @@ void MyFrame::OnCount(wxCommandEvent& WXUNUSED(event))
     CHECK_ITEM( item );
 
     int i = m_treeCtrl->GetChildrenCount( item, FALSE );
-    
+
     wxLogMessage(wxT("%d children"), i);
 }
 
@@ -295,7 +297,7 @@ void MyFrame::OnCountRec(wxCommandEvent& WXUNUSED(event))
     CHECK_ITEM( item );
 
     int i = m_treeCtrl->GetChildrenCount( item );
-    
+
     wxLogMessage(wxT("%d children"), i);
 }
 
@@ -392,6 +394,11 @@ void MyFrame::OnEnsureVisible(wxCommandEvent& event)
     m_treeCtrl->DoEnsureVisible();
 }
 
+void MyFrame::OnInsertItem(wxCommandEvent& WXUNUSED(event))
+{
+    m_treeCtrl->InsertItem(m_treeCtrl->GetRootItem(), 1, "2nd item");
+}
+
 void MyFrame::OnAddItem(wxCommandEvent& WXUNUSED(event))
 {
     static int s_num = 0;
index dc193c2954443ee2c48dc7e69d0f5c3ba806938f..0c0cd5739568b5b76265b694fdd5e7bd1972ab39 100644 (file)
@@ -132,12 +132,13 @@ public:
 
     void OnCount(wxCommandEvent& event);
     void OnCountRec(wxCommandEvent& event);
-    
+
     void OnRename(wxCommandEvent& event);
     void OnSort(wxCommandEvent& event) { DoSort(); }
     void OnSortRev(wxCommandEvent& event) { DoSort(TRUE); }
 
     void OnAddItem(wxCommandEvent& event);
+    void OnInsertItem(wxCommandEvent& event);
 
     void OnIncIndent(wxCommandEvent& event);
     void OnDecIndent(wxCommandEvent& event);
@@ -178,6 +179,7 @@ enum
     TreeTest_CollapseAndReset,
     TreeTest_EnsureVisible,
     TreeTest_AddItem,
+    TreeTest_InsertItem,
     TreeTest_IncIndent,
     TreeTest_DecIndent,
     TreeTest_IncSpacing,