]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/ownerdrw/ownerdrw.cpp
added workaround for GTK+ focus_out bug (and removed Vaclav's mouse capture stack...
[wxWidgets.git] / samples / ownerdrw / ownerdrw.cpp
index 27815e5424df76b54c1824d561a30d4bdcde0ffc..4488631127c8328271ca4d61a2a98a520f452bb6 100644 (file)
@@ -175,6 +175,12 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int
   // create the menu
   InitMenu();
 
+  // create the status line
+  const int widths[] = { -1, 60 };
+  CreateStatusBar(2);
+  SetStatusWidths(2, widths);
+  SetStatusText("no selection", 0);
+
   // make a panel with some controls
   wxPanel *pPanel = new wxPanel(this, -1, wxPoint(0, 0), 
                                 wxSize(400, 200), wxTAB_TRAVERSAL);
@@ -243,12 +249,6 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int
 
   delete[] astrChoices;
 
-  // create the status line
-  const int widths[] = { -1, 60 };
-  CreateStatusBar(2);
-  SetStatusWidths(2, widths);
-  SetStatusText("no selection", 0);
-
   Show(TRUE);
 }
 
@@ -263,7 +263,8 @@ void OwnerDrawnFrame::OnQuit(wxCommandEvent& event)
 
 void OwnerDrawnFrame::OnAbout(wxCommandEvent& event)
 {
-  wxMessageDialog dialog(this, "Demo of owner-drawn controls\n"
+  wxMessageDialog dialog(this,
+                         "Demo of owner-drawn controls\n",
                          "About wxOwnerDrawn", wxYES_NO | wxCANCEL);
   dialog.ShowModal();
 }
@@ -272,15 +273,16 @@ void OwnerDrawnFrame::OnListboxSelect(wxCommandEvent& event)
 {
   wxString strSelection;
   unsigned int nSel = event.GetSelection();
-  strSelection.sprintf("item %d selected (%schecked)", nSel,
-                       m_pListBox->IsChecked(nSel) ? "" : "not ");
+  strSelection.sprintf(wxT("item %d selected (%schecked)"), nSel,
+                       m_pListBox->IsChecked(nSel) ? wxT("") : wxT("not "));
   SetStatusText(strSelection);
 }
 
 void OwnerDrawnFrame::OnListboxDblClick(wxCommandEvent& event)
 {
   wxString strSelection;
-  strSelection.sprintf("item %d double clicked", m_pListBox->GetSelection());
+  strSelection.sprintf(wxT("item %d double clicked"),
+                       m_pListBox->GetSelection());
   wxMessageDialog dialog(this, strSelection);
   dialog.ShowModal();
 }
@@ -289,7 +291,7 @@ void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event)
 {
   wxString strSelection;
   unsigned int nItem = event.GetInt();
-  strSelection.sprintf("item %d was %schecked", nItem,
-                       m_pListBox->IsChecked(nItem) ? "" : "un");
+  strSelection.sprintf(wxT("item %d was %schecked"), nItem,
+                       m_pListBox->IsChecked(nItem) ? wxT("") : wxT("un"));
   SetStatusText(strSelection);
-}
\ No newline at end of file
+}