From fca9bc70c08c83e75d9d2fb35b64a972d852bf84 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 18 Sep 2012 10:35:46 +0100 Subject: add a new stock reset/revert button Change-Id: Ie854c063856eb8ed7401162ed60114d7cc904d26 --- tools/inc/tools/wintypes.hxx | 3 ++- vcl/inc/svids.hrc | 3 ++- vcl/source/control/button.cxx | 3 ++- vcl/source/src/btntext.src | 5 +++++ vcl/source/window/builder.cxx | 6 ++++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx index c1fb936eb0cd..2a99ab75db0b 100644 --- a/tools/inc/tools/wintypes.hxx +++ b/tools/inc/tools/wintypes.hxx @@ -311,7 +311,8 @@ typedef sal_uInt16 StandardButtonType; #define BUTTON_IGNORE ((StandardButtonType)8) #define BUTTON_ABORT ((StandardButtonType)9) #define BUTTON_LESS ((StandardButtonType)10) -#define BUTTON_COUNT 11 +#define BUTTON_RESET ((StandardButtonType)11) +#define BUTTON_COUNT 12 // prominent place for ListBox window types diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index 502e8efafee1..57e3d3ae788f 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -145,8 +145,9 @@ #define SV_BUTTONTEXT_CLOSE SV_HELPTEXT_CLOSE #define SV_BUTTONTEXT_MORE 10107 #define SV_BUTTONTEXT_IGNORE 10108 -#define SV_BUTTONTEXT_ABORT 10109 +#define SV_BUTTONTEXT_ABORT 10109 #define SV_BUTTONTEXT_LESS 10110 +#define SV_BUTTONTEXT_RESET 10111 #define SV_STDTEXT_FIRST SV_STDTEXT_SERVICENOTAVAILABLE #define SV_STDTEXT_SERVICENOTAVAILABLE 10200 diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index af949745b91c..6b45e6d02285 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -139,7 +139,8 @@ XubString Button::GetStandardText( StandardButtonType eButton ) { SV_BUTTONTEXT_MORE, "~More" }, { SV_BUTTONTEXT_IGNORE, "~Ignore" }, { SV_BUTTONTEXT_ABORT, "~Abort" }, - { SV_BUTTONTEXT_LESS, "~Less" } + { SV_BUTTONTEXT_LESS, "~Less" }, + { SV_BUTTONTEXT_RESET, "R~eset" } }; String aText; diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src index cad485f867d6..dd49e9b082ca 100644 --- a/vcl/source/src/btntext.src +++ b/vcl/source/src/btntext.src @@ -76,3 +76,8 @@ String SV_BUTTONTEXT_ABORT { Text [ en-US ] = "~Abort"; }; + +String SV_BUTTONTEXT_RESET +{ + Text [ en-US ] = "R~eset"; +}; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index d463f48cabe0..2d2405d75f00 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -262,6 +262,12 @@ namespace pBtn->SetText(VclResId(SV_BUTTONTEXT_CLOSE).toString()); pWindow = pBtn; } + else if (sType.equalsL(RTL_CONSTASCII_STRINGPARAM("gtk-revert-to-saved"))) + { + PushButton *pBtn = new PushButton(pParent, nBits); + pBtn->SetText(VclResId(SV_BUTTONTEXT_RESET).toString()); + pWindow = pBtn; + } else fprintf(stderr, "unknown stock type %s\n", sType.getStr()); } -- cgit