Kaydet (Commit) 99a93452 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: add wrapper for radio button

Change-Id: I8b4b35ac313796364502f8e9e2e836dc21f48a42
üst cca08f80
......@@ -388,6 +388,8 @@ public:
*/
void group(RadioButton &rOther);
virtual void ShowFocus(const Rectangle& rRect) override;
virtual FactoryFunction GetUITestFactory() const override;
};
class VCL_DLLPUBLIC CheckBox : public Button
......
......@@ -199,6 +199,27 @@ protected:
virtual OUString get_name() const override;
};
class UITEST_DLLPUBLIC RadioButtonUIObject : public WindowUIObject
{
private:
VclPtr<RadioButton> mxRadioButton;
public:
RadioButtonUIObject(VclPtr<RadioButton> xCheckbox);
virtual ~RadioButtonUIObject();
virtual void execute(const OUString& rAction,
const StringMap& rParameters) override;
virtual StringMap get_state() override;
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
protected:
virtual OUString get_name() const override;
};
class UITEST_DLLPUBLIC TabPageUIObject : public WindowUIObject
{
private:
......
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment