]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/textctrl.cpp
stop usign a deprecated method, and ensure that the imagelist
[wxWidgets.git] / samples / widgets / textctrl.cpp
index a32a3e51c2c1bf6dca9f2d9ad6b7fb28b037e902..6c52e648257e1e81839cb860565b47ac6cbfebad 100644 (file)
@@ -29,6 +29,7 @@
     #include "wx/log.h"
     #include "wx/timer.h"
 
+    #include "wx/bitmap.h"
     #include "wx/button.h"
     #include "wx/checkbox.h"
     #include "wx/radiobox.h"
@@ -41,7 +42,6 @@
 
 #include "widgets.h"
 
-#if 1
 #include "icons/text.xpm"
 
 // ----------------------------------------------------------------------------
@@ -543,7 +543,7 @@ void TextWidgetsPage::CreateText()
     {
         valueOld = m_text->GetValue();
 
-        m_sizerText->Remove(m_text);
+        m_sizerText->Detach( m_text );
         delete m_text;
     }
     else
@@ -555,8 +555,10 @@ void TextWidgetsPage::CreateText()
                             valueOld,
                             wxDefaultPosition, wxDefaultSize,
                             flags);
+
+    // cast to int needed to silence gcc warning about different enums
     m_sizerText->Add(m_text, 1, wxALL |
-                     (flags & wxTE_MULTILINE ? wxGROW
+                     (flags & wxTE_MULTILINE ? (int)wxGROW
                                              : wxALIGN_TOP), 5);
     m_sizerText->Layout();
 }
@@ -700,7 +702,8 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event))
         {
             long elapsed = sw.Time();
             wxLogMessage(_T("Loaded file '%s' in %lu.%us"),
-                         filename.c_str(), elapsed / 1000, elapsed % 1000);
+                         filename.c_str(), elapsed / 1000,
+                         (unsigned int) elapsed % 1000);
         }
     }
 }
@@ -756,4 +759,4 @@ void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
 {
     CreateText();
 }
-#endif
+