X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..1b7751aaa9a86d76a850b9267bc0c201e3cea30f:/interface/wx/collpane.h diff --git a/interface/wx/collpane.h b/interface/wx/collpane.h index b6a1f49080..40e9d25090 100644 --- a/interface/wx/collpane.h +++ b/interface/wx/collpane.h @@ -3,9 +3,12 @@ // Purpose: interface of wxCollapsiblePane // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxCP_DEFAULT_STYLE (wxTAB_TRAVERSAL | wxNO_BORDER) +#define wxCP_NO_TLW_RESIZE (0x0002) + /** @class wxCollapsiblePaneEvent @@ -41,7 +44,7 @@ public: void SetCollapsed(bool collapsed); }; - +wxEventType wxEVT_COLLAPSIBLEPANE_CHANGED; /** @class wxCollapsiblePane @@ -65,7 +68,7 @@ public: Usage sample: @code - wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, wxT("Details:")); + wxCollapsiblePane *collpane = new wxCollapsiblePane(this, wxID_ANY, "Details:"); // add the pane with a zero proportion value to the 'sz' sizer which contains it sz->Add(collpane, 0, wxGROW|wxALL, 5); @@ -73,7 +76,7 @@ public: // now add a test label in the collapsible pane using a sizer to layout it: wxWindow *win = collpane->GetPane(); wxSizer *paneSz = new wxBoxSizer(wxVERTICAL); - paneSz->Add(new wxStaticText(win, wxID_ANY, wxT("test!")), 1, wxGROW|wxALL, 2); + paneSz->Add(new wxStaticText(win, wxID_ANY, "test!"), 1, wxGROW|wxALL, 2); win->SetSizer(paneSz); paneSz->SetSizeHints(win); @endcode @@ -82,17 +85,25 @@ public: @beginStyleTable @style{wxCP_DEFAULT_STYLE} - The default style: 0. + The default style. It includes wxTAB_TRAVERSAL and wxBORDER_NONE. + @style{wxCP_NO_TLW_RESIZE} + By default wxCollapsiblePane resizes the top level window containing it + when its own size changes. This allows to easily implement dialogs + containing an optionally shown part, for example, and so is the default + behaviour but can be inconvenient in some specific cases -- use this + flag to disable this automatic parent resizing then. @endStyleTable - @beginEventTable{wxCollapsiblePaneEvent} + @beginEventEmissionTable{wxCollapsiblePaneEvent,wxNavigationKeyEvent} @event{EVT_COLLAPSIBLEPANE_CHANGED(id, func)} - The user expanded or collapsed the collapsible pane. + The user expanded or collapsed the collapsible pane. + @event{EVT_NAVIGATION_KEY(func)} + Process a navigation key event. @endEventTable @library{wxcore} @category{ctrl} - + @appearance{collapsiblepane} @see wxPanel, wxCollapsiblePaneEvent */ @@ -103,7 +114,7 @@ public: Default constructor. */ wxCollapsiblePane(); - + /** Initializes the object and calls Create() with all the parameters. */ @@ -113,7 +124,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxCP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "collapsiblePane"); + const wxString& name = wxCollapsiblePaneNameStr); /** @param parent @@ -143,12 +154,12 @@ public: const wxSize& size = wxDefaultSize, long style = wxCP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "collapsiblePane"); + const wxString& name = wxCollapsiblePaneNameStr); /** Collapses or expands the pane window. */ - void Collapse(bool collapse = true); + virtual void Collapse(bool collapse = true); /** Same as calling Collapse(@false). @@ -159,16 +170,15 @@ public: Returns a pointer to the pane window. Add controls to the returned wxWindow to make them collapsible. */ - wxWindow* GetPane() const; + virtual wxWindow* GetPane() const; /** Returns @true if the pane window is currently hidden. */ - bool IsCollapsed() const; + virtual bool IsCollapsed() const; /** Returns @true if the pane window is currently shown. */ bool IsExpanded() const; }; -