From da175b2ce4dc35cc4c0baa8bbdc16bf4de6c7684 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 23 Jun 1999 10:03:44 +0000 Subject: [PATCH] Motif compile fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/gtk/README.txt | 88 ++++++----- distrib/gtk/Setup | 4 +- distrib/gtk/copy_src | 2 + include/wx/dataobj.h | 49 +----- include/wx/defs.h | 3 + include/wx/motif/clipbrd.h | 7 + include/wx/motif/dataobj.h | 195 +++++++++++------------- include/wx/motif/dialog.h | 4 + include/wx/motif/window.h | 2 + include/wx/msw/ole/dataobj.h | 47 ++++++ samples/minimal/minimal.cpp | 3 +- src/motif/Makefile.am | 6 +- src/motif/bmpbuttn.cpp | 2 +- src/motif/button.cpp | 7 +- src/motif/checkbox.cpp | 4 +- src/motif/choice.cpp | 10 +- src/motif/clipbrd.cpp | 10 +- src/motif/combobox.cpp | 2 +- src/motif/control.cpp | 3 + src/motif/dataobj.cpp | 279 ++++++++++++++++++++++++++++++++--- src/motif/dialog.cpp | 4 +- src/motif/frame.cpp | 6 +- src/motif/gauge.cpp | 2 +- src/motif/listbox.cpp | 2 +- src/motif/mdi.cpp | 2 +- src/motif/radiobox.cpp | 8 +- src/motif/radiobut.cpp | 4 +- src/motif/slider.cpp | 2 +- src/motif/statbmp.cpp | 2 +- src/motif/statbox.cpp | 6 +- src/motif/stattext.cpp | 4 +- src/motif/textctrl.cpp | 2 +- src/motif/toolbar.cpp | 2 +- src/motif/utils.cpp | 4 +- 34 files changed, 513 insertions(+), 264 deletions(-) diff --git a/distrib/gtk/README.txt b/distrib/gtk/README.txt index 843b2cff75..5f4af286bc 100644 --- a/distrib/gtk/README.txt +++ b/distrib/gtk/README.txt @@ -1,44 +1,29 @@ wxPython README --------------- -Introduction ------------- -The code in this subtree is a Python Extension Module that enables the -use of wxWindows from the Python language. So what is Python? Go to -http://www.python.org to learn more but in a nutshell, it's an -extremly cool object oriented language. It's easier than Perl and -nearly as powerful. It runs on more platforms than Java, and by some -reports, is even faster than Java with a JIT compiler! - -So why would you want to use wxPython over just C++ and wxWindows? -Personally I prefer using Python for everything. I only use C++ when -I absolutly have to eek more performance out of an algorithm, and even -then I ususally code it as an extension module and leave the majority -of the program in Python. Another good thing to use wxPython for is -quick prototyping of your wxWindows apps. With C++ you have to -continuously go though the edit-compile-link-run cycle, which can be -quite time comsuming. With Python it is only an edit-run cycle. You -can easily build an application in a few hours with Python that would -normally take a few days with C++. Converting a wxPython app to a -C++/wxWindows app should be a straight forward task. - -This extension module attempts to mirror the class heiarchy of -wxWindows as closely as possble. This means that there is a wxFrame -class in wxPython that looks, smells, tastes and acts almost the same -as the wxFrame class in the C++ version. Unfortunatly, I wasn't able -to match things exactly because of differences in the languages, but -the differences should be easy to absorb because they are natural to -Python. For example, some methods that return mutliple values via -argument pointers in C++ will return a tuple of values in Python. -These differences have not been documented yet so if something isn't -working the same as described in the wxWindows documents the best -thing to do is to scan through the wxPython sources, especially the .i -files, as that is where the interfaces for wxPython are defined. - -I have reports of successfully embedding wxPython within a wxWindows -C++ app on GTK. It hasn't yet been attempted on MSW (to my knowledge) -so I don't know how successful such an attempt would be. However it -is certainly possible. +Welcome to the wonderful world of wxPython! + +Once you have installed the wxPython extension module, you can try it +out by going to the [install dir]\wxPython\demo directory and typing: + + python demo.py + +There are also some other sample files there for you to play with and +learn from. + +If you selected to install the documentation then point your browser +to [install dir]\wxPython\docs\index.htm and you will then be looking +at the docs for wxWindows. For the most part you can use the C++ docs +as most classes and methods are used identically. Where there are +differences they are documented with a "wxPython Note." + +On Win32 systems the binary self-installer creates a program group on +the Start Menu that contains a link to running the demo and a link to +the help file. To help you save disk space I'm now using Microsoft's +HTML Help format. If your system doesn't know what to do with the help +file, you can install the HTML Help Viewer as part of IE 4+, NT +Service Pack 4+, or the HTML Workshop at +http://msdn.microsoft.com/workshop/author/htmlhelp/download.asp. @@ -57,6 +42,33 @@ Or you can send mail directly to the list using this address: wxpython-users@starship.python.net +---------------------------------------------------------------------- + + +What's new in 2.1b1 +-------------------- +Fixed wxComboBox.SetSelection so that it actually sets the selected +item. (Actually just removed it from wxPython and let it default to +wxChoice.SetSelection which was already doing the right thing.) + +Added the Printing Framework. + +Switched back to using the wxWindows DLL for the pre-built Win32 +version. The problem was needing to reinitialize static class info +data after loading each extension module. + +Lots of little tweaks and additions to reflect changes to various +wxWindows classes. + +Fixed a bug with attaching objects to tree items. Actually was a +symptom of a larger problem with not obtaining the interpreter lock +when doing any Py_DECREFs. + +wxSizer and friends. Sizers are layout tools that manage a colection +of windows and sizers. Different types of sizers apply different +types of layout algorithms. You saw it here first! These classes are +not even in the wxWindows C++ library yet! + What's new in 2.0b9 diff --git a/distrib/gtk/Setup b/distrib/gtk/Setup index ed7cf93ccd..60f8fd0db1 100644 --- a/distrib/gtk/Setup +++ b/distrib/gtk/Setup @@ -36,8 +36,8 @@ TARGETDIR=$(BINLIBDEST)/wxPython wxc wx.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \ mdi.cpp controls.cpp controls2.cpp windows2.cpp cmndlgs.cpp \ - frames.cpp stattool.cpp windows3.cpp image.cpp \ - utils.cpp \ + frames.cpp stattool.cpp windows3.cpp image.cpp misc2.cpp \ + utils.cpp printfw.cpp \ ## comment out the next line to disable wxGLCanvas ##_glcanvas.cpp glcanvas.cpp -DWITH_GLCANVAS -lGL -lGLU \ -I. $(WX_CONFIG_CFLAGS) -I/usr/local/lib/glib/include \ diff --git a/distrib/gtk/copy_src b/distrib/gtk/copy_src index 6e6c75236f..67c68fa076 100755 --- a/distrib/gtk/copy_src +++ b/distrib/gtk/copy_src @@ -269,6 +269,8 @@ cp ./src/gtk/* ~/wxgtk_dist/wxGTK/utils/wxPython/src/gtk mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/lib cp ./lib/*.py ~/wxgtk_dist/wxGTK/utils/wxPython/lib +mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/lib/sizers +cp ./lib/sizers/*.py ~/wxgtk_dist/wxGTK/utils/wxPython/lib/sizers mkdir ~/wxgtk_dist/wxGTK/utils/wxPython/tests cp ./tests/README.txt ~/wxgtk_dist/wxGTK/utils/wxPython/tests diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 20428c455e..b109dc64fe 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -13,53 +13,6 @@ #define _WX_DATAOBJ_H_BASE_ #if defined(__WXMSW__) -// ---------------------------------------------------------------------------- -// wxDataFormat identifies the single format of data -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataFormat -{ -public: - // the clipboard formats under Win32 are UINTs - typedef unsigned int NativeFormat; - - wxDataFormat(NativeFormat format = wxDF_INVALID) { m_format = format; } - wxDataFormat& operator=(NativeFormat format) - { m_format = format; return *this; } - - // defautl copy ctor/assignment operators ok - - // comparison (must have both versions) - bool operator==(wxDataFormatId format) const - { return m_format == (NativeFormat)format; } - bool operator!=(wxDataFormatId format) const - { return m_format != (NativeFormat)format; } - bool operator==(const wxDataFormat& format) const - { return m_format == format.m_format; } - bool operator!=(const wxDataFormat& format) const - { return m_format != format.m_format; } - - // explicit and implicit conversions to NativeFormat which is one of - // standard data types (implicit conversion is useful for preserving the - // compatibility with old code) - NativeFormat GetFormatId() const { return m_format; } - operator NativeFormat() const { return m_format; } - - // this only works with standard ids - void SetId(wxDataFormatId format) { m_format = format; } - - // string ids are used for custom types - this SetId() must be used for - // application-specific formats - wxString GetId() const; - void SetId(const wxChar *format); - -private: - // returns TRUE if the format is one of those defined in wxDataFormatId - bool IsStandard() const { return m_format > 0 && m_format < wxDF_MAX; } - - NativeFormat m_format; -}; - #include "wx/msw/ole/dataobj.h" #elif defined(__WXMOTIF__) #include "wx/motif/dataobj.h" @@ -81,7 +34,7 @@ private: class WXDLLEXPORT wxPrivateDataObject : public wxDataObject { -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) DECLARE_DYNAMIC_CLASS( wxPrivateDataObject ) #endif diff --git a/include/wx/defs.h b/include/wx/defs.h index 1cc239db8b..7ed90835ba 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1347,6 +1347,9 @@ typedef void* WXFont; typedef void* WXImage; typedef void* WXCursor; typedef void* WXFontList; + +typedef unsigned long Atom; /* this might fail on a few architectures */ + #endif // Motif #ifdef __WXGTK__ diff --git a/include/wx/motif/clipbrd.h b/include/wx/motif/clipbrd.h index a86215aeab..dceeabcfaa 100644 --- a/include/wx/motif/clipbrd.h +++ b/include/wx/motif/clipbrd.h @@ -22,6 +22,8 @@ #include "wx/defs.h" #include "wx/setup.h" +#include "wx/dataobj.h" + #include "wx/list.h" #include "wx/module.h" @@ -69,10 +71,15 @@ public: // clears wxTheClipboard and the system's clipboard if possible virtual void Clear(); + /// If primary == TRUE, use primary selection in all further ops, + /// primary=FALSE resets it. + inline void UsePrimarySelection(bool primary = TRUE) { m_usePrimary = primary; } + // implementation bool m_open; wxList m_data; + bool m_usePrimary; }; /* The clipboard */ diff --git a/include/wx/motif/dataobj.h b/include/wx/motif/dataobj.h index 02daba2b37..fc0c3216af 100644 --- a/include/wx/motif/dataobj.h +++ b/include/wx/motif/dataobj.h @@ -23,149 +23,124 @@ // classes //------------------------------------------------------------------------- -class WXDLLEXPORT wxDataObject; -class WXDLLEXPORT wxTextDataObject; -class WXDLLEXPORT wxBitmapDataObject; -class WXDLLEXPORT wxPrivateDataObject; -class WXDLLEXPORT wxFileDataObject; +class wxDataFormat; +class wxDataObject; +class wxTextDataObject; //------------------------------------------------------------------------- -// wxDataObject +// wxDataFormat //------------------------------------------------------------------------- -class WXDLLEXPORT wxDataObject: public wxObject +class wxDataFormat : public wxObject { - DECLARE_ABSTRACT_CLASS( wxDataObject ) + DECLARE_CLASS( wxDataFormat ) public: + wxDataFormat(); + wxDataFormat( wxDataFormatId type ); + wxDataFormat( const wxString &id ); + wxDataFormat( const wxChar *id ); + wxDataFormat( const wxDataFormat &format ); + wxDataFormat( const Atom atom ); - wxDataObject() {} - ~wxDataObject() {} + void SetType( wxDataFormatId type ); + wxDataFormatId GetType() const; - virtual wxDataFormat GetFormat() const = 0; - - // implementation -}; + /* the string Id identifies the format of clipboard or DnD data. a word + * processor would e.g. add a wxTextDataObject and a wxPrivateDataObject + * to the clipboard - the latter with the Id "application/wxword", an + * image manipulation program would put a wxBitmapDataObject and a + * wxPrivateDataObject to the clipboard - the latter with "image/png". */ -// ---------------------------------------------------------------------------- -// wxTextDataObject is a specialization of wxDataObject for text data -// ---------------------------------------------------------------------------- + wxString GetId() const; + void SetId( const wxChar *id ); -class WXDLLEXPORT wxTextDataObject : public wxDataObject -{ - DECLARE_DYNAMIC_CLASS( wxTextDataObject ) + Atom GetAtom(); + void SetAtom(Atom atom) { m_hasAtom = TRUE; m_atom = atom; } -public: + // implicit conversion to wxDataFormatId + operator wxDataFormatId() const { return m_type; } - wxTextDataObject() {} - wxTextDataObject( const wxString& strText ) - : m_strText(strText) { } - - virtual wxDataFormat GetFormat() const - { return wxDF_TEXT; } - - void SetText( const wxString& strText) - { m_strText = strText; } - - wxString GetText() const - { return m_strText; } + bool operator==(wxDataFormatId type) const { return m_type == type; } + bool operator!=(wxDataFormatId type) const { return m_type != type; } private: - wxString m_strText; - + wxDataFormatId m_type; + wxString m_id; + bool m_hasAtom; + Atom m_atom; }; -// ---------------------------------------------------------------------------- -// wxFileDataObject is a specialization of wxDataObject for file names -// ---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +// wxDataObject to be placed in wxDataBroker +//---------------------------------------------------------------------------- -class WXDLLEXPORT wxFileDataObject : public wxDataObject +class wxDataObject : public wxObject { - DECLARE_DYNAMIC_CLASS( wxFileDataObject ) + DECLARE_DYNAMIC_CLASS( wxDataObject ) public: - wxFileDataObject(void) {} - - virtual wxDataFormat GetFormat() const - { return wxDF_FILENAME; } - - void AddFile( const wxString &file ) - { m_files += file; m_files += (char)0; } - - wxString GetFiles() const - { return m_files; } - -private: - wxString m_files; - -}; + /* constructor */ + wxDataObject(); -// ---------------------------------------------------------------------------- -// wxBitmapDataObject is a specialization of wxDataObject for bitmaps -// ---------------------------------------------------------------------------- + /* destructor */ + ~wxDataObject(); -class WXDLLEXPORT wxBitmapDataObject : public wxDataObject -{ - DECLARE_DYNAMIC_CLASS( wxBitmapDataObject ) + /* write data to dest */ + virtual void WriteData( void *dest ) const = 0; -public: + /* get size of data */ + virtual size_t GetSize() const = 0; - wxBitmapDataObject(void) {} - - virtual wxDataFormat GetFormat() const - { return wxDF_BITMAP; } - - void SetBitmap( const wxBitmap &bitmap ) - { m_bitmap = bitmap; } - - wxBitmap GetBitmap() const - { return m_bitmap; } - -private: - wxBitmap m_bitmap; + /* implementation */ + + wxDataFormat &GetFormat(); + + wxDataFormatId GetFormatType() const; + wxString GetFormatId() const; + Atom GetFormatAtom() const; + + wxDataFormat m_format; }; -// ---------------------------------------------------------------------------- -// wxPrivateDataObject is a specialization of wxDataObject for app specific data -// ---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +// wxTextDataObject is a specialization of wxDataObject for text data +//---------------------------------------------------------------------------- -class WXDLLEXPORT wxPrivateDataObject : public wxDataObject +class wxTextDataObject : public wxDataObject { - DECLARE_DYNAMIC_CLASS( wxPrivateDataObject ) + DECLARE_DYNAMIC_CLASS( wxTextDataObject ) public: - wxPrivateDataObject(); - - ~wxPrivateDataObject(); - - virtual wxDataFormat GetFormat() const - { return wxDF_PRIVATE; } - - // the string ID identifies the format of clipboard or DnD data. a word - // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject - // to the clipboard - the latter with the Id "WXWORD_FORMAT". - - void SetId( const wxString& id ) - { m_id = id; } - - wxString GetId() const - { return m_id; } - - // will make internal copy - void SetData( const char *data, size_t size ); - - size_t GetDataSize() const - { return m_size; } - - char* GetData() const - { return m_data; } - -private: - size_t m_size; - char* m_data; - wxString m_id; + /* default constructor. call SetText() later or override + WriteData() and GetSize() for working on-demand */ + wxTextDataObject(); + + /* constructor */ + wxTextDataObject( const wxString& data ); + + /* set current text data */ + void SetText( const wxString& data ); + + /* get current text data */ + wxString GetText() const; + + /* by default calls WriteString() with string set by constructor or + by SetText(). can be overridden for working on-demand */ + virtual void WriteData( void *dest ) const; + + /* by default, returns length of string as set by constructor or + by SetText(). can be overridden for working on-demand */ + virtual size_t GetSize() const; + + /* write string to dest */ + void WriteString( const wxString &str, void *dest ) const; + + /* implementation */ + + wxString m_data; }; diff --git a/include/wx/motif/dialog.h b/include/wx/motif/dialog.h index 21107d0282..b929956e96 100644 --- a/include/wx/motif/dialog.h +++ b/include/wx/motif/dialog.h @@ -84,6 +84,9 @@ public: virtual int ShowModal(); virtual void EndModal(int retCode); + void SetReturnCode(int returnCode) { m_returnCode = returnCode; } + int GetReturnCode() const { return m_returnCode; } + // Standard buttons void OnOK(wxCommandEvent& event); void OnApply(wxCommandEvent& event); @@ -104,6 +107,7 @@ public: //// Motif-specific bool m_modalShowing; wxString m_dialogTitle; + int m_returnCode; protected: virtual void DoSetSize(int x, int y, diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index fed6259e2d..3a165449c1 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -209,6 +209,7 @@ protected: int GetPixmapWidth() const { return m_pixmapWidth; } int GetPixmapHeight() const { return m_pixmapHeight; } +public: // Change properties virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden) virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour); @@ -220,6 +221,7 @@ protected: // Change foreground colour using current foreground colour setting virtual void ChangeForegroundColour(); +protected: // Adds the widget to the hash table and adds event handlers. bool AttachWidget(wxWindow* parent, WXWidget mainWidget, WXWidget formWidget, int x, int y, int width, int height); diff --git a/include/wx/msw/ole/dataobj.h b/include/wx/msw/ole/dataobj.h index 1fcfb1f30f..6490e67f82 100644 --- a/include/wx/msw/ole/dataobj.h +++ b/include/wx/msw/ole/dataobj.h @@ -12,6 +12,53 @@ #ifndef _WX_OLEDATAOBJ_H #define _WX_OLEDATAOBJ_H +// ---------------------------------------------------------------------------- +// wxDataFormat identifies the single format of data +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxDataFormat +{ +public: + // the clipboard formats under Win32 are UINTs + typedef unsigned int NativeFormat; + + wxDataFormat(NativeFormat format = wxDF_INVALID) { m_format = format; } + wxDataFormat& operator=(NativeFormat format) + { m_format = format; return *this; } + + // defautl copy ctor/assignment operators ok + + // comparison (must have both versions) + bool operator==(wxDataFormatId format) const + { return m_format == (NativeFormat)format; } + bool operator!=(wxDataFormatId format) const + { return m_format != (NativeFormat)format; } + bool operator==(const wxDataFormat& format) const + { return m_format == format.m_format; } + bool operator!=(const wxDataFormat& format) const + { return m_format != format.m_format; } + + // explicit and implicit conversions to NativeFormat which is one of + // standard data types (implicit conversion is useful for preserving the + // compatibility with old code) + NativeFormat GetFormatId() const { return m_format; } + operator NativeFormat() const { return m_format; } + + // this only works with standard ids + void SetId(wxDataFormatId format) { m_format = format; } + + // string ids are used for custom types - this SetId() must be used for + // application-specific formats + wxString GetId() const; + void SetId(const wxChar *format); + +private: + // returns TRUE if the format is one of those defined in wxDataFormatId + bool IsStandard() const { return m_format > 0 && m_format < wxDF_MAX; } + + NativeFormat m_format; +}; + // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index ebed2f206c..cf8bd0166f 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -149,7 +149,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) SetIcon(wxICON(mondrian)); // create a menu bar - wxMenu *menuFile = new wxMenu(wxMENU_TEAROFF); + wxMenu *menuFile = new wxMenu; +// wxMenu *menuFile = new wxMenu(wxMENU_TEAROFF); menuFile->Append(Minimal_About, "&About...\tCtrl-A", "Show about dialog"); menuFile->AppendSeparator(); diff --git a/src/motif/Makefile.am b/src/motif/Makefile.am index 5bb3e6d516..22e1853393 100644 --- a/src/motif/Makefile.am +++ b/src/motif/Makefile.am @@ -178,13 +178,11 @@ libwx_motif_la_SOURCES = \ spinbutt.cpp \ statbmp.cpp \ statbox.cpp \ - statline.cpp \ stattext.cpp \ textctrl.cpp \ timer.cpp \ - tooltip.cpp \ - utilsres.cpp \ - wave.cpp \ + toolbar.cpp \ + utils.cpp \ window.cpp # propform.cpp \ diff --git a/src/motif/bmpbuttn.cpp b/src/motif/bmpbuttn.cpp index f5e7767b14..bf9a57a63f 100644 --- a/src/motif/bmpbuttn.cpp +++ b/src/motif/bmpbuttn.cpp @@ -92,7 +92,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit m_mainWidget = (WXWidget) buttonWidget; - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); ChangeBackgroundColour (); diff --git a/src/motif/button.cpp b/src/motif/button.cpp index 209c03de98..f48bab4230 100644 --- a/src/motif/button.cpp +++ b/src/motif/button.cpp @@ -40,7 +40,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_windowStyle = style; m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); parent->AddChild((wxButton *)this); @@ -54,7 +54,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmString text = XmStringCreateSimple ((char*) (const char*) label1); Widget parentWidget = (Widget) parent->GetClientWidget(); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); /* * Patch Note (important) @@ -89,8 +89,11 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, void wxButton::SetDefault() { wxWindow *parent = (wxWindow *)GetParent(); +/* + TODO if (parent) parent->SetDefaultItem(this); +*/ // We initially do not set XmNdefaultShadowThickness, to have small buttons. // Unfortunately, buttons are now mis-aligned. We try to correct this diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index 0a5027d046..160e3a6c81 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -43,7 +43,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_windowStyle = style; m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); if (parent) parent->AddChild(this); @@ -56,7 +56,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmString text = XmStringCreateSimple (label1); Widget parentWidget = (Widget) parent->GetClientWidget(); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("toggle", xmToggleButtonWidgetClass, parentWidget, diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index b950c67ef4..528d0607f0 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -66,7 +66,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id, m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); Widget parentWidget = (Widget) parent->GetClientWidget(); @@ -174,9 +174,9 @@ void wxChoice::Append(const wxString& item) DoChangeBackgroundColour((WXWidget) w, m_backgroundColour); - if (m_windowFont.Ok()) + if (m_font.Ok()) XtVaSetValues (w, - XmNfontList, (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay((Widget) m_formWidget)), + XmNfontList, (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_formWidget)), NULL); WXWidget *new_widgetList = new WXWidget[m_noStrings + 1]; @@ -436,12 +436,12 @@ void wxChoice::ChangeFont(bool keepOriginalSize) // Note that this causes the widget to be resized back // to its original size! We therefore have to set the size // back again. TODO: a better way in Motif? - if (m_windowFont.Ok()) + if (m_font.Ok()) { int width, height, width1, height1; GetSize(& width, & height); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay((Widget) m_mainWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_mainWidget)); XtVaSetValues ((Widget) m_mainWidget, XmNfontList, fontList, NULL); XtVaSetValues ((Widget) m_buttonWidget, XmNfontList, fontList, NULL); diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 21df675bf2..c5046a0db0 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -203,16 +203,16 @@ wxObject *wxGetClipboardData(wxDataFormat dataFormat, long *len) wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat) { // Only wxDF_TEXT supported - if (dataFormat == (wxDataFormat) 0) + if (dataFormat == wxDF_TEXT) return wxDF_TEXT; else - return (wxDataFormat) 0; + return wxDF_INVALID; } wxDataFormat wxRegisterClipboardFormat(char *formatName) { // Not supported - return (wxDataFormat) 0; + return (wxDataFormat) wxDF_INVALID; } bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount) @@ -281,6 +281,7 @@ bool wxClipboard::SetData( wxDataObject *data ) return wxSetClipboardData(data->GetFormat(), (wxObject*) (const char*) str); break; } +/* case wxDF_BITMAP: case wxDF_DIB: { @@ -289,6 +290,7 @@ bool wxClipboard::SetData( wxDataObject *data ) return wxSetClipboardData(data->GetFormat(), & bitmap); break; } +*/ default: { return FALSE; @@ -332,6 +334,7 @@ bool wxClipboard::GetData( wxDataObject *data ) return FALSE; break; } +/* case wxDF_BITMAP: case wxDF_DIB: { @@ -347,6 +350,7 @@ bool wxClipboard::GetData( wxDataObject *data ) return FALSE; break; } +*/ default: { return FALSE; diff --git a/src/motif/combobox.cpp b/src/motif/combobox.cpp index 41a12151e5..b24da1adb0 100644 --- a/src/motif/combobox.cpp +++ b/src/motif/combobox.cpp @@ -84,7 +84,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, SetValue(value); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/control.cpp b/src/motif/control.cpp index 090eae88f8..38e35741fa 100644 --- a/src/motif/control.cpp +++ b/src/motif/control.cpp @@ -38,12 +38,15 @@ wxControl::~wxControl() { // If we delete an item, we should initialize the parent panel, // because it could now be invalid. +/* + TODO wxWindow *parent = (wxWindow *)GetParent(); if (parent) { if (parent->GetDefaultItem() == (wxButton*) this) parent->SetDefaultItem((wxButton*) NULL); } +*/ } void wxControl::SetLabel(const wxString& label) diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp index 465bc56741..b41b06164e 100644 --- a/src/motif/dataobj.cpp +++ b/src/motif/dataobj.cpp @@ -14,29 +14,241 @@ #include "wx/dataobj.h" #include "wx/app.h" +#include +#include "wx/utils.h" + +//------------------------------------------------------------------------- +// global data +//------------------------------------------------------------------------- + +Atom g_textAtom = 0; + +//------------------------------------------------------------------------- +// wxDataFormat +//------------------------------------------------------------------------- + +IMPLEMENT_CLASS(wxDataFormat, wxObject) + +wxDataFormat::wxDataFormat() +{ + if (!g_textAtom) g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE ); + m_type = wxDF_INVALID; + m_hasAtom = FALSE; + m_atom = (Atom) 0; +} + +wxDataFormat::wxDataFormat( wxDataFormatId type ) +{ + if (!g_textAtom) g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE ); + SetType( type ); +} + +wxDataFormat::wxDataFormat( const wxChar *id ) +{ + if (!g_textAtom) g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE ); + SetId( id ); +} + +wxDataFormat::wxDataFormat( const wxString &id ) +{ + if (!g_textAtom) g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE ); + SetId( id ); +} + +wxDataFormat::wxDataFormat( const wxDataFormat &format ) +{ + if (!g_textAtom) g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE ); + m_type = format.GetType(); + m_id = format.GetId(); + m_hasAtom = TRUE; + m_atom = ((wxDataFormat &)format).GetAtom(); // const_cast +} + +wxDataFormat::wxDataFormat( const Atom atom ) +{ + if (!g_textAtom) g_textAtom = XInternAtom( (Display*) wxGetDisplay(), "STRING", FALSE ); + m_hasAtom = TRUE; + + m_atom = atom; + + if (m_atom == g_textAtom) + { + m_type = wxDF_TEXT; + } else +/* + if (m_atom == GDK_TARGET_BITMAP) + { + m_type = wxDF_BITMAP; + } else +*/ + { + m_type = wxDF_PRIVATE; + m_id = XGetAtomName( (Display*) wxGetDisplay(), m_atom ); + + if (m_id == _T("file:ALL")) + { + m_type = wxDF_FILENAME; + } + } +} + +void wxDataFormat::SetType( wxDataFormatId type ) +{ + m_type = type; + + if (m_type == wxDF_TEXT) + { + m_id = _T("STRING"); + } + else + if (m_type == wxDF_BITMAP) + { + m_id = _T("BITMAP"); + } + else + if (m_type == wxDF_FILENAME) + { + m_id = _T("file:ALL"); + } + else + { + wxFAIL_MSG( _T("invalid dataformat") ); + } + + m_hasAtom = FALSE; +} + +wxDataFormatId wxDataFormat::GetType() const +{ + return m_type; +} + +wxString wxDataFormat::GetId() const +{ + return m_id; +} + +void wxDataFormat::SetId( const wxChar *id ) +{ + m_type = wxDF_PRIVATE; + m_id = id; + m_hasAtom = FALSE; +} + +Atom wxDataFormat::GetAtom() +{ + if (!m_hasAtom) + { + m_hasAtom = TRUE; + + if (m_type == wxDF_TEXT) + { + m_atom = g_textAtom; + } + else +/* + if (m_type == wxDF_BITMAP) + { + m_atom = GDK_TARGET_BITMAP; + } + else +*/ + if (m_type == wxDF_PRIVATE) + { + m_atom = XInternAtom( (Display*) wxGetDisplay(), MBSTRINGCAST m_id.mbc_str(), FALSE ); + } + else + if (m_type == wxDF_FILENAME) + { + m_atom = XInternAtom( (Display*) wxGetDisplay(), "file:ALL", FALSE ); + } + else + { + m_hasAtom = FALSE; + m_atom = (Atom) 0; + } + } + + return m_atom; +} + //------------------------------------------------------------------------- // wxDataObject //------------------------------------------------------------------------- IMPLEMENT_ABSTRACT_CLASS( wxDataObject, wxObject ) +wxDataObject::wxDataObject() +{ +} + +wxDataObject::~wxDataObject() +{ +} + +wxDataFormat &wxDataObject::GetFormat() +{ + return m_format; +} + +wxDataFormatId wxDataObject::GetFormatType() const +{ + return m_format.GetType(); +} + +wxString wxDataObject::GetFormatId() const +{ + return m_format.GetId(); +} + +Atom wxDataObject::GetFormatAtom() const +{ + Atom ret = ((wxDataObject*) this)->m_format.GetAtom(); + return ret; +} + // ---------------------------------------------------------------------------- // wxTextDataObject // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS( wxTextDataObject, wxDataObject ) -// ---------------------------------------------------------------------------- -// wxFileDataObject -// ---------------------------------------------------------------------------- +wxTextDataObject::wxTextDataObject() +{ + m_format.SetType( wxDF_TEXT ); +} -IMPLEMENT_DYNAMIC_CLASS( wxFileDataObject, wxDataObject ) +wxTextDataObject::wxTextDataObject( const wxString& data ) +{ + m_format.SetType( wxDF_TEXT ); -// ---------------------------------------------------------------------------- -// wxBitmapDataObject -// ---------------------------------------------------------------------------- + m_data = data; +} + +void wxTextDataObject::SetText( const wxString& data ) +{ + m_data = data; +} + +wxString wxTextDataObject::GetText() const +{ + return m_data; +} -IMPLEMENT_DYNAMIC_CLASS( wxBitmapDataObject, wxDataObject ) +void wxTextDataObject::WriteData( void *dest ) const +{ + WriteString( m_data, dest ); +} + +size_t wxTextDataObject::GetSize() const +{ + return m_data.Len() + 1; +} + +void wxTextDataObject::WriteString( const wxString &str, void *dest ) const +{ + memcpy( dest, str.mb_str(), str.Len()+1 ); +} // ---------------------------------------------------------------------------- // wxPrivateDataObject @@ -44,26 +256,45 @@ IMPLEMENT_DYNAMIC_CLASS( wxBitmapDataObject, wxDataObject ) IMPLEMENT_DYNAMIC_CLASS( wxPrivateDataObject, wxDataObject ) -wxPrivateDataObject::wxPrivateDataObject() -{ - m_size = 0; - m_data = (char*) NULL; - m_id = wxTheApp->GetAppName(); +void wxPrivateDataObject::Free() +{ + if ( m_data ) + free(m_data); } - -wxPrivateDataObject::~wxPrivateDataObject() -{ - if (m_data) delete[] m_data; + +wxPrivateDataObject::wxPrivateDataObject() +{ + wxString id = _T("application/"); + id += wxTheApp->GetAppName(); + + m_format.SetId( id ); + + m_size = 0; + m_data = (void *)NULL; } - -void wxPrivateDataObject::SetData( const char *data, size_t size ) + +void wxPrivateDataObject::SetData( const void *data, size_t size ) { + Free(); + m_size = size; - - if (m_data) delete[] m_data; - - m_data = new char[size]; + m_data = malloc(size); - memcpy( m_data, data, size ); + memcpy( m_data, data, size ); +} + +void wxPrivateDataObject::WriteData( void *dest ) const +{ + WriteData( m_data, dest ); +} + +size_t wxPrivateDataObject::GetSize() const +{ + return m_size; +} + +void wxPrivateDataObject::WriteData( const void *data, void *dest ) const +{ + memcpy( dest, data, GetSize() ); } diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 775b1ca779..d298056eb6 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -60,6 +60,8 @@ wxList wxModalDialogs; wxList wxModelessWindows; // Frames and modeless dialogs extern wxList wxPendingDelete; +extern wxHashTable *wxWidgetHashTable; + #define wxUSE_INVISIBLE_RESIZE 1 #if !USE_SHARED_LIBRARY @@ -139,7 +141,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, XmStringFree(str); } - m_windowFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); + m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); ChangeFont(FALSE); wxAddWindowToTable(dialogShell, this); diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index 98682e8b99..08cb475d7d 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -50,6 +50,8 @@ #include "wx/motif/private.h" +extern wxHashTable *wxWidgetHashTable; + void wxCloseFrameCallback(Widget, XtPointer, XmAnyCallbackStruct *cbs); void wxFrameFocusProc(Widget workArea, XtPointer clientData, XmAnyCallbackStruct *cbs); @@ -91,7 +93,7 @@ wxFrame::wxFrame() m_frameMenuBar = NULL; m_frameStatusBar = NULL; - m_windowParent = NULL; + m_parent = NULL; m_iconized = FALSE; //// Motif-specific @@ -133,7 +135,7 @@ bool wxFrame::Create(wxWindow *parent, m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE); m_foregroundColour = *wxBLACK; - m_windowFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); + m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); if ( id > -1 ) m_windowId = id; diff --git a/src/motif/gauge.cpp b/src/motif/gauge.cpp index 5804f0b9b4..a8fc4cb16d 100644 --- a/src/motif/gauge.cpp +++ b/src/motif/gauge.cpp @@ -123,7 +123,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id, if (height == -1) height = 80; - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index dab3cd4846..0666c62369 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -111,7 +111,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, XtAddCallback (listWidget, XmNdefaultActionCallback, (XtCallbackProc) wxListBoxDefaultActionProc, (XtPointer) this); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index bace16b9f9..57786a54b9 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -302,7 +302,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE); m_foregroundColour = *wxBLACK; - m_windowFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); + m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); if ( id > -1 ) m_windowId = id; diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp index ea9ef07f6b..85c9cb6d19 100644 --- a/src/motif/radiobox.cpp +++ b/src/motif/radiobox.cpp @@ -63,7 +63,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, m_radioButtonLabels = (wxString*) NULL; m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); SetName(name); SetValidator(val); @@ -98,7 +98,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, m_formWidget = (WXWidget) formWidget; - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); if (label1 != "") { text = XmStringCreateSimple ((char*) (const char*) label1); @@ -177,7 +177,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, } SetSelection (0); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); // XtManageChild((Widget) m_formWidget); @@ -424,7 +424,7 @@ void wxRadioBox::ChangeFont(bool keepOriginalSize) { wxWindow::ChangeFont(keepOriginalSize); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay((Widget) GetTopWidget())); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) GetTopWidget())); int i; for (i = 0; i < m_noItems; i++) diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp index 7fe7f99d31..7092369312 100644 --- a/src/motif/radiobut.cpp +++ b/src/motif/radiobut.cpp @@ -47,7 +47,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, SetValidator(validator); m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); if (parent) parent->AddChild(this); @@ -64,7 +64,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, XmString text = XmStringCreateSimple ((char*) (const char*) label1); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); Widget radioButtonWidget = XtVaCreateManagedWidget ("toggle", #if wxUSE_GADGETS diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index ab2b4f6e4a..5493609873 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -99,7 +99,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, XtAddCallback (sliderWidget, XmNdragCallback, (XtCallbackProc) wxSliderCallback, (XtPointer) this); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp index ba3ae76b29..d4a8308d1a 100644 --- a/src/motif/statbmp.cpp +++ b/src/motif/statbmp.cpp @@ -66,7 +66,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, XmNlabelType, XmPIXMAP, NULL); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp index c3cda9c6d5..872d120417 100644 --- a/src/motif/statbox.cpp +++ b/src/motif/statbox.cpp @@ -27,7 +27,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) BEGIN_EVENT_TABLE(wxStaticBox, wxControl) - EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground) +// EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground) END_EVENT_TABLE() #endif @@ -53,7 +53,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, m_labelWidget = (WXWidget) 0; m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); SetName(name); @@ -79,7 +79,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, if (hasLabel) { - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); wxString label1(wxStripMenuCodes(label)); XmString text = XmStringCreateSimple ((char*) (const char*) label1); diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index 996cf9315e..ab21159392 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -45,7 +45,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_windowId = id; m_windowStyle = style; - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); char* label1 = (label.IsNull() ? "" : (char*) (const char*) label); @@ -56,7 +56,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, // XmString text = XmStringCreateSimple (label1); XmString text = XmStringCreateLtoR (label1, XmSTRING_DEFAULT_CHARSET); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); m_mainWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) name, xmLabelWidgetClass, diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index 5a8950d25d..9668a888a8 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -185,7 +185,7 @@ bool wxTextCtrl::Create(wxWindow *parent, XtAddCallback((Widget) m_mainWidget, XmNlosingFocusCallback, (XtCallbackProc)wxTextWindowLoseFocusProc, (XtPointer)this); // font - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 319e564d81..2ab14b3f8a 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -106,7 +106,7 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons m_mainWidget = (WXWidget) toolbar; - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); ChangeFont(FALSE); SetCanAddEventHandler(TRUE); diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 47e93405ef..65d6c32bec 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -541,8 +541,8 @@ wxXSetBusyCursor (wxWindow * win, wxCursor * cursor) else { // Restore old cursor - if (win->GetCursor()->Ok()) - attrs.cursor = (Cursor) win->GetCursor()->GetXCursor(display); + if (win->GetCursor().Ok()) + attrs.cursor = (Cursor) win->GetCursor().GetXCursor(display); else attrs.cursor = None; } -- 2.45.2