]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/grid/test.cpp
GetItem() doesn't ignore column number any more
[wxWidgets.git] / samples / grid / test.cpp
index 013983c366275b82ca627a3170a9810d2bdb4f15..7662b5b09c2993c7d8c897804afc875f408ea50b 100644 (file)
@@ -40,8 +40,6 @@ class MyFrame: public wxFrame
     wxGrid *grid;
     MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
 
-    bool OnClose(void) { return TRUE; }
-
     void ToggleEditable(wxCommandEvent& event);
     void ToggleRowLabel(wxCommandEvent& event);
     void ToggleColLabel(wxCommandEvent& event);
@@ -62,8 +60,8 @@ class MyFrame: public wxFrame
 DECLARE_EVENT_TABLE()
 };
 
-wxBitmap *cellBitmap1 = NULL;
-wxBitmap *cellBitmap2 = NULL;
+wxBitmap *cellBitmap1 = (wxBitmap *) NULL;
+wxBitmap *cellBitmap2 = (wxBitmap *) NULL;
 
 // ID for the menu quit command
 #define GRID_QUIT 1
@@ -94,15 +92,12 @@ bool MyApp::OnInit(void)
 #endif
 
   // Create the main frame window
-  MyFrame *frame = new MyFrame(NULL, "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
+  MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
   
   // Give it an icon
 #ifdef __WXMSW__
   frame->SetIcon(wxIcon("mondrian"));
 #endif
-#ifdef __X__
-  frame->SetIcon(wxIcon("aiai.xbm"));
-#endif
 
   // Make a menubar
   wxMenu *file_menu = new wxMenu;
@@ -140,7 +135,7 @@ bool MyApp::OnInit(void)
   frame->grid->SetCellValue("First cell", 0, 0);
   frame->grid->SetCellValue("Another cell", 1, 1);
   frame->grid->SetCellValue("Yet another cell", 2, 2);
-  frame->grid->SetCellTextFont(wxTheFontList->FindOrCreateFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
+  frame->grid->SetCellTextFont(wxTheFontList->FindOrCreateFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
   frame->grid->SetCellTextColour(*wxRED, 1, 1);
   frame->grid->SetCellBackgroundColour(*wxCYAN, 2, 2);
   if (cellBitmap1 && cellBitmap2)
@@ -164,7 +159,7 @@ bool MyApp::OnInit(void)
 MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
   wxFrame(frame, -1, title, pos, size)
 {
-  grid = NULL;
+  grid = (wxGenericGrid *) NULL;
 }
 
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
@@ -184,13 +179,13 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
   EVT_MENU(GRID_QUIT, MyFrame::Quit)
 END_EVENT_TABLE()
 
-void MyFrame::ToggleEditable(wxCommandEvent& event)
+void MyFrame::ToggleEditable(wxCommandEvent& WXUNUSED(event))
 {
       grid->SetEditable(!grid->GetEditable());
       grid->Refresh();
 }
 
-void MyFrame::ToggleRowLabel(wxCommandEvent& event)
+void MyFrame::ToggleRowLabel(wxCommandEvent& WXUNUSED(event))
 {
       if (grid->GetLabelSize(wxVERTICAL) > 0)
         grid->SetLabelSize(wxVERTICAL, 0);
@@ -199,7 +194,7 @@ void MyFrame::ToggleRowLabel(wxCommandEvent& event)
       grid->Refresh();
 }
 
-void MyFrame::ToggleColLabel(wxCommandEvent& event)
+void MyFrame::ToggleColLabel(wxCommandEvent& WXUNUSED(event))
 {
       if (grid->GetLabelSize(wxHORIZONTAL) > 0)
         grid->SetLabelSize(wxHORIZONTAL, 0);
@@ -208,34 +203,34 @@ void MyFrame::ToggleColLabel(wxCommandEvent& event)
       grid->Refresh();
 }
 
-void MyFrame::ToggleDividers(wxCommandEvent& event)
+void MyFrame::ToggleDividers(wxCommandEvent& WXUNUSED(event))
 {
-      if (!grid->GetDividerPen())
-        grid->SetDividerPen(wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID));
+      if (!grid->GetDividerPen().Ok())
+        grid->SetDividerPen(wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID));
       else
-        grid->SetDividerPen(NULL);
+        grid->SetDividerPen(wxNullPen);
       grid->Refresh();
 }
 
-void MyFrame::LeftCell(wxCommandEvent& event)
+void MyFrame::LeftCell(wxCommandEvent& WXUNUSED(event))
 {
       grid->SetCellAlignment(wxLEFT);
       grid->Refresh();
 }
 
-void MyFrame::CentreCell(wxCommandEvent& event)
+void MyFrame::CentreCell(wxCommandEvent& WXUNUSED(event))
 {
       grid->SetCellAlignment(wxCENTRE);
       grid->Refresh();
 }
 
-void MyFrame::RightCell(wxCommandEvent& event)
+void MyFrame::RightCell(wxCommandEvent& WXUNUSED(event))
 {
       grid->SetCellAlignment(wxRIGHT);
       grid->Refresh();
 }
 
-void MyFrame::ColourLabelBackground(wxCommandEvent& event)
+void MyFrame::ColourLabelBackground(wxCommandEvent& WXUNUSED(event))
 {
       wxColourData data;
       data.SetChooseFull(TRUE);
@@ -249,7 +244,7 @@ void MyFrame::ColourLabelBackground(wxCommandEvent& event)
       }
 }
 
-void MyFrame::ColourLabelText(wxCommandEvent& event)
+void MyFrame::ColourLabelText(wxCommandEvent& WXUNUSED(event))
 {
       wxColourData data;
       data.SetChooseFull(TRUE);
@@ -263,14 +258,14 @@ void MyFrame::ColourLabelText(wxCommandEvent& event)
       }
 }
 
-void MyFrame::NormalLabelColouring(wxCommandEvent& event)
+void MyFrame::NormalLabelColouring(wxCommandEvent& WXUNUSED(event))
 {
       grid->SetLabelBackgroundColour(*wxLIGHT_GREY);
       grid->SetLabelTextColour(*wxBLACK);
       grid->Refresh();
 }
 
-void MyFrame::ColourCellBackground(wxCommandEvent& event)
+void MyFrame::ColourCellBackground(wxCommandEvent& WXUNUSED(event))
 {
       wxColourData data;
       data.SetChooseFull(TRUE);
@@ -284,7 +279,7 @@ void MyFrame::ColourCellBackground(wxCommandEvent& event)
       }
 }
 
-void MyFrame::ColourCellText(wxCommandEvent& event)
+void MyFrame::ColourCellText(wxCommandEvent& WXUNUSED(event))
 {
       wxColourData data;
       data.SetChooseFull(TRUE);
@@ -298,14 +293,14 @@ void MyFrame::ColourCellText(wxCommandEvent& event)
       }
 }
 
-void MyFrame::NormalCellColouring(wxCommandEvent& event)
+void MyFrame::NormalCellColouring(wxCommandEvent& WXUNUSED(event))
 {
       grid->SetCellBackgroundColour(*wxWHITE);
       grid->SetCellTextColour(*wxBLACK);
       grid->Refresh();
 }
 
-void MyFrame::Quit(wxCommandEvent& event)
+void MyFrame::Quit(wxCommandEvent& WXUNUSED(event))
 {
       this->Close(TRUE);
 }