]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Added samples.inc to DATAFILES in Makefile.in - is that enough?
[wxWidgets.git] / src / msw / textctrl.cpp
index c4969c93942f6fc51158c2cd32afcc6acbcc0df7..e48ba50b35f9b573cab85320dd0d32b39126eacc 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        textctrl.cpp
+// Name:        msw/textctrl.cpp
 // Purpose:     wxTextCtrl
 // Author:      Julian Smart
 // Modified by:
 // Purpose:     wxTextCtrl
 // Author:      Julian Smart
 // Modified by:
@@ -178,6 +178,10 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
     if (m_windowStyle & wxTE_PASSWORD) // hidden input
         msStyle |= ES_PASSWORD;
 
     if (m_windowStyle & wxTE_PASSWORD) // hidden input
         msStyle |= ES_PASSWORD;
 
+   if (m_windowStyle & wxTE_AUTO_SCROLL)
+        msStyle |=  ES_AUTOHSCROLL;
+
+
     // we always want the characters and the arrows
     m_lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;
 
     // we always want the characters and the arrows
     m_lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;
 
@@ -416,7 +420,7 @@ void wxTextCtrl::SetValue(const wxString& value)
     if ( (value.length() > 0x400) || (value != GetValue()) )
     {
         wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
     if ( (value.length() > 0x400) || (value != GetValue()) )
     {
         wxString valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
-                               
+
         SetWindowText(GetHwnd(), valueDos.c_str());
 
         AdjustSpaceLimit();
         SetWindowText(GetHwnd(), valueDos.c_str());
 
         AdjustSpaceLimit();
@@ -554,7 +558,7 @@ void wxTextCtrl::SetInsertionPoint(long pos)
     SendMessage(hWnd, EM_SETSEL, 0, MAKELPARAM(pos, pos));
 #endif // Win32/16
 
     SendMessage(hWnd, EM_SETSEL, 0, MAKELPARAM(pos, pos));
 #endif // Win32/16
 
-    static const char *nothing = "";
+    static const wxChar *nothing = _T("");
     SendMessage(hWnd, EM_REPLACESEL, 0, (LPARAM)nothing);
 }
 
     SendMessage(hWnd, EM_REPLACESEL, 0, (LPARAM)nothing);
 }
 
@@ -887,7 +891,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
             if ( !(m_windowStyle & wxTE_MULTILINE) )
             {
                 wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
             if ( !(m_windowStyle & wxTE_MULTILINE) )
             {
                 wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
-                event.SetEventObject( this );
+                InitCommandEvent(event);
                 if ( GetEventHandler()->ProcessEvent(event) )
                     return;
             }
                 if ( GetEventHandler()->ProcessEvent(event) )
                     return;
             }
@@ -934,9 +938,9 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
         case EN_CHANGE:
             {
                 wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
         case EN_CHANGE:
             {
                 wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId);
-                event.SetEventObject( this );
-                event.SetString( GetValue() );
-                ProcessCommand( event );
+                InitCommandEvent(event);
+                event.SetString(GetValue());
+                ProcessCommand(event);
             }
             break;
 
             }
             break;
 
@@ -1016,27 +1020,27 @@ wxSize wxTextCtrl::DoGetBestSize() const
 // standard handlers for standard edit menu events
 // ----------------------------------------------------------------------------
 
 // standard handlers for standard edit menu events
 // ----------------------------------------------------------------------------
 
-void wxTextCtrl::OnCut(wxCommandEvent& event)
+void wxTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event))
 {
     Cut();
 }
 
 {
     Cut();
 }
 
-void wxTextCtrl::OnCopy(wxCommandEvent& event)
+void wxTextCtrl::OnCopy(wxCommandEvent& WXUNUSED(event))
 {
     Copy();
 }
 
 {
     Copy();
 }
 
-void wxTextCtrl::OnPaste(wxCommandEvent& event)
+void wxTextCtrl::OnPaste(wxCommandEvent& WXUNUSED(event))
 {
     Paste();
 }
 
 {
     Paste();
 }
 
-void wxTextCtrl::OnUndo(wxCommandEvent& event)
+void wxTextCtrl::OnUndo(wxCommandEvent& WXUNUSED(event))
 {
     Undo();
 }
 
 {
     Undo();
 }
 
-void wxTextCtrl::OnRedo(wxCommandEvent& event)
+void wxTextCtrl::OnRedo(wxCommandEvent& WXUNUSED(event))
 {
     Redo();
 }
 {
     Redo();
 }