#pragma implementation "textctrl.h"
#endif
+#ifdef __VMS
+#define XtParent XTPARENT
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fstream.h>
#include "wx/filefn.h"
#include "wx/utils.h"
+#ifdef __VMS__
+#pragma message disable nosimpint
+#endif
#include <Xm/Text.h>
+#ifdef __VMS__
+#pragma message enable nosimpint
+#endif
#include "wx/motif/private.h"
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)
EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo)
END_EVENT_TABLE()
-#endif
// ============================================================================
// implementation
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))
// Can cut if there's a selection
long from, to;
GetSelection(& from, & to);
- return (from != to) ;
+ return (from != to) && (IsEditable());
}
bool wxTextCtrl::CanPaste() const
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 ||
XmNhorizontalScrollBar, &hsb,
XmNverticalScrollBar, &vsb,
NULL);
- wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
+ wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
if (hsb)
DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
if (vsb)
}
static void
-wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr)
+wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr))
{
if (!wxGetWindowFromTable(w))
// Widget has been deleted!
}
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;
}
static void
-wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs)
+wxTextWindowGainFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *WXUNUSED(cbs))
{
if (!wxGetWindowFromTable(w))
return;
}
static void
-wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *cbs)
+wxTextWindowLoseFocusProc (Widget w, XtPointer clientData, XmAnyCallbackStruct *WXUNUSED(cbs))
{
if (!wxGetWindowFromTable(w))
return;
}
static void wxTextWindowActivateProc(Widget w, XtPointer clientData,
- XmAnyCallbackStruct *ptr)
+ XmAnyCallbackStruct *WXUNUSED(ptr))
{
if (!wxGetWindowFromTable(w))
return;