diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-25 13:30:57 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:52 +0100 |
commit | eb51d8b61ad2fa104fa9fd5da92e328a1ad85075 (patch) | |
tree | 9d68cfcf38cb78e12b92ab8e9f6e7c9756479bba /vcl | |
parent | a390a10269ed2aafd7dd8fcce3b057c9b4a3dd86 (diff) |
support has-default for buttons
Change-Id: I4b3b6bfa3fadaed0770b5e5254f5afc4c67de191
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/button.hxx | 1 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index d6690b55f849..fbc34850b2e3 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -201,6 +201,7 @@ public: void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; } const Link& GetToggleHdl() const { return maToggleHdl; } + virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue); virtual void take_properties(Window &rOther); }; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 09b70558a881..38bdee46455a 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1748,6 +1748,22 @@ Size PushButton::GetOptimalSize(WindowSizeType eType) const } } +bool PushButton::set_property(const rtl::OString &rKey, const rtl::OString &rValue) +{ + if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("has-default"))) + { + WinBits nBits = GetStyle(); + nBits &= ~(WB_DEFBUTTON); + if (toBool(rValue)) + nBits |= WB_DEFBUTTON; + SetStyle(nBits); + } + else + return Control::set_property(rKey, rValue); + return true; +} + + // ======================================================================= void OKButton::ImplInit( Window* pParent, WinBits nStyle ) |