summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-25 13:30:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:52 +0100
commiteb51d8b61ad2fa104fa9fd5da92e328a1ad85075 (patch)
tree9d68cfcf38cb78e12b92ab8e9f6e7c9756479bba
parenta390a10269ed2aafd7dd8fcce3b057c9b4a3dd86 (diff)
support has-default for buttons
Change-Id: I4b3b6bfa3fadaed0770b5e5254f5afc4c67de191
-rw-r--r--vcl/inc/vcl/button.hxx1
-rw-r--r--vcl/source/control/button.cxx16
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 )