]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/controls/controls.cpp
Added more makefiles; fixed some samples for Cygwin
[wxWidgets.git] / samples / controls / controls.cpp
index f9b2a7b63025b3f118b9ebbe3e1f0421af7b96e3..da243509affa4d01a9866fed8de629686e39f4d3 100644 (file)
@@ -363,7 +363,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
   {
     Image_List, Image_Choice, Image_Combo, Image_Text, Image_Radio, Image_Gauge, Image_Max
   };
-  wxImageList *imagelist = new wxImageList(32, 32, FALSE, Image_Max);
+  wxImageList *imagelist = new wxImageList(16, 16, FALSE, Image_Max);
 
   static const char *s_iconNames[Image_Max] =
   {
@@ -443,15 +443,20 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
   m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
 
   panel = new wxPanel(m_notebook);
-  m_textentry = new MyTextCtrl( panel, -1, "Write text here.", wxPoint(10,10), wxSize(320,28),
-                                0);//wxTE_PROCESS_ENTER);
-  (*m_textentry) << " More text.";          // this text is appended
+  m_textentry = new MyTextCtrl( panel, -1, "Some text.", wxPoint(10,10), wxSize(320,28),
+                                //0);
+                                wxTE_PROCESS_ENTER);
+  (*m_textentry) << " Appended.";
   m_textentry->SetInsertionPoint(0);
-  m_textentry->WriteText("Less text.");     // this text is prepended
+  m_textentry->WriteText( "Prepended. " );
 
-  m_multitext = new MyTextCtrl( panel, ID_TEXT, "And here.", wxPoint(10,50), wxSize(320,70),
+  m_multitext = new MyTextCtrl( panel, ID_TEXT, "Some text.", wxPoint(10,50), wxSize(320,70),
                                 wxTE_MULTILINE );
-  (*m_multitext) << " More text.\nPress function keys to test different \nwxTextCtrl functions.";
+  (*m_multitext) << " Appended.";
+  m_multitext->SetInsertionPoint(0);
+  m_multitext->WriteText( "Prepended. " );
+  m_multitext->AppendText( "\nPress function keys to test different \nwxTextCtrl functions." );
+  
   new MyTextCtrl( panel, -1, "This one is with wxTE_PROCESS_TAB style.",
                              wxPoint(10,120), wxSize(320,70), wxTE_MULTILINE | wxTE_PROCESS_TAB);
 
@@ -515,7 +520,11 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
 
 void MyPanel::OnPasteFromClipboard( wxCommandEvent &WXUNUSED(event) )
 {
-#if wxUSE_CLIPBOARD
+  // We test for wxUSE_DRAG_AND_DROP also, because data objects
+  // may not be implemented for compilers that can't cope with the OLE
+  // parts in wxUSE_DRAG_AND_DROP.
+
+#if wxUSE_CLIPBOARD && wxUSE_DRAG_AND_DROP
   if (!wxTheClipboard->Open())
   {
      *m_text << "Error opening the clipboard.\n";
@@ -558,7 +567,7 @@ void MyPanel::OnPasteFromClipboard( wxCommandEvent &WXUNUSED(event) )
 
 void MyPanel::OnCopyToClipboard( wxCommandEvent &WXUNUSED(event) )
 {
-#if wxUSE_CLIPBOARD
+#if wxUSE_CLIPBOARD && wxUSE_DRAG_AND_DROP
   wxString text( m_multitext->GetLineText(0) );
 
   if (text.IsEmpty())