diff --git a/include/eepp/ui/abstract/uiabstracttableview.hpp b/include/eepp/ui/abstract/uiabstracttableview.hpp index 40ff4e522..6e5054c0c 100644 --- a/include/eepp/ui/abstract/uiabstracttableview.hpp +++ b/include/eepp/ui/abstract/uiabstracttableview.hpp @@ -87,6 +87,8 @@ class EE_API UIAbstractTableView : public UIAbstractView { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + bool getRowSearchByName() const; void setRowSearchByName( bool rowSearchByName ); diff --git a/include/eepp/ui/uicheckbox.hpp b/include/eepp/ui/uicheckbox.hpp index 6463d72a6..39264aae5 100644 --- a/include/eepp/ui/uicheckbox.hpp +++ b/include/eepp/ui/uicheckbox.hpp @@ -36,8 +36,10 @@ class EE_API UICheckBox : public UITextView { virtual bool applyProperty( const StyleSheetProperty& attribute ); - std::string getPropertyString( const PropertyDefinition* propertyDef, - const Uint32& propertyIndex = 0 ) const; + virtual std::string getPropertyString( const PropertyDefinition* propertyDef, + const Uint32& propertyIndex = 0 ) const; + + virtual std::vector getPropertiesImplemented() const; protected: UIWidget* mActiveButton; diff --git a/include/eepp/ui/uicodeeditor.hpp b/include/eepp/ui/uicodeeditor.hpp index ba41f4afd..44179498f 100644 --- a/include/eepp/ui/uicodeeditor.hpp +++ b/include/eepp/ui/uicodeeditor.hpp @@ -343,6 +343,8 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + const bool& getHighlightMatchingBracket() const; void setHighlightMatchingBracket( const bool& highlightMatchingBracket ); diff --git a/include/eepp/ui/uicombobox.hpp b/include/eepp/ui/uicombobox.hpp index bdff76017..5970e14ab 100644 --- a/include/eepp/ui/uicombobox.hpp +++ b/include/eepp/ui/uicombobox.hpp @@ -32,6 +32,8 @@ class EE_API UIComboBox : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + void loadFromXmlNode( const pugi::xml_node& node ); protected: diff --git a/include/eepp/ui/uiconsole.hpp b/include/eepp/ui/uiconsole.hpp index 2fd5ba661..0f5b358ef 100644 --- a/include/eepp/ui/uiconsole.hpp +++ b/include/eepp/ui/uiconsole.hpp @@ -167,6 +167,8 @@ class EE_API UIConsole : public UIWidget, virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + void updateCacheSize(); virtual Uint32 onPressEnter(); diff --git a/include/eepp/ui/uidropdownlist.hpp b/include/eepp/ui/uidropdownlist.hpp index c43ce8680..c8dc0c100 100644 --- a/include/eepp/ui/uidropdownlist.hpp +++ b/include/eepp/ui/uidropdownlist.hpp @@ -49,6 +49,8 @@ class EE_API UIDropDownList : public UITextInput { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + virtual void loadFromXmlNode( const pugi::xml_node& node ); protected: diff --git a/include/eepp/ui/uigridlayout.hpp b/include/eepp/ui/uigridlayout.hpp index 2a0b0d8c5..cef8b5f8b 100644 --- a/include/eepp/ui/uigridlayout.hpp +++ b/include/eepp/ui/uigridlayout.hpp @@ -48,6 +48,8 @@ class EE_API UIGridLayout : public UILayout { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + virtual bool applyProperty( const StyleSheetProperty& attribute ); virtual void updateLayout(); diff --git a/include/eepp/ui/uiimage.hpp b/include/eepp/ui/uiimage.hpp index ea8a21999..01d1916d4 100644 --- a/include/eepp/ui/uiimage.hpp +++ b/include/eepp/ui/uiimage.hpp @@ -35,10 +35,12 @@ class EE_API UIImage : public UIWidget { const Vector2f& getAlignOffset() const; + virtual bool applyProperty( const StyleSheetProperty& attribute ); + virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; - virtual bool applyProperty( const StyleSheetProperty& attribute ); + virtual std::vector getPropertiesImplemented() const; const UIScaleType& getScaleType() const; diff --git a/include/eepp/ui/uilinearlayout.hpp b/include/eepp/ui/uilinearlayout.hpp index bcadf2077..45e00cf4b 100644 --- a/include/eepp/ui/uilinearlayout.hpp +++ b/include/eepp/ui/uilinearlayout.hpp @@ -34,6 +34,8 @@ class EE_API UILinearLayout : public UILayout { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + void updateLayout(); bool isPacking() const; diff --git a/include/eepp/ui/uilistbox.hpp b/include/eepp/ui/uilistbox.hpp index 8c478d19d..050ed6aa5 100644 --- a/include/eepp/ui/uilistbox.hpp +++ b/include/eepp/ui/uilistbox.hpp @@ -102,6 +102,8 @@ class EE_API UIListBox : public UITouchDraggableWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: friend class UIListBoxItem; friend class UIItemContainer; diff --git a/include/eepp/ui/uiloader.hpp b/include/eepp/ui/uiloader.hpp index dc53ceed4..10f21047d 100644 --- a/include/eepp/ui/uiloader.hpp +++ b/include/eepp/ui/uiloader.hpp @@ -56,6 +56,8 @@ class EE_API UILoader : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + Float getArcStartAngle() const; UILoader* setArcStartAngle( const Float& arcStartAngle ); diff --git a/include/eepp/ui/uimenu.hpp b/include/eepp/ui/uimenu.hpp index bbfcc1d8d..ed9f292fc 100644 --- a/include/eepp/ui/uimenu.hpp +++ b/include/eepp/ui/uimenu.hpp @@ -74,6 +74,8 @@ class EE_API UIMenu : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + UINode* getOwnerNode() const; /** The owner node is the node who triggers the visibility of the menu */ diff --git a/include/eepp/ui/uimenucheckbox.hpp b/include/eepp/ui/uimenucheckbox.hpp index e2a466808..89ba84ded 100644 --- a/include/eepp/ui/uimenucheckbox.hpp +++ b/include/eepp/ui/uimenucheckbox.hpp @@ -30,6 +30,8 @@ class EE_API UIMenuCheckBox : public UIMenuItem { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex ) const; + virtual std::vector getPropertiesImplemented() const; + protected: bool mActive; UISkin* mSkinActive; diff --git a/include/eepp/ui/uimenuradiobutton.hpp b/include/eepp/ui/uimenuradiobutton.hpp index 87fa673a4..bc5f9ea1d 100644 --- a/include/eepp/ui/uimenuradiobutton.hpp +++ b/include/eepp/ui/uimenuradiobutton.hpp @@ -30,6 +30,8 @@ class EE_API UIMenuRadioButton : public UIMenuItem { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: bool mActive; UISkin* mSkinActive; diff --git a/include/eepp/ui/uiprogressbar.hpp b/include/eepp/ui/uiprogressbar.hpp index 744c1241b..09914a85f 100644 --- a/include/eepp/ui/uiprogressbar.hpp +++ b/include/eepp/ui/uiprogressbar.hpp @@ -59,6 +59,8 @@ class EE_API UIProgressBar : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + const StyleConfig& getStyleConfig() const; protected: diff --git a/include/eepp/ui/uipushbutton.hpp b/include/eepp/ui/uipushbutton.hpp index b11b2ee35..408763d53 100644 --- a/include/eepp/ui/uipushbutton.hpp +++ b/include/eepp/ui/uipushbutton.hpp @@ -46,6 +46,8 @@ class EE_API UIPushButton : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + void setTextAlign( const Uint32& align ); virtual Sizef getContentSize() const; diff --git a/include/eepp/ui/uiradiobutton.hpp b/include/eepp/ui/uiradiobutton.hpp index 393d8363c..48da8185a 100644 --- a/include/eepp/ui/uiradiobutton.hpp +++ b/include/eepp/ui/uiradiobutton.hpp @@ -37,6 +37,8 @@ class EE_API UIRadioButton : public UITextView { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: UIWidget* mActiveButton; UIWidget* mInactiveButton; diff --git a/include/eepp/ui/uiroot.hpp b/include/eepp/ui/uiroot.hpp index 0b02da323..11b9a439b 100644 --- a/include/eepp/ui/uiroot.hpp +++ b/include/eepp/ui/uiroot.hpp @@ -14,6 +14,8 @@ class EE_API UIRoot : public UIWidget { bool applyProperty( const StyleSheetProperty& attribute ); + virtual std::vector getPropertiesImplemented() const; + protected: UIRoot(); diff --git a/include/eepp/ui/uiscrollablewidget.hpp b/include/eepp/ui/uiscrollablewidget.hpp index c3319369c..45b45366f 100644 --- a/include/eepp/ui/uiscrollablewidget.hpp +++ b/include/eepp/ui/uiscrollablewidget.hpp @@ -36,6 +36,8 @@ class EE_API UIScrollableWidget : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + virtual Sizef getContentSize() const = 0; void scrollToTop(); diff --git a/include/eepp/ui/uiscrollbar.hpp b/include/eepp/ui/uiscrollbar.hpp index c08719d2d..58abdf823 100644 --- a/include/eepp/ui/uiscrollbar.hpp +++ b/include/eepp/ui/uiscrollbar.hpp @@ -78,6 +78,8 @@ class EE_API UIScrollBar : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + bool isDragging() const; protected: diff --git a/include/eepp/ui/uiscrollview.hpp b/include/eepp/ui/uiscrollview.hpp index 3e59af116..a73aef89e 100644 --- a/include/eepp/ui/uiscrollview.hpp +++ b/include/eepp/ui/uiscrollview.hpp @@ -42,6 +42,8 @@ class EE_API UIScrollView : public UITouchDraggableWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: ScrollViewType mViewType; ScrollBarMode mVScrollMode; diff --git a/include/eepp/ui/uiselectbutton.hpp b/include/eepp/ui/uiselectbutton.hpp index 7dfa4517e..bc9f0f73b 100644 --- a/include/eepp/ui/uiselectbutton.hpp +++ b/include/eepp/ui/uiselectbutton.hpp @@ -34,6 +34,8 @@ class EE_API UISelectButton : public UIPushButton { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex ) const; + virtual std::vector getPropertiesImplemented() const; + virtual void setSelected( bool set ); void setSelectOnClick( bool set ); diff --git a/include/eepp/ui/uislider.hpp b/include/eepp/ui/uislider.hpp index 643512b8f..76e464772 100644 --- a/include/eepp/ui/uislider.hpp +++ b/include/eepp/ui/uislider.hpp @@ -77,6 +77,8 @@ class EE_API UISlider : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + Sizef getMinimumSize(); bool isDragging() const; diff --git a/include/eepp/ui/uispinbox.hpp b/include/eepp/ui/uispinbox.hpp index 79dd89aee..e16b92e82 100644 --- a/include/eepp/ui/uispinbox.hpp +++ b/include/eepp/ui/uispinbox.hpp @@ -59,6 +59,8 @@ class EE_API UISpinBox : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: UITextInput* mInput; UIWidget* mPushUp; diff --git a/include/eepp/ui/uisplitter.hpp b/include/eepp/ui/uisplitter.hpp index 34976a65e..165db7655 100644 --- a/include/eepp/ui/uisplitter.hpp +++ b/include/eepp/ui/uisplitter.hpp @@ -42,6 +42,8 @@ class EE_API UISplitter : public UILayout { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + virtual void updateLayout(); protected: diff --git a/include/eepp/ui/uisprite.hpp b/include/eepp/ui/uisprite.hpp index ef91895ae..e56ce4b8d 100644 --- a/include/eepp/ui/uisprite.hpp +++ b/include/eepp/ui/uisprite.hpp @@ -51,6 +51,8 @@ class EE_API UISprite : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: Graphics::Sprite* mSprite; RenderMode mRender; diff --git a/include/eepp/ui/uitab.hpp b/include/eepp/ui/uitab.hpp index 0d00d7152..2148d857a 100644 --- a/include/eepp/ui/uitab.hpp +++ b/include/eepp/ui/uitab.hpp @@ -34,6 +34,8 @@ class EE_API UITab : public UISelectButton { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + UITabWidget* getTabWidget() const; virtual UIWidget* getExtraInnerWidget() const; diff --git a/include/eepp/ui/uitabwidget.hpp b/include/eepp/ui/uitabwidget.hpp index 12ae50d7b..0b0e4f25c 100644 --- a/include/eepp/ui/uitabwidget.hpp +++ b/include/eepp/ui/uitabwidget.hpp @@ -122,6 +122,8 @@ class EE_API UITabWidget : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + virtual bool isDrawInvalidator() const; void invalidate( Node* invalidator ); diff --git a/include/eepp/ui/uitextinput.hpp b/include/eepp/ui/uitextinput.hpp index 52d5e6b4e..e5d394fa6 100644 --- a/include/eepp/ui/uitextinput.hpp +++ b/include/eepp/ui/uitextinput.hpp @@ -54,6 +54,8 @@ class EE_API UITextInput : public UITextView, public TextDocument::Client { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + virtual UIWidget* setPadding( const Rectf& padding ); const String& getHint() const; diff --git a/include/eepp/ui/uitextureregion.hpp b/include/eepp/ui/uitextureregion.hpp index 7693236f3..067fef7be 100644 --- a/include/eepp/ui/uitextureregion.hpp +++ b/include/eepp/ui/uitextureregion.hpp @@ -48,6 +48,8 @@ class EE_API UITextureRegion : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: UIScaleType mScaleType; Graphics::TextureRegion* mTextureRegion; diff --git a/include/eepp/ui/uitextview.hpp b/include/eepp/ui/uitextview.hpp index 14346bcf6..d4b226dfd 100644 --- a/include/eepp/ui/uitextview.hpp +++ b/include/eepp/ui/uitextview.hpp @@ -88,6 +88,8 @@ class EE_API UITextView : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + void setTextAlign( const Uint32& align ); UITextView* setFontFillColor( const Color& color, Uint32 from, Uint32 to ); diff --git a/include/eepp/ui/uitooltip.hpp b/include/eepp/ui/uitooltip.hpp index 543feb425..432fedea5 100644 --- a/include/eepp/ui/uitooltip.hpp +++ b/include/eepp/ui/uitooltip.hpp @@ -91,6 +91,8 @@ class EE_API UITooltip : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + const String& getStringBuffer() const; void setStringBuffer( const String& stringBuffer ); diff --git a/include/eepp/ui/uitouchdraggablewidget.hpp b/include/eepp/ui/uitouchdraggablewidget.hpp index 58ab78eb5..2da5e334b 100644 --- a/include/eepp/ui/uitouchdraggablewidget.hpp +++ b/include/eepp/ui/uitouchdraggablewidget.hpp @@ -34,6 +34,8 @@ class EE_API UITouchDraggableWidget : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: Vector2f mTouchDragPoint; Vector2f mTouchDragAcceleration; diff --git a/include/eepp/ui/uiviewpager.hpp b/include/eepp/ui/uiviewpager.hpp index 9e4fcd571..1587ff9ee 100644 --- a/include/eepp/ui/uiviewpager.hpp +++ b/include/eepp/ui/uiviewpager.hpp @@ -51,10 +51,12 @@ class EE_API UIViewPager : public UIWidget { void setTimingFunction( const Ease::Interpolation& timingFunction ); + virtual bool applyProperty( const StyleSheetProperty& attribute ); + virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex ) const; - virtual bool applyProperty( const StyleSheetProperty& attribute ); + virtual std::vector getPropertiesImplemented() const; const Int32& getTotalPages() const; diff --git a/include/eepp/ui/uiwidgettable.hpp b/include/eepp/ui/uiwidgettable.hpp index ce4d386d0..2b1164e51 100644 --- a/include/eepp/ui/uiwidgettable.hpp +++ b/include/eepp/ui/uiwidgettable.hpp @@ -80,6 +80,8 @@ class EE_API UIWidgetTable : public UITouchDraggableWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + protected: friend class UIItemContainer; friend class UIWidgetTableRow; diff --git a/include/eepp/ui/uiwindow.hpp b/include/eepp/ui/uiwindow.hpp index a98642221..8d14c2b8c 100644 --- a/include/eepp/ui/uiwindow.hpp +++ b/include/eepp/ui/uiwindow.hpp @@ -157,6 +157,8 @@ class EE_API UIWindow : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + std::string getWindowFlagsString() const; Sizef getMinWindowSizeWithDecoration(); diff --git a/src/eepp/ui/abstract/uiabstracttableview.cpp b/src/eepp/ui/abstract/uiabstracttableview.cpp index bc236d8e1..0ca265c04 100644 --- a/src/eepp/ui/abstract/uiabstracttableview.cpp +++ b/src/eepp/ui/abstract/uiabstracttableview.cpp @@ -656,6 +656,12 @@ std::string UIAbstractTableView::getPropertyString( const PropertyDefinition* pr } } +std::vector UIAbstractTableView::getPropertiesImplemented() const { + auto props = UIAbstractView::getPropertiesImplemented(); + props.push_back( PropertyId::RowHeight ); + return props; +} + bool UIAbstractTableView::getRowSearchByName() const { return mRowSearchByName; } diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index e1bb6beb6..8e2c77b3f 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -235,6 +235,12 @@ std::string UICheckBox::getPropertyString( const PropertyDefinition* propertyDef } } +std::vector UICheckBox::getPropertiesImplemented() const { + auto props = UITextView::getPropertiesImplemented(); + props.push_back( PropertyId::Checked ); + return props; +} + bool UICheckBox::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index e6aa6f9e4..f7c02d18f 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -1945,6 +1945,24 @@ std::string UICodeEditor::getPropertyString( const PropertyDefinition* propertyD } } +std::vector UICodeEditor::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Locked, + PropertyId::Color, + PropertyId::ShadowColor, + PropertyId::SelectionColor, + PropertyId::SelectionBackColor, + PropertyId::FontFamily, + PropertyId::FontSize, + PropertyId::FontStyle, + PropertyId::TextStrokeWidth, + PropertyId::TextStrokeColor, + PropertyId::TextSelection, + PropertyId::LineSpacing }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + const bool& UICodeEditor::getHighlightMatchingBracket() const { return mHighlightMatchingBracket; } diff --git a/src/eepp/ui/uicombobox.cpp b/src/eepp/ui/uicombobox.cpp index 7624b1e24..629a940f3 100644 --- a/src/eepp/ui/uicombobox.cpp +++ b/src/eepp/ui/uicombobox.cpp @@ -225,4 +225,45 @@ std::string UIComboBox::getPropertyString( const PropertyDefinition* propertyDef } } +std::vector UIComboBox::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { + PropertyId::Color, + PropertyId::ShadowColor, + PropertyId::SelectionColor, + PropertyId::SelectionBackColor, + PropertyId::FontFamily, + PropertyId::FontSize, + PropertyId::FontStyle, + PropertyId::Wordwrap, + PropertyId::TextStrokeWidth, + PropertyId::TextStrokeColor, + PropertyId::TextSelection, + PropertyId::TextAlign, + PropertyId::Text, + PropertyId::AllowEditing, + PropertyId::MaxLength, + PropertyId::Numeric, + PropertyId::AllowFloat, + PropertyId::Hint, + PropertyId::HintColor, + PropertyId::HintShadowColor, + PropertyId::HintFontSize, + PropertyId::HintFontFamily, + PropertyId::HintFontStyle, + PropertyId::HintStrokeWidth, + PropertyId::HintStrokeColor, + PropertyId::PopUpToRoot, + PropertyId::MaxVisibleItems, + PropertyId::SelectedIndex, + PropertyId::SelectedText, + PropertyId::ScrollBarStyle, + PropertyId::RowHeight, + PropertyId::VScrollMode, + PropertyId::HScrollMode, + }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + }} // namespace EE::UI diff --git a/src/eepp/ui/uiconsole.cpp b/src/eepp/ui/uiconsole.cpp index 8bb6202cd..ac83337e3 100644 --- a/src/eepp/ui/uiconsole.cpp +++ b/src/eepp/ui/uiconsole.cpp @@ -208,12 +208,22 @@ std::string UIConsole::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UIConsole::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Color, PropertyId::ShadowColor, + PropertyId::SelectionColor, PropertyId::SelectionBackColor, + PropertyId::FontFamily, PropertyId::FontSize, + PropertyId::FontStyle, PropertyId::TextStrokeWidth, + PropertyId::TextStrokeColor }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + UIConsole* UIConsole::setFontSize( const Float& dpSize ) { if ( mFontStyleConfig.CharacterSize != dpSize ) { mFontStyleConfig.CharacterSize = eeabs( dpSize - (int)dpSize ) == 0.5f || (int)dpSize == dpSize ? dpSize : eefloor( dpSize ); - mFontStyleConfig.CharacterSize = mFontStyleConfig.CharacterSize; invalidateDraw(); onFontChanged(); } diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 99ee49dbe..0e60f0d3a 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -45,9 +45,7 @@ UIDropDownList::UIDropDownList( const std::string& tag ) : cb::Make1( this, &UIDropDownList::onItemKeyDown ) ); mListBox->addEventListener( Event::KeyDown, cb::Make1( this, &UIDropDownList::onItemKeyDown ) ); mListBox->addEventListener( Event::OnClear, cb::Make1( this, &UIDropDownList::onWidgetClear ) ); - mListBox->addEventListener( Event::OnClose, [&]( const Event* ) { - mListBox = nullptr; - } ); + mListBox->addEventListener( Event::OnClose, [&]( const Event* ) { mListBox = nullptr; } ); } UIDropDownList::~UIDropDownList() { @@ -143,12 +141,12 @@ void UIDropDownList::showList() { if ( mStyleConfig.MaxNumVisibleItems < mListBox->getCount() ) { mListBox->setSize( NULL != mFriendNode ? mFriendNode->getSize().getWidth() : getSize().getWidth(), - ( Int32 )( mStyleConfig.MaxNumVisibleItems * mListBox->getRowHeight() ) + + (Int32)( mStyleConfig.MaxNumVisibleItems * mListBox->getRowHeight() ) + tPadding.Top + tPadding.Bottom ); } else { mListBox->setSize( NULL != mFriendNode ? mFriendNode->getSize().getWidth() : getSize().getWidth(), - ( Int32 )( mListBox->getCount() * mListBox->getRowHeight() ) + + (Int32)( mListBox->getCount() * mListBox->getRowHeight() ) + tPadding.Top + tPadding.Bottom ); } @@ -377,6 +375,15 @@ std::string UIDropDownList::getPropertyString( const PropertyDefinition* propert return ""; } +std::vector UIDropDownList::getPropertiesImplemented() const { + auto props = UITextInput::getPropertiesImplemented(); + auto local = { PropertyId::PopUpToRoot, PropertyId::MaxVisibleItems, PropertyId::SelectedIndex, + PropertyId::SelectedText, PropertyId::ScrollBarStyle, PropertyId::RowHeight, + PropertyId::VScrollMode, PropertyId::HScrollMode }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + void UIDropDownList::loadFromXmlNode( const pugi::xml_node& node ) { beginAttributesTransaction(); diff --git a/src/eepp/ui/uigridlayout.cpp b/src/eepp/ui/uigridlayout.cpp index 8f24d5777..685453087 100644 --- a/src/eepp/ui/uigridlayout.cpp +++ b/src/eepp/ui/uigridlayout.cpp @@ -258,6 +258,15 @@ std::string UIGridLayout::getPropertyString( const PropertyDefinition* propertyD } } +std::vector UIGridLayout::getPropertiesImplemented() const { + auto props = UILayout::getPropertiesImplemented(); + auto local = { PropertyId::ColumnMargin, PropertyId::RowMargin, PropertyId::ColumnMode, + PropertyId::RowMode, PropertyId::ColumnWeight, PropertyId::RowWeight, + PropertyId::ColumnWidth, PropertyId::RowHeight, PropertyId::ReverseDraw }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIGridLayout::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiimage.cpp b/src/eepp/ui/uiimage.cpp index 9a699bd7c..edad491bf 100644 --- a/src/eepp/ui/uiimage.cpp +++ b/src/eepp/ui/uiimage.cpp @@ -234,6 +234,13 @@ std::string UIImage::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UIImage::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::ScaleType, PropertyId::Tint }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIImage::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uilinearlayout.cpp b/src/eepp/ui/uilinearlayout.cpp index 9767d1913..93b863691 100644 --- a/src/eepp/ui/uilinearlayout.cpp +++ b/src/eepp/ui/uilinearlayout.cpp @@ -499,6 +499,13 @@ std::string UILinearLayout::getPropertyString( const PropertyDefinition* propert } } +std::vector UILinearLayout::getPropertiesImplemented() const { + auto props = UILayout::getPropertiesImplemented(); + auto local = { PropertyId::Orientation, PropertyId::GravityOwner }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UILinearLayout::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index ba8917708..1567d063b 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -1054,6 +1054,15 @@ std::string UIListBox::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UIListBox::getPropertiesImplemented() const { + auto props = UITouchDraggableWidget::getPropertiesImplemented(); + auto local = { PropertyId::RowHeight, PropertyId::VScrollMode, + PropertyId::HScrollMode, PropertyId::SelectedIndex, + PropertyId::SelectedText, PropertyId::ScrollBarStyle }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIListBox::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiloader.cpp b/src/eepp/ui/uiloader.cpp index a08b371c1..1a3ffd19b 100644 --- a/src/eepp/ui/uiloader.cpp +++ b/src/eepp/ui/uiloader.cpp @@ -249,6 +249,16 @@ std::string UILoader::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UILoader::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Indeterminate, PropertyId::MaxProgress, + PropertyId::Progress, PropertyId::FillColor, + PropertyId::Radius, PropertyId::OutlineThickness, + PropertyId::AnimationSpeed, PropertyId::ArcStartAngle }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UILoader::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index 7b933b7e5..10fb6dd07 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -600,6 +600,13 @@ std::string UIMenu::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UIMenu::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::MinIconSize }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIMenu::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uimenucheckbox.cpp b/src/eepp/ui/uimenucheckbox.cpp index e8e1a6187..0b4877f77 100644 --- a/src/eepp/ui/uimenucheckbox.cpp +++ b/src/eepp/ui/uimenucheckbox.cpp @@ -158,4 +158,11 @@ std::string UIMenuCheckBox::getPropertyString( const PropertyDefinition* propert } } +std::vector UIMenuCheckBox::getPropertiesImplemented() const { + auto props = UIPushButton::getPropertiesImplemented(); + auto local = { PropertyId::Checked }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + }} // namespace EE::UI diff --git a/src/eepp/ui/uimenuradiobutton.cpp b/src/eepp/ui/uimenuradiobutton.cpp index 8e6323f63..dbf226b3c 100644 --- a/src/eepp/ui/uimenuradiobutton.cpp +++ b/src/eepp/ui/uimenuradiobutton.cpp @@ -150,6 +150,13 @@ std::string UIMenuRadioButton::getPropertyString( const PropertyDefinition* prop } } +std::vector UIMenuRadioButton::getPropertiesImplemented() const { + auto props = UIMenuItem::getPropertiesImplemented(); + auto local = { PropertyId::Selected }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIMenuRadioButton::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index 24573d01c..602de3204 100644 --- a/src/eepp/ui/uiprogressbar.cpp +++ b/src/eepp/ui/uiprogressbar.cpp @@ -240,6 +240,14 @@ std::string UIProgressBar::getPropertyString( const PropertyDefinition* property } } +std::vector UIProgressBar::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::TotalSteps, PropertyId::Progress, PropertyId::VerticalExpand, + PropertyId::DisplayPercent, PropertyId::MovementSpeed }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIProgressBar::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index 9b9f48b60..cf96b64db 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -16,8 +16,9 @@ UIPushButton* UIPushButton::NewWithTag( const std::string& tag ) { return eeNew( UIPushButton, ( tag ) ); } -UIPushButton* UIPushButton::NewWithOpt( const std::string& tag, - const std::function& newTextViewCb ) { +UIPushButton* +UIPushButton::NewWithOpt( const std::string& tag, + const std::function& newTextViewCb ) { return eeNew( UIPushButton, ( tag, newTextViewCb ) ); } @@ -470,6 +471,30 @@ std::string UIPushButton::getPropertyString( const PropertyDefinition* propertyD } } +std::vector UIPushButton::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Text, + PropertyId::Icon, + PropertyId::MinIconSize, + PropertyId::TextAlign, + PropertyId::TextAsFallback, + PropertyId::Tint, + PropertyId::Color, + PropertyId::ShadowColor, + PropertyId::SelectionColor, + PropertyId::SelectionBackColor, + PropertyId::FontFamily, + PropertyId::FontSize, + PropertyId::FontStyle, + PropertyId::Wordwrap, + PropertyId::TextStrokeWidth, + PropertyId::TextStrokeColor, + PropertyId::TextSelection, + PropertyId::TextTransform }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIPushButton::applyProperty( const StyleSheetProperty& attribute ) { bool attributeSet = true; diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index 03a9ec422..913b950c8 100644 --- a/src/eepp/ui/uiradiobutton.cpp +++ b/src/eepp/ui/uiradiobutton.cpp @@ -236,13 +236,13 @@ void UIRadioButton::alignFix() { switch ( Font::getHorizontalAlign( getFlags() ) ) { case UI_HALIGN_CENTER: - mRealAlignOffset.x = - ( Float )( ( Int32 )( ( mSize.x - mPaddingPx.Left - mPaddingPx.Right - - mTextCache->getTextWidth() - - mActiveButton->getPixelsSize().getWidth() + - PixelDensity::dpToPx( mTextSeparation ) ) / - 2.f ) ) + - mActiveButton->getPixelsSize().getWidth() + PixelDensity::dpToPx( mTextSeparation ); + mRealAlignOffset.x = (Float)( (Int32)( ( mSize.x - mPaddingPx.Left - mPaddingPx.Right - + mTextCache->getTextWidth() - + mActiveButton->getPixelsSize().getWidth() + + PixelDensity::dpToPx( mTextSeparation ) ) / + 2.f ) ) + + mActiveButton->getPixelsSize().getWidth() + + PixelDensity::dpToPx( mTextSeparation ); break; case UI_HALIGN_RIGHT: mRealAlignOffset.x = ( (Float)mSize.x - mPaddingPx.Left - mPaddingPx.Right - @@ -288,6 +288,13 @@ std::string UIRadioButton::getPropertyString( const PropertyDefinition* property } } +std::vector UIRadioButton::getPropertiesImplemented() const { + auto props = UITextView::getPropertiesImplemented(); + auto local = { PropertyId::Selected }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIRadioButton::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiroot.cpp b/src/eepp/ui/uiroot.cpp index 16bbffc32..2cd0fedd4 100644 --- a/src/eepp/ui/uiroot.cpp +++ b/src/eepp/ui/uiroot.cpp @@ -36,4 +36,10 @@ bool UIRoot::applyProperty( const StyleSheetProperty& attribute ) { return true; } +std::vector UIRoot::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + props.push_back( PropertyId::DroppableHoveringColor ); + return props; +} + }} // namespace EE::UI diff --git a/src/eepp/ui/uiscrollablewidget.cpp b/src/eepp/ui/uiscrollablewidget.cpp index 58558834b..0bb7b6ebb 100644 --- a/src/eepp/ui/uiscrollablewidget.cpp +++ b/src/eepp/ui/uiscrollablewidget.cpp @@ -240,6 +240,14 @@ std::string UIScrollableWidget::getPropertyString( const PropertyDefinition* pro } } +std::vector UIScrollableWidget::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::VScrollMode, PropertyId::HScrollMode, PropertyId::ScrollBarStyle, + PropertyId::ScrollBarMode }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + void UIScrollableWidget::scrollToTop() { mVScroll->setValue( 0 ); } diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 58cfa0f75..2903f8494 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -380,6 +380,15 @@ std::string UIScrollBar::getPropertyString( const PropertyDefinition* propertyDe } } +std::vector UIScrollBar::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Orientation, PropertyId::MinValue, PropertyId::MaxValue, + PropertyId::Value, PropertyId::ClickStep, PropertyId::PageStep, + PropertyId::BackgroundExpand }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIScrollBar::isDragging() const { return mSlider->isDragging(); } diff --git a/src/eepp/ui/uiscrollview.cpp b/src/eepp/ui/uiscrollview.cpp index b8ce93763..a71c8ad87 100644 --- a/src/eepp/ui/uiscrollview.cpp +++ b/src/eepp/ui/uiscrollview.cpp @@ -277,6 +277,14 @@ std::string UIScrollView::getPropertyString( const PropertyDefinition* propertyD } } +std::vector UIScrollView::getPropertiesImplemented() const { + auto props = UITouchDraggableWidget::getPropertiesImplemented(); + auto local = { PropertyId::VScrollMode, PropertyId::HScrollMode, PropertyId::ScrollBarStyle, + PropertyId::ScrollBarMode }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIScrollView::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiselectbutton.cpp b/src/eepp/ui/uiselectbutton.cpp index bf1d3dd26..e142a25bd 100644 --- a/src/eepp/ui/uiselectbutton.cpp +++ b/src/eepp/ui/uiselectbutton.cpp @@ -113,6 +113,13 @@ std::string UISelectButton::getPropertyString( const PropertyDefinition* propert } } +std::vector UISelectButton::getPropertiesImplemented() const { + auto props = UIPushButton::getPropertiesImplemented(); + auto local = { PropertyId::SelectOnClick, PropertyId::Selected }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + void UISelectButton::setSelected( bool set ) { if ( set ) { select(); diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index bff212ee8..2a9256e69 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -445,8 +445,8 @@ void UISlider::manageClick( const Uint32& Flags ) { else setValue( mValue + mClickStep ); } - } else if ( Flags & (EE_BUTTONS_WUWD|EE_BUTTONS_WLWR) ) { - if ( Flags & (EE_BUTTON_WUMASK|EE_BUTTON_WLMASK) ) + } else if ( Flags & ( EE_BUTTONS_WUWD | EE_BUTTONS_WLWR ) ) { + if ( Flags & ( EE_BUTTON_WUMASK | EE_BUTTON_WLMASK ) ) setValue( mValue - mClickStep ); else setValue( mValue + mClickStep ); @@ -583,6 +583,15 @@ std::string UISlider::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UISlider::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Orientation, PropertyId::MinValue, PropertyId::MaxValue, + PropertyId::Value, PropertyId::ClickStep, PropertyId::PageStep, + PropertyId::HalfSlider, PropertyId::BackgroundExpand }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UISlider::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index dc22013dc..8fc02042a 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -301,6 +301,14 @@ std::string UISpinBox::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UISpinBox::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::MinValue, PropertyId::MaxValue, PropertyId::Value, + PropertyId::ClickStep }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UISpinBox::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uisplitter.cpp b/src/eepp/ui/uisplitter.cpp index 6408a2aba..6a24dbfe8 100644 --- a/src/eepp/ui/uisplitter.cpp +++ b/src/eepp/ui/uisplitter.cpp @@ -158,6 +158,14 @@ std::string UISplitter::getPropertyString( const PropertyDefinition* propertyDef } } +std::vector UISplitter::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::SplitterPartition, PropertyId::SplitterAlwaysShow, + PropertyId::Orientation }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + void UISplitter::onChildCountChange( Node* child, const bool& removed ) { if ( child != mSplitter ) { if ( !removed ) { diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index 59cd91bc3..2a5420cac 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -54,8 +54,8 @@ void UISprite::draw() { if ( NULL != mSprite && 0.f != mAlpha ) { checkTextureRegionUpdate(); - mSprite->setPosition( Vector2f( ( Float )( mScreenPosi.x + (int)mAlignOffset.x ), - ( Float )( mScreenPosi.y + (int)mAlignOffset.y ) ) ); + mSprite->setPosition( Vector2f( (Float)( mScreenPosi.x + (int)mAlignOffset.x ), + (Float)( mScreenPosi.y + (int)mAlignOffset.y ) ) ); TextureRegion* textureRegion = mSprite->getCurrentTextureRegion(); @@ -208,6 +208,13 @@ std::string UISprite::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UISprite::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Src }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UISprite::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index 6e6e9c8d9..0fa6778ac 100644 --- a/src/eepp/ui/uitab.cpp +++ b/src/eepp/ui/uitab.cpp @@ -280,6 +280,13 @@ std::string UITab::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UITab::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Text, PropertyId::Owns }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UITab::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index 612bcfc00..1279148c4 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -177,6 +177,24 @@ std::string UITabWidget::getPropertyString( const PropertyDefinition* propertyDe } } +std::vector UITabWidget::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::MaxTextLength, + PropertyId::MinTabWidth, + PropertyId::MaxTabWidth, + PropertyId::TabClosable, + PropertyId::TabsEdgesDiffSkin, + PropertyId::TabSeparation, + PropertyId::TabHeight, + PropertyId::TabBarHideOnSingleTab, + PropertyId::TabBarAllowRearrange, + PropertyId::TabBarAllowDragAndDrop, + PropertyId::TabAllowSwitchTabsInEmptySpaces, + PropertyId::DroppableHoveringColor }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UITabWidget::isDrawInvalidator() const { return true; } diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 6b0967771..8913d8e0a 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -465,6 +465,18 @@ std::string UITextInput::getPropertyString( const PropertyDefinition* propertyDe } } +std::vector UITextInput::getPropertiesImplemented() const { + auto props = UITextView::getPropertiesImplemented(); + auto local = { + PropertyId::Text, PropertyId::AllowEditing, PropertyId::MaxLength, + PropertyId::Numeric, PropertyId::AllowFloat, PropertyId::Hint, + PropertyId::HintColor, PropertyId::HintShadowColor, PropertyId::HintFontSize, + PropertyId::HintFontFamily, PropertyId::HintFontStyle, PropertyId::HintStrokeWidth, + PropertyId::HintStrokeColor }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UITextInput::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uitextureregion.cpp b/src/eepp/ui/uitextureregion.cpp index 60cf80b2e..e23c86745 100644 --- a/src/eepp/ui/uitextureregion.cpp +++ b/src/eepp/ui/uitextureregion.cpp @@ -114,10 +114,10 @@ void UITextureRegion::draw() { } } else { mTextureRegion->setOffset( - Vector2i( ( Int32 )( (Float)oOff.x / mTextureRegion->getPixelDensity() * - PixelDensity::getPixelDensity() ), - ( Int32 )( (Float)oOff.y / mTextureRegion->getPixelDensity() * - PixelDensity::getPixelDensity() ) ) ); + Vector2i( (Int32)( (Float)oOff.x / mTextureRegion->getPixelDensity() * + PixelDensity::getPixelDensity() ), + (Int32)( (Float)oOff.y / mTextureRegion->getPixelDensity() * + PixelDensity::getPixelDensity() ) ) ); mTextureRegion->setDestSize( Vector2f( (Float)mTextureRegion->getPixelsSize().x, (Float)mTextureRegion->getPixelsSize().y ) ); @@ -222,6 +222,13 @@ std::string UITextureRegion::getPropertyString( const PropertyDefinition* proper } } +std::vector UITextureRegion::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Src, PropertyId::ScaleType, PropertyId::Tint }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UITextureRegion::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uitextview.cpp b/src/eepp/ui/uitextview.cpp index d19d2e666..08943714c 100644 --- a/src/eepp/ui/uitextview.cpp +++ b/src/eepp/ui/uitextview.cpp @@ -766,6 +766,18 @@ std::string UITextView::getPropertyString( const PropertyDefinition* propertyDef } } +std::vector UITextView::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { + PropertyId::Text, PropertyId::TextTransform, PropertyId::Color, + PropertyId::ShadowColor, PropertyId::SelectionColor, PropertyId::SelectionBackColor, + PropertyId::FontFamily, PropertyId::FontSize, PropertyId::FontStyle, + PropertyId::Wordwrap, PropertyId::TextStrokeWidth, PropertyId::TextStrokeColor, + PropertyId::TextSelection, PropertyId::TextAlign }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + void UITextView::setTextAlign( const Uint32& align ) { mFlags &= ~( UI_HALIGN_CENTER | UI_HALIGN_RIGHT ); mFlags |= align; diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index c09a38a42..300f5dfad 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -367,6 +367,16 @@ std::string UITooltip::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UITooltip::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { + PropertyId::TextTransform, PropertyId::Color, PropertyId::ShadowColor, + PropertyId::FontFamily, PropertyId::FontSize, PropertyId::FontStyle, + PropertyId::TextStrokeWidth, PropertyId::TextStrokeColor, PropertyId::TextAlign }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + const String& UITooltip::getStringBuffer() const { return mStringBuffer; } diff --git a/src/eepp/ui/uitouchdraggablewidget.cpp b/src/eepp/ui/uitouchdraggablewidget.cpp index a170ac1f7..95c8a4e10 100644 --- a/src/eepp/ui/uitouchdraggablewidget.cpp +++ b/src/eepp/ui/uitouchdraggablewidget.cpp @@ -157,6 +157,13 @@ std::string UITouchDraggableWidget::getPropertyString( const PropertyDefinition* } } +std::vector UITouchDraggableWidget::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::TouchDrag, PropertyId::TouchDragDeceleration }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UITouchDraggableWidget::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiviewpager.cpp b/src/eepp/ui/uiviewpager.cpp index 2fc47a033..6e960faf3 100644 --- a/src/eepp/ui/uiviewpager.cpp +++ b/src/eepp/ui/uiviewpager.cpp @@ -309,6 +309,19 @@ std::string UIViewPager::getPropertyString( const PropertyDefinition* propertyDe } } +std::vector UIViewPager::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Orientation, + PropertyId::DragResistance, + PropertyId::ChangePagePercent, + PropertyId::MaxEdgeResistance, + PropertyId::PageTransitionDuration, + PropertyId::TimingFunction, + PropertyId::PageLocked }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIViewPager::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiwidgettable.cpp b/src/eepp/ui/uiwidgettable.cpp index 23d894c41..263ba5dff 100644 --- a/src/eepp/ui/uiwidgettable.cpp +++ b/src/eepp/ui/uiwidgettable.cpp @@ -678,6 +678,14 @@ std::string UIWidgetTable::getPropertyString( const PropertyDefinition* property } } +std::vector UIWidgetTable::getPropertiesImplemented() const { + auto props = UITouchDraggableWidget::getPropertiesImplemented(); + auto local = { PropertyId::RowHeight, PropertyId::VScrollMode, PropertyId::HScrollMode, + PropertyId::ScrollBarStyle }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIWidgetTable::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index ff21fa7e0..e67786f5f 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -1601,6 +1601,25 @@ std::string UIWindow::getPropertyString( const PropertyDefinition* propertyDef, } } +std::vector UIWindow::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::Width, + PropertyId::Height, + PropertyId::WindowTitle, + PropertyId::WindowOpacity, + PropertyId::WindowButtonsOffset, + PropertyId::WindowFlags, + PropertyId::WindowTitlebarSize, + PropertyId::WindowBorderSize, + PropertyId::WindowMinSize, + PropertyId::WindowButtonsSeparation, + PropertyId::WindowCornerDistance, + PropertyId::WindowTitlebarAutoSize, + PropertyId::WindowBorderAutoSize }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + bool UIWindow::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/modules/eterm/include/eterm/ui/uiterminal.hpp b/src/modules/eterm/include/eterm/ui/uiterminal.hpp index c032d18b6..1ef3400bd 100644 --- a/src/modules/eterm/include/eterm/ui/uiterminal.hpp +++ b/src/modules/eterm/include/eterm/ui/uiterminal.hpp @@ -100,6 +100,8 @@ class UITerminal : public UIWidget { virtual std::string getPropertyString( const PropertyDefinition* propertyDef, const Uint32& propertyIndex = 0 ) const; + virtual std::vector getPropertiesImplemented() const; + void executeFile( const std::string& cmd ); const TerminalColorScheme& getColorScheme() const; diff --git a/src/modules/eterm/src/eterm/ui/uiterminal.cpp b/src/modules/eterm/src/eterm/ui/uiterminal.cpp index ea5ef4646..940ecbb82 100644 --- a/src/modules/eterm/src/eterm/ui/uiterminal.cpp +++ b/src/modules/eterm/src/eterm/ui/uiterminal.cpp @@ -227,6 +227,13 @@ std::string UITerminal::getPropertyString( const PropertyDefinition* propertyDef } } +std::vector UITerminal::getPropertiesImplemented() const { + auto props = UIWidget::getPropertiesImplemented(); + auto local = { PropertyId::VScrollMode, PropertyId::ScrollBarStyle, PropertyId::ScrollBarMode }; + props.insert( props.end(), local.begin(), local.end() ); + return props; +} + void UITerminal::executeFile( const std::string& cmd ) { if ( mTerm ) mTerm->executeFile( cmd );