From c330a2cf9369d3ae2bdb3bd67e995517288b353d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 26 Jan 1999 11:51:12 +0000 Subject: [PATCH] Some compile warnings removed; file selector prototypes put in each filedlg.h; Dialog Editor wxGTK makefile hacked git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/fileconf.h | 8 ++++ include/wx/filedlg.h | 35 ---------------- include/wx/filefn.h | 4 ++ include/wx/gtk/filedlg.h | 36 ++++++++++++++++ include/wx/gtk1/filedlg.h | 36 ++++++++++++++++ include/wx/mimetype.h | 2 +- include/wx/motif/bmpbuttn.h | 4 ++ include/wx/motif/checkbox.h | 1 + include/wx/motif/choice.h | 1 + include/wx/motif/combobox.h | 1 + include/wx/motif/dcclient.h | 77 +++++++++++++++++++++++++++++++++++ include/wx/motif/dialog.h | 1 + include/wx/motif/filedlg.h | 8 ++-- include/wx/motif/frame.h | 1 + include/wx/motif/gauge.h | 1 + include/wx/motif/icon.h | 2 + include/wx/motif/listbox.h | 3 ++ include/wx/motif/mdi.h | 2 + include/wx/motif/radiobox.h | 2 + include/wx/motif/slider.h | 1 + include/wx/motif/statbmp.h | 1 + include/wx/motif/statbox.h | 1 + include/wx/msw/filedlg.h | 36 ++++++++++++++++ include/wx/prntbase.h | 2 +- include/wx/stubs/filedlg.h | 35 ++++++++++++++++ samples/controls/controls.cpp | 6 +++ src/common/prntbase.cpp | 4 +- src/gtk/menu.cpp | 2 +- src/gtk1/menu.cpp | 2 +- src/motif/filedlg.cpp | 2 +- 30 files changed, 271 insertions(+), 46 deletions(-) diff --git a/include/wx/fileconf.h b/include/wx/fileconf.h index 3465dc923f..c4712f7147 100644 --- a/include/wx/fileconf.h +++ b/include/wx/fileconf.h @@ -202,9 +202,17 @@ public: { return wxConfigBase::Read(key, val); } bool Read(const wxString& key, double* val, double defVal) const { return wxConfigBase::Read(key, val, defVal); } + bool Read(const wxString& key, bool* val) const + { return wxConfigBase::Read(key, val); } + bool Read(const wxString& key, bool* val, bool defVal) const + { return wxConfigBase::Read(key, val, defVal); } virtual bool Write(const wxString& key, const wxString& szValue); virtual bool Write(const wxString& key, long lValue); + bool Write(const wxString& key, double value) + { return wxConfigBase::Write(key, value); } + bool Write(const wxString& key, bool value) + { return wxConfigBase::Write(key, value); } virtual bool Flush(bool bCurrentOnly = FALSE); diff --git a/include/wx/filedlg.h b/include/wx/filedlg.h index 179638097c..7fc2e7a76e 100644 --- a/include/wx/filedlg.h +++ b/include/wx/filedlg.h @@ -15,41 +15,6 @@ #include "wx/stubs/filedlg.h" #endif -// File selector - backward compatibility -WXDLLEXPORT wxString -wxFileSelector(const char *message = wxFileSelectorPromptStr, - const char *default_path = NULL, - const char *default_filename = NULL, - const char *default_extension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, - int flags = 0, - wxWindow *parent = NULL, - int x = -1, int y = -1); - -// An extended version of wxFileSelector -WXDLLEXPORT wxString -wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, - const char *default_path = NULL, - const char *default_filename = NULL, - int *indexDefaultExtension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, - int flags = 0, - wxWindow *parent = NULL, - int x = -1, int y = -1); - -// Ask for filename to load -WXDLLEXPORT wxString -wxLoadFileSelector(const char *what, - const char *extension, - const char *default_name = (const char *)NULL, - wxWindow *parent = (wxWindow *) NULL); - -// Ask for filename to save -WXDLLEXPORT wxString -wxSaveFileSelector(const char *what, - const char *extension, - const char *default_name = (const char *) NULL, - wxWindow *parent = (wxWindow *) NULL); #endif // _WX_FILEDLG_H_BASE_ diff --git a/include/wx/filefn.h b/include/wx/filefn.h index ae1bf31032..3127f1c51e 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -210,7 +210,11 @@ class WXDLLEXPORT wxPathList : public wxStringList { public: void AddEnvList(const wxString& envVariable); // Adds all paths in environment variable + void Add(const wxString& path); + // Avoid compiler warning + wxNode *Add(const char *s) { return wxStringList::Add(s); } + wxString FindValidPath(const wxString& filename); // Find the first full path // for which the file exists wxString FindAbsoluteValidPath(const wxString& filename); // Find the first full path diff --git a/include/wx/gtk/filedlg.h b/include/wx/gtk/filedlg.h index 78e4e84eb5..641c056762 100644 --- a/include/wx/gtk/filedlg.h +++ b/include/wx/gtk/filedlg.h @@ -76,5 +76,41 @@ class wxFileDialog: public wxDialog #define wxHIDE_READONLY 8 #define wxFILE_MUST_EXIST 16 +// File selector - backward compatibility +WXDLLEXPORT wxString +wxFileSelector(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + const char *default_extension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// An extended version of wxFileSelector +WXDLLEXPORT wxString +wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + int *indexDefaultExtension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// Ask for filename to load +WXDLLEXPORT wxString +wxLoadFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *)NULL, + wxWindow *parent = (wxWindow *) NULL); + +// Ask for filename to save +WXDLLEXPORT wxString +wxSaveFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *) NULL, + wxWindow *parent = (wxWindow *) NULL); + #endif // __GTKFILEDLGH__ diff --git a/include/wx/gtk1/filedlg.h b/include/wx/gtk1/filedlg.h index 78e4e84eb5..641c056762 100644 --- a/include/wx/gtk1/filedlg.h +++ b/include/wx/gtk1/filedlg.h @@ -76,5 +76,41 @@ class wxFileDialog: public wxDialog #define wxHIDE_READONLY 8 #define wxFILE_MUST_EXIST 16 +// File selector - backward compatibility +WXDLLEXPORT wxString +wxFileSelector(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + const char *default_extension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// An extended version of wxFileSelector +WXDLLEXPORT wxString +wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + int *indexDefaultExtension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// Ask for filename to load +WXDLLEXPORT wxString +wxLoadFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *)NULL, + wxWindow *parent = (wxWindow *) NULL); + +// Ask for filename to save +WXDLLEXPORT wxString +wxSaveFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *) NULL, + wxWindow *parent = (wxWindow *) NULL); + #endif // __GTKFILEDLGH__ diff --git a/include/wx/mimetype.h b/include/wx/mimetype.h index d79caf78af..4c5f826a17 100644 --- a/include/wx/mimetype.h +++ b/include/wx/mimetype.h @@ -50,7 +50,7 @@ public: const wxString& GetMimeType() const { return m_mimetype; } // override this function in derived class - virtual wxString GetParamValue(const wxString& paramName) const + virtual wxString GetParamValue(const wxString& WXUNUSED(paramName)) const { return ""; } // virtual dtor as in any base class diff --git a/include/wx/motif/bmpbuttn.h b/include/wx/motif/bmpbuttn.h index 66e0ed7713..47fe63c018 100644 --- a/include/wx/motif/bmpbuttn.h +++ b/include/wx/motif/bmpbuttn.h @@ -47,6 +47,10 @@ class WXDLLEXPORT wxBitmapButton: public wxButton { SetBitmapLabel(bitmap); } + virtual void SetLabel(const wxString& label) + { + wxControl::SetLabel(label); + } virtual void SetBitmapLabel(const wxBitmap& bitmap); diff --git a/include/wx/motif/checkbox.h b/include/wx/motif/checkbox.h index 6a159d5295..187cd9aa91 100644 --- a/include/wx/motif/checkbox.h +++ b/include/wx/motif/checkbox.h @@ -83,6 +83,7 @@ class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } virtual void SetLabel(const wxBitmap *bitmap); }; diff --git a/include/wx/motif/choice.h b/include/wx/motif/choice.h index 1e3c872c5d..17702e03cb 100644 --- a/include/wx/motif/choice.h +++ b/include/wx/motif/choice.h @@ -60,6 +60,7 @@ class WXDLLEXPORT wxChoice: public wxControl virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } virtual wxString GetStringSelection() const ; virtual bool SetStringSelection(const wxString& sel); diff --git a/include/wx/motif/combobox.h b/include/wx/motif/combobox.h index 890acc3fc0..7568d28b79 100644 --- a/include/wx/motif/combobox.h +++ b/include/wx/motif/combobox.h @@ -55,6 +55,7 @@ class WXDLLEXPORT wxComboBox: public wxChoice virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } // List functions virtual void Append(const wxString& item); diff --git a/include/wx/motif/dcclient.h b/include/wx/motif/dcclient.h index fc256e3e4d..2eef5da012 100644 --- a/include/wx/motif/dcclient.h +++ b/include/wx/motif/dcclient.h @@ -44,13 +44,44 @@ class WXDLLEXPORT wxWindowDC: public wxDC ~wxWindowDC(void); virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE ); + inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE) + { + FloodFill(pt.x, pt.y, col, style); + } + virtual bool GetPixel( long x1, long y1, wxColour *col ) const; + inline bool GetPixel(const wxPoint& pt, wxColour *col) const + { + return GetPixel(pt.x, pt.y, col); + } virtual void DrawLine( long x1, long y1, long x2, long y2 ); + inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2) + { + DrawLine(pt1.x, pt1.y, pt2.x, pt2.y); + } + virtual void CrossHair( long x, long y ); + inline void CrossHair(const wxPoint& pt) + { + CrossHair(pt.x, pt.y); + } + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ); + inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) + { + DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); + } + virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ); + virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea) + { + DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); + } + virtual void DrawPoint( long x, long y ); + inline void DrawPoint( wxPoint& point ) + { DrawPoint(point.x, point.y); } virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ); virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 ); @@ -60,15 +91,57 @@ class WXDLLEXPORT wxWindowDC: public wxDC int fillStyle=wxODDEVEN_RULE ); virtual void DrawRectangle( long x, long y, long width, long height ); + inline void DrawRectangle(const wxPoint& pt, const wxSize& sz) + { + DrawRectangle(pt.x, pt.y, sz.x, sz.y); + } + inline void DrawRectangle(const wxRect& rect) + { + DrawRectangle(rect.x, rect.y, rect.width, rect.height); + } + virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ); + inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0) + { + DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); + } + inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0) + { + DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius); + } + virtual void DrawEllipse( long x, long y, long width, long height ); + inline void DrawEllipse(const wxPoint& pt, const wxSize& sz) + { + DrawEllipse(pt.x, pt.y, sz.x, sz.y); + } + inline void DrawEllipse(const wxRect& rect) + { + DrawEllipse(rect.x, rect.y, rect.width, rect.height); + } virtual bool CanDrawBitmap(void) const; + virtual void DrawIcon( const wxIcon &icon, long x, long y); + inline void DrawIcon(const wxIcon& icon, const wxPoint& pt) + { + DrawIcon(icon, pt.x, pt.y); + } + virtual bool Blit( long xdest, long ydest, long width, long height, wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ); + inline bool Blit(const wxPoint& destPt, const wxSize& sz, + wxDC *source, const wxPoint& srcPt, int rop = wxCOPY, bool useMask = FALSE) + { + return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask); + } virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ); + inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE) + { + DrawText(text, pt.x, pt.y, use16bit); + } + virtual bool CanGetTextExtent(void) const; virtual void GetTextExtent( const wxString &string, long *width, long *height, long *descent = NULL, long *externalLeading = NULL, @@ -94,6 +167,10 @@ class WXDLLEXPORT wxWindowDC: public wxDC virtual void DestroyClippingRegion(void); virtual void DrawSpline( wxList *points ); + virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ) + { wxDC::DrawSpline(x1, y1, x2, y2, x3, y3); } + virtual void DrawSpline( int n, wxPoint points[] ) + { wxDC::DrawSpline(n, points); } // Motif-specific void SetDCClipping (); // Helper function for setting clipping diff --git a/include/wx/motif/dialog.h b/include/wx/motif/dialog.h index 36994eccb5..f1d351436b 100644 --- a/include/wx/motif/dialog.h +++ b/include/wx/motif/dialog.h @@ -67,6 +67,7 @@ public: virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } bool Show(bool show); void Iconize(bool iconize); diff --git a/include/wx/motif/filedlg.h b/include/wx/motif/filedlg.h index a3fb0750e6..29cd0fb8f7 100644 --- a/include/wx/motif/filedlg.h +++ b/include/wx/motif/filedlg.h @@ -74,22 +74,22 @@ public: #define wxFILE_MUST_EXIST 0x0010 // File selector - backward compatibility -char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, +WXDLLEXPORT wxString wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, const char *default_filename = NULL, const char *default_extension = NULL, const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1); // An extended version of wxFileSelector -char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, +WXDLLEXPORT wxString wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, const char *default_filename = NULL, int *indexDefaultExtension = NULL, const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1); // Generic file load dialog -char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); +WXDLLEXPORT wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); // Generic file save dialog -char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); +WXDLLEXPORT wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); #endif // _WX_FILEDLG_H_ diff --git a/include/wx/motif/frame.h b/include/wx/motif/frame.h index 91b6567d8e..25afb91bd8 100644 --- a/include/wx/motif/frame.h +++ b/include/wx/motif/frame.h @@ -71,6 +71,7 @@ public: virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } void ClientToScreen(int *x, int *y) const; wxPoint ClientToScreen(const wxPoint& pt) const { return wxWindow::ClientToScreen(pt); } diff --git a/include/wx/motif/gauge.h b/include/wx/motif/gauge.h index 30381c04e8..81413b0488 100644 --- a/include/wx/motif/gauge.h +++ b/include/wx/motif/gauge.h @@ -60,6 +60,7 @@ class WXDLLEXPORT wxGauge: public wxControl virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; diff --git a/include/wx/motif/icon.h b/include/wx/motif/icon.h index 89f048ab15..4231ec7e05 100644 --- a/include/wx/motif/icon.h +++ b/include/wx/motif/icon.h @@ -56,6 +56,8 @@ public: bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE, int desiredWidth = -1, int desiredHeight = -1); + bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XBM) + { return wxBitmap::LoadFile(name, type); } inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; } inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; } diff --git a/include/wx/motif/listbox.h b/include/wx/motif/listbox.h index 0a7ccee86f..5d3d61ca42 100644 --- a/include/wx/motif/listbox.h +++ b/include/wx/motif/listbox.h @@ -67,7 +67,9 @@ class WXDLLEXPORT wxListBox: public wxControl virtual int GetSelection() const ; virtual void Delete(int n); virtual char *GetClientData(int n) const ; + virtual void *GetClientData() { return wxWindow::GetClientData(); } virtual void SetClientData(int n, char *clientData); + virtual void SetClientData( void *data ) { wxWindow::SetClientData(data); } virtual void SetString(int n, const wxString& s); // For single or multiple choice list item @@ -79,6 +81,7 @@ class WXDLLEXPORT wxListBox: public wxControl virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } // Set the specified item at the first visible item // or scroll to max range. diff --git a/include/wx/motif/mdi.h b/include/wx/motif/mdi.h index 557f0044db..a45aa1e434 100644 --- a/include/wx/motif/mdi.h +++ b/include/wx/motif/mdi.h @@ -155,6 +155,7 @@ public: virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } void GetSize(int *width, int *height) const; wxSize GetSize() const { return wxWindow::GetSize(); } @@ -226,6 +227,7 @@ class WXDLLEXPORT wxMDIClientWindow: public wxNotebook void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } void SetClientSize(int width, int height); void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); } diff --git a/include/wx/motif/radiobox.h b/include/wx/motif/radiobox.h index 527f9772b7..6d536f7a97 100644 --- a/include/wx/motif/radiobox.h +++ b/include/wx/motif/radiobox.h @@ -54,6 +54,8 @@ public: void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } + void SetLabel(const wxString& label) { wxControl::SetLabel(label); }; void SetLabel(int item, const wxString& label) ; wxString GetLabel(int item) const; diff --git a/include/wx/motif/slider.h b/include/wx/motif/slider.h index d0448159f1..5d1bacf51a 100644 --- a/include/wx/motif/slider.h +++ b/include/wx/motif/slider.h @@ -58,6 +58,7 @@ public: void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } void SetRange(int minValue, int maxValue); diff --git a/include/wx/motif/statbmp.h b/include/wx/motif/statbmp.h index ccc1c0e86c..3da85fba6f 100644 --- a/include/wx/motif/statbmp.h +++ b/include/wx/motif/statbmp.h @@ -53,6 +53,7 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; } diff --git a/include/wx/motif/statbox.h b/include/wx/motif/statbox.h index 4f8e005eec..5ebf48dd4e 100644 --- a/include/wx/motif/statbox.h +++ b/include/wx/motif/statbox.h @@ -52,6 +52,7 @@ class WXDLLEXPORT wxStaticBox: public wxControl void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) { wxWindow::SetSize(rect, sizeFlags); } void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } void SetLabel(const wxString& label); wxString GetLabel() const; diff --git a/include/wx/msw/filedlg.h b/include/wx/msw/filedlg.h index 89c919c1c4..7a02cfab45 100644 --- a/include/wx/msw/filedlg.h +++ b/include/wx/msw/filedlg.h @@ -69,5 +69,41 @@ protected: #define wxHIDE_READONLY 0x0008 #define wxFILE_MUST_EXIST 0x0010 +// File selector - backward compatibility +WXDLLEXPORT wxString +wxFileSelector(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + const char *default_extension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// An extended version of wxFileSelector +WXDLLEXPORT wxString +wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + int *indexDefaultExtension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// Ask for filename to load +WXDLLEXPORT wxString +wxLoadFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *)NULL, + wxWindow *parent = (wxWindow *) NULL); + +// Ask for filename to save +WXDLLEXPORT wxString +wxSaveFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *) NULL, + wxWindow *parent = (wxWindow *) NULL); + #endif // _WX_FILEDLG_H_ diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index f484b7a925..9bd3aeb0c1 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -221,7 +221,7 @@ public: inline virtual wxPrintPreviewBase *GetPrintPreview() const { return m_printPreview; } void OnPrint(wxCommandEvent& event); - void OnClose(wxCommandEvent& event); + void OnWindowClose(wxCommandEvent& event); void OnNext(wxCommandEvent& event); void OnPrevious(wxCommandEvent& event); void OnZoom(wxCommandEvent& event); diff --git a/include/wx/stubs/filedlg.h b/include/wx/stubs/filedlg.h index 1abeed4d68..a5e532fa24 100644 --- a/include/wx/stubs/filedlg.h +++ b/include/wx/stubs/filedlg.h @@ -67,5 +67,40 @@ public: #define wxHIDE_READONLY 0x0008 #define wxFILE_MUST_EXIST 0x0010 +// File selector - backward compatibility +WXDLLEXPORT wxString +wxFileSelector(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + const char *default_extension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// An extended version of wxFileSelector +WXDLLEXPORT wxString +wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + int *indexDefaultExtension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// Ask for filename to load +WXDLLEXPORT wxString +wxLoadFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *)NULL, + wxWindow *parent = (wxWindow *) NULL); + +// Ask for filename to save +WXDLLEXPORT wxString +wxSaveFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *) NULL, + wxWindow *parent = (wxWindow *) NULL); #endif // _WX_FILEDLG_H_ diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index f9a4752eea..d0f9bbb2d5 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -28,7 +28,10 @@ #include "wx/imaglist.h" #include "wx/spinbutt.h" #include "wx/clipbrd.h" + +#ifdef __WXGTK__ #include "wx/tooltip.h" +#endif #if defined(__WXGTK__) || defined(__WXMOTIF__) #define USE_XPM @@ -337,7 +340,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) : (void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) ); button = new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) ); + +#ifdef __WXGTK__ wxToolTip::Add( button, "Press here to set italic font" ); +#endif // button->SetForegroundColour( "red" ); m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) ); m_checkbox->SetValue(FALSE); diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 03532a1b97..c8cba869c4 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -222,7 +222,7 @@ void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event) */ BEGIN_EVENT_TABLE(wxPreviewControlBar, wxPanel) - EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnClose) + EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnWindowClose) EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrint) EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPrevious) EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNext) @@ -259,7 +259,7 @@ void wxPreviewControlBar::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.DrawLine( 0, h-1, w, h-1 ); } -void wxPreviewControlBar::OnClose(wxCommandEvent& WXUNUSED(event)) +void wxPreviewControlBar::OnWindowClose(wxCommandEvent& WXUNUSED(event)) { wxPreviewFrame *frame = (wxPreviewFrame *)GetParent(); frame->Close(TRUE); diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 424da9aa7e..27173bba72 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -168,7 +168,7 @@ void wxMenuBar::SetLabel( int id, const wxString &label ) { wxMenuItem* item = FindMenuItemById( id ); - if (item) return item->SetText( label ); + if (item) item->SetText( label ); } void wxMenuBar::EnableTop( int pos, bool flag ) diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 424da9aa7e..27173bba72 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -168,7 +168,7 @@ void wxMenuBar::SetLabel( int id, const wxString &label ) { wxMenuItem* item = FindMenuItemById( id ); - if (item) return item->SetText( label ); + if (item) item->SetText( label ); } void wxMenuBar::EnableTop( int pos, bool flag ) diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp index cde482345f..0f22a05299 100644 --- a/src/motif/filedlg.cpp +++ b/src/motif/filedlg.cpp @@ -96,7 +96,7 @@ wxString wxFileSelectorEx(const char *title, if ( fileDialog.ShowModal() == wxID_OK ) { *defaultFilterIndex = fileDialog.GetFilterIndex(); - return fileDialog.GetPath()); + return fileDialog.GetPath(); } else return wxEmptyString; -- 2.45.2