From e9321277925fc8eb439dd713fc7015cc873f0c38 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 16 Sep 2011 17:03:01 +0000 Subject: [PATCH 1/1] fixes for missing or broken interface items for Phoenix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/checklst.h | 20 ++++++++++++++++++++ interface/wx/combobox.h | 11 +++++++++++ interface/wx/dataview.h | 30 ++++++++++++++++++++++++++++++ interface/wx/defs.h | 13 ++++++++++++- interface/wx/fileconf.h | 37 +++++++++++++++++++++++++++++++++++++ interface/wx/filedlg.h | 11 +++++++++++ interface/wx/font.h | 3 ++- interface/wx/gauge.h | 11 +++++++++++ interface/wx/listbox.h | 19 +++++++++++++++++++ interface/wx/menu.h | 24 +++++++++++++++++++++++- interface/wx/textentry.h | 2 +- 11 files changed, 177 insertions(+), 4 deletions(-) diff --git a/interface/wx/checklst.h b/interface/wx/checklst.h index 8789618478..4e17472566 100644 --- a/interface/wx/checklst.h +++ b/interface/wx/checklst.h @@ -109,6 +109,25 @@ public: const wxString& name = "listBox"); //@} + bool Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + int nStrings = 0, + const wxString choices[] = NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxListBoxNameStr); + + bool Create(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxListBoxNameStr); + /** Destructor, destroying the list box. */ @@ -132,5 +151,6 @@ public: Index of item whose check status is to be returned. */ bool IsChecked(unsigned int item) const; + }; diff --git a/interface/wx/combobox.h b/interface/wx/combobox.h index e77f8a8fd2..738ca21a9d 100644 --- a/interface/wx/combobox.h +++ b/interface/wx/combobox.h @@ -305,5 +305,16 @@ public: @since 2.9.1 */ virtual void Dismiss(); + + virtual int GetSelection() const; + virtual void GetSelection(long *from, long *to) const; + virtual void SetSelection(int n); + virtual void SetSelection(long from, long to); + virtual int FindString(const wxString& s, bool bCase = false) const; + virtual wxString GetString(unsigned int n) const; + virtual wxString GetStringSelection() const; + virtual void SetString(unsigned int n, const wxString& s); + + virtual unsigned int GetCount() const; }; diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 0c06dae862..d0659a9f7c 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -631,6 +631,36 @@ public: }; +// ---------------------------------------------------------------------------- +// wxDataViewCtrl flags +// ---------------------------------------------------------------------------- + +// size of a wxDataViewRenderer without contents: +#define wxDVC_DEFAULT_RENDERER_SIZE 20 + +// the default width of new (text) columns: +#define wxDVC_DEFAULT_WIDTH 80 + +// the default width of new toggle columns: +#define wxDVC_TOGGLE_DEFAULT_WIDTH 30 + +// the default minimal width of the columns: +#define wxDVC_DEFAULT_MINWIDTH 30 + +// The default alignment of wxDataViewRenderers is to take +// the alignment from the column it owns. +#define wxDVR_DEFAULT_ALIGNMENT -1 + +#define wxDV_SINGLE 0x0000 // for convenience +#define wxDV_MULTIPLE 0x0001 // can select multiple items + +#define wxDV_NO_HEADER 0x0002 // column titles not visible +#define wxDV_HORIZ_RULES 0x0004 // light horizontal rules between rows +#define wxDV_VERT_RULES 0x0008 // light vertical rules between columns + +#define wxDV_ROW_LINES 0x0010 // alternating colour in rows +#define wxDV_VARIABLE_LINE_HEIGHT 0x0020 // variable line height + /** @class wxDataViewCtrl diff --git a/interface/wx/defs.h b/interface/wx/defs.h index e8ce18bf23..5444441351 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -469,6 +469,10 @@ enum wxBorder (wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE) +/* symbolic constant used by all Find()-like functions returning positive */ +/* integer on success as failure indicator */ +#define wxNOT_FOUND (-1) + /** Background styles. @@ -517,7 +521,14 @@ enum wxBackgroundStyle EVT_ERASE_BACKGROUND event will not be generated at all for windows with this style. */ - wxBG_STYLE_PAINT + wxBG_STYLE_PAINT, + + /* this style is deprecated and doesn't do anything, don't use */ + wxBG_STYLE_COLOUR, + + /* this is a Mac-only style, don't use in portable code */ + wxBG_STYLE_TRANSPARENT, + }; diff --git a/interface/wx/fileconf.h b/interface/wx/fileconf.h index d4019a7fa3..5f22d8a79d 100644 --- a/interface/wx/fileconf.h +++ b/interface/wx/fileconf.h @@ -27,6 +27,16 @@ class wxFileConfig : public wxConfigBase { public: + + // New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or + // wxCONFIG_USE_GLOBAL_FILE to say which files should be used. + wxFileConfig(const wxString& appName = wxEmptyString, + const wxString& vendorName = wxEmptyString, + const wxString& localFilename = wxEmptyString, + const wxString& globalFilename = wxEmptyString, + long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE, + const wxMBConv& conv = wxConvAuto()); + /** Read the config data from the specified stream instead of the associated file, as usual. @@ -57,6 +67,9 @@ public: */ static wxFileName GetLocalFile(const wxString& basename, int style = 0); + static wxString GetGlobalFileName(const wxString& szFile); + static wxString GetLocalFileName(const wxString& szFile, int style = 0); + /** Saves all config data to the given stream, returns @true if data was saved successfully or @false on error. @@ -81,5 +94,29 @@ public: @see wxCHANGE_UMASK() */ void SetUmask(int mode); + + // implement inherited pure virtual functions + virtual void SetPath(const wxString& strPath); + virtual const wxString& GetPath() const; + + virtual bool GetFirstGroup(wxString& str, long& lIndex) const; + virtual bool GetNextGroup (wxString& str, long& lIndex) const; + virtual bool GetFirstEntry(wxString& str, long& lIndex) const; + virtual bool GetNextEntry (wxString& str, long& lIndex) const; + + virtual size_t GetNumberOfEntries(bool bRecursive = false) const; + virtual size_t GetNumberOfGroups(bool bRecursive = false) const; + + virtual bool HasGroup(const wxString& strName) const; + virtual bool HasEntry(const wxString& strName) const; + + virtual bool Flush(bool bCurrentOnly = false); + + virtual bool RenameEntry(const wxString& oldName, const wxString& newName); + virtual bool RenameGroup(const wxString& oldName, const wxString& newName); + + virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true); + virtual bool DeleteGroup(const wxString& szKey); + virtual bool DeleteAll(); }; diff --git a/interface/wx/filedlg.h b/interface/wx/filedlg.h index a3c5bfd621..e8dd236323 100644 --- a/interface/wx/filedlg.h +++ b/interface/wx/filedlg.h @@ -6,6 +6,17 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +enum +{ + wxFD_OPEN = 0x0001, + wxFD_SAVE = 0x0002, + wxFD_OVERWRITE_PROMPT = 0x0004, + wxFD_FILE_MUST_EXIST = 0x0010, + wxFD_MULTIPLE = 0x0020, + wxFD_CHANGE_DIR = 0x0080, + wxFD_PREVIEW = 0x0100 +}; + /** @class wxFileDialog diff --git a/interface/wx/font.h b/interface/wx/font.h index 3d4d3b1fdc..7d8316ce92 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -36,9 +36,10 @@ enum wxFontFamily /// See also wxFont::IsFixedWidth() for an easy way to test for monospace property. wxFONTFAMILY_TELETYPE = wxTELETYPE, + wxFONTFAMILY_MAX, /// Invalid font family value, returned by wxFont::GetFamily() when the /// font is invalid for example. - wxFONTFAMILY_UNKNOWN + wxFONTFAMILY_UNKNOWN = wxFONTFAMILY_MAX }; /** diff --git a/interface/wx/gauge.h b/interface/wx/gauge.h index 1abe6bca20..c17a9ea04b 100644 --- a/interface/wx/gauge.h +++ b/interface/wx/gauge.h @@ -6,6 +6,17 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// wxGauge style flags +// ---------------------------------------------------------------------------- + +#define wxGA_HORIZONTAL wxHORIZONTAL +#define wxGA_VERTICAL wxVERTICAL + +// Win32 only, is default (and only) on some other platforms +#define wxGA_SMOOTH 0x0020 + /** @class wxGauge diff --git a/interface/wx/listbox.h b/interface/wx/listbox.h index a802354f32..68fe933e88 100644 --- a/interface/wx/listbox.h +++ b/interface/wx/listbox.h @@ -166,6 +166,13 @@ public: */ void Deselect(int n); + virtual void SetSelection(int n); + + virtual int GetSelection() const; + + virtual bool SetStringSelection(const wxString& s, bool select); + virtual bool SetStringSelection(const wxString& s); + /** Fill an array of ints with the positions of the currently selected items. @@ -291,5 +298,17 @@ public: The string that should be visible. */ void SetFirstItem(const wxString& string); + + virtual void EnsureVisible(int n); + + virtual bool IsSorted() const; + + // implement base class pure virtuals + virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL); + + virtual unsigned int GetCount() const; + virtual wxString GetString(unsigned int n) const; + virtual void SetString(unsigned int n, const wxString& s); + virtual int FindString(const wxString& s, bool bCase = false) const; }; diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 87922d10a8..d1df2b809f 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -373,6 +373,28 @@ public: @remarks Use only after the menubar has been associated with a frame. */ virtual void SetMenuLabel(size_t pos, const wxString& label); + + /** + Enables you to set the global menubar on Mac, that is, the menubar displayed + when the app is running without any frames open. + + @param menubar + The menubar to set. + + @remarks Only exists on Mac, other platforms do not have this method. + */ + static void MacSetCommonMenuBar(wxMenuBar* menubar); + + /** + Enables you to get the global menubar on Mac, that is, the menubar displayed + when the app is running without any frames open. + + @return The global menubar. + + @remarks Only exists on Mac, other platforms do not have this method. + */ + static wxMenuBar* MacGetCommonMenuBar(); + }; @@ -799,7 +821,7 @@ public: @see Append(), Prepend() */ - wxMenuItem* Insert(size_t pos, wxMenuItem* item); + wxMenuItem* Insert(size_t pos, wxMenuItem* menuItem); /** Inserts the given @a item before the position @a pos. diff --git a/interface/wx/textentry.h b/interface/wx/textentry.h index b1b6a5d5cf..330b00efa1 100644 --- a/interface/wx/textentry.h +++ b/interface/wx/textentry.h @@ -442,7 +442,7 @@ public: @since 2.9.0 */ - virtual void SetHint(const wxString& hint); + virtual bool SetHint(const wxString& hint); /** Returns the current hint string. -- 2.45.2