From 1802a5769601ecc84298d5732b6f5bcb42b07137 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 14 May 2016 23:48:31 -0700 Subject: [PATCH 01/36] Fix parameter names in wxMediaCtrl::Load* methods --- interface/wx/mediactrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/mediactrl.h b/interface/wx/mediactrl.h index 2184fd6e3d..1dd6db3283 100644 --- a/interface/wx/mediactrl.h +++ b/interface/wx/mediactrl.h @@ -372,13 +372,13 @@ public: /** Same as Load(const wxURI& uri). Kept for wxPython compatibility. */ - bool LoadURI(const wxString& fileName); + bool LoadURI(const wxString& uri); /** Same as Load(const wxURI& uri, const wxURI& proxy). Kept for wxPython compatibility. */ - bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy); + bool LoadURIWithProxy(const wxString& uri, const wxString& proxy); /** Pauses playback of the movie. From 5260de14716fb2a3faceb474c22efbb1e10998a6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 21 Jun 2016 14:07:56 -0700 Subject: [PATCH 02/36] Fix typos and missing items in the ribbon interface definitions --- include/wx/ribbon/gallery.h | 3 +++ interface/wx/ribbon/art.h | 6 ++--- interface/wx/ribbon/bar.h | 45 +++++++++++++++++++++++++++++++++ interface/wx/ribbon/buttonbar.h | 4 +++ interface/wx/ribbon/gallery.h | 6 +++++ interface/wx/ribbon/panel.h | 12 +++++++++ interface/wx/ribbon/toolbar.h | 18 +++++++++++++ 7 files changed, 91 insertions(+), 3 deletions(-) diff --git a/include/wx/ribbon/gallery.h b/include/wx/ribbon/gallery.h index 4c1b2fd726..cf7b9875de 100644 --- a/include/wx/ribbon/gallery.h +++ b/include/wx/ribbon/gallery.h @@ -179,10 +179,13 @@ typedef void (wxEvtHandler::*wxRibbonGalleryEventFunction)(wxRibbonGalleryEvent& // wxpython/swig event work %constant wxEventType wxEVT_RIBBONGALLERY_HOVER_CHANGED; %constant wxEventType wxEVT_RIBBONGALLERY_SELECTED; +%constant wxEventType wxEVT_RIBBONGALLERY_CLICKED; + %pythoncode { EVT_RIBBONGALLERY_HOVER_CHANGED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_HOVER_CHANGED, 1 ) EVT_RIBBONGALLERY_SELECTED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_SELECTED, 1 ) + EVT_RIBBONGALLERY_CLICKED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_CLICKED, 1 ) } #endif // SWIG diff --git a/interface/wx/ribbon/art.h b/interface/wx/ribbon/art.h index febae28a1d..84a5338c49 100644 --- a/interface/wx/ribbon/art.h +++ b/interface/wx/ribbon/art.h @@ -278,7 +278,7 @@ public: @see SetColourScheme() */ - virtual void SetColour(int id, const wxColor& colour) = 0; + virtual void SetColour(int id, const wxColour& colour) = 0; /** @see wxRibbonArtProvider::GetColour() @@ -586,7 +586,7 @@ public: wxDC& dc, wxWindow* wnd, const wxRect& rect, - wxRibbonButtonBarButtonKind kind, + wxRibbonButtonKind kind, long state, const wxString& label, const wxBitmap& bitmap_large, @@ -950,7 +950,7 @@ public: virtual bool GetButtonBarButtonSize( wxDC& dc, wxWindow* wnd, - wxRibbonButtonBarButtonKind kind, + wxRibbonButtonKind kind, wxRibbonButtonBarButtonState size, const wxString& label, wxSize bitmap_size_large, diff --git a/interface/wx/ribbon/bar.h b/interface/wx/ribbon/bar.h index 7b0926ef2c..3d98f0ca76 100644 --- a/interface/wx/ribbon/bar.h +++ b/interface/wx/ribbon/bar.h @@ -6,6 +6,22 @@ /////////////////////////////////////////////////////////////////////////////// +enum wxRibbonBarOption +{ + wxRIBBON_BAR_SHOW_PAGE_LABELS, + wxRIBBON_BAR_SHOW_PAGE_ICONS, + wxRIBBON_BAR_FLOW_HORIZONTAL, + wxRIBBON_BAR_FLOW_VERTICAL, + wxRIBBON_BAR_SHOW_PANEL_EXT_BUTTONS, + wxRIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS, + wxRIBBON_BAR_ALWAYS_SHOW_TABS, + wxRIBBON_BAR_SHOW_TOGGLE_BUTTON, + wxRIBBON_BAR_SHOW_HELP_BUTTON, + wxRIBBON_BAR_DEFAULT_STYLE, + wxRIBBON_BAR_FOLDBAR_STYLE +}; + + /** The possible display modes of the panel area of a wxRibbonBar widget. @@ -68,6 +84,35 @@ public: void SetPage(wxRibbonPage* page); }; + +wxEventType wxEVT_RIBBONBAR_PAGE_CHANGED; +wxEventType wxEVT_RIBBONBAR_PAGE_CHANGING; +wxEventType wxEVT_RIBBONBAR_TAB_MIDDLE_DOWN; +wxEventType wxEVT_RIBBONBAR_TAB_MIDDLE_UP; +wxEventType wxEVT_RIBBONBAR_TAB_RIGHT_DOWN; +wxEventType wxEVT_RIBBONBAR_TAB_RIGHT_UP; +wxEventType wxEVT_RIBBONBAR_TAB_LEFT_DCLICK; +wxEventType wxEVT_RIBBONBAR_TOGGLED; +wxEventType wxEVT_RIBBONBAR_HELP_CLICK; + + +class wxRibbonPageTabInfo +{ +public: + wxRect rect; + wxRibbonPage *page; + int ideal_width; + int small_begin_need_separator_width; + int small_must_have_separator_width; + int minimum_width; + bool active; + bool hovered; + bool highlight; + bool shown; +}; + + + /** @class wxRibbonBar diff --git a/interface/wx/ribbon/buttonbar.h b/interface/wx/ribbon/buttonbar.h index 6eebd7ca91..8d7e5fcca2 100644 --- a/interface/wx/ribbon/buttonbar.h +++ b/interface/wx/ribbon/buttonbar.h @@ -562,3 +562,7 @@ public: */ bool PopupMenu(wxMenu* menu); }; + + +wxEventType wxEVT_RIBBONBUTTONBAR_CLICKED; +wxEventType wxEVT_RIBBONBUTTONBAR_DROPDOWN_CLICKED; diff --git a/interface/wx/ribbon/gallery.h b/interface/wx/ribbon/gallery.h index e1525ee206..2b34f83a64 100644 --- a/interface/wx/ribbon/gallery.h +++ b/interface/wx/ribbon/gallery.h @@ -297,3 +297,9 @@ public: */ void SetGalleryItem(wxRibbonGalleryItem* item); }; + + +wxEventType wxEVT_RIBBONGALLERY_HOVER_CHANGED; +wxEventType wxEVT_RIBBONGALLERY_SELECTED; +wxEventType wxEVT_RIBBONGALLERY_CLICKED; + diff --git a/interface/wx/ribbon/panel.h b/interface/wx/ribbon/panel.h index a7cae829f4..a4a0e6ee22 100644 --- a/interface/wx/ribbon/panel.h +++ b/interface/wx/ribbon/panel.h @@ -5,6 +5,18 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// + +enum wxRibbonPanelOption +{ + wxRIBBON_PANEL_NO_AUTO_MINIMISE, + wxRIBBON_PANEL_EXT_BUTTON, + wxRIBBON_PANEL_MINIMISE_BUTTON, + wxRIBBON_PANEL_STRETCH, + wxRIBBON_PANEL_FLEXIBLE, + wxRIBBON_PANEL_DEFAULT_STYLE +}; + + /** @class wxRibbonPanelEvent diff --git a/interface/wx/ribbon/toolbar.h b/interface/wx/ribbon/toolbar.h index c73f96380c..62e0ad0d46 100644 --- a/interface/wx/ribbon/toolbar.h +++ b/interface/wx/ribbon/toolbar.h @@ -5,6 +5,7 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// + /** @class wxRibbonToolBar @@ -492,3 +493,20 @@ public: */ virtual void ToggleTool(int tool_id, bool checked); }; + + +class wxRibbonToolBarEvent : public wxCommandEvent +{ +public: + wxRibbonToolBarEvent(wxEventType command_type = wxEVT_NULL, + int win_id = 0, + wxRibbonToolBar* bar = NULL); + + wxRibbonToolBar* GetBar(); + void SetBar(wxRibbonToolBar* bar); + bool PopupMenu(wxMenu* menu); +}; + + +wxEventType wxEVT_RIBBONTOOLBAR_CLICKED; +wxEventType wxEVT_RIBBONTOOLBAR_DROPDOWN_CLICKED; From c40f782fae465be033f902c9d717985990fd92f3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 21 Jun 2016 18:21:27 -0700 Subject: [PATCH 03/36] Fix typo --- interface/wx/sizer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index 38c2c66eb7..f1e3295f52 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -50,8 +50,8 @@ @section wxsizer_flags wxSizer flags - The "flag" argument accepted by wxSizeItem constructors and other - functions, e.g. wxSizer::Add(), is OR-combination of the following flags. + The "flag" argument accepted by wxSizerItem constructors and other + functions, e.g. wxSizer::Add(), is an OR-combination of the following flags. Two main behaviours are defined using these flags. One is the border around a window: the border parameter determines the border width whereas the flags given here determine which side(s) of the item that the border will From c58d1445b257eb8c6484960056c5bc33f3d1050b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 28 Jun 2016 17:11:37 -0700 Subject: [PATCH 04/36] Add more stuff missing from the ribbon interface --- interface/wx/ribbon/art.h | 341 ++++++++++++++++++++++++++++++++ interface/wx/ribbon/buttonbar.h | 7 +- interface/wx/ribbon/panel.h | 3 + 3 files changed, 350 insertions(+), 1 deletion(-) diff --git a/interface/wx/ribbon/art.h b/interface/wx/ribbon/art.h index 84a5338c49..ea38adb621 100644 --- a/interface/wx/ribbon/art.h +++ b/interface/wx/ribbon/art.h @@ -1028,3 +1028,344 @@ public: */ virtual wxRect GetRibbonHelpButtonArea(const wxRect& rect) = 0; }; + + + +class wxRibbonMSWArtProvider : public wxRibbonArtProvider +{ +public: + wxRibbonMSWArtProvider(bool set_colour_scheme = true); + virtual ~wxRibbonMSWArtProvider(); + + wxRibbonArtProvider* Clone() const; + void SetFlags(long flags); + long GetFlags() const; + + int GetMetric(int id) const; + void SetMetric(int id, int new_val); + void SetFont(int id, const wxFont& font); + wxFont GetFont(int id) const; + wxColour GetColour(int id) const; + void SetColour(int id, const wxColour& colour); + void GetColourScheme(wxColour* primary, + wxColour* secondary, + wxColour* tertiary) const; + void SetColourScheme(const wxColour& primary, + const wxColour& secondary, + const wxColour& tertiary); + + int GetTabCtrlHeight( + wxDC& dc, + wxWindow* wnd, + const wxRibbonPageTabInfoArray& pages); + + void DrawTabCtrlBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawTab(wxDC& dc, + wxWindow* wnd, + const wxRibbonPageTabInfo& tab); + + void DrawTabSeparator( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + double visibility); + + void DrawPageBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawScrollButton( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + long style); + + void DrawPanelBackground( + wxDC& dc, + wxRibbonPanel* wnd, + const wxRect& rect); + + void DrawGalleryBackground( + wxDC& dc, + wxRibbonGallery* wnd, + const wxRect& rect); + + void DrawGalleryItemBackground( + wxDC& dc, + wxRibbonGallery* wnd, + const wxRect& rect, + wxRibbonGalleryItem* item); + + void DrawMinimisedPanel( + wxDC& dc, + wxRibbonPanel* wnd, + const wxRect& rect, + wxBitmap& bitmap); + + void DrawButtonBarBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawButtonBarButton( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + wxRibbonButtonKind kind, + long state, + const wxString& label, + const wxBitmap& bitmap_large, + const wxBitmap& bitmap_small); + + void DrawToolBarBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawToolGroupBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawTool( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + const wxBitmap& bitmap, + wxRibbonButtonKind kind, + long state); + + void DrawToggleButton( + wxDC& dc, + wxRibbonBar* wnd, + const wxRect& rect, + wxRibbonDisplayMode mode); + + void DrawHelpButton(wxDC& dc, + wxRibbonBar* wnd, + const wxRect& rect); + + void GetBarTabWidth( + wxDC& dc, + wxWindow* wnd, + const wxString& label, + const wxBitmap& bitmap, + int* ideal, + int* small_begin_need_separator, + int* small_must_have_separator, + int* minimum); + + wxSize GetScrollButtonMinimumSize( + wxDC& dc, + wxWindow* wnd, + long style); + + wxSize GetPanelSize( + wxDC& dc, + const wxRibbonPanel* wnd, + wxSize client_size, + wxPoint* client_offset); + + wxSize GetPanelClientSize( + wxDC& dc, + const wxRibbonPanel* wnd, + wxSize size, + wxPoint* client_offset); + + wxRect GetPanelExtButtonArea( + wxDC& dc, + const wxRibbonPanel* wnd, + wxRect rect); + + wxSize GetGallerySize( + wxDC& dc, + const wxRibbonGallery* wnd, + wxSize client_size); + + wxSize GetGalleryClientSize( + wxDC& dc, + const wxRibbonGallery* wnd, + wxSize size, + wxPoint* client_offset, + wxRect* scroll_up_button, + wxRect* scroll_down_button, + wxRect* extension_button); + + wxRect GetPageBackgroundRedrawArea( + wxDC& dc, + const wxRibbonPage* wnd, + wxSize page_old_size, + wxSize page_new_size); + + bool GetButtonBarButtonSize( + wxDC& dc, + wxWindow* wnd, + wxRibbonButtonKind kind, + wxRibbonButtonBarButtonState size, + const wxString& label, + wxSize bitmap_size_large, + wxSize bitmap_size_small, + wxSize* button_size, + wxRect* normal_region, + wxRect* dropdown_region); + + wxSize GetMinimisedPanelMinimumSize( + wxDC& dc, + const wxRibbonPanel* wnd, + wxSize* desired_bitmap_size, + wxDirection* expanded_panel_direction); + + wxSize GetToolSize( + wxDC& dc, + wxWindow* wnd, + wxSize bitmap_size, + wxRibbonButtonKind kind, + bool is_first, + bool is_last, + wxRect* dropdown_region); + + wxRect GetBarToggleButtonArea(const wxRect& rect); + + wxRect GetRibbonHelpButtonArea(const wxRect& rect); +}; + + +class wxRibbonAUIArtProvider : public wxRibbonMSWArtProvider +{ +public: + wxRibbonAUIArtProvider(); + virtual ~wxRibbonAUIArtProvider(); + + wxRibbonArtProvider* Clone() const; + + wxColour GetColour(int id) const; + void SetColour(int id, const wxColour& colour); + void SetColourScheme(const wxColour& primary, + const wxColour& secondary, + const wxColour& tertiary); + void SetFont(int id, const wxFont& font); + + wxSize GetScrollButtonMinimumSize( + wxDC& dc, + wxWindow* wnd, + long style); + + void DrawScrollButton( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + long style); + + wxSize GetPanelSize( + wxDC& dc, + const wxRibbonPanel* wnd, + wxSize client_size, + wxPoint* client_offset); + + wxSize GetPanelClientSize( + wxDC& dc, + const wxRibbonPanel* wnd, + wxSize size, + wxPoint* client_offset); + + wxRect GetPanelExtButtonArea( + wxDC& dc, + const wxRibbonPanel* wnd, + wxRect rect); + + void DrawTabCtrlBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + int GetTabCtrlHeight( + wxDC& dc, + wxWindow* wnd, + const wxRibbonPageTabInfoArray& pages); + + void GetBarTabWidth( + wxDC& dc, + wxWindow* wnd, + const wxString& label, + const wxBitmap& bitmap, + int* ideal, + int* small_begin_need_separator, + int* small_must_have_separator, + int* minimum); + + void DrawTab(wxDC& dc, + wxWindow* wnd, + const wxRibbonPageTabInfo& tab); + + void DrawTabSeparator( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + double visibility); + + void DrawPageBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawPanelBackground( + wxDC& dc, + wxRibbonPanel* wnd, + const wxRect& rect); + + void DrawMinimisedPanel( + wxDC& dc, + wxRibbonPanel* wnd, + const wxRect& rect, + wxBitmap& bitmap); + + void DrawGalleryBackground( + wxDC& dc, + wxRibbonGallery* wnd, + const wxRect& rect); + + void DrawGalleryItemBackground( + wxDC& dc, + wxRibbonGallery* wnd, + const wxRect& rect, + wxRibbonGalleryItem* item); + + void DrawButtonBarBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawButtonBarButton( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + wxRibbonButtonKind kind, + long state, + const wxString& label, + const wxBitmap& bitmap_large, + const wxBitmap& bitmap_small); + + void DrawToolBarBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawToolGroupBackground( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect); + + void DrawTool( + wxDC& dc, + wxWindow* wnd, + const wxRect& rect, + const wxBitmap& bitmap, + wxRibbonButtonKind kind, + long state); + +}; diff --git a/interface/wx/ribbon/buttonbar.h b/interface/wx/ribbon/buttonbar.h index 8d7e5fcca2..f2d5336904 100644 --- a/interface/wx/ribbon/buttonbar.h +++ b/interface/wx/ribbon/buttonbar.h @@ -69,7 +69,12 @@ enum wxRibbonButtonBarButtonState Only applicable to dropdown and hybrid buttons. */ wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE = 1 << 6, - + + /** + A mask to extract active flags + */ + wxRIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE, + /** The button is disabled. Hover flags may still be set when a button is disabled, but should be ignored during drawing if the button is diff --git a/interface/wx/ribbon/panel.h b/interface/wx/ribbon/panel.h index a4a0e6ee22..f4fabf56b1 100644 --- a/interface/wx/ribbon/panel.h +++ b/interface/wx/ribbon/panel.h @@ -52,6 +52,9 @@ public: void SetPanel(wxRibbonPanel* page); }; +wxEventType wxEVT_RIBBONPANEL_EXTBUTTON_ACTIVATED; + + /** @class wxRibbonPanel From 9566c4c6deb10857f05520481ae206983079bbab Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 4 Jul 2016 22:33:48 -0700 Subject: [PATCH 05/36] fix missing ; --- interface/wx/ribbon/panel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/ribbon/panel.h b/interface/wx/ribbon/panel.h index f4fabf56b1..ca83991a55 100644 --- a/interface/wx/ribbon/panel.h +++ b/interface/wx/ribbon/panel.h @@ -39,7 +39,7 @@ public: */ wxRibbonPanelEvent(wxEventType command_type = wxEVT_NULL, int win_id = 0, - wxRibbonPanel* panel = NULL) + wxRibbonPanel* panel = NULL); /** Returns the panel relating to this event. From bb96082fde952be5d43cea800ba56e5ccf76cee9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 5 Jul 2016 11:17:42 -0700 Subject: [PATCH 06/36] Use "clientData" parameter name for consistency. --- interface/wx/ribbon/toolbar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/ribbon/toolbar.h b/interface/wx/ribbon/toolbar.h index 62e0ad0d46..588b6b3ea6 100644 --- a/interface/wx/ribbon/toolbar.h +++ b/interface/wx/ribbon/toolbar.h @@ -144,7 +144,7 @@ public: const wxBitmap& bitmap_disabled = wxNullBitmap, const wxString& help_string = wxEmptyString, wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL, - wxObject* client_data = NULL); + wxObject* clientData = NULL); /** Add a separator to the tool bar. @@ -249,7 +249,7 @@ public: const wxBitmap& bitmap_disabled = wxNullBitmap, const wxString& help_string = wxEmptyString, wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL, - wxObject* client_data = NULL); + wxObject* clientData = NULL); /** Insert a separator to the tool bar at the specified position. From 9c045a4e3409acf4f2133a5accedff5161c5b4d6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 6 Jul 2016 18:46:20 -0700 Subject: [PATCH 07/36] typo --- interface/wx/ribbon/art.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/ribbon/art.h b/interface/wx/ribbon/art.h index ea38adb621..e22d092fea 100644 --- a/interface/wx/ribbon/art.h +++ b/interface/wx/ribbon/art.h @@ -862,7 +862,7 @@ public: /** Calculate the client size of a wxRibbonGallery control for a given size. This should act as the inverse to GetGallerySize(), and decrement - the given size by enough to fir the gallery border, buttons, and other + the given size by enough to fit the gallery border, buttons, and other chrome. @param dc From db34678e53d20114f5ec9238b978fef8f9caedc0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 7 Jul 2016 21:01:29 -0700 Subject: [PATCH 08/36] Add missing parameter name --- interface/wx/ribbon/buttonbar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/ribbon/buttonbar.h b/interface/wx/ribbon/buttonbar.h index f2d5336904..27ea3d46ce 100644 --- a/interface/wx/ribbon/buttonbar.h +++ b/interface/wx/ribbon/buttonbar.h @@ -427,7 +427,7 @@ public: @since 2.9.5 */ - virtual int GetItemId(wxRibbonButtonBarButtonBase *) const; + virtual int GetItemId(wxRibbonButtonBarButtonBase *item) const; /** Calculate button layouts and positions. From 824f9551eeb075544814292a3dc6596c28e906a1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 13 Jul 2016 10:21:15 -0700 Subject: [PATCH 09/36] Add missing GetParser method --- interface/wx/html/htmlwin.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/wx/html/htmlwin.h b/interface/wx/html/htmlwin.h index 498cecbd6b..d6b03dd7d4 100644 --- a/interface/wx/html/htmlwin.h +++ b/interface/wx/html/htmlwin.h @@ -221,6 +221,11 @@ public: */ wxString GetOpenedPageTitle() const; + /** + Returns a pointer to the current parser. + */ + wxHtmlWinParser *GetParser() const; + /** Returns the related frame. */ From b2ae25fc6ae59cfd95f15b7401b63ebb06c72e02 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 13 Jul 2016 10:24:58 -0700 Subject: [PATCH 10/36] WX_CLEAR_LIST in wxHtmlWindow::CleanUpStatics is hard-crashing in wxHtmlWindow::CleanUpStatics, perhaps due to a different cleanup order?? Anyway, switching to .Clear() avoids the crash and does nearly the same. Since it is in code that is called on exit it shouldn't matter either way. --- src/html/htmlwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 008b30fbb7..2c09d5b86c 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -291,7 +291,7 @@ wxCursor *wxHtmlWindow::ms_cursorDefault = NULL; void wxHtmlWindow::CleanUpStatics() { wxDELETE(m_DefaultFilter); - WX_CLEAR_LIST(wxList, m_Filters); + m_Filters.Clear(); if (m_GlobalProcessors) WX_CLEAR_LIST(wxHtmlProcessorList, *m_GlobalProcessors); wxDELETE(m_GlobalProcessors); From 3243436ff788102fd510db10221ff76d74edd92b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 14 Jul 2016 11:48:57 -0700 Subject: [PATCH 11/36] Add lots of missing methods in wxAboutDialogInfo --- interface/wx/aboutdlg.h | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/interface/wx/aboutdlg.h b/interface/wx/aboutdlg.h index 4df0846323..1b04645c83 100644 --- a/interface/wx/aboutdlg.h +++ b/interface/wx/aboutdlg.h @@ -161,6 +161,16 @@ public: */ void SetDocWriters(const wxArrayString& docwriters); + /** + Returns @true if an icon has been set for the about dialog. + */ + bool HasIcon() const; + + /** + Returns the icon set by SetIcon(). + */ + wxIcon GetIcon() const; + /** Set the icon to be shown in the dialog. By default the icon of the main frame will be shown if the native about dialog supports custom icons. If it doesn't @@ -170,6 +180,18 @@ public: */ void SetIcon(const wxIcon& icon); + /** + Returns @true if the licence string has been set. + */ + bool HasLicence() const; + + /** + Returns the licence string. + + @see SetLicence() + */ + const wxString& GetLicence() const; + /** Set the long, multiline string containing the text of the program licence. @@ -213,6 +235,35 @@ public: */ void SetVersion(const wxString& version, const wxString& longVersion = wxString()); + /** + Return the short version string. + + @see SetVersion() + */ + const wxString& GetVersion() const; + + /** + Return the long version string if set. + + @see SetVersion() + */ + const wxString& GetLongVersion() const; + + /** + Returns @true if the website info has been set. + */ + bool HasWebSite() const; + + /** + Returns the website URL set for the dialog. + */ + const wxString& GetWebSiteURL() const; + + /** + Returns the description of the website URL set for the dialog. + */ + const wxString& GetWebSiteDescription() const; + /** Set the web site for the program and its description (which defaults to @a url itself if empty). @@ -223,6 +274,49 @@ public: */ void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString); + + + /** + Returns @true if developers have been set in the dialog info. + */ + bool HasDevelopers() const; + + /** + Returns an array of the developer strings set in the dialog info. + */ + const wxArrayString& GetDevelopers() const; + + /** + Returns @true if writers have been set in the dialog info. + */ + bool HasDocWriters() const; + + /** + Returns an array of the writer strings set in the dialog info. + */ + const wxArrayString& GetDocWriters() const; + + /** + Returns @true if artists have been set in the dialog info. + */ + bool HasArtists() const; + + /** + Returns an array of the artist strings set in the dialog info. + */ + const wxArrayString& GetArtists() const; + + /** + Returns @true if translators have been set in the dialog info. + */ + bool HasTranslators() const; + + /** + Returns an array of the translator strings set in the dialog info. + */ + const wxArrayString& GetTranslators() const; + + }; From cf8aa0b2d79fd84369607f15e74a1dc820d5d5b8 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 15 Jul 2016 15:41:10 -0700 Subject: [PATCH 12/36] Change parameter name to reduce confusion in wxPython docs. --- interface/wx/font.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/font.h b/interface/wx/font.h index 2f7ca100b4..e9779e7f75 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -470,7 +470,7 @@ public: @since 2.9.5 */ - wxFont(const wxFontInfo& font); + wxFont(const wxFontInfo& fontInfo); /** Creates a font object with the specified attributes and size in points. From 5301cbd84520255860a844597c7f2087d8ea7b84 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 2 Aug 2016 14:58:17 -0700 Subject: [PATCH 13/36] Fix typo --- interface/wx/artprov.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/artprov.h b/interface/wx/artprov.h index aff555eb29..d0581d9913 100644 --- a/interface/wx/artprov.h +++ b/interface/wx/artprov.h @@ -409,7 +409,7 @@ protected: wxArtID unique identifier of the bitmap. @param client wxArtClient identifier of the client (i.e. who is asking for the bitmap). - This only servers as a hint. + This only serves as a hint. @param size Preferred size of the bitmap. The function may return a bitmap of different dimensions, it will be automatically rescaled to meet client's request. From 2fab4c4fc12692be64279688595c6478bfcbeea9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Aug 2016 16:38:32 -0700 Subject: [PATCH 14/36] Add setter methods to wxListEvent --- include/wx/listbase.h | 8 ++++++++ interface/wx/listctrl.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/include/wx/listbase.h b/include/wx/listbase.h index 6a3bcf6016..4309817822 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -472,9 +472,17 @@ public: long GetMask() const { return m_item.m_mask; } const wxListItem& GetItem() const { return m_item; } + void SetKeyCode(int code) { m_code = code; } + void SetIndex(long index) { m_itemIndex = index; } + void SetColumn(int col) { m_col = col; } + void SetPoint(const wxPoint& point) { m_pointDrag = point; } + void SetItem(const wxListItem& item) { m_item = item; } + // for wxEVT_LIST_CACHE_HINT only long GetCacheFrom() const { return m_oldItemIndex; } long GetCacheTo() const { return m_itemIndex; } + void SetCacheFrom(long cacheFrom) { m_oldItemIndex = cacheFrom; } + void SetCacheTo(long cacheTo) { m_itemIndex = cacheTo; } // was label editing canceled? (for wxEVT_LIST_END_LABEL_EDIT only) bool IsEditCancelled() const { return m_editCancelled; } diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 14fffe2f0e..ea71e997df 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -1505,6 +1505,44 @@ public: admittedly rare case when the user wants to rename it to an empty string). */ bool IsEditCancelled() const; + + + /** + @see GetKeyCode() + */ + void SetKeyCode(int code); + + /** + @see GetIndex() + */ + void SetIndex(long index); + + /** + @see GetColumn() + */ + void SetColumn(int col); + + /** + @see GetPoint() + */ + void SetPoint(const wxPoint& point); + + /** + @see GetItem() + */ + void SetItem(const wxListItem& item); + + + /** + @see GetCacheFrom() + */ + void SetCacheFrom(long cacheFrom); + + /** + @see GetCacheTo() + */ + void SetCacheTo(long cacheTo); + }; From cbbf8fe9d8532a6b75fc221304c6924d8882f8ba Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 Aug 2016 22:47:44 -0700 Subject: [PATCH 15/36] wxPalette::Create should return true --- src/osx/palette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/palette.cpp b/src/osx/palette.cpp index 86ced8bca7..428db12d2a 100644 --- a/src/osx/palette.cpp +++ b/src/osx/palette.cpp @@ -89,7 +89,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre M_PALETTEDATA->m_palette[i].Set( red[i] , green[i] , blue[i] ) ; } - return false; + return true; } int wxPalette::GetPixel(unsigned char red, unsigned char green, unsigned char blue) const From a5fe9de656f76fe40723495bf07d33af7cdd3da7 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 10 Aug 2016 19:22:34 -0700 Subject: [PATCH 16/36] Add missing methods --- interface/wx/fs_mem.h | 3 +++ interface/wx/html/htmlcell.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/interface/wx/fs_mem.h b/interface/wx/fs_mem.h index a083bbc0c6..546ced5b2b 100644 --- a/interface/wx/fs_mem.h +++ b/interface/wx/fs_mem.h @@ -90,6 +90,9 @@ public: */ static void AddFile(const wxString& filename, wxImage& image, wxBitmapType type); static void AddFile(const wxString& filename, const wxBitmap& bitmap, wxBitmapType type); + static void AddFile(const wxString& filename, const wxString& textdata); + static void AddFile(const wxString& filename, const void *binarydata, size_t size); + //@} //@{ diff --git a/interface/wx/html/htmlcell.h b/interface/wx/html/htmlcell.h index 9abac27be7..085f4afd4c 100644 --- a/interface/wx/html/htmlcell.h +++ b/interface/wx/html/htmlcell.h @@ -435,6 +435,13 @@ public: Sets the cell's position within parent container. */ virtual void SetPos(int x, int y); + + /** + Converts the cell into text representation. If sel != NULL then + only part of the cell inside the selection is converted. + */ + virtual wxString ConvertToText(wxHtmlSelection* sel) const; + }; From 0be4a6d91969fb7ba50d0010838ada49153b3099 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 23 Feb 2015 20:14:25 -0800 Subject: [PATCH 17/36] some formatting tweaks for propgrid --- interface/wx/propgrid/propgrid.h | 2 +- interface/wx/propgrid/propgridiface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 0ce99ecd48..7a39445bcf 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -331,7 +331,7 @@ wxPG_VFB_DEFAULT = wxPG_VFB_MARK_CELL | #define wxPGVFBFlags unsigned char /** - wxPGValidationInfo + @class wxPGValidationInfo Used to convey validation information to and from functions that actually perform validation. Mostly used in custom property classes. diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index 3316bec709..e40069d446 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -398,7 +398,7 @@ public: void GetPropertiesWithFlag( wxArrayPGProperty* targetArr, wxPGProperty::FlagType flags, bool inverse = false, - int iterFlags = (wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES) ) const; + int iterFlags = wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES ) const; /** Returns value of given attribute. If none found, returns wxNullVariant. From bf13c0af22e881a9aa693fda90b9656c9968eecb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 23 Feb 2015 21:40:58 -0800 Subject: [PATCH 18/36] Remove wxDEPRECATED decorator from doc --- interface/wx/propgrid/property.h | 303 ++++++++----------------------- 1 file changed, 75 insertions(+), 228 deletions(-) diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 02b365eb98..a11f3e2edd 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -100,8 +100,7 @@ struct wxPGPaintData */ #define wxPG_FLOAT_PRECISION wxS("Precision") -/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed - to textctrl etc.). +/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed to textctrl etc). */ #define wxPG_STRING_PASSWORD wxS("Password") @@ -146,6 +145,8 @@ struct wxPGPaintData /** Specific to wxFileProperty and derivatives, long, default is 0. Sets a specific wxFileDialog style for the file dialog, e.g. ::wxFD_SAVE. + + @since 2.9.4 */ #define wxPG_FILE_DIALOG_STYLE wxS("DialogStyle") @@ -215,35 +216,29 @@ enum wxPGPropertyFlags { /** Indicates bold font. - @hideinitializer */ wxPG_PROP_MODIFIED = 0x0001, /** Disables ('greyed' text and editor does not activate) property. - @hideinitializer */ wxPG_PROP_DISABLED = 0x0002, /** Hider button will hide this property. - @hideinitializer */ wxPG_PROP_HIDDEN = 0x0004, /** This property has custom paint image just in front of its value. If property only draws custom images into a popup list, then this flag should not be set. - @hideinitializer */ wxPG_PROP_CUSTOMIMAGE = 0x0008, /** Do not create text based editor for this property (but button-triggered dialog and choice are ok). - @hideinitializer */ wxPG_PROP_NOEDITOR = 0x0010, /** Property is collapsed, ie. it's children are hidden. - @hideinitializer */ wxPG_PROP_COLLAPSED = 0x0020, @@ -254,26 +249,22 @@ wxPG_PROP_COLLAPSED = 0x0020, If property is not selected, then indicates that the actual property value has failed validation (NB: this behaviour is not currently supported, but may be used in the future). - @hideinitializer */ wxPG_PROP_INVALID_VALUE = 0x0040, /** Switched via SetWasModified(). Temporary flag - only used when setting/changing property value. - @hideinitializer */ wxPG_PROP_WAS_MODIFIED = 0x0200, /** If set, then child properties (if any) are private, and should be "invisible" to the application. - @hideinitializer */ wxPG_PROP_AGGREGATE = 0x0400, /** If set, then child properties (if any) are copies and should not be deleted in dtor. - @hideinitializer */ wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, @@ -281,7 +272,6 @@ wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, Classifies this item as a non-category. Used for faster item type identification. - @hideinitializer */ wxPG_PROP_PROPERTY = 0x1000, @@ -289,20 +279,17 @@ wxPG_PROP_PROPERTY = 0x1000, Classifies this item as a category. Used for faster item type identification. - @hideinitializer */ wxPG_PROP_CATEGORY = 0x2000, /** Classifies this item as a property that has children, but is not aggregate - (i.e. children are not private). - @hideinitializer + (ie children are not private). */ wxPG_PROP_MISC_PARENT = 0x4000, /** Property is read-only. Editor is still created for wxTextCtrl-based property editors. For others, editor is not usually created because they do implement wxTE_READONLY style or equivalent. - @hideinitializer */ wxPG_PROP_READONLY = 0x8000, @@ -313,14 +300,12 @@ wxPG_PROP_READONLY = 0x8000, /** Property's value is composed from values of child properties. @remarks This flag cannot be used with property iterators. - @hideinitializer */ wxPG_PROP_COMPOSED_VALUE = 0x00010000, /** Common value of property is selectable in editor. @remarks This flag cannot be used with property iterators. - @hideinitializer */ wxPG_PROP_USES_COMMON_VALUE = 0x00020000, @@ -333,22 +318,18 @@ wxPG_PROP_USES_COMMON_VALUE = 0x00020000, This flag cannot be used with property iterators. @see wxPGProperty::SetAutoUnspecified() - @hideinitializer */ wxPG_PROP_AUTO_UNSPECIFIED = 0x00040000, -/** Indicates the bit usable by derived properties. - @hideinitializer +/** Indicates the bit useable by derived properties. */ wxPG_PROP_CLASS_SPECIFIC_1 = 0x00080000, -/** Indicates the bit usable by derived properties. - @hideinitializer +/** Indicates the bit useable by derived properties. */ wxPG_PROP_CLASS_SPECIFIC_2 = 0x00100000, /** Indicates that the property is being deleted and should be ignored. - @hideinitializer */ wxPG_PROP_BEING_DELETED = 0x00200000 @@ -427,15 +408,11 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxStringProperty - Simple string property. - - Supported special attributes: - - @c wxPG_STRING_PASSWORD: Set to @true in order to echo value as asterisks and - to use @c wxTE_PASSWORD on the editor (wxTextCtrl). - - @c wxPG_ATTR_AUTOCOMPLETE: Set to @true to enable auto-completion + Simple string property. wxPG_STRING_PASSWORD attribute may be used + to echo value as asterisks and use wxTE_PASSWORD for wxTextCtrl. + wxPG_ATTR_AUTOCOMPLETE attribute may be used to enable auto-completion (use a wxArrayString value), and is also supported by any property that happens to use a wxTextCtrl-based editor. - @see @ref propgrid_property_attributes @remarks wxStringProperty has a special trait: if it has value of "", and also has child properties, then its displayed @@ -445,8 +422,9 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxIntProperty Like wxStringProperty, but converts text to a signed long integer. - wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong) on overlfow. + wxIntProperty seamlessly supports 64-bit integers (ie. wxLongLong). To safely convert variant to integer, use code like this: + @code wxLongLong ll; ll << property->GetValue(); @@ -455,61 +433,21 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 wxLongLong ll = propertyGrid->GetPropertyValueAsLong(property); @endcode - Getting 64-bit value: - @code - wxLongLong_t value = pg->GetPropertyValueAsLongLong(); - - // or - - wxLongLong value; - wxVariant variant = property->GetValue(); - if ( variant.IsType(wxPG_VARIANT_TYPE_LONGLONG) ) - value = variant.GetLongLong(); - else - value = variant.GetLong(); - @endcode - - Setting 64-bit value: - @code - pg->SetPropertyValue(longLongVal); - - // or - - property->SetValue(WXVARIANT(longLongVal)); - @endcode - - Supported special attributes: - - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX to specify acceptable value range. - @subsection wxUIntProperty Like wxIntProperty, but displays value as unsigned int. To set - the prefix used globally, manipulate @c wxPG_UINT_PREFIX string attribute. - To set the globally used base, manipulate @c wxPG_UINT_BASE int + the prefix used globally, manipulate wxPG_UINT_PREFIX string attribute. + To set the globally used base, manipulate wxPG_UINT_BASE int attribute. Regardless of current prefix, understands (hex) values starting - with both "0x" and "$" (apart from edit mode). + with both "0x" and "$". Like wxIntProperty, wxUIntProperty seamlessly supports 64-bit unsigned - integers (i.e. wxULongLong). Same wxVariant safety rules apply. - - Supported special attributes: - - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX: Specifies acceptable value range. - - @c wxPG_UINT_BASE: Defines base. Valid constants are @c wxPG_BASE_OCT, - @c wxPG_BASE_DEC, @c wxPG_BASE_HEX and @c wxPG_BASE_HEXL (lowercase characters). - Arbitrary bases are not supported. - - @c wxPG_UINT_PREFIX: Defines displayed prefix. Possible values are - @c wxPG_PREFIX_NONE, @c wxPG_PREFIX_0x and @c wxPG_PREFIX_DOLLAR_SIGN. - Only @c wxPG_PREFIX_NONE works with decimal and octal numbers. - @see @ref propgrid_property_attributes - - @remarks - For example how to use seamless 64-bit integer support, see wxIntProperty - documentation (just use wxULongLong instead of wxLongLong). + integers (ie. wxULongLong). Same wxVariant safety rules apply. @subsection wxFloatProperty Like wxStringProperty, but converts text to a double-precision floating point. Default float-to-text precision is 6 decimals, but this can be changed - by modifying @c wxPG_FLOAT_PRECISION attribute. + by modifying wxPG_FLOAT_PRECISION attribute. Note that when displaying the value, sign is omitted if the resulting textual representation is effectively zero (for example, -0.0001 with @@ -517,26 +455,12 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 what C standard library does, but should result in better end-user experience in almost all cases. - Supported special attributes: - - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX: Specifies acceptable value range. - - @c wxPG_FLOAT_PRECISION: Sets the (max) precision used when floating point - value is rendered as text. The default -1 means shortest floating-point - 6-digit representation. - @see @ref propgrid_property_attributes - @subsection wxBoolProperty Represents a boolean value. wxChoice is used as editor control, by the - default. @c wxPG_BOOL_USE_CHECKBOX attribute can be set to @true in order to + default. wxPG_BOOL_USE_CHECKBOX attribute can be set to true in order to use check box instead. - Supported special attributes: - - @c wxPG_BOOL_USE_CHECKBOX: If set to @true uses check box editor instead - of combo box. - - @c wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING: If set to @true cycles combo box - instead showing the list. - @see @ref propgrid_property_attributes - @subsection wxLongStringProperty Like wxStringProperty, but has a button that triggers a small text editor @@ -577,27 +501,15 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxDirProperty Like wxLongStringProperty, but the button triggers dir selector instead. - - Supported special attributes: - - @c wxPG_DIR_DIALOG_MESSAGE: Sets specific message in the dir selector. - @see @ref propgrid_property_attributes + Supported properties (all with string value): wxPG_DIR_DIALOG_MESSAGE. @subsection wxFileProperty Like wxLongStringProperty, but the button triggers file selector instead. Default wildcard is "All files..." but this can be changed by setting - @c wxPG_FILE_WILDCARD attribute. - - Supported special attributes: - - @c wxPG_FILE_WILDCARD: Sets wildcard (see wxFileDialog for format details), "All - files..." is default. - - @c wxPG_FILE_SHOW_FULL_PATH: Default @true. When @false, only the file name is shown - (i.e. drive and directory are hidden). - - @c wxPG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the - given path string. - - @c wxPG_FILE_INITIAL_PATH: Sets the initial path of where to look for files. - - @c wxPG_FILE_DIALOG_TITLE: Sets a specific title for the dir dialog. - @see @ref propgrid_property_attributes + wxPG_FILE_WILDCARD attribute (see wxFileDialog for format details). + Attribute wxPG_FILE_SHOW_FULL_PATH can be set to @false in order to show + only the filename, not the entire path. @subsection wxEnumProperty @@ -619,54 +531,33 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxArrayStringProperty - Property that manages a list of strings. Allows editing of a list - of strings in wxTextCtrl and in a separate dialog. - - Supported special attributes: - - @c wxPG_ARRAY_DELIMITER: Sets string delimiter character. - Default is comma (','). - @see @ref propgrid_property_attributes + Allows editing of a list of strings in wxTextCtrl and in a separate + dialog. Supports "Delimiter" attribute, which defaults to comma (','). @subsection wxDateProperty - Property representing wxDateTime. Default editor is DatePickerCtrl, - although TextCtrl should work as well. - - Supported special attributes: - - @c wxPG_DATE_FORMAT: Determines displayed date format (with wxDateTime::Format). - Default is recommended as it is locale-dependent. - - @c wxPG_DATE_PICKER_STYLE: Determines window style used with wxDatePickerCtrl. - Default is @c wxDP_DEFAULT | @c wxDP_SHOWCENTURY. Using @c wxDP_ALLOWNONE - enables additional support for unspecified property value. - @see @ref propgrid_property_attributes + wxDateTime property. Default editor is DatePickerCtrl, although TextCtrl + should work as well. wxPG_DATE_FORMAT attribute can be used to change + string wxDateTime::Format uses (although default is recommended as it is + locale-dependent), and wxPG_DATE_PICKER_STYLE allows changing window + style given to DatePickerCtrl (default is wxDP_DEFAULT|wxDP_SHOWCENTURY). + Using wxDP_ALLOWNONE will enable better unspecified value support. @subsection wxEditEnumProperty Represents a string that can be freely edited or selected from list of choices - custom combobox control is used to edit the value. - @remarks - Uses int value, similar to wxEnumProperty, unless text entered by user is - is not in choices (in which case string value is used). - @subsection wxMultiChoiceProperty Allows editing a multiple selection from a list of strings. This is property is pretty much built around concept of wxMultiChoiceDialog. It uses wxArrayString value. - Supported special attributes: - - @c wxPG_ATTR_MULTICHOICE_USERSTRINGMODE: If > 0, allows user to manually - enter strings that are not in the list of choices. If this value is 1, - user strings are preferably placed in front of valid choices. If value - is 2, then those strings will placed behind valid choices. - @see @ref propgrid_property_attributes - @subsection wxImageFileProperty - Property representing image file(name). Like wxFileProperty, - but has thumbnail of the image in front of the filename - and autogenerates wildcard from available image handlers. + Like wxFileProperty, but has thumbnail of the image in front of + the filename and autogenerates wildcard from available image handlers. @subsection wxColourProperty @@ -676,10 +567,8 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 There are various sub-classing opportunities with this class. See below in wxSystemColourProperty section for details. - Supported special attributes: - - @c wxPG_COLOUR_HAS_ALPHA: If set to @true allows user to edit the alpha - colour component. - @see @ref propgrid_property_attributes + Setting "HasAlpha" attribute to @true for this property allows user to + edit the alpha colour component. @subsection wxFontProperty @@ -710,7 +599,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 }; @endcode - In wxSystemColourProperty, and its derived class wxColourProperty, there + in wxSystemColourProperty, and its derived class wxColourProperty, there are various sub-classing features. To set a basic list of colour names, call wxPGProperty::SetChoices(). @@ -864,7 +753,7 @@ public: This virtual function is called after m_value has been set. @remarks - - If m_value was set to Null variant (i.e. unspecified value), OnSetValue() + - If m_value was set to Null variant (ie. unspecified value), OnSetValue() will not be called. - m_value may be of any variant type. Typically properties internally support only one variant type, and as such OnSetValue() provides a good opportunity to convert @@ -998,7 +887,7 @@ public: @remarks - Default behaviour is to return wxSize(0,0), which means no image. - Default image width or height is indicated with dimension -1. - - You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxDefaultSize. + - You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxSize(-1, -1). */ virtual wxSize OnMeasureImage( int item = -1 ) const; @@ -1221,7 +1110,7 @@ public: Returns instance of a new wxPGEditorDialogAdapter instance, which is used when user presses the (optional) button next to the editor control; - Default implementation returns @NULL (i.e. no action is generated when + Default implementation returns @NULL (ie. no action is generated when button is pressed). */ virtual wxPGEditorDialogAdapter* GetEditorDialog() const; @@ -1250,6 +1139,15 @@ public: */ int AddChoice( const wxString& label, int value = wxPG_INVALID_VALUE ); + /** + Adds a private child property. + + @deprecated Use AddPrivateChild() instead. + + @see AddPrivateChild() + */ + void AddChild( wxPGProperty* prop ); + /** Adds a private child property. If you use this instead of wxPropertyGridInterface::Insert() or @@ -1266,7 +1164,7 @@ public: void AdaptListToValue( wxVariant& list, wxVariant* value ) const; /** - Use this member function to add independent (i.e. regular) children to + Use this member function to add independent (ie. regular) children to a property. @return Appended childProperty. @@ -1379,9 +1277,7 @@ public: */ const wxPGEditor* GetColumnEditor( int column ) const; - /** Returns property's base name (ie. parent's name is not added - in any case). - */ + /** Returns property's base name (ie. parent's name is not added in any case) */ const wxString& GetBaseName() const; /** @@ -1430,7 +1326,7 @@ public: */ void* GetClientData() const; - /** Gets managed client object of a property. + /** Sets managed client object of a property. */ wxClientData *GetClientObject() const; @@ -1465,7 +1361,7 @@ public: const wxPGEditor* GetEditorClass() const; /** - Returns property's hint text (shown in empty value cell). + Returns property flags. */ inline wxString GetHintText() const; @@ -1559,6 +1455,14 @@ public: */ virtual wxString GetValueAsString( int argFlags = 0 ) const; + /** Synonymous to GetValueAsString(). + + @deprecated Use GetValueAsString() instead. + + @see GetValueAsString() + */ + wxString GetValueString( int argFlags = 0 ) const; + /** Returns value type used by this property. */ @@ -1619,7 +1523,7 @@ public: int Index( const wxPGProperty* p ) const; /** - Use this member function to add independent (i.e. regular) children to + Use this member function to add independent (ie. regular) children to a property. @return Inserted childProperty. @@ -1673,7 +1577,6 @@ public: /** Returns @true if candidateParent is some parent of this property. - Use, for example, to detect if item is inside collapsed section. */ bool IsSomeParent( wxPGProperty* candidateParent ) const; @@ -1756,10 +1659,6 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. - - @remarks - Unlike wxPropertyGridInterface::SetPropertyBackgroundColour(), - this does not automatically update the display. */ void SetBackgroundColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -1805,7 +1704,7 @@ public: */ void SetClientData( void* clientData ); - /** Sets client object of a property. + /** Returns client object of a property. */ void SetClientObject(wxClientData* clientObject); @@ -1849,11 +1748,8 @@ public: /** Sets property's label. - @remarks - - Properties under same parent may have same labels. However, - property names must still remain unique. - - Unlike wxPropertyGridInterface::SetPropertyLabel(), - this does not automatically update the display. + @remarks Properties under same parent may have same labels. However, + property names must still remain unique. */ void SetLabel( const wxString& label ); @@ -1895,10 +1791,6 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. - - @remarks - Unlike wxPropertyGridInterface::SetPropertyTextColour(), - this does not automatically update the display. */ void SetTextColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -1959,22 +1851,19 @@ public: void SetValueInEvent( wxVariant value ) const; /** - Sets property's value to unspecified (i.e. Null variant). + Sets property's value to unspecified (ie. Null variant). */ void SetValueToUnspecified(); /** Call with @false in OnSetValue() to cancel value changes after all - (i.e. cancel @true returned by StringToValue() or IntToValue()). + (ie. cancel @true returned by StringToValue() or IntToValue()). */ void SetWasModified( bool set = true ); /** Updates composed values of parent non-category properties, recursively. Returns topmost property updated. - - @remarks - Must not call SetValue() (as can be called in it). */ wxPGProperty* UpdateParentValues(); @@ -2401,80 +2290,38 @@ public: */ wxPGChoices( const wxPGChoices& a ); - /** - Constructor. - - @param labels - Labels for choices. - - @param values - Values for choices. If @NULL, indexes are used. - */ + /** Constructor. */ wxPGChoices( const wxChar** labels, const long* values = NULL ); - /** - Constructor. - - @param labels - Labels for choices. - - @param values - Values for choices. If empty, indexes are used. - */ + /** Constructor. */ wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ); - /** - Simple interface constructor. - */ + /** Constructor. */ wxPGChoices( wxPGChoicesData* data ); - /** - Destructor. - */ + /** Destructor. */ ~wxPGChoices(); /** Adds to current. If did not have own copies, creates them now. If was empty, identical to set except that creates copies. - - @param labels - Labels for added choices. - - @param values - Values for added choices. If empty, relevant entry indexes are used. */ void Add( const wxChar** labels, const ValArrItem* values = NULL ); - /** - Adds to current. Version that works with wxArrayString and wxArrayInt. - */ + /** Version that works with wxArrayString and wxArrayInt. */ void Add( const wxArrayString& arr, const wxArrayInt& arrint ); - /** - Adds a single choice item. - - @param label - Label for added choice. - - @param value - Value for added choice. If unspecified, index is used. - */ + /** Adds single item. */ wxPGChoiceEntry& Add( const wxString& label, int value = wxPG_INVALID_VALUE ); - /** - Adds a single item, with bitmap. - */ + /** Adds a single item, with bitmap. */ wxPGChoiceEntry& Add( const wxString& label, const wxBitmap& bitmap, int value = wxPG_INVALID_VALUE ); - /** - Adds a single item with full entry information. - */ + /** Adds a single item with full entry information. */ wxPGChoiceEntry& Add( const wxPGChoiceEntry& entry ); - /** - Adds a single item, sorted. - */ + /** Adds single item, sorted. */ wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE ); /** @@ -2516,7 +2363,7 @@ public: unsigned int GetCount() const; /** - Returns value of item. + Returns value of item; */ int GetValue( unsigned int ind ) const; @@ -2544,7 +2391,7 @@ public: int Index( int val ) const; /** - Inserts a single item. + Inserts single item. */ wxPGChoiceEntry& Insert( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); From c8c02a1bf2704df59c4eb40c1254b9c771aee919 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 23 Feb 2015 21:42:47 -0800 Subject: [PATCH 19/36] Add wxPGPaintData and wxPGCellRenderer --- interface/wx/propgrid/property.h | 146 +++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index a11f3e2edd..db818933d5 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -33,6 +33,152 @@ struct wxPGPaintData int m_drawnHeight; }; +/** + @class wxPGPaintData + + Contains information relayed to property's OnCustomPaint. +*/ +struct wxPGPaintData +{ + /** wxPropertyGrid. */ + const wxPropertyGrid* m_parent; + + /** + Normally -1, otherwise index to drop-down list item that has to be + drawn. + */ + int m_choiceItem; + + /** Set to drawn width in OnCustomPaint (optional). */ + int m_drawnWidth; + + /** + In a measure item call, set this to the height of item at m_choiceItem + index. + */ + int m_drawnHeight; +}; + + +// space between vertical sides of a custom image +#define wxPG_CUSTOM_IMAGE_SPACINGY 1 + +// space between caption and selection rectangle, +#define wxPG_CAPRECTXMARGIN 2 + +// horizontally and vertically +#define wxPG_CAPRECTYMARGIN 1 + + +/** + @class wxPGCellRenderer + + Base class for wxPropertyGrid cell renderers. +*/ +class wxPGCellRenderer : public wxObjectRefData +{ +public: + + wxPGCellRenderer() + : wxObjectRefData() { } + virtual ~wxPGCellRenderer() { } + + // Render flags + enum + { + // We are painting selected item + Selected = 0x00010000, + + // We are painting item in choice popup + ChoicePopup = 0x00020000, + + // We are rendering wxOwnerDrawnComboBox control + // (or other owner drawn control, but that is only + // officially supported one ATM). + Control = 0x00040000, + + // We are painting a disable property + Disabled = 0x00080000, + + // We are painting selected, disabled, or similar + // item that dictates fore- and background colours, + // overriding any cell values. + DontUseCellFgCol = 0x00100000, + DontUseCellBgCol = 0x00200000, + DontUseCellColours = DontUseCellFgCol | + DontUseCellBgCol + }; + + /** + Returns @true if rendered something in the foreground (text or + bitmap. + */ + virtual bool Render( wxDC& dc, + const wxRect& rect, + const wxPropertyGrid* propertyGrid, + wxPGProperty* property, + int column, + int item, + int flags ) const = 0; + + /** Returns size of the image in front of the editable area. + @remarks + If property is NULL, then this call is for a custom value. In that case + the item is index to wxPropertyGrid's custom values. + */ + virtual wxSize GetImageSize( const wxPGProperty* property, + int column, + int item ) const; + + /** Paints property category selection rectangle. + */ + virtual void DrawCaptionSelectionRect( wxDC& dc, + int x, int y, + int w, int h ) const; + + /** Utility to draw vertically centered text. + */ + void DrawText( wxDC& dc, + const wxRect& rect, + int imageWidth, + const wxString& text ) const; + + /** + Utility to draw editor's value, or vertically aligned text if editor is + NULL. + */ + void DrawEditorValue( wxDC& dc, const wxRect& rect, + int xOffset, const wxString& text, + wxPGProperty* property, + const wxPGEditor* editor ) const; + + /** Utility to render cell bitmap and set text colour plus bg brush + colour. + + @return Returns image width, which, for instance, can be passed to + DrawText. + */ + int PreDrawCell( wxDC& dc, + const wxRect& rect, + const wxPGCell& cell, + int flags ) const; + + /** + Utility to be called after drawing is done, to revert whatever + changes PreDrawCell() did. + + @param flags + Same as those passed to PreDrawCell(). + */ + void PostDrawCell( wxDC& dc, + const wxPropertyGrid* propGrid, + const wxPGCell& cell, + int flags ) const; +}; + + + + /** @section propgrid_property_attributes wxPropertyGrid Property Attribute Identifiers From 774f37d0a34cda7a1d06514ccae65b88d690a27b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 3 Mar 2015 20:39:20 -0800 Subject: [PATCH 20/36] Add more missing classes --- interface/wx/propgrid/editors.h | 242 +++++++++++++++++++++++++++++++ interface/wx/propgrid/property.h | 84 +++++++++++ 2 files changed, 326 insertions(+) diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index 0d5ae8f349..ca7488394d 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -5,6 +5,26 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + @class wxPGWindowList + + Contains a list of editor windows returned by CreateControls. +*/ + +class wxPGWindowList +{ +public: + wxPGWindowList(); + void SetSecondary( wxWindow* secondary ); + + wxWindow* m_primary; + wxWindow* m_secondary; + + wxPGWindowList( wxWindow* a ); + wxPGWindowList( wxWindow* a, wxWindow* b ); +}; + + /** @class wxPGEditor @@ -166,6 +186,228 @@ public: Default implementation returns @false. */ virtual bool CanContainCustomImage() const; + + // + // This member is public so scripting language bindings + // wrapper code can access it freely. + void* m_clientData; + +}; + + + + +class wxPGTextCtrlEditor : public wxPGEditor +{ +public: + wxPGTextCtrlEditor(); + virtual ~wxPGTextCtrlEditor(); + + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; + virtual void UpdateControl( wxPGProperty* property, + wxWindow* ctrl ) const; + virtual bool OnEvent( wxPropertyGrid* propgrid, + wxPGProperty* property, + wxWindow* primaryCtrl, + wxEvent& event ) const; + virtual bool GetValueFromControl( wxVariant& variant, + wxPGProperty* property, + wxWindow* ctrl ) const; + + virtual wxString GetName() const; + + virtual void SetControlStringValue( wxPGProperty* property, + wxWindow* ctrl, + const wxString& txt ) const; + virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; + + static bool OnTextCtrlEvent( wxPropertyGrid* propgrid, + wxPGProperty* property, + wxWindow* ctrl, + wxEvent& event ); + + static bool GetTextCtrlValueFromControl( wxVariant& variant, + wxPGProperty* property, + wxWindow* ctrl ); +}; + + +class wxPGChoiceEditor : public wxPGEditor +{ +public: + wxPGChoiceEditor() + virtual ~wxPGChoiceEditor(); + + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; + virtual void UpdateControl( wxPGProperty* property, + wxWindow* ctrl ) const; + virtual bool OnEvent( wxPropertyGrid* propgrid, + wxPGProperty* property, + wxWindow* primaryCtrl, + wxEvent& event ) const; + virtual bool GetValueFromControl( wxVariant& variant, + wxPGProperty* property, + wxWindow* ctrl ) const; + virtual void SetValueToUnspecified( wxPGProperty* property, + wxWindow* ctrl ) const; + virtual wxString GetName() const; + + virtual void SetControlIntValue( wxPGProperty* property, + wxWindow* ctrl, + int value ) const; + virtual void SetControlStringValue( wxPGProperty* property, + wxWindow* ctrl, + const wxString& txt ) const; + + virtual int InsertItem( wxWindow* ctrl, + const wxString& label, + int index ) const; + virtual void DeleteItem( wxWindow* ctrl, int index ) const; + virtual bool CanContainCustomImage() const; + + wxWindow* CreateControlsBase( wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& sz, + long extraStyle ) const; + +}; + + +class wxPGComboBoxEditor : public wxPGChoiceEditor +{ +public: + wxPGComboBoxEditor(); + virtual ~wxPGComboBoxEditor(); + + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; + + virtual wxString GetName() const; + + virtual void UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const; + + virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, + wxWindow* ctrl, wxEvent& event ) const; + + virtual bool GetValueFromControl( wxVariant& variant, + wxPGProperty* property, + wxWindow* ctrl ) const; + + virtual void OnFocus( wxPGProperty* property, wxWindow* wnd ) const; + +}; + + +class wxPGChoiceAndButtonEditor : public wxPGChoiceEditor +{ +public: + wxPGChoiceAndButtonEditor(); + virtual ~wxPGChoiceAndButtonEditor(); + virtual wxString GetName() const; + + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; +}; + +class wxPGTextCtrlAndButtonEditor : public wxPGTextCtrlEditor +{ +public: + wxPGTextCtrlAndButtonEditor(); + virtual ~wxPGTextCtrlAndButtonEditor(); + virtual wxString GetName() const; + + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; +}; + + + + + +class wxPGCheckBoxEditor : public wxPGEditor +{ +public: + wxPGCheckBoxEditor(); + virtual ~wxPGCheckBoxEditor(); + + virtual wxString GetName() const; + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; + virtual void UpdateControl( wxPGProperty* property, + wxWindow* ctrl ) const; + virtual bool OnEvent( wxPropertyGrid* propgrid, + wxPGProperty* property, + wxWindow* primaryCtrl, + wxEvent& event ) const; + virtual bool GetValueFromControl( wxVariant& variant, + wxPGProperty* property, + wxWindow* ctrl ) const; + virtual void SetValueToUnspecified( wxPGProperty* property, + wxWindow* ctrl ) const; + + virtual void DrawValue( wxDC& dc, + const wxRect& rect, + wxPGProperty* property, + const wxString& text ) const; + + virtual void SetControlIntValue( wxPGProperty* property, + wxWindow* ctrl, + int value ) const; +}; + + + +/** + @class wxPGEditorDialogAdapter + + Derive a class from this to adapt an existing editor dialog or function to + be used when editor button of a property is pushed. + + You only need to derive class and implement DoShowDialog() to create and + show the dialog, and finally submit the value returned by the dialog + via SetValue(). + + @library{wxpropgrid} + @category{propgrid} +*/ +class wxPGEditorDialogAdapter : public wxObject +{ +public: + wxPGEditorDialogAdapter(); + virtual ~wxPGEditorDialogAdapter(); + + bool ShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property ); + + virtual bool DoShowDialog( wxPropertyGrid* propGrid, + wxPGProperty* property ) = 0; + + void SetValue( wxVariant value ); + + /** + This method is typically only used if deriving class from existing + adapter with value conversion purposes. + */ + wxVariant& GetValue() { return m_value; } + + // + // This member is public so scripting language bindings + // wrapper code can access it freely. + void* m_clientData; }; diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index db818933d5..1614173cf0 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -177,6 +177,44 @@ public: }; +/** + @class wxPGDefaultRenderer + + Default cell renderer, that can handles the common + scenarios. +*/ +class wxPGDefaultRenderer : public wxPGCellRenderer +{ +public: + virtual bool Render( wxDC& dc, + const wxRect& rect, + const wxPropertyGrid* propertyGrid, + wxPGProperty* property, + int column, + int item, + int flags ) const; + + virtual wxSize GetImageSize( const wxPGProperty* property, + int column, + int item ) const; +}; + + +class wxPGCellData : public wxObjectRefData +{ +public: + wxPGCellData(); + + void SetText( const wxString& text ); + void SetBitmap( const wxBitmap& bitmap ); + void SetFgCol( const wxColour& col ); + void SetBgCol( const wxColour& col ); + void SetFont( const wxFont& font ); + +protected: + virtual ~wxPGCellData() { } +}; + /** @@ -2403,6 +2441,52 @@ public: // ----------------------------------------------------------------------- + +/** + @class wxPGChoiceEntry + Data of a single wxPGChoices choice. +*/ +class wxPGChoiceEntry : public wxPGCell +{ +public: + wxPGChoiceEntry(); + wxPGChoiceEntry(const wxPGChoiceEntry& other); + wxPGChoiceEntry( const wxString& label, + int value = wxPG_INVALID_VALUE ); + + virtual ~wxPGChoiceEntry(); + + void SetValue( int value ); + int GetValue() const; + + wxPGChoiceEntry& operator=( const wxPGChoiceEntry& other ); +}; + + +class wxPGChoicesData : public wxObjectRefData +{ +public: + // Constructor sets m_refCount to 1. + wxPGChoicesData(); + + void CopyDataFrom( wxPGChoicesData* data ); + + wxPGChoiceEntry& Insert( int index, const wxPGChoiceEntry& item ); + + // Delete all entries + void Clear(); + + unsigned int GetCount() const; + + const wxPGChoiceEntry& Item( unsigned int i ) const; + wxPGChoiceEntry& Item( unsigned int i ); +}; + +#define wxPGChoicesEmptyData ((wxPGChoicesData*)NULL) + + + + /** @class wxPGChoices From af9a0f67344fac4f4cff8802a15b2061d50e8959 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 5 Mar 2015 15:14:23 -0800 Subject: [PATCH 21/36] Change ~wxPGChoicesData from private to protected --- include/wx/propgrid/property.h | 1 + interface/wx/propgrid/property.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 4d3b6f002f..46591191d6 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -677,6 +677,7 @@ public: private: wxVector m_items; +protected: virtual ~wxPGChoicesData(); }; diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 1614173cf0..b281e43175 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -2480,6 +2480,9 @@ public: const wxPGChoiceEntry& Item( unsigned int i ) const; wxPGChoiceEntry& Item( unsigned int i ); + +protected: + virtual ~wxPGChoicesData(); }; #define wxPGChoicesEmptyData ((wxPGChoicesData*)NULL) From 12f9b8b7e4d2b2b39685d49d7ef37a50c7356cdf Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 24 Aug 2016 18:50:52 -0700 Subject: [PATCH 22/36] SetValueToUnspecified is not pure virtual --- interface/wx/propgrid/editors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index ca7488394d..7409284b74 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -129,7 +129,7 @@ public: /** Sets value in control to unspecified. */ virtual void SetValueToUnspecified( wxPGProperty* property, - wxWindow* ctrl ) const = 0; + wxWindow* ctrl ) const; /** Called by property grid to set new appearance for the control. From 17bb46299ed5022d3e488f5a2906586b026f1959 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 Aug 2016 16:18:15 -0700 Subject: [PATCH 23/36] Fix wxPropertyGridPage declaration --- interface/wx/propgrid/manager.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 022eb726c6..940ddb8626 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -36,8 +36,9 @@ @library{wxpropgrid} @category{propgrid} */ -class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler, - public wxPropertyGridInterface +class wxPropertyGridPage : public wxEvtHandler, + public wxPropertyGridInterface, + public wxPropertyGridPageState { friend class wxPropertyGridManager; From 6988758648aedab9465c65b228546ad931041926 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 2 Sep 2016 10:33:00 -0700 Subject: [PATCH 24/36] Add missing methods in wxGridCellAttr --- interface/wx/grid.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/interface/wx/grid.h b/interface/wx/grid.h index a250db796f..c363027bc0 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -801,7 +801,10 @@ public: Row, /// Return the attribute set for this cells column. - Col + Col, + + Default, + Merged }; /** @@ -978,6 +981,22 @@ public: */ void SetTextColour(const wxColour& colText); + + void MergeWith(wxGridCellAttr *mergefrom); + + void SetSize(int num_rows, int num_cols); + void SetOverflow(bool allow = true); + void SetKind(wxAttrKind kind); + + bool HasReadWriteMode() const; + bool HasOverflowMode() const; + bool HasSize() const; + + void GetSize(int *num_rows, int *num_cols) const; + bool GetOverflow() const; + wxAttrKind GetKind(); + + protected: /** From 8557172cb5a06b90f43e53258d26f311e0203339 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 14 Sep 2016 20:16:27 -0700 Subject: [PATCH 25/36] Add SetFlag and ClearFlag --- interface/wx/propgrid/property.h | 40 +++++++------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index b281e43175..ed79e1617d 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -1447,7 +1447,7 @@ public: double GetAttributeAsDouble( const wxString& name, double defVal ) const; /** - Returns comma-delimited string of property attributes. + Returns attributes as list wxVariant. */ const wxPGAttributeStorage& GetAttributes() const; @@ -1755,10 +1755,11 @@ public: bool IsRoot() const; /** - Returns true if this is a sub-property. + Returns true if this is a sub-property. */ bool IsSubProperty() const; + /** Returns @true if candidateParent is some parent of this property. */ @@ -1819,8 +1820,9 @@ public: */ void SetAttribute( const wxString& name, wxVariant value ); + void SetAttributes( const wxPGAttributeStorage& attributes ); - + /** Set if user can change the property's value to unspecified by modifying the value of the editor control (usually by clearing @@ -2063,34 +2065,7 @@ public: protected: /** - Sets property cell in fashion that reduces number of exclusive - copies of cell data. Used when setting, for instance, same - background colour for a number of properties. - - @param firstCol - First column to affect. - - @param lastCol - Last column to affect. - - @param preparedCell - Pre-prepared cell that is used for those which cell data - before this matched unmodCellData. - - @param srcData - If unmodCellData did not match, valid cell data from this - is merged into cell (usually generating new exclusive copy - of cell's data). - - @param unmodCellData - If cell's cell data matches this, its cell is now set to - preparedCell. - - @param ignoreWithFlags - Properties with any one of these flags are skipped. - - @param recursively - If @true, apply this operation recursively in child properties. + Helper for language bindings. */ void AdaptiveSetCell( unsigned int firstCol, unsigned int lastCol, @@ -2137,6 +2112,9 @@ protected: Returns true if child property is selected. */ bool IsChildSelected( bool recursive = false ) const; + + void SetFlag( wxPGPropertyFlags flag ); + void ClearFlag( FlagType flag ); }; // ----------------------------------------------------------------------- From ec0a91464eccc9568c41b1bfeb05d895e8a27069 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 19 Sep 2016 13:36:42 -0700 Subject: [PATCH 26/36] Add missing ctors and dtor for wxPropertyGridManager --- interface/wx/propgrid/manager.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 940ddb8626..4c2cfea320 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -106,7 +106,7 @@ public: virtual void Init(); /** - Return @false here to indicate unhandled events should be + Return false here to indicate unhandled events should be propagated to manager's parent, as normal. */ virtual bool IsHandlingAllEvents() const; @@ -143,8 +143,8 @@ public: wxPropertyGridManager inherits from wxPropertyGridInterface, and as such it has most property manipulation functions. However, only some of them affect - properties on all pages (e.g. GetPropertyByName() and ExpandAll()), while some - (e.g. Append()) only apply to the currently selected page. + properties on all pages (eg. GetPropertyByName() and ExpandAll()), while some + (eg. Append()) only apply to the currently selected page. To operate explicitly on properties on specific page, use wxPropertyGridManager::GetPage() to obtain pointer to page's @@ -172,6 +172,8 @@ public: wxPG_TOOLBAR | // Include description box. wxPG_DESCRIPTION | + // Include compactor. + wxPG_COMPACTOR | // Plus defaults. wxPGMAN_DEFAULT_STYLE ); @@ -212,8 +214,16 @@ class wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface { public: /** - The default constructor. The styles to be used are styles valid for - the wxWindow. + Two step constructor. + Call Create when this constructor is called to build up the + wxPropertyGridManager. + */ + wxPropertyGridManager(); + + /** + The default constructor. The styles to be used are styles valid for + the wxWindow. + @see @link wndflags Additional Window Styles @endlink */ wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, @@ -221,9 +231,7 @@ public: long style = wxPGMAN_DEFAULT_STYLE, const wxString& name = wxPropertyGridManagerNameStr ); - /** - Destructor. - */ + /** Destructor */ virtual ~wxPropertyGridManager(); /** @@ -285,7 +293,7 @@ public: Enables or disables (shows/hides) categories according to parameter enable. @remarks - Calling this may not properly update toolbar buttons. + Calling his may not properly update toolbar buttons. */ bool EnableCategories( bool enable ); @@ -317,7 +325,7 @@ public: wxPropertyGrid* GetGrid(); /** - Similar to GetIterator(), but instead returns wxPGVIterator instance, + Similar to GetIterator, but instead returns wxPGVIterator instance, which can be useful for forward-iterating through arbitrary property containers. */ @@ -397,7 +405,7 @@ public: @param pageObj wxPropertyGridPage instance. Manager will take ownership of this - object. If @NULL, default page object is constructed. + object. If NULL, default page object is constructed. @return Returns pointer to created page. */ @@ -437,7 +445,7 @@ public: Select and displays a given page. @param index - Index of page being selected. Can be -1 to select nothing. + Index of page being seleced. Can be -1 to select nothing. */ void SelectPage( int index ); From 6b335c8ca440a7adea8309c2272b53aaff59f526 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 30 Sep 2016 13:44:38 -0700 Subject: [PATCH 27/36] Add missing wxPropertySheetDialog methods and fix a typo. --- include/wx/generic/propdlg.h | 2 +- interface/wx/propdlg.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/propdlg.h b/include/wx/generic/propdlg.h index 5072dfdf0a..eacc73e1b6 100644 --- a/include/wx/generic/propdlg.h +++ b/include/wx/generic/propdlg.h @@ -106,7 +106,7 @@ public: virtual wxWindow* GetContentWindow() const wxOVERRIDE; // Set and get the inner sizer - void SetInnerSize(wxSizer* sizer) { m_innerSizer = sizer; } + void SetInnerSizer(wxSizer* sizer) { m_innerSizer = sizer; } wxSizer* GetInnerSizer() const { return m_innerSizer ; } // Set and get the book style diff --git a/interface/wx/propdlg.h b/interface/wx/propdlg.h index 06706f46a8..9593e88a4f 100644 --- a/interface/wx/propdlg.h +++ b/interface/wx/propdlg.h @@ -107,6 +107,11 @@ enum wxPropertySheetDialogFlags class wxPropertySheetDialog : public wxDialog { public: + /** + Default constructor. Call Create if using this form of constructor. + */ + wxPropertySheetDialog(); + /** Constructor. */ @@ -159,6 +164,11 @@ public: */ wxSizer* GetInnerSizer() const; + /** + Set the inner sizer that contains the book control and button sizer. + */ + void SetInnerSizer(wxSizer* sizer); + /** Returns the sheet style. @@ -186,5 +196,31 @@ public: It is a bit list of the ::wxPropertySheetDialogFlags values. */ void SetSheetStyle(long style); + + + /** + Set the border around the whole dialog + */ + void SetSheetOuterBorder(int border); + + /** + Returns the border around the whole dialog + */ + int GetSheetOuterBorder() const; + + + /** + Set the border around the book control only. + */ + void SetSheetInnerBorder(int border); + + /** + Returns the border around the book control only. + */ + int GetSheetInnerBorder() const; + + + virtual wxWindow* GetContentWindow() const; + }; From 60aa5d8e41519117058b4852cd6bb7290822e284 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 30 Sep 2016 16:45:23 -0700 Subject: [PATCH 28/36] fix code snippet --- interface/wx/richtext/richtextformatdlg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/wx/richtext/richtextformatdlg.h b/interface/wx/richtext/richtextformatdlg.h index 43a7a3cb75..6fc9e34089 100644 --- a/interface/wx/richtext/richtextformatdlg.h +++ b/interface/wx/richtext/richtextformatdlg.h @@ -99,10 +99,10 @@ public: For example: @code wxRichTextRange range; - if (m_richTextCtrl-HasSelection()) - range = m_richTextCtrl-GetSelectionRange(); + if (m_richTextCtrl->HasSelection()) + range = m_richTextCtrl->GetSelectionRange(); else - range = wxRichTextRange(0, m_richTextCtrl-GetLastPosition()+1); + range = wxRichTextRange(0, m_richTextCtrl->GetLastPosition()+1); int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING| \ wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS; From 107d6551c09f1bd2f11b0cab9840e5c047755921 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 26 Oct 2016 09:32:50 -0700 Subject: [PATCH 29/36] Revert "WX_CLEAR_LIST in wxHtmlWindow::CleanUpStatics is hard-crashing" The issue was an incorrect ownership transfer in wxPython. This reverts commit b2ae25fc6ae59cfd95f15b7401b63ebb06c72e02. --- src/html/htmlwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 2c09d5b86c..008b30fbb7 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -291,7 +291,7 @@ wxCursor *wxHtmlWindow::ms_cursorDefault = NULL; void wxHtmlWindow::CleanUpStatics() { wxDELETE(m_DefaultFilter); - m_Filters.Clear(); + WX_CLEAR_LIST(wxList, m_Filters); if (m_GlobalProcessors) WX_CLEAR_LIST(wxHtmlProcessorList, *m_GlobalProcessors); wxDELETE(m_GlobalProcessors); From 90059c0cf913a76c6adb58e1aadb8d3a4d4e63db Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 25 Oct 2016 19:10:37 -0700 Subject: [PATCH 30/36] Add AUI event types --- interface/wx/aui/framemanager.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index c37430727a..1b30ed0b0a 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -1023,3 +1023,12 @@ public: void Veto(bool veto = true); }; + + +wxEventType wxEVT_AUI_PANE_BUTTON; +wxEventType wxEVT_AUI_PANE_CLOSE; +wxEventType wxEVT_AUI_PANE_MAXIMIZE; +wxEventType wxEVT_AUI_PANE_RESTORE; +wxEventType wxEVT_AUI_PANE_ACTIVATED; +wxEventType wxEVT_AUI_RENDER; +wxEventType wxEVT_AUI_FIND_MANAGER; From aaa1a51a595fdc9ae165eb9eba185abd418255b9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 27 Oct 2016 18:48:52 -0700 Subject: [PATCH 31/36] Additions and fixes for AUI class interfaces --- interface/wx/aui/auibar.h | 16 ++++ interface/wx/aui/auibook.h | 55 ++++++++++++- interface/wx/aui/dockart.h | 99 ++++++++++++++++++++++ interface/wx/aui/framemanager.h | 62 ++++++++++++++ interface/wx/aui/tabmdi.h | 140 ++++++++++++++++++++++++++++++++ 5 files changed, 368 insertions(+), 4 deletions(-) create mode 100644 interface/wx/aui/tabmdi.h diff --git a/interface/wx/aui/auibar.h b/interface/wx/aui/auibar.h index 8cdc0a62c3..1c2dfba0e9 100644 --- a/interface/wx/aui/auibar.h +++ b/interface/wx/aui/auibar.h @@ -148,6 +148,10 @@ enum wxAuiToolBarToolTextOrientation class wxAuiToolBarEvent : public wxNotifyEvent { public: + wxAuiToolBarEvent(wxEventType commandType = wxEVT_NULL, + int winId = 0); + wxAuiToolBarEvent(const wxAuiToolBarEvent& c); + /** Returns whether the drop down menu has been clicked. */ @@ -167,8 +171,20 @@ public: Returns the wxAuiToolBarItem identifier. */ int GetToolId() const; + + + void SetDropDownClicked(bool c); + void SetClickPoint(const wxPoint& p); + void SetItemRect(const wxRect& r); + void SetToolId(int toolId); }; +wxEventType wxEVT_AUITOOLBAR_TOOL_DROPDOWN; +wxEventType wxEVT_AUITOOLBAR_OVERFLOW_CLICK; +wxEventType wxEVT_AUITOOLBAR_RIGHT_CLICK; +wxEventType wxEVT_AUITOOLBAR_MIDDLE_CLICK; +wxEventType wxEVT_AUITOOLBAR_BEGIN_DRAG; + /** @class wxAuiToolBarItem diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index 59eed12556..e5d6c2a895 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -5,6 +5,32 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +enum wxAuiNotebookOption +{ + wxAUI_NB_TOP = 1 << 0, + wxAUI_NB_LEFT = 1 << 1, // not implemented yet + wxAUI_NB_RIGHT = 1 << 2, // not implemented yet + wxAUI_NB_BOTTOM = 1 << 3, + wxAUI_NB_TAB_SPLIT = 1 << 4, + wxAUI_NB_TAB_MOVE = 1 << 5, + wxAUI_NB_TAB_EXTERNAL_MOVE = 1 << 6, + wxAUI_NB_TAB_FIXED_WIDTH = 1 << 7, + wxAUI_NB_SCROLL_BUTTONS = 1 << 8, + wxAUI_NB_WINDOWLIST_BUTTON = 1 << 9, + wxAUI_NB_CLOSE_BUTTON = 1 << 10, + wxAUI_NB_CLOSE_ON_ACTIVE_TAB = 1 << 11, + wxAUI_NB_CLOSE_ON_ALL_TABS = 1 << 12, + wxAUI_NB_MIDDLE_CLICK_CLOSE = 1 << 13, + + wxAUI_NB_DEFAULT_STYLE = wxAUI_NB_TOP | + wxAUI_NB_TAB_SPLIT | + wxAUI_NB_TAB_MOVE | + wxAUI_NB_SCROLL_BUTTONS | + wxAUI_NB_CLOSE_ON_ACTIVE_TAB | + wxAUI_NB_MIDDLE_CLICK_CLOSE +}; + + /** @class wxAuiNotebook @@ -20,9 +46,9 @@ splitter configurations, and toggle through different themes to customize the control's look and feel. - The appearance of this class is configurable and can be changed by calling - wxAuiNotebook::SetArtProvider(). By default, native art provider is used if - available (currently only in wxGTK and wxMSW) and wxAuiGenericTabArt otherwise. + The default theme that is used is wxAuiDefaultTabArt, which provides a modern, + glossy look and feel. + The theme can be changed by calling wxAuiNotebook::SetArtProvider. @beginStyleTable @style{wxAUI_NB_DEFAULT_STYLE} @@ -270,7 +296,7 @@ public: @since 2.9.3 */ virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text, - bool select=false, int imageId=NO_IMAGE); + bool select, int imageId); /** Removes a page, without deleting the window pointer. @@ -375,6 +401,27 @@ public: bool ShowWindowMenu(); }; + +/** + @class wxAuiNotebookPage + + A simple class which holds information about the notebook's pages and their state. + + @library{wxaui} + @category{aui} +*/ +class wxAuiNotebookPage +{ +public: + wxWindow* window; // page's associated window + wxString caption; // caption displayed on the tab + wxString tooltip; // tooltip displayed when hovering over tab title + wxBitmap bitmap; // tab's bitmap + wxRect rect; // tab's hit rectangle + bool active; // true if the page is currently active +}; + + /** @class wxAuiTabContainerButton diff --git a/interface/wx/aui/dockart.h b/interface/wx/aui/dockart.h index cf23c1693f..89287d0132 100644 --- a/interface/wx/aui/dockart.h +++ b/interface/wx/aui/dockart.h @@ -281,3 +281,102 @@ public: virtual void SetMetric(int id, int new_val) = 0; }; + + + +/** + @class wxAuiDefaultDockArt + + This is the default art provider for @ref wxAuiManager. Dock art + can be customized by creating a class derived from this one, + or replacing this class entirely. +*/ +class wxAuiDefaultDockArt : public wxAuiDockArt +{ +public: + + wxAuiDefaultDockArt(); + + int GetMetric(int metricId); + void SetMetric(int metricId, int newVal); + wxColour GetColour(int id); + void SetColour(int id, const wxColour& colour); + void SetFont(int id, const wxFont& font); + wxFont GetFont(int id); + + void DrawSash(wxDC& dc, + wxWindow *window, + int orientation, + const wxRect& rect); + + void DrawBackground(wxDC& dc, + wxWindow *window, + int orientation, + const wxRect& rect); + + void DrawCaption(wxDC& dc, + wxWindow *window, + const wxString& text, + const wxRect& rect, + wxAuiPaneInfo& pane); + + void DrawGripper(wxDC& dc, + wxWindow *window, + const wxRect& rect, + wxAuiPaneInfo& pane); + + void DrawBorder(wxDC& dc, + wxWindow *window, + const wxRect& rect, + wxAuiPaneInfo& pane); + + void DrawPaneButton(wxDC& dc, + wxWindow *window, + int button, + int buttonState, + const wxRect& rect, + wxAuiPaneInfo& pane); + + void DrawIcon(wxDC& dc, + const wxRect& rect, + wxAuiPaneInfo& pane); + +protected: + + void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active); + + void InitBitmaps(); + +protected: + + wxPen m_borderPen; + wxBrush m_sashBrush; + wxBrush m_backgroundBrush; + wxBrush m_gripperBrush; + wxFont m_captionFont; + wxBitmap m_inactiveCloseBitmap; + wxBitmap m_inactivePinBitmap; + wxBitmap m_inactiveMaximizeBitmap; + wxBitmap m_inactiveRestoreBitmap; + wxBitmap m_activeCloseBitmap; + wxBitmap m_activePinBitmap; + wxBitmap m_activeMaximizeBitmap; + wxBitmap m_activeRestoreBitmap; + wxPen m_gripperPen1; + wxPen m_gripperPen2; + wxPen m_gripperPen3; + wxColour m_baseColour; + wxColour m_activeCaptionColour; + wxColour m_activeCaptionGradientColour; + wxColour m_activeCaptionTextColour; + wxColour m_inactiveCaptionColour; + wxColour m_inactiveCaptionGradientColour; + wxColour m_inactiveCaptionTextColour; + int m_borderSize; + int m_captionSize; + int m_sashSize; + int m_buttonSize; + int m_gripperSize; + int m_gradientType; +}; + diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index 1b30ed0b0a..62bface265 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -1032,3 +1032,65 @@ wxEventType wxEVT_AUI_PANE_RESTORE; wxEventType wxEVT_AUI_PANE_ACTIVATED; wxEventType wxEVT_AUI_RENDER; wxEventType wxEVT_AUI_FIND_MANAGER; + + + +class wxAuiDockInfo +{ +public: + wxAuiDockInfo(); + wxAuiDockInfo(const wxAuiDockInfo& c); + wxAuiDockInfo& operator=(const wxAuiDockInfo& c); + + bool IsOk() const; + bool IsHorizontal() const; + bool IsVertical() const; + + wxAuiPaneInfoPtrArray panes; // array of panes + wxRect rect; // current rectangle + int dock_direction; // dock direction (top, bottom, left, right, center) + int dock_layer; // layer number (0 = innermost layer) + int dock_row; // row number on the docking bar (0 = first row) + int size; // size of the dock + int min_size; // minimum size of a dock (0 if there is no min) + bool resizable; // flag indicating whether the dock is resizable + bool toolbar; // flag indicating dock contains only toolbars + bool fixed; // flag indicating that the dock operates on + // absolute coordinates as opposed to proportional + bool reserved1; +}; + + +class wxAuiDockUIPart +{ +public: + enum + { + typeCaption, + typeGripper, + typeDock, + typeDockSizer, + typePane, + typePaneSizer, + typeBackground, + typePaneBorder, + typePaneButton + }; + + int type; // ui part type (see enum above) + int orientation; // orientation (either wxHORIZONTAL or wxVERTICAL) + wxAuiDockInfo* dock; // which dock the item is associated with + wxAuiPaneInfo* pane; // which pane the item is associated with + wxAuiPaneButton* button; // which pane button the item is associated with + wxSizer* cont_sizer; // the part's containing sizer + wxSizerItem* sizer_item; // the sizer item of the part + wxRect rect; // client coord rectangle of the part itself +}; + + + +class wxAuiPaneButton +{ +public: + int button_id; // id of the button (e.g. buttonClose) +}; diff --git a/interface/wx/aui/tabmdi.h b/interface/wx/aui/tabmdi.h new file mode 100644 index 0000000000..4092edcdfc --- /dev/null +++ b/interface/wx/aui/tabmdi.h @@ -0,0 +1,140 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/aui/tabmdi.h +// Purpose: Documentation of wxAui MDI classes. +// Created: 2016-10-27 +// Copyright: (c) 2016 wxWidgets development team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + + +class wxAuiMDIParentFrame : public wxFrame +{ +public: + wxAuiMDIParentFrame(); + wxAuiMDIParentFrame(wxWindow *parent, + wxWindowID winid, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, + const wxString& name = wxFrameNameStr); + + ~wxAuiMDIParentFrame(); + + bool Create(wxWindow *parent, + wxWindowID winid, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, + const wxString& name = wxFrameNameStr ); + + void SetArtProvider(wxAuiTabArt* provider); + wxAuiTabArt* GetArtProvider(); + wxAuiNotebook* GetNotebook() const; + + wxMenu* GetWindowMenu() const; + void SetWindowMenu(wxMenu* pMenu); + + virtual void SetMenuBar(wxMenuBar *pMenuBar); + + void SetChildMenuBar(wxAuiMDIChildFrame *pChild); + + wxAuiMDIChildFrame *GetActiveChild() const; + void SetActiveChild(wxAuiMDIChildFrame* pChildFrame); + + wxAuiMDIClientWindow *GetClientWindow() const; + virtual wxAuiMDIClientWindow *OnCreateClient(); + + virtual void Cascade(); + virtual void Tile(wxOrientation orient = wxHORIZONTAL); + virtual void ArrangeIcons(); + virtual void ActivateNext(); + virtual void ActivatePrevious(); +}; + + + +class wxAuiMDIChildFrame : public wxPanel +{ +public: + wxAuiMDIChildFrame(); + wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent, + wxWindowID winid, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr); + + virtual ~wxAuiMDIChildFrame(); + bool Create(wxAuiMDIParentFrame *parent, + wxWindowID winid, + const wxString& title, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString& name = wxFrameNameStr); + + virtual void SetMenuBar(wxMenuBar *menuBar); + virtual wxMenuBar *GetMenuBar() const; + + virtual void SetTitle(const wxString& title); + virtual wxString GetTitle() const; + + virtual void SetIcons(const wxIconBundle& icons); + virtual const wxIconBundle& GetIcons() const; + + virtual void SetIcon(const wxIcon& icon); + virtual const wxIcon& GetIcon() const; + + virtual void Activate(); + virtual bool Destroy(); + + virtual bool Show(bool show = true); + + // no status bars + virtual wxStatusBar* CreateStatusBar(int number = 1, + long style = 1, + wxWindowID winid = 1, + const wxString& name = wxEmptyString); + + virtual wxStatusBar *GetStatusBar() const; + virtual void SetStatusText( const wxString &text, int number=0 ); + virtual void SetStatusWidths( int n, const int widths_field[] ); + + // no toolbar bars + virtual wxToolBar* CreateToolBar(long style, + wxWindowID winid, + const wxString& name); + virtual wxToolBar *GetToolBar() const; + + // no maximize etc + virtual void Maximize(bool maximize = true); + virtual void Restore(); + virtual void Iconize(bool iconize = true); + virtual bool IsMaximized() const; + virtual bool IsIconized() const; + virtual bool ShowFullScreen(bool show, long style); + virtual bool IsFullScreen() const; + + virtual bool IsTopLevel() const; + + void SetMDIParentFrame(wxAuiMDIParentFrame* parent); + wxAuiMDIParentFrame* GetMDIParentFrame() const; +}; + + +class wxAuiMDIClientWindow : public wxAuiNotebook +{ +public: + wxAuiMDIClientWindow(); + wxAuiMDIClientWindow(wxAuiMDIParentFrame *parent, long style = 0); + + virtual bool CreateClient(wxAuiMDIParentFrame *parent, + long style = wxVSCROLL | wxHSCROLL); + + virtual int SetSelection(size_t page); + virtual wxAuiMDIChildFrame* GetActiveChild(); + virtual void SetActiveChild(wxAuiMDIChildFrame* pChildFrame); +}; From 0dfe73c21e581cc242f152968c7aa78ecf7066e0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 28 Oct 2016 14:22:06 -0700 Subject: [PATCH 32/36] Add public attributes to wxAuiPaneInfo --- interface/wx/aui/framemanager.h | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index 62bface265..df94c7a320 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -917,6 +917,63 @@ public: Makes a copy of the wxAuiPaneInfo object. */ wxAuiPaneInfo& operator=(const wxAuiPaneInfo& c); + + + /// name of the pane + wxString name; + + /// caption displayed on the window + wxString caption; + + /// icon of the pane, may be invalid + wxBitmap icon; + + /// window that is in this pane + wxWindow* window; + + /// floating frame window that holds the pane + wxFrame* frame; + + /// a combination of wxPaneState values + unsigned int state; + + /// dock direction (top, bottom, left, right, center) + int dock_direction; + + /// layer number (0 = innermost layer) + int dock_layer; + + /// row number on the docking bar (0 = first row) + int dock_row; + + /// position inside the row (0 = first position) + int dock_pos; + + /// size that the layout engine will prefer + wxSize best_size; + + /// minimum size the pane window can tolerate + wxSize min_size; + + /// maximum size the pane window can tolerate + wxSize max_size; + + /// position while floating + wxPoint floating_pos; + + /// size while floating + wxSize floating_size; + + /// proportion while docked + int dock_proportion; + + /// buttons on the pane + wxAuiPaneButtonArray buttons; + + /// current rectangle (populated by wxAUI) + wxRect rect; + + bool IsValid() const; }; From fcc453848b89e059831f9a5e14c8c28784b60e96 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Nov 2016 19:02:17 -0800 Subject: [PATCH 33/36] Add missing GetPageImage --- interface/wx/aui/auibook.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index e5d6c2a895..50db1b0d02 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -399,6 +399,12 @@ public: and returns @true if a selection was made. */ bool ShowWindowMenu(); + + + /** + Returns the image index for the given page. + */ + virtual int GetPageImage(size_t nPage) const; }; From 016d8f5af468d4a83fdae83464830b48e29e4a80 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 22 Nov 2016 10:49:58 -0800 Subject: [PATCH 34/36] Fix instances of e.g. and i.e. --- interface/wx/propgrid/editors.h | 4 ++-- interface/wx/propgrid/manager.h | 10 +++++----- interface/wx/propgrid/property.h | 22 +++++++++++----------- interface/wx/propgrid/propgrid.h | 2 +- interface/wx/propgrid/propgridiface.h | 16 ++++++++-------- interface/wx/propgrid/propgridpagestate.h | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index 7409284b74..cddb8fc900 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -38,7 +38,7 @@ public: calling wxPropertyGrid::RegisterAdditionalEditors() prior use. - Pointer to built-in editor is available as wxPGEditor_EditorName - (eg. wxPGEditor_TextCtrl). + (e.g. wxPGEditor_TextCtrl). - Before you start using new editor you just created, you need to register it using static function @@ -113,7 +113,7 @@ public: @remarks wxPropertyGrid will automatically unfocus the editor when @c wxEVT_TEXT_ENTER is received and when it results in property value being modified. This happens regardless of - editor type (ie. behaviour is same for any wxTextCtrl and + editor type (i.e. behaviour is same for any wxTextCtrl and wxComboBox based editor). */ virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 4c2cfea320..6322ca1874 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -143,8 +143,8 @@ public: wxPropertyGridManager inherits from wxPropertyGridInterface, and as such it has most property manipulation functions. However, only some of them affect - properties on all pages (eg. GetPropertyByName() and ExpandAll()), while some - (eg. Append()) only apply to the currently selected page. + properties on all pages (e.g. GetPropertyByName() and ExpandAll()), while some + (e.g. Append()) only apply to the currently selected page. To operate explicitly on properties on specific page, use wxPropertyGridManager::GetPage() to obtain pointer to page's @@ -419,7 +419,7 @@ public: bool IsAnyModified() const; /** - Returns @true if updating is frozen (ie. Freeze() called but not yet Thaw() ). + Returns @true if updating is frozen (i.e. Freeze() called but not yet Thaw() ). */ bool IsFrozen() const; @@ -496,7 +496,7 @@ public: labels to be shown in full. @param subProps - If @false, will still allow sub-properties (ie. properties which + If @false, will still allow sub-properties (i.e. properties which parent is not root or category) to be cropped. @param allPages @@ -550,7 +550,7 @@ protected: /** Creates property grid for the manager. Reimplement in derived class to use subclassed wxPropertyGrid. However, if you do this then you - must also use the two-step construction (ie. default constructor and + must also use the two-step construction (i.e. default constructor and Create() instead of constructor with arguments) when creating the manager. */ diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index ed79e1617d..045291967e 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -422,7 +422,7 @@ wxPG_PROP_CUSTOMIMAGE = 0x0008, */ wxPG_PROP_NOEDITOR = 0x0010, -/** Property is collapsed, ie. it's children are hidden. +/** Property is collapsed, i.e. it's children are hidden. */ wxPG_PROP_COLLAPSED = 0x0020, @@ -606,7 +606,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxIntProperty Like wxStringProperty, but converts text to a signed long integer. - wxIntProperty seamlessly supports 64-bit integers (ie. wxLongLong). + wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong). To safely convert variant to integer, use code like this: @code @@ -625,7 +625,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 attribute. Regardless of current prefix, understands (hex) values starting with both "0x" and "$". Like wxIntProperty, wxUIntProperty seamlessly supports 64-bit unsigned - integers (ie. wxULongLong). Same wxVariant safety rules apply. + integers (i.e. wxULongLong). Same wxVariant safety rules apply. @subsection wxFloatProperty @@ -707,7 +707,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 manually edit the flags as a text; a continuous sequence of spaces, commas and semicolons are considered as a flag id separator. - Note: When changing "choices" (ie. flag labels) of wxFlagsProperty, + Note: When changing "choices" (i.e. flag labels) of wxFlagsProperty, you will need to use wxPGProperty::SetChoices() - otherwise they will not get updated properly. @@ -937,7 +937,7 @@ public: This virtual function is called after m_value has been set. @remarks - - If m_value was set to Null variant (ie. unspecified value), OnSetValue() + - If m_value was set to Null variant (i.e. unspecified value), OnSetValue() will not be called. - m_value may be of any variant type. Typically properties internally support only one variant type, and as such OnSetValue() provides a good opportunity to convert @@ -1294,7 +1294,7 @@ public: Returns instance of a new wxPGEditorDialogAdapter instance, which is used when user presses the (optional) button next to the editor control; - Default implementation returns @NULL (ie. no action is generated when + Default implementation returns @NULL (i.e. no action is generated when button is pressed). */ virtual wxPGEditorDialogAdapter* GetEditorDialog() const; @@ -1348,7 +1348,7 @@ public: void AdaptListToValue( wxVariant& list, wxVariant* value ) const; /** - Use this member function to add independent (ie. regular) children to + Use this member function to add independent (i.e. regular) children to a property. @return Appended childProperty. @@ -1461,7 +1461,7 @@ public: */ const wxPGEditor* GetColumnEditor( int column ) const; - /** Returns property's base name (ie. parent's name is not added in any case) */ + /** Returns property's base name (i.e. parent's name is not added in any case) */ const wxString& GetBaseName() const; /** @@ -1707,7 +1707,7 @@ public: int Index( const wxPGProperty* p ) const; /** - Use this member function to add independent (ie. regular) children to + Use this member function to add independent (i.e. regular) children to a property. @return Inserted childProperty. @@ -2037,13 +2037,13 @@ public: void SetValueInEvent( wxVariant value ) const; /** - Sets property's value to unspecified (ie. Null variant). + Sets property's value to unspecified (i.e. Null variant). */ void SetValueToUnspecified(); /** Call with @false in OnSetValue() to cancel value changes after all - (ie. cancel @true returned by StringToValue() or IntToValue()). + (i.e. cancel @true returned by StringToValue() or IntToValue()). */ void SetWasModified( bool set = true ); diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 7a39445bcf..b35b736d9c 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -920,7 +920,7 @@ public: bool IsEditorFocused() const; /** - Returns true if updating is frozen (ie. Freeze() called but not + Returns true if updating is frozen (i.e. Freeze() called but not yet Thaw() ). */ bool IsFrozen() const; diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index e40069d446..21637fa6bd 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -142,7 +142,7 @@ public: Refresh() when calling this function after control has been shown for the first time. - This functions deselects selected property, if any. Validation - failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. + failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. */ wxPGProperty* Append( wxPGProperty* property ); @@ -171,7 +171,7 @@ public: Deletes all properties. @remarks This functions deselects selected property, if any. Validation - failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. + failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. */ virtual void Clear() = 0; @@ -206,7 +206,7 @@ public: @return Returns @true if actually collapsed. @remarks This function may deselect selected property, if any. Validation - failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. + failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. */ bool Collapse( wxPGPropArg id ); @@ -218,7 +218,7 @@ public: Return @false if failed (may fail if editor value cannot be validated). @remarks This functions clears selection. Validation failure option - wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. selection + wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. */ bool CollapseAll(); @@ -244,7 +244,7 @@ public: This functions deselects selected property, if any. Validation failure option wxPG_VFB_STAY_IN_PROPERTY is not - respected, ie. selection is cleared even if editor had + respected, i.e. selection is cleared even if editor had invalid value. */ void DeleteProperty( wxPGPropArg id ); @@ -295,7 +295,7 @@ public: @return Returns @true if actually expanded. @remarks This function may deselect selected property, if any. Validation - failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. + failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. */ bool Expand( wxPGPropArg id ); @@ -304,7 +304,7 @@ public: Expands all items that can be expanded. @remarks This functions clears selection. Validation failure option - wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. selection + wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. */ bool ExpandAll( bool expand = true ); @@ -626,7 +626,7 @@ public: especially true if current mode is non-categoric. - This functions deselects selected property, if any. Validation - failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, ie. + failure option wxPG_VFB_STAY_IN_PROPERTY is not respected, i.e. selection is cleared even if editor had invalid value. Example of use: diff --git a/interface/wx/propgrid/propgridpagestate.h b/interface/wx/propgrid/propgridpagestate.h index 3f16b4faae..328af6c0c6 100644 --- a/interface/wx/propgrid/propgridpagestate.h +++ b/interface/wx/propgrid/propgridpagestate.h @@ -129,7 +129,7 @@ wxPG_ITERATOR_MASK_OP_PARENT = wxPG_ITERATOR_FLAGS_ALL, /** Combines all flags needed to iterate through visible properties - (ie. hidden properties and children of collapsed parents are skipped). + (i.e. hidden properties and children of collapsed parents are skipped). @hideinitializer */ wxPG_ITERATE_VISIBLE = wxPG_ITERATE_PROPERTIES | From 9e5dd5091402a7f4f5829e7b43edd7bc42bee3bd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 6 Jan 2017 16:43:05 -0800 Subject: [PATCH 35/36] Revert some changes from incorrect merge that discarded formatting, etc. --- interface/wx/propgrid/manager.h | 14 +- interface/wx/propgrid/property.h | 488 +++++++++++++------------- interface/wx/propgrid/propgridiface.h | 2 +- 3 files changed, 259 insertions(+), 245 deletions(-) diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 6322ca1874..a51ff229e9 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -106,7 +106,7 @@ public: virtual void Init(); /** - Return false here to indicate unhandled events should be + Return @false here to indicate unhandled events should be propagated to manager's parent, as normal. */ virtual bool IsHandlingAllEvents() const; @@ -231,7 +231,9 @@ public: long style = wxPGMAN_DEFAULT_STYLE, const wxString& name = wxPropertyGridManagerNameStr ); - /** Destructor */ + /** + Destructor. + */ virtual ~wxPropertyGridManager(); /** @@ -293,7 +295,7 @@ public: Enables or disables (shows/hides) categories according to parameter enable. @remarks - Calling his may not properly update toolbar buttons. + Calling this may not properly update toolbar buttons. */ bool EnableCategories( bool enable ); @@ -325,7 +327,7 @@ public: wxPropertyGrid* GetGrid(); /** - Similar to GetIterator, but instead returns wxPGVIterator instance, + Similar to GetIterator(), but instead returns wxPGVIterator instance, which can be useful for forward-iterating through arbitrary property containers. */ @@ -405,7 +407,7 @@ public: @param pageObj wxPropertyGridPage instance. Manager will take ownership of this - object. If NULL, default page object is constructed. + object. If @NULL, default page object is constructed. @return Returns pointer to created page. */ @@ -445,7 +447,7 @@ public: Select and displays a given page. @param index - Index of page being seleced. Can be -1 to select nothing. + Index of page being selected. Can be -1 to select nothing. */ void SelectPage( int index ); diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 045291967e..c53e0bd8ac 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -33,190 +33,6 @@ struct wxPGPaintData int m_drawnHeight; }; -/** - @class wxPGPaintData - - Contains information relayed to property's OnCustomPaint. -*/ -struct wxPGPaintData -{ - /** wxPropertyGrid. */ - const wxPropertyGrid* m_parent; - - /** - Normally -1, otherwise index to drop-down list item that has to be - drawn. - */ - int m_choiceItem; - - /** Set to drawn width in OnCustomPaint (optional). */ - int m_drawnWidth; - - /** - In a measure item call, set this to the height of item at m_choiceItem - index. - */ - int m_drawnHeight; -}; - - -// space between vertical sides of a custom image -#define wxPG_CUSTOM_IMAGE_SPACINGY 1 - -// space between caption and selection rectangle, -#define wxPG_CAPRECTXMARGIN 2 - -// horizontally and vertically -#define wxPG_CAPRECTYMARGIN 1 - - -/** - @class wxPGCellRenderer - - Base class for wxPropertyGrid cell renderers. -*/ -class wxPGCellRenderer : public wxObjectRefData -{ -public: - - wxPGCellRenderer() - : wxObjectRefData() { } - virtual ~wxPGCellRenderer() { } - - // Render flags - enum - { - // We are painting selected item - Selected = 0x00010000, - - // We are painting item in choice popup - ChoicePopup = 0x00020000, - - // We are rendering wxOwnerDrawnComboBox control - // (or other owner drawn control, but that is only - // officially supported one ATM). - Control = 0x00040000, - - // We are painting a disable property - Disabled = 0x00080000, - - // We are painting selected, disabled, or similar - // item that dictates fore- and background colours, - // overriding any cell values. - DontUseCellFgCol = 0x00100000, - DontUseCellBgCol = 0x00200000, - DontUseCellColours = DontUseCellFgCol | - DontUseCellBgCol - }; - - /** - Returns @true if rendered something in the foreground (text or - bitmap. - */ - virtual bool Render( wxDC& dc, - const wxRect& rect, - const wxPropertyGrid* propertyGrid, - wxPGProperty* property, - int column, - int item, - int flags ) const = 0; - - /** Returns size of the image in front of the editable area. - @remarks - If property is NULL, then this call is for a custom value. In that case - the item is index to wxPropertyGrid's custom values. - */ - virtual wxSize GetImageSize( const wxPGProperty* property, - int column, - int item ) const; - - /** Paints property category selection rectangle. - */ - virtual void DrawCaptionSelectionRect( wxDC& dc, - int x, int y, - int w, int h ) const; - - /** Utility to draw vertically centered text. - */ - void DrawText( wxDC& dc, - const wxRect& rect, - int imageWidth, - const wxString& text ) const; - - /** - Utility to draw editor's value, or vertically aligned text if editor is - NULL. - */ - void DrawEditorValue( wxDC& dc, const wxRect& rect, - int xOffset, const wxString& text, - wxPGProperty* property, - const wxPGEditor* editor ) const; - - /** Utility to render cell bitmap and set text colour plus bg brush - colour. - - @return Returns image width, which, for instance, can be passed to - DrawText. - */ - int PreDrawCell( wxDC& dc, - const wxRect& rect, - const wxPGCell& cell, - int flags ) const; - - /** - Utility to be called after drawing is done, to revert whatever - changes PreDrawCell() did. - - @param flags - Same as those passed to PreDrawCell(). - */ - void PostDrawCell( wxDC& dc, - const wxPropertyGrid* propGrid, - const wxPGCell& cell, - int flags ) const; -}; - - -/** - @class wxPGDefaultRenderer - - Default cell renderer, that can handles the common - scenarios. -*/ -class wxPGDefaultRenderer : public wxPGCellRenderer -{ -public: - virtual bool Render( wxDC& dc, - const wxRect& rect, - const wxPropertyGrid* propertyGrid, - wxPGProperty* property, - int column, - int item, - int flags ) const; - - virtual wxSize GetImageSize( const wxPGProperty* property, - int column, - int item ) const; -}; - - -class wxPGCellData : public wxObjectRefData -{ -public: - wxPGCellData(); - - void SetText( const wxString& text ); - void SetBitmap( const wxBitmap& bitmap ); - void SetFgCol( const wxColour& col ); - void SetBgCol( const wxColour& col ); - void SetFont( const wxFont& font ); - -protected: - virtual ~wxPGCellData() { } -}; - - - /** @section propgrid_property_attributes wxPropertyGrid Property Attribute Identifiers @@ -284,7 +100,8 @@ protected: */ #define wxPG_FLOAT_PRECISION wxS("Precision") -/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed to textctrl etc). +/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed + to textctrl etc.). */ #define wxPG_STRING_PASSWORD wxS("Password") @@ -400,29 +217,35 @@ enum wxPGPropertyFlags { /** Indicates bold font. + @hideinitializer */ wxPG_PROP_MODIFIED = 0x0001, /** Disables ('greyed' text and editor does not activate) property. + @hideinitializer */ wxPG_PROP_DISABLED = 0x0002, /** Hider button will hide this property. + @hideinitializer */ wxPG_PROP_HIDDEN = 0x0004, /** This property has custom paint image just in front of its value. If property only draws custom images into a popup list, then this flag should not be set. + @hideinitializer */ wxPG_PROP_CUSTOMIMAGE = 0x0008, /** Do not create text based editor for this property (but button-triggered dialog and choice are ok). + @hideinitializer */ wxPG_PROP_NOEDITOR = 0x0010, -/** Property is collapsed, i.e. it's children are hidden. +/** Property is collapsed, ie. it's children are hidden. + @hideinitializer */ wxPG_PROP_COLLAPSED = 0x0020, @@ -433,22 +256,26 @@ wxPG_PROP_COLLAPSED = 0x0020, If property is not selected, then indicates that the actual property value has failed validation (NB: this behaviour is not currently supported, but may be used in the future). + @hideinitializer */ wxPG_PROP_INVALID_VALUE = 0x0040, /** Switched via SetWasModified(). Temporary flag - only used when setting/changing property value. + @hideinitializer */ wxPG_PROP_WAS_MODIFIED = 0x0200, /** If set, then child properties (if any) are private, and should be "invisible" to the application. + @hideinitializer */ wxPG_PROP_AGGREGATE = 0x0400, /** If set, then child properties (if any) are copies and should not be deleted in dtor. + @hideinitializer */ wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, @@ -456,6 +283,7 @@ wxPG_PROP_CHILDREN_ARE_COPIES = 0x0800, Classifies this item as a non-category. Used for faster item type identification. + @hideinitializer */ wxPG_PROP_PROPERTY = 0x1000, @@ -463,17 +291,20 @@ wxPG_PROP_PROPERTY = 0x1000, Classifies this item as a category. Used for faster item type identification. + @hideinitializer */ wxPG_PROP_CATEGORY = 0x2000, /** Classifies this item as a property that has children, but is not aggregate - (ie children are not private). + (i.e. children are not private). + @hideinitializer */ wxPG_PROP_MISC_PARENT = 0x4000, /** Property is read-only. Editor is still created for wxTextCtrl-based property editors. For others, editor is not usually created because they do implement wxTE_READONLY style or equivalent. + @hideinitializer */ wxPG_PROP_READONLY = 0x8000, @@ -484,12 +315,14 @@ wxPG_PROP_READONLY = 0x8000, /** Property's value is composed from values of child properties. @remarks This flag cannot be used with property iterators. + @hideinitializer */ wxPG_PROP_COMPOSED_VALUE = 0x00010000, /** Common value of property is selectable in editor. @remarks This flag cannot be used with property iterators. + @hideinitializer */ wxPG_PROP_USES_COMMON_VALUE = 0x00020000, @@ -502,18 +335,22 @@ wxPG_PROP_USES_COMMON_VALUE = 0x00020000, This flag cannot be used with property iterators. @see wxPGProperty::SetAutoUnspecified() + @hideinitializer */ wxPG_PROP_AUTO_UNSPECIFIED = 0x00040000, /** Indicates the bit useable by derived properties. + @hideinitializer */ wxPG_PROP_CLASS_SPECIFIC_1 = 0x00080000, /** Indicates the bit useable by derived properties. + @hideinitializer */ wxPG_PROP_CLASS_SPECIFIC_2 = 0x00100000, /** Indicates that the property is being deleted and should be ignored. + @hideinitializer */ wxPG_PROP_BEING_DELETED = 0x00200000 @@ -592,11 +429,15 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxStringProperty - Simple string property. wxPG_STRING_PASSWORD attribute may be used - to echo value as asterisks and use wxTE_PASSWORD for wxTextCtrl. - wxPG_ATTR_AUTOCOMPLETE attribute may be used to enable auto-completion + Simple string property. + + Supported special attributes: + - @c wxPG_STRING_PASSWORD: Set to @true in order to echo value as asterisks and + to use @c wxTE_PASSWORD on the editor (wxTextCtrl). + - @c wxPG_ATTR_AUTOCOMPLETE: Set to @true to enable auto-completion (use a wxArrayString value), and is also supported by any property that happens to use a wxTextCtrl-based editor. + @see @ref propgrid_property_attributes @remarks wxStringProperty has a special trait: if it has value of "", and also has child properties, then its displayed @@ -606,7 +447,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxIntProperty Like wxStringProperty, but converts text to a signed long integer. - wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong). + wxIntProperty seamlessly supports 64-bit integers (i.e. wxLongLong) on overlfow. To safely convert variant to integer, use code like this: @code @@ -617,21 +458,61 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 wxLongLong ll = propertyGrid->GetPropertyValueAsLong(property); @endcode + Getting 64-bit value: + @code + wxLongLong_t value = pg->GetPropertyValueAsLongLong(); + + // or + + wxLongLong value; + wxVariant variant = property->GetValue(); + if ( variant.IsType(wxPG_VARIANT_TYPE_LONGLONG) ) + value = variant.GetLongLong(); + else + value = variant.GetLong(); + @endcode + + Setting 64-bit value: + @code + pg->SetPropertyValue(longLongVal); + + // or + + property->SetValue(WXVARIANT(longLongVal)); + @endcode + + Supported special attributes: + - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX to specify acceptable value range. + @subsection wxUIntProperty Like wxIntProperty, but displays value as unsigned int. To set - the prefix used globally, manipulate wxPG_UINT_PREFIX string attribute. - To set the globally used base, manipulate wxPG_UINT_BASE int + the prefix used globally, manipulate @c wxPG_UINT_PREFIX string attribute. + To set the globally used base, manipulate @c wxPG_UINT_BASE int attribute. Regardless of current prefix, understands (hex) values starting - with both "0x" and "$". + with both "0x" and "$" (apart from edit mode). Like wxIntProperty, wxUIntProperty seamlessly supports 64-bit unsigned integers (i.e. wxULongLong). Same wxVariant safety rules apply. + Supported special attributes: + - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX: Specifies acceptable value range. + - @c wxPG_UINT_BASE: Defines base. Valid constants are @c wxPG_BASE_OCT, + @c wxPG_BASE_DEC, @c wxPG_BASE_HEX and @c wxPG_BASE_HEXL (lowercase characters). + Arbitrary bases are not supported. + - @c wxPG_UINT_PREFIX: Defines displayed prefix. Possible values are + @c wxPG_PREFIX_NONE, @c wxPG_PREFIX_0x and @c wxPG_PREFIX_DOLLAR_SIGN. + Only @c wxPG_PREFIX_NONE works with decimal and octal numbers. + @see @ref propgrid_property_attributes + + @remarks + For example how to use seamless 64-bit integer support, see wxIntProperty + documentation (just use wxULongLong instead of wxLongLong). + @subsection wxFloatProperty Like wxStringProperty, but converts text to a double-precision floating point. Default float-to-text precision is 6 decimals, but this can be changed - by modifying wxPG_FLOAT_PRECISION attribute. + by modifying @c wxPG_FLOAT_PRECISION attribute. Note that when displaying the value, sign is omitted if the resulting textual representation is effectively zero (for example, -0.0001 with @@ -639,12 +520,26 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 what C standard library does, but should result in better end-user experience in almost all cases. + Supported special attributes: + - @c wxPG_ATTR_MIN, @c wxPG_ATTR_MAX: Specifies acceptable value range. + - @c wxPG_FLOAT_PRECISION: Sets the (max) precision used when floating point + value is rendered as text. The default -1 means shortest floating-point + 6-digit representation. + @see @ref propgrid_property_attributes + @subsection wxBoolProperty Represents a boolean value. wxChoice is used as editor control, by the - default. wxPG_BOOL_USE_CHECKBOX attribute can be set to true in order to + default. @c wxPG_BOOL_USE_CHECKBOX attribute can be set to @true in order to use check box instead. + Supported special attributes: + - @c wxPG_BOOL_USE_CHECKBOX: If set to @true uses check box editor instead + of combo box. + - @c wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING: If set to @true cycles combo box + instead showing the list. + @see @ref propgrid_property_attributes + @subsection wxLongStringProperty Like wxStringProperty, but has a button that triggers a small text editor @@ -685,15 +580,27 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxDirProperty Like wxLongStringProperty, but the button triggers dir selector instead. - Supported properties (all with string value): wxPG_DIR_DIALOG_MESSAGE. + + Supported special attributes: + - @c wxPG_DIR_DIALOG_MESSAGE: Sets specific message in the dir selector. + @see @ref propgrid_property_attributes @subsection wxFileProperty Like wxLongStringProperty, but the button triggers file selector instead. Default wildcard is "All files..." but this can be changed by setting - wxPG_FILE_WILDCARD attribute (see wxFileDialog for format details). - Attribute wxPG_FILE_SHOW_FULL_PATH can be set to @false in order to show - only the filename, not the entire path. + @c wxPG_FILE_WILDCARD attribute. + + Supported special attributes: + - @c wxPG_FILE_WILDCARD: Sets wildcard (see wxFileDialog for format details), "All + files..." is default. + - @c wxPG_FILE_SHOW_FULL_PATH: Default @true. When @false, only the file name is shown + (i.e. drive and directory are hidden). + - @c wxPG_FILE_SHOW_RELATIVE_PATH: If set, then the filename is shown relative to the + given path string. + - @c wxPG_FILE_INITIAL_PATH: Sets the initial path of where to look for files. + - @c wxPG_FILE_DIALOG_TITLE: Sets a specific title for the dir dialog. + @see @ref propgrid_property_attributes @subsection wxEnumProperty @@ -715,33 +622,54 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 @subsection wxArrayStringProperty - Allows editing of a list of strings in wxTextCtrl and in a separate - dialog. Supports "Delimiter" attribute, which defaults to comma (','). + Property that manages a list of strings. Allows editing of a list + of strings in wxTextCtrl and in a separate dialog. + + Supported special attributes: + - @c wxPG_ARRAY_DELIMITER: Sets string delimiter character. + Default is comma (','). + @see @ref propgrid_property_attributes @subsection wxDateProperty - wxDateTime property. Default editor is DatePickerCtrl, although TextCtrl - should work as well. wxPG_DATE_FORMAT attribute can be used to change - string wxDateTime::Format uses (although default is recommended as it is - locale-dependent), and wxPG_DATE_PICKER_STYLE allows changing window - style given to DatePickerCtrl (default is wxDP_DEFAULT|wxDP_SHOWCENTURY). - Using wxDP_ALLOWNONE will enable better unspecified value support. + Property representing wxDateTime. Default editor is DatePickerCtrl, + although TextCtrl should work as well. + + Supported special attributes: + - @c wxPG_DATE_FORMAT: Determines displayed date format (with wxDateTime::Format). + Default is recommended as it is locale-dependent. + - @c wxPG_DATE_PICKER_STYLE: Determines window style used with wxDatePickerCtrl. + Default is @c wxDP_DEFAULT | @c wxDP_SHOWCENTURY. Using @c wxDP_ALLOWNONE + enables additional support for unspecified property value. + @see @ref propgrid_property_attributes @subsection wxEditEnumProperty Represents a string that can be freely edited or selected from list of choices - custom combobox control is used to edit the value. + @remarks + Uses int value, similar to wxEnumProperty, unless text entered by user is + is not in choices (in which case string value is used). + @subsection wxMultiChoiceProperty Allows editing a multiple selection from a list of strings. This is property is pretty much built around concept of wxMultiChoiceDialog. It uses wxArrayString value. + Supported special attributes: + - @c wxPG_ATTR_MULTICHOICE_USERSTRINGMODE: If > 0, allows user to manually + enter strings that are not in the list of choices. If this value is 1, + user strings are preferably placed in front of valid choices. If value + is 2, then those strings will placed behind valid choices. + @see @ref propgrid_property_attributes + @subsection wxImageFileProperty - Like wxFileProperty, but has thumbnail of the image in front of - the filename and autogenerates wildcard from available image handlers. + Property representing image file(name). Like wxFileProperty, + but has thumbnail of the image in front of the filename + and autogenerates wildcard from available image handlers. @subsection wxColourProperty @@ -751,8 +679,10 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 There are various sub-classing opportunities with this class. See below in wxSystemColourProperty section for details. - Setting "HasAlpha" attribute to @true for this property allows user to - edit the alpha colour component. + Supported special attributes: + - @c wxPG_COLOUR_HAS_ALPHA: If set to @true allows user to edit the alpha + colour component. + @see @ref propgrid_property_attributes @subsection wxFontProperty @@ -783,7 +713,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 }; @endcode - in wxSystemColourProperty, and its derived class wxColourProperty, there + In wxSystemColourProperty, and its derived class wxColourProperty, there are various sub-classing features. To set a basic list of colour names, call wxPGProperty::SetChoices(). @@ -1071,7 +1001,7 @@ public: @remarks - Default behaviour is to return wxSize(0,0), which means no image. - Default image width or height is indicated with dimension -1. - - You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxSize(-1, -1). + - You can also return wxPG_DEFAULT_IMAGE_SIZE which equals wxDefaultSize. */ virtual wxSize OnMeasureImage( int item = -1 ) const; @@ -1447,7 +1377,7 @@ public: double GetAttributeAsDouble( const wxString& name, double defVal ) const; /** - Returns attributes as list wxVariant. + Returns comma-delimited string of property attributes. */ const wxPGAttributeStorage& GetAttributes() const; @@ -1461,7 +1391,9 @@ public: */ const wxPGEditor* GetColumnEditor( int column ) const; - /** Returns property's base name (i.e. parent's name is not added in any case) */ + /** Returns property's base name (i.e. parent's name is not added + in any case). + */ const wxString& GetBaseName() const; /** @@ -1510,7 +1442,7 @@ public: */ void* GetClientData() const; - /** Sets managed client object of a property. + /** Gets managed client object of a property. */ wxClientData *GetClientObject() const; @@ -1545,7 +1477,7 @@ public: const wxPGEditor* GetEditorClass() const; /** - Returns property flags. + Returns property's hint text (shown in empty value cell). */ inline wxString GetHintText() const; @@ -1762,6 +1694,7 @@ public: /** Returns @true if candidateParent is some parent of this property. + Use, for example, to detect if item is inside collapsed section. */ bool IsSomeParent( wxPGProperty* candidateParent ) const; @@ -1820,9 +1753,8 @@ public: */ void SetAttribute( const wxString& name, wxVariant value ); - void SetAttributes( const wxPGAttributeStorage& attributes ); - + /** Set if user can change the property's value to unspecified by modifying the value of the editor control (usually by clearing @@ -1845,6 +1777,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyBackgroundColour(), + this does not automatically update the display. */ void SetBackgroundColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -1890,7 +1826,7 @@ public: */ void SetClientData( void* clientData ); - /** Returns client object of a property. + /** Sets client object of a property. */ void SetClientObject(wxClientData* clientObject); @@ -1934,8 +1870,11 @@ public: /** Sets property's label. - @remarks Properties under same parent may have same labels. However, - property names must still remain unique. + @remarks + - Properties under same parent may have same labels. However, + property names must still remain unique. + - Unlike wxPropertyGridInterface::SetPropertyLabel(), + this does not automatically update the display. */ void SetLabel( const wxString& label ); @@ -1977,6 +1916,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyTextColour(), + this does not automatically update the display. */ void SetTextColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -2050,6 +1993,9 @@ public: /** Updates composed values of parent non-category properties, recursively. Returns topmost property updated. + + @remarks + Must not call SetValue() (as can be called in it). */ wxPGProperty* UpdateParentValues(); @@ -2065,7 +2011,34 @@ public: protected: /** - Helper for language bindings. + Sets property cell in fashion that reduces number of exclusive + copies of cell data. Used when setting, for instance, same + background colour for a number of properties. + + @param firstCol + First column to affect. + + @param lastCol + Last column to affect. + + @param preparedCell + Pre-prepared cell that is used for those which cell data + before this matched unmodCellData. + + @param srcData + If unmodCellData did not match, valid cell data from this + is merged into cell (usually generating new exclusive copy + of cell's data). + + @param unmodCellData + If cell's cell data matches this, its cell is now set to + preparedCell. + + @param ignoreWithFlags + Properties with any one of these flags are skipped. + + @param recursively + If @true, apply this operation recursively in child properties. */ void AdaptiveSetCell( unsigned int firstCol, unsigned int lastCol, @@ -2112,9 +2085,6 @@ protected: Returns true if child property is selected. */ bool IsChildSelected( bool recursive = false ) const; - - void SetFlag( wxPGPropertyFlags flag ); - void ClearFlag( FlagType flag ); }; // ----------------------------------------------------------------------- @@ -2501,38 +2471,80 @@ public: */ wxPGChoices( const wxPGChoices& a ); - /** Constructor. */ + /** + Constructor. + + @param labels + Labels for choices. + + @param values + Values for choices. If @NULL, indexes are used. + */ wxPGChoices( const wxChar** labels, const long* values = NULL ); - /** Constructor. */ + /** + Constructor. + + @param labels + Labels for choices. + + @param values + Values for choices. If empty, indexes are used. + */ wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ); - /** Constructor. */ + /** + Simple interface constructor. + */ wxPGChoices( wxPGChoicesData* data ); - /** Destructor. */ + /** + Destructor. + */ ~wxPGChoices(); /** Adds to current. If did not have own copies, creates them now. If was empty, identical to set except that creates copies. + + @param labels + Labels for added choices. + + @param values + Values for added choices. If empty, relevant entry indexes are used. */ void Add( const wxChar** labels, const ValArrItem* values = NULL ); - /** Version that works with wxArrayString and wxArrayInt. */ + /** + Adds to current. Version that works with wxArrayString and wxArrayInt. + */ void Add( const wxArrayString& arr, const wxArrayInt& arrint ); - /** Adds single item. */ + /** + Adds a single choice item. + + @param label + Label for added choice. + + @param value + Value for added choice. If unspecified, index is used. + */ wxPGChoiceEntry& Add( const wxString& label, int value = wxPG_INVALID_VALUE ); - /** Adds a single item, with bitmap. */ + /** + Adds a single item, with bitmap. + */ wxPGChoiceEntry& Add( const wxString& label, const wxBitmap& bitmap, int value = wxPG_INVALID_VALUE ); - /** Adds a single item with full entry information. */ + /** + Adds a single item with full entry information. + */ wxPGChoiceEntry& Add( const wxPGChoiceEntry& entry ); - /** Adds single item, sorted. */ + /** + Adds a single item, sorted. + */ wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE ); /** @@ -2574,7 +2586,7 @@ public: unsigned int GetCount() const; /** - Returns value of item; + Returns value of item. */ int GetValue( unsigned int ind ) const; @@ -2602,7 +2614,7 @@ public: int Index( int val ) const; /** - Inserts single item. + Inserts a single item. */ wxPGChoiceEntry& Insert( const wxString& label, int index, int value = wxPG_INVALID_VALUE ); diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index 21637fa6bd..38131acb31 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -398,7 +398,7 @@ public: void GetPropertiesWithFlag( wxArrayPGProperty* targetArr, wxPGProperty::FlagType flags, bool inverse = false, - int iterFlags = wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES ) const; + int iterFlags = (wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_HIDDEN|wxPG_ITERATE_CATEGORIES) ) const; /** Returns value of given attribute. If none found, returns wxNullVariant. From ae288823c925cea204db51f9e4a9ea36ddbf72cb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 21 Jan 2017 18:06:03 -0800 Subject: [PATCH 36/36] wxSystemSettings does not inherit from wxObject --- interface/wx/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/settings.h b/interface/wx/settings.h index ff4176bb37..11f913a2f6 100644 --- a/interface/wx/settings.h +++ b/interface/wx/settings.h @@ -265,7 +265,7 @@ enum wxSystemScreenType @see wxFont, wxColour, wxSystemOptions */ -class wxSystemSettings : public wxObject +class wxSystemSettings { public: /**