]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/checklst/checklst.cpp
stub out wxRegion ctor not implemented in wxMGL and wxDFB to at least fix compilation
[wxWidgets.git] / samples / checklst / checklst.cpp
index ed5f70f12761f4c5973ce7427c099f87644cd050..a6e13a446725a5d0df3a942141f29e9cf42ccce6 100644 (file)
@@ -66,7 +66,6 @@ public:
     void OnAppendItems(wxCommandEvent& event);
     void OnRemoveItems(wxCommandEvent& event);
 
-    void OnGetItemHeight(wxCommandEvent& event);
     void OnGetBestSize(wxCommandEvent& event);
 
     void OnMakeItemFirst(wxCommandEvent& event);
@@ -108,7 +107,6 @@ enum
     Menu_InsertItemsEnd,
     Menu_AppendItems,
     Menu_RemoveItems,
-    Menu_GetItemHeight,
     Menu_GetBestSize,
     Menu_MakeItemFirst,
 
@@ -129,14 +127,13 @@ BEGIN_EVENT_TABLE(CheckListBoxFrame, wxFrame)
     EVT_MENU(Menu_Selection, CheckListBoxFrame::OnToggleSelection)
     EVT_MENU(Menu_Extended, CheckListBoxFrame::OnToggleExtended)
     EVT_MENU(Menu_Sorting, CheckListBoxFrame::OnToggleSorting)
-    
+
     EVT_MENU(Menu_InsertItemsStart, CheckListBoxFrame::OnInsertItemsStart)
     EVT_MENU(Menu_InsertItemsMiddle, CheckListBoxFrame::OnInsertItemsMiddle)
     EVT_MENU(Menu_InsertItemsEnd, CheckListBoxFrame::OnInsertItemsEnd)
     EVT_MENU(Menu_AppendItems, CheckListBoxFrame::OnAppendItems)
     EVT_MENU(Menu_RemoveItems, CheckListBoxFrame::OnRemoveItems)
 
-    EVT_MENU(Menu_GetItemHeight, CheckListBoxFrame::OnGetItemHeight)
     EVT_MENU(Menu_GetBestSize, CheckListBoxFrame::OnGetBestSize)
 
     EVT_MENU(Menu_MakeItemFirst, CheckListBoxFrame::OnMakeItemFirst)
@@ -149,7 +146,7 @@ BEGIN_EVENT_TABLE(CheckListBoxFrame, wxFrame)
     EVT_BUTTON(Btn_Down, CheckListBoxFrame::OnButtonDown)
 END_EVENT_TABLE()
 
-IMPLEMENT_APP(CheckListBoxApp);
+IMPLEMENT_APP(CheckListBoxApp)
 
 // init our app: create windows
 bool CheckListBoxApp::OnInit(void)
@@ -201,7 +198,6 @@ CheckListBoxFrame::CheckListBoxFrame(wxFrame *frame,
     menuList->AppendCheckItem(Menu_Extended, _T("Extended selection"));
     menuList->AppendCheckItem(Menu_Sorting, _T("Sorting"));
     menuList->AppendSeparator();
-    menuList->Append(Menu_GetItemHeight, _T("Get the height of an item"));
     menuList->Append(Menu_GetBestSize, _T("Get the best size of the checklistbox control"));
     menuList->AppendSeparator();
     menuList->Append(Menu_MakeItemFirst, _T("Make selected item the first item"));
@@ -273,8 +269,6 @@ void CheckListBoxFrame::CreateCheckListbox(long flags)
          flags
         );
 
-    //m_pListBox->SetBackgroundColour(*wxGREEN);
-
     delete [] astrChoices;
 
     // set grey background for every second entry
@@ -367,16 +361,6 @@ void CheckListBoxFrame::OnRemoveItems(wxCommandEvent& WXUNUSED(event))
         m_pListBox->Delete(0);
 }
 
-void CheckListBoxFrame::OnGetItemHeight(wxCommandEvent& WXUNUSED(event))
-{
-    int height = m_pListBox->GetItemHeight();
-
-    wxMessageBox(wxString::Format(wxT("Height of an item is:%i"),
-                                  height
-                                 )
-                );
-}
-
 void CheckListBoxFrame::OnGetBestSize(wxCommandEvent& WXUNUSED(event))
 {
     wxSize bestSize = m_pListBox->GetBestSize();
@@ -420,7 +404,7 @@ void CheckListBoxFrame::OnToggleExtended(wxCommandEvent& event)
 
     sizer->Insert(0, m_pListBox, 1, wxGROW | wxALL, 10);
 
-    m_panel->Layout();    
+    m_panel->Layout();
 }
 
 void CheckListBoxFrame::OnToggleSorting(wxCommandEvent& event)
@@ -434,7 +418,7 @@ void CheckListBoxFrame::OnToggleSorting(wxCommandEvent& event)
 
     sizer->Insert(0, m_pListBox, 1, wxGROW | wxALL, 10);
 
-    m_panel->Layout();    
+    m_panel->Layout();
 }
 
 void CheckListBoxFrame::OnListboxSelect(wxCommandEvent& event)
@@ -513,7 +497,7 @@ void CheckListBoxFrame::OnButtonMove(bool up)
         wxString label = m_pListBox->GetString(selection);
 
         int positionNew = up ? selection - 1 : selection + 2;
-        if ( positionNew < 0 || positionNew > m_pListBox->GetCount() )
+        if ( positionNew < 0 || positionNew > (int)m_pListBox->GetCount() )
         {
             wxLogStatus(this, wxT("Can't move this item %s"), up ? wxT("up") : wxT("down"));
         }