diff options
-rw-r--r-- | include/vcl/toolkit/button.hxx | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 47 |
2 files changed, 49 insertions, 0 deletions
diff --git a/include/vcl/toolkit/button.hxx b/include/vcl/toolkit/button.hxx index 28024d8c7d0b..e894f9e28bfb 100644 --- a/include/vcl/toolkit/button.hxx +++ b/include/vcl/toolkit/button.hxx @@ -179,6 +179,8 @@ public: return mbIsAction; } + void DumpAsPropertyTree(tools::JsonWriter&) override; + protected: PushButtonDropdownStyle mnDDStyle; bool mbIsActive; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index e6e731f79ee5..210d2b6290e0 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -578,6 +578,46 @@ FactoryFunction Button::GetUITestFactory() const return ButtonUIObject::create; } +namespace +{ + +const char* symbolTypeName(SymbolType eSymbolType) +{ + switch (eSymbolType) + { + case SymbolType::DONTKNOW: return "DONTKNOW"; + case SymbolType::IMAGE: return "IMAGE"; + case SymbolType::ARROW_UP: return "ARROW_UP"; + case SymbolType::ARROW_DOWN: return "ARROW_DOWN"; + case SymbolType::ARROW_LEFT: return "ARROW_LEFT"; + case SymbolType::ARROW_RIGHT: return "ARROW_RIGHT"; + case SymbolType::SPIN_UP: return "SPIN_UP"; + case SymbolType::SPIN_DOWN: return "SPIN_DOWN"; + case SymbolType::SPIN_LEFT: return "SPIN_LEFT"; + case SymbolType::SPIN_RIGHT: return "SPIN_RIGHT"; + case SymbolType::FIRST: return "FIRST"; + case SymbolType::LAST: return "LAST"; + case SymbolType::PREV: return "PREV"; + case SymbolType::NEXT: return "NEXT"; + case SymbolType::PAGEUP: return "PAGEUP"; + case SymbolType::PAGEDOWN: return "PAGEDOWN"; + case SymbolType::PLAY: return "PLAY"; + case SymbolType::STOP: return "STOP"; + case SymbolType::CLOSE: return "CLOSE"; + case SymbolType::CHECKMARK: return "CHECKMARK"; + case SymbolType::RADIOCHECKMARK: return "RADIOCHECKMARK"; + case SymbolType::FLOAT: return "FLOAT"; + case SymbolType::DOCK: return "DOCK"; + case SymbolType::HIDE: return "HIDE"; + case SymbolType::HELP: return "HELP"; + case SymbolType::PLUS: return "PLUS"; + } + + return "UNKNOWN"; +} + +} + void Button::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) { Control::DumpAsPropertyTree(rJsonWriter); @@ -598,6 +638,13 @@ void Button::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) rJsonWriter.put("has_default", true); } +void PushButton::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) +{ + Button::DumpAsPropertyTree(rJsonWriter); + if (GetSymbol() != SymbolType::DONTKNOW) + rJsonWriter.put("symbol", symbolTypeName(GetSymbol())); +} + IMPL_STATIC_LINK( Button, dispatchCommandHandler, Button*, pButton, void ) { if (pButton == nullptr) |