X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b86de524c7b9f7d6067305c01c1fb35ad7321ec4..4cb1706ae52c02214a4540c6c4b6882bed5af416:/src/motif/textctrl.cpp?ds=sidebyside diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index 6a2c7a0cb5..3a66bd8ff8 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -21,6 +21,10 @@ #pragma implementation "textctrl.h" #endif +#ifdef __VMS +#define XtParent XTPARENT +#endif + #include #include #include @@ -31,7 +35,13 @@ #include "wx/filefn.h" #include "wx/utils.h" +#ifdef __VMS__ +#pragma message disable nosimpint +#endif #include +#ifdef __VMS__ +#pragma message enable nosimpint +#endif #include "wx/motif/private.h" @@ -51,7 +61,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); -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) @@ -71,7 +80,6 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData, XmAnyCallba EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo) END_EVENT_TABLE() -#endif // ============================================================================ // implementation @@ -150,6 +158,10 @@ bool wxTextCtrl::Create(wxWindow *parent, NULL ); + XtVaSetValues ((Widget) m_mainWidget, + XmNeditable, ((style & wxTE_READONLY) ? False : True), + NULL); + // TODO: Is this relevant? What does it do? int noCols = 2; if (!value.IsNull() && (value.Length() > (unsigned int) noCols)) @@ -292,7 +304,7 @@ bool wxTextCtrl::CanCut() const // Can cut if there's a selection long from, to; GetSelection(& from, & to); - return (from != to) ; + return (from != to) && (IsEditable()); } bool wxTextCtrl::CanPaste() const @@ -395,7 +407,7 @@ bool wxTextCtrl::LoadFile(const wxString& file) Clear(); Widget textWidget = (Widget) m_mainWidget; - FILE *fp; + FILE *fp = 0; struct stat statb; if ((stat ((char*) (const char*) file, &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG || @@ -777,7 +789,7 @@ static void MergeChangesIntoString(wxString& value, } static void -wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr) +wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr)) { if (!wxGetWindowFromTable(w)) // Widget has been deleted! @@ -788,7 +800,7 @@ wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr) } static void -wxTextWindowModifyProc (Widget w, XtPointer clientData, XmTextVerifyCallbackStruct *cbs) +wxTextWindowModifyProc (Widget WXUNUSED(w), XtPointer clientData, XmTextVerifyCallbackStruct *cbs) { wxTextCtrl *tw = (wxTextCtrl *) clientData; tw->m_processedDefault = FALSE; @@ -838,7 +850,7 @@ wxTextWindowModifyProc (Widget w, XtPointer clientData, XmTextVerifyCallbackStru } static void -wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs) +wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *WXUNUSED(cbs)) { if (!wxGetWindowFromTable(w)) return; @@ -850,7 +862,7 @@ wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct * } static void -wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs) +wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *WXUNUSED(cbs)) { if (!wxGetWindowFromTable(w)) return; @@ -862,7 +874,7 @@ wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct * } static void wxTextWindowActivateProc(Widget w, XtPointer clientData, - XmAnyCallbackStruct *ptr) + XmAnyCallbackStruct *WXUNUSED(ptr)) { if (!wxGetWindowFromTable(w)) return;