]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/textctrl.cpp
Fix horizontal mouse wheel scrolling in wxGTK.
[wxWidgets.git] / src / motif / textctrl.cpp
index aeafee2200798c6870935fecf4a94c07f478420d..7455453a4c59780b15b990b294d5d7df979f1a7c 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by:
 // Created:     17/09/98
 // Author:      Julian Smart
 // Modified by:
 // Created:     17/09/98
-// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#ifdef __VMS
-#define XtParent XTPARENT
-#endif
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <ctype.h>
@@ -63,8 +58,6 @@ static void wxTextWindowGainFocusProc(Widget w, XtPointer clientData, XmAnyCallb
 static void wxTextWindowLoseFocusProc(Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs);
 static void wxTextWindowActivateProc(Widget w, XtPointer clientData, XmAnyCallbackStruct *ptr);
 
 static void wxTextWindowLoseFocusProc(Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs);
 static void wxTextWindowActivateProc(Widget w, XtPointer clientData, XmAnyCallbackStruct *ptr);
 
-    IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxTextCtrlBase)
-
     BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
         EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
         EVT_CHAR(wxTextCtrl::OnChar)
     BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
         EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
         EVT_CHAR(wxTextCtrl::OnChar)
@@ -94,7 +87,7 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData, XmAnyCallba
 // Text item
 wxTextCtrl::wxTextCtrl()
 {
 // Text item
 wxTextCtrl::wxTextCtrl()
 {
-    m_tempCallbackStruct = (void*) NULL;
+    m_tempCallbackStruct = NULL;
     m_modified = false;
     m_processedDefault = false;
 }
     m_modified = false;
     m_processedDefault = false;
 }
@@ -112,7 +105,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
         return false;
     PreCreation();
 
         return false;
     PreCreation();
 
-    m_tempCallbackStruct = (void*) NULL;
+    m_tempCallbackStruct = NULL;
     m_modified = false;
     m_processedDefault = false;
 
     m_modified = false;
     m_processedDefault = false;
 
@@ -167,7 +160,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
 #if 0
         // TODO: Is this relevant? What does it do?
         int noCols = 2;
 #if 0
         // TODO: Is this relevant? What does it do?
         int noCols = 2;
-        if (!value.IsNull() && (value.length() > (unsigned int) noCols))
+        if (!value.empty() && (value.length() > (unsigned int) noCols))
             noCols = value.length();
         XtVaSetValues((Widget) m_mainWidget,
                       XmNcolumns, noCols,
             noCols = value.length();
         XtVaSetValues((Widget) m_mainWidget,
                       XmNcolumns, noCols,
@@ -391,7 +384,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
         XmTextVerifyCallbackStruct *textStruct =
             (XmTextVerifyCallbackStruct *) m_tempCallbackStruct;
         textStruct->doit = True;
         XmTextVerifyCallbackStruct *textStruct =
             (XmTextVerifyCallbackStruct *) m_tempCallbackStruct;
         textStruct->doit = True;
-        if (isascii(event.m_keyCode) && (textStruct->text->length == 1))
+        if (wxIsascii(event.m_keyCode) && (textStruct->text->length == 1))
         {
             textStruct->text->ptr[0] = (char)((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode);
         }
         {
             textStruct->text->ptr[0] = (char)((event.m_keyCode == WXK_RETURN) ? 10 : event.m_keyCode);
         }
@@ -471,12 +464,12 @@ void wxTextCtrl::DoSendEvents(void *wxcbs, long keycode)
     // the character passed through)
     cbs->doit = False;
 
     // the character passed through)
     cbs->doit = False;
 
-    GetEventHandler()->ProcessEvent(event);
+    HandleWindowEvent(event);
 
     if ( !InSetValue() && m_processedDefault )
     {
         // Can generate a command
 
     if ( !InSetValue() && m_processedDefault )
     {
         // Can generate a command
-        wxCommandEvent commandEvent(wxEVT_COMMAND_TEXT_UPDATED, GetId());
+        wxCommandEvent commandEvent(wxEVT_TEXT, GetId());
         commandEvent.SetEventObject(this);
         ProcessCommand(commandEvent);
     }
         commandEvent.SetEventObject(this);
         ProcessCommand(commandEvent);
     }
@@ -667,7 +660,7 @@ wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *
     wxTextCtrl *tw = (wxTextCtrl *) clientData;
     wxFocusEvent event(wxEVT_SET_FOCUS, tw->GetId());
     event.SetEventObject(tw);
     wxTextCtrl *tw = (wxTextCtrl *) clientData;
     wxFocusEvent event(wxEVT_SET_FOCUS, tw->GetId());
     event.SetEventObject(tw);
-    tw->GetEventHandler()->ProcessEvent(event);
+    tw->HandleWindowEvent(event);
 }
 
 static void
 }
 
 static void
@@ -679,7 +672,7 @@ wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *
     wxTextCtrl *tw = (wxTextCtrl *) clientData;
     wxFocusEvent event(wxEVT_KILL_FOCUS, tw->GetId());
     event.SetEventObject(tw);
     wxTextCtrl *tw = (wxTextCtrl *) clientData;
     wxFocusEvent event(wxEVT_KILL_FOCUS, tw->GetId());
     event.SetEventObject(tw);
-    tw->GetEventHandler()->ProcessEvent(event);
+    tw->HandleWindowEvent(event);
 }
 
 static void wxTextWindowActivateProc(Widget w, XtPointer clientData,
 }
 
 static void wxTextWindowActivateProc(Widget w, XtPointer clientData,
@@ -693,7 +686,7 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData,
     if (tw->InSetValue())
         return;
 
     if (tw->InSetValue())
         return;
 
-    wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER);
+    wxCommandEvent event(wxEVT_TEXT_ENTER);
     event.SetId(tw->GetId());
     event.SetEventObject(tw);
     tw->ProcessCommand(event);
     event.SetId(tw->GetId());
     event.SetEventObject(tw);
     tw->ProcessCommand(event);