summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-07 21:19:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-09 11:40:53 +0000
commitd9e3efbc0ed6193119565530e390a1c1c0a5f6b7 (patch)
tree6d010e3fea983ece69ed72b723f71319d3407d41 /vcl
parentf8a4ce67987e5cb47f07dc61eeb450e1d5b9c541 (diff)
add a CloseButton to vcl for convenience
does exactly the same default action as a CancelButton except with "Close" as the label Change-Id: I538e8fc761cde4a1050d066ef935df1ecd930414
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/button.hxx7
-rw-r--r--vcl/source/control/button.cxx7
-rw-r--r--vcl/source/window/builder.cxx2
3 files changed, 16 insertions, 0 deletions
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 478ec9a3243a..46be2854e301 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -247,6 +247,13 @@ public:
virtual void Click();
};
+class VCL_DLLPUBLIC CloseButton : public CancelButton
+{
+public:
+ CloseButton(Window* pParent, WinBits nStyle = 0);
+};
+
+
// --------------
// - HelpButton -
// --------------
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 82d037892201..8ad4c6cb6324 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1866,6 +1866,13 @@ void CancelButton::Click()
}
}
+CloseButton::CloseButton( Window* pParent, WinBits nStyle )
+ : CancelButton(pParent, nStyle)
+{
+ SetText( Button::GetStandardText( BUTTON_CLOSE ) );
+ SetHelpText( Button::GetStandardHelpText( BUTTON_CLOSE ) );
+}
+
// =======================================================================
void HelpButton::ImplInit( Window* pParent, WinBits nStyle )
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index d9defdfc932f..5e6fc5ce9672 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -506,6 +506,8 @@ namespace
pWindow = new OKButton(pParent, nBits);
else if (sType == "gtk-cancel")
pWindow = new CancelButton(pParent, nBits);
+ else if (sType == "gtk-close")
+ pWindow = new CloseButton(pParent, nBits);
else if (sType == "gtk-help")
pWindow = new HelpButton(pParent, nBits);
else