From 813c20a67e8a82d16700344625b8fdfb32e04833 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 27 Jul 1999 20:12:16 +0000 Subject: [PATCH] wxMotif fixes and common fixes for socket compilation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/motif/listbox.h | 8 ++++---- include/wx/motif/textctrl.h | 4 ++-- src/generic/listctrl.cpp | 2 +- src/motif/gsockmot.cpp | 7 +++++++ src/motif/listbox.cpp | 10 +++++----- src/motif/textctrl.cpp | 9 +++++++-- src/motif/window.cpp | 2 +- src/unix/gsocket.c | 7 ++++++- 8 files changed, 33 insertions(+), 16 deletions(-) diff --git a/include/wx/motif/listbox.h b/include/wx/motif/listbox.h index ea5c008089..d7585a547e 100644 --- a/include/wx/motif/listbox.h +++ b/include/wx/motif/listbox.h @@ -55,8 +55,8 @@ public: ~wxListBox(); virtual void Append(const wxString& item); - virtual void Append(const wxString& item, char *clientData); - virtual void Set(int n, const wxString* choices, char **clientData = NULL); + virtual void Append(const wxString& item, void *clientData); + virtual void Set(int n, const wxString* choices, void **clientData = NULL); virtual int FindString(const wxString& s) const ; virtual void Clear(); virtual void SetSelection(int n, bool select = TRUE); @@ -66,9 +66,9 @@ public: // For single choice list item only virtual int GetSelection() const ; virtual void Delete(int n); - virtual char *GetClientData(int n) const ; + virtual void *GetClientData(int n) const ; virtual void *GetClientData() { return wxWindow::GetClientData(); } - virtual void SetClientData(int n, char *clientData); + virtual void SetClientData(int n, void *clientData); virtual void SetClientData( void *data ) { wxWindow::SetClientData(data); } virtual void SetString(int n, const wxString& s); diff --git a/include/wx/motif/textctrl.h b/include/wx/motif/textctrl.h index 4a537fdea0..6d0bb105de 100644 --- a/include/wx/motif/textctrl.h +++ b/include/wx/motif/textctrl.h @@ -20,7 +20,7 @@ WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr; WXDLLEXPORT_DATA(extern const char*) wxEmptyString; // Single-line text item -class WXDLLEXPORT wxTextCtrl : public wxControl +class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase { DECLARE_DYNAMIC_CLASS(wxTextCtrl) @@ -95,7 +95,7 @@ public: virtual bool IsModified() const; virtual long XYToPosition(long x, long y) const; - virtual void PositionToXY(long pos, long *x, long *y) const; + virtual bool PositionToXY(long pos, long *x, long *y) const; virtual void ShowPosition(long pos); virtual void Clear(); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 7dc0dd3c52..65f568eb3b 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1146,7 +1146,7 @@ void wxListMainWindow::DeleteLine( wxListLineData *line ) void wxListMainWindow::EditLabel( long item ) { wxNode *node = m_lines.Nth( item ); - wxCHECK_MSG( node, (wxTextCtrl *)NULL, _T("wrong index in wxListCtrl::Edit()") ); + wxCHECK_RET( node, _T("wrong index in wxListCtrl::Edit()") ); m_currentEdit = (wxListLineData*) node->Data(); diff --git a/src/motif/gsockmot.cpp b/src/motif/gsockmot.cpp index af86c62dfb..f9870d43c8 100644 --- a/src/motif/gsockmot.cpp +++ b/src/motif/gsockmot.cpp @@ -4,6 +4,11 @@ // Purpose: GSocket: Motif part // CVSID: $Id$ // ------------------------------------------------------------------------- + +#include "wx/setup.h" + +#if wxUSE_SOCKETS + #include #include #include @@ -113,3 +118,5 @@ unsigned long GSocket_GetEventID(GSocket *socket) void GSocket_DoEvent(unsigned long evt_id) { } + +#endif // wxUSE_SOCKETS diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 0666c62369..685db11e3d 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -226,7 +226,7 @@ void wxListBox::Append(const wxString& item) m_noItems ++; } -void wxListBox::Append(const wxString& item, char *clientData) +void wxListBox::Append(const wxString& item, void *clientData) { int width1, height1; int width2, height2; @@ -272,7 +272,7 @@ void wxListBox::Append(const wxString& item, char *clientData) m_noItems ++; } -void wxListBox::Set(int n, const wxString *choices, char** clientData) +void wxListBox::Set(int n, const wxString *choices, void** clientData) { m_clientDataList.Clear(); int width1, height1; @@ -427,16 +427,16 @@ void wxListBox::Deselect(int N) XmListDeselectPos ((Widget) m_mainWidget, N + 1); } -char *wxListBox::GetClientData(int N) const +void *wxListBox::GetClientData(int N) const { wxNode *node = m_clientDataList.Find ((long) N); if (node) - return (char *) node->Data (); + return (void *) node->Data (); else return NULL; } -void wxListBox::SetClientData(int N, char *Client_data) +void wxListBox::SetClientData(int N, void *Client_data) { wxNode *node = m_clientDataList.Find ((long) N); if (node) diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index 241308c0e2..224bd0200c 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -522,11 +522,16 @@ long wxTextCtrl::XYToPosition(long x, long y) const return r+x; } -void wxTextCtrl::PositionToXY(long pos, long *x, long *y) const +bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const { Position xx, yy; XmTextPosToXY((Widget) m_mainWidget, pos, &xx, &yy); - *x = xx; *y = yy; + if ( x ) + *x = xx; + if ( y ) + *y = yy; + + return TRUE; } void wxTextCtrl::ShowPosition(long pos) diff --git a/src/motif/window.cpp b/src/motif/window.cpp index c8e810b83f..c97a0ed0ed 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -217,7 +217,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, { wxCHECK_MSG( parent, FALSE, "can't create wxWindow without parent" ); - CreateBase(parent, id, pos, size, style, name); + CreateBase(parent, id, pos, size, style, wxDefaultValidator, name); parent->AddChild(this); diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index 86711be599..ab328de2e7 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -6,6 +6,10 @@ * ------------------------------------------------------------------------- */ +#include "wx/setup.h" + +#if wxUSE_SOCKETS + #include #include #include @@ -35,7 +39,6 @@ #include -#include "wx/setup.h" #include "wx/gsocket.h" #include "gsockunx.h" @@ -968,3 +971,5 @@ GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf) return GSOCK_NOERROR; } + +#endif // wxUSE_SOCKETS -- 2.47.2