diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-19 03:36:18 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:02:20 +0200 |
commit | 99a934520777a5d3f6323e8f52f8dc388239cfe7 (patch) | |
tree | 6e2b4f243e1eff38d1d98a8f78ca64bd2d9e1c4c /vcl/source | |
parent | cca08f80b37e05564cffd2f51afd54322848112c (diff) |
uitest: add wrapper for radio button
Change-Id: I8b4b35ac313796364502f8e9e2e836dc21f48a42
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/button.cxx | 5 | ||||
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 38 |
2 files changed, 43 insertions, 0 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 0546be2bee38..ae8279c0c19b 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2949,6 +2949,11 @@ void RadioButton::ShowFocus(const Rectangle& rRect) Button::ShowFocus(rRect); } +FactoryFunction RadioButton::GetUITestFactory() const +{ + return RadioButtonUIObject::create; +} + void CheckBox::ImplInitCheckBoxData() { meState = TRISTATE_FALSE; diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 6b4c471cc51c..b7b39ea1a1d7 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -581,6 +581,44 @@ std::unique_ptr<UIObject> CheckBoxUIObject::create(vcl::Window* pWindow) return std::unique_ptr<UIObject>(new CheckBoxUIObject(pCheckBox)); } +RadioButtonUIObject::RadioButtonUIObject(VclPtr<RadioButton> xRadioButton): + WindowUIObject(xRadioButton), + mxRadioButton(xRadioButton) +{ +} + +RadioButtonUIObject::~RadioButtonUIObject() +{ +} + +void RadioButtonUIObject::execute(const OUString& rAction, + const StringMap& /*rParameters*/) +{ + if (rAction == "CLICK") + { + mxRadioButton->ImplCallClick(); + } +} + +StringMap RadioButtonUIObject::get_state() +{ + StringMap aMap = WindowUIObject::get_state(); + + return aMap; +} + +OUString RadioButtonUIObject::get_name() const +{ + return OUString("RadioButtonUIObject"); +} + +std::unique_ptr<UIObject> RadioButtonUIObject::create(vcl::Window* pWindow) +{ + RadioButton* pRadioButton = dynamic_cast<RadioButton*>(pWindow); + assert(pRadioButton); + return std::unique_ptr<UIObject>(new RadioButtonUIObject(pRadioButton)); +} + TabPageUIObject::TabPageUIObject(VclPtr<TabPage> xTabPage): WindowUIObject(xTabPage), mxTabPage(xTabPage) |