diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-23 11:54:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:37 +0100 |
commit | 13dde575a9e03f1d1fbfbb40514c142a6e2f2909 (patch) | |
tree | 2d43fe5b64b9bc9836ad1dbee335ac803507c2d7 /vcl/inc/vcl/layout.hxx | |
parent | fcdf78fc9f0165ba42415d9a703aefc6da4a3b37 (diff) |
Implement a VclExpander equivalent of GtkExpander
Change-Id: I539d8d313a35509cf603f18e5f074eab331f2480
Diffstat (limited to 'vcl/inc/vcl/layout.hxx')
-rw-r--r-- | vcl/inc/vcl/layout.hxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx index ca6d50f83eef..42071ce4f4cd 100644 --- a/vcl/inc/vcl/layout.hxx +++ b/vcl/inc/vcl/layout.hxx @@ -29,6 +29,7 @@ #define _VCLLAYOUT_HXX #include <vcl/dllapi.h> +#include <vcl/button.hxx> #include <vcl/window.hxx> #include <boost/multi_array.hpp> @@ -377,8 +378,8 @@ class VCL_DLLPUBLIC VclBin : public VclContainer { public: VclBin(Window *pParent) : VclContainer(pParent) {} - Window *get_child(); - const Window *get_child() const; + virtual Window *get_child(); + virtual const Window *get_child() const; virtual Size calculateRequisition() const; virtual void setAllocation(const Size &rAllocation); }; @@ -422,6 +423,30 @@ private: float m_fYScale; }; +class VCL_DLLPUBLIC VclExpander : public VclBin +{ +public: + VclExpander(Window *pParent) + : VclBin(pParent) + , m_bResizeTopLevel(true) + , m_aDisclosureButton(this) + { + m_aDisclosureButton.SetToggleHdl(LINK(this, VclExpander, ClickHdl)); + m_aDisclosureButton.Show(); + } + virtual Window *get_child(); + virtual const Window *get_child() const; + virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue); +protected: + virtual Size calculateRequisition() const; + virtual void setAllocation(const Size &rAllocation); +private: + bool m_bResizeTopLevel; + DisclosureButton m_aDisclosureButton; + DECL_DLLPRIVATE_LINK(ClickHdl, DisclosureButton* pBtn); +}; + + /* * @return true if rValue is "True", "true", "1", etc. */ |