From 7a4b8f27709c3dd59a5b447850389ca25f178047 Mon Sep 17 00:00:00 2001 From: Michael Bedward Date: Fri, 3 Sep 1999 04:18:50 +0000 Subject: [PATCH 1/1] Fixes for gcc 2.95 and AIX. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/statline.h | 2 ++ include/wx/helpbase.h | 4 ++-- samples/config/conftest.cpp | 2 +- src/generic/statline.cpp | 2 +- src/motif/checkbox.cpp | 12 +++++++++--- src/motif/stattext.cpp | 10 ++++++++-- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/wx/generic/statline.h b/include/wx/generic/statline.h index 0058ddede8..d8832381ac 100644 --- a/include/wx/generic/statline.h +++ b/include/wx/generic/statline.h @@ -15,6 +15,8 @@ #pragma interface #endif +class wxStaticBox; + // ---------------------------------------------------------------------------- // wxStaticLine // ---------------------------------------------------------------------------- diff --git a/include/wx/helpbase.h b/include/wx/helpbase.h index 32ed2987b0..3ef8f7e1f9 100644 --- a/include/wx/helpbase.h +++ b/include/wx/helpbase.h @@ -39,8 +39,8 @@ class WXDLLEXPORT wxHelpControllerBase: public wxObject // Must call this to set the filename and server name. // server is only required when implementing TCP/IP-based // help controllers. - virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return FALSE; }; - virtual bool Initialize(const wxString& file) = 0; + virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return FALSE; } + virtual bool Initialize(const wxString& file) { return FALSE; } // Set viewer: only relevant to some kinds of controller virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} diff --git a/samples/config/conftest.cpp b/samples/config/conftest.cpp index 37b8c1f543..0dbc6cd148 100644 --- a/samples/config/conftest.cpp +++ b/samples/config/conftest.cpp @@ -142,7 +142,7 @@ MyFrame::MyFrame() : wxFrame((wxFrame *) NULL, -1, "wxConfig Demo") { // submenu - wxMenu *sub_menu = new wxMenu( wxMENU_TEAROFF ); + wxMenu *sub_menu = new wxMenu( wxEmptyString, wxMENU_TEAROFF ); sub_menu->Append(Minimal_About, "&About", "About this sample"); sub_menu->Append(Minimal_About, "&About", "About this sample"); sub_menu->Append(Minimal_About, "&About", "About this sample"); diff --git a/src/generic/statline.cpp b/src/generic/statline.cpp index 21ad893852..f6872ff56a 100644 --- a/src/generic/statline.cpp +++ b/src/generic/statline.cpp @@ -47,7 +47,7 @@ bool wxStaticLine::Create( wxWindow *parent, long style, const wxString &name) { - if ( !CreateBase(parent, id, pos, size, style, name) ) + if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; // ok, this is ugly but it's better than nothing: use a thin static box to diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index 4b582b16c7..8018173cc2 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -52,19 +52,25 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, else m_windowId = id; +#if 0 // gcc 2.95 doesn't like this apparently char* label1 = (label.IsNull() ? "" : (char*) (const char*) label); - XmString text = XmStringCreateSimple (label1); +#endif + + wxXmString text( label ); + Widget parentWidget = (Widget) parent->GetClientWidget(); XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("toggle", xmToggleButtonWidgetClass, parentWidget, XmNfontList, fontList, - XmNlabelString, text, + XmNlabelString, text(), NULL); +#if 0 XmStringFree (text); - +#endif + XtAddCallback ((Widget) m_mainWidget, XmNvalueChangedCallback, (XtCallbackProc) wxCheckBoxCallback, (XtPointer) this); diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index fdcd50c98d..a5105b10ec 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -47,15 +47,21 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_windowStyle = style; m_font = parent->GetFont(); +#if 0 // gcc 2.95 doesn't like this apparently char* label1 = (label.IsNull() ? "" : (char*) (const char*) label); - +#endif + Widget parentWidget = (Widget) parent->GetClientWidget(); +#if 0 // gcc 2.95 doesn't like this apparently // Use XmStringCreateLtoR(), since XmStringCreateSimple // doesn't obey separators. // XmString text = XmStringCreateSimple (label1); XmString text = XmStringCreateLtoR (label1, XmSTRING_DEFAULT_CHARSET); - +#endif // 0 + + XmString text = XmStringCreateLtoR ((char *)(const char*)label, XmSTRING_DEFAULT_CHARSET); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); m_mainWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) name, -- 2.45.2