From c7a5220c212cb8e727cb5d19e12f432db5d600f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Sat, 18 Feb 2017 05:00:15 -0300 Subject: [PATCH] UI module refactoring. --HG-- branch : dev --- include/eepp/ui/uibackground.hpp | 21 +- include/eepp/ui/uiborder.hpp | 14 +- include/eepp/ui/uicombobox.hpp | 2 +- include/eepp/ui/uicommondialog.hpp | 2 +- include/eepp/ui/uicomplexcontrol.hpp | 10 +- include/eepp/ui/uicontrol.hpp | 72 ++--- include/eepp/ui/uicontrolanim.hpp | 40 +-- include/eepp/ui/uidragable.hpp | 16 +- include/eepp/ui/uigfx.hpp | 2 +- include/eepp/ui/uiitemcontainer.hpp | 6 +- include/eepp/ui/uimenusubmenu.hpp | 2 +- include/eepp/ui/uisprite.hpp | 2 +- include/eepp/ui/uitextbox.hpp | 2 +- include/eepp/ui/uitooltip.hpp | 2 +- include/eepp/ui/uiwindow.hpp | 18 +- projects/linux/ee.creator.user | 2 +- src/eepp/gaming/mapeditor/mapeditor.cpp | 190 +++++++------- .../gaming/mapeditor/maplayerproperties.cpp | 22 +- .../gaming/mapeditor/mapobjectproperties.cpp | 24 +- .../gaming/mapeditor/tilemapproperties.cpp | 58 ++--- src/eepp/gaming/mapeditor/uigotypenew.cpp | 8 +- src/eepp/gaming/mapeditor/uimap.cpp | 4 +- src/eepp/gaming/mapeditor/uimap.hpp | 4 +- src/eepp/gaming/mapeditor/uimaplayernew.cpp | 10 +- src/eepp/gaming/mapeditor/uimapnew.cpp | 86 +++--- src/eepp/ui/tools/textureatlaseditor.cpp | 46 ++-- src/eepp/ui/tools/textureatlasnew.cpp | 20 +- .../ui/tools/textureatlassubtextureeditor.cpp | 14 +- src/eepp/ui/uibackground.cpp | 24 +- src/eepp/ui/uiborder.cpp | 10 +- src/eepp/ui/uicheckbox.cpp | 28 +- src/eepp/ui/uicombobox.cpp | 6 +- src/eepp/ui/uicommondialog.cpp | 92 +++---- src/eepp/ui/uicomplexcontrol.cpp | 52 ++-- src/eepp/ui/uicontrol.cpp | 178 ++++++------- src/eepp/ui/uicontrolanim.cpp | 124 ++++----- src/eepp/ui/uidefaulttheme.cpp | 24 +- src/eepp/ui/uidragable.cpp | 30 +-- src/eepp/ui/uidropdownlist.cpp | 36 +-- src/eepp/ui/uigenericgrid.cpp | 128 ++++----- src/eepp/ui/uigfx.cpp | 16 +- src/eepp/ui/uigridcell.cpp | 34 +-- src/eepp/ui/uilistbox.cpp | 142 +++++----- src/eepp/ui/uilistboxitem.cpp | 10 +- src/eepp/ui/uimanager.cpp | 20 +- src/eepp/ui/uimenu.cpp | 104 ++++---- src/eepp/ui/uimenucheckbox.cpp | 4 +- src/eepp/ui/uimenuitem.cpp | 4 +- src/eepp/ui/uimenusubmenu.cpp | 30 +-- src/eepp/ui/uimessagebox.cpp | 48 ++-- src/eepp/ui/uipopupmenu.cpp | 14 +- src/eepp/ui/uiprogressbar.cpp | 10 +- src/eepp/ui/uipushbutton.cpp | 32 +-- src/eepp/ui/uiradiobutton.cpp | 40 +-- src/eepp/ui/uiscrollbar.cpp | 44 ++-- src/eepp/ui/uiselectbutton.cpp | 4 +- src/eepp/ui/uiseparator.cpp | 2 +- src/eepp/ui/uislider.cpp | 68 ++--- src/eepp/ui/uispinbox.cpp | 28 +- src/eepp/ui/uisprite.cpp | 16 +- src/eepp/ui/uitab.cpp | 8 +- src/eepp/ui/uitabwidget.cpp | 60 ++--- src/eepp/ui/uitextbox.cpp | 14 +- src/eepp/ui/uitextedit.cpp | 152 +++++------ src/eepp/ui/uitextinput.cpp | 4 +- src/eepp/ui/uitextinputpassword.cpp | 10 +- src/eepp/ui/uitheme.cpp | 84 +++--- src/eepp/ui/uitooltip.cpp | 26 +- src/eepp/ui/uiwindow.cpp | 246 +++++++++--------- src/eepp/ui/uiwinmenu.cpp | 26 +- src/test/eetest.cpp | 134 +++++----- src/test/eetest.hpp | 14 +- 72 files changed, 1441 insertions(+), 1438 deletions(-) diff --git a/include/eepp/ui/uibackground.hpp b/include/eepp/ui/uibackground.hpp index d42506e2a..64a5aabf4 100644 --- a/include/eepp/ui/uibackground.hpp +++ b/include/eepp/ui/uibackground.hpp @@ -12,27 +12,28 @@ class EE_API UIBackground { UIBackground( const UIBackground& Back ); UIBackground( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor, const unsigned int& corners, const EE_BLEND_MODE& BlendMode ); - ColorA& color( const unsigned int& index = 0 ); + ColorA& getColor( const unsigned int& index = 0 ); - void color( const ColorA& Col ); + void setColor( const ColorA& Col ); - const std::vector& colors(); + const std::vector& getColors(); - void colors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ); + void setColors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ); - void colorsTo( const ColorA& color ); + void setColorsTo( const ColorA& color ); - const EE_BLEND_MODE& blend() const; + const EE_BLEND_MODE& getBlendMode() const; - void blend( const EE_BLEND_MODE& blend ); + void setBlendMode( const EE_BLEND_MODE& blend ); - const unsigned int& corners() const; - void corners( const unsigned int& corners ); + const unsigned int& getCorners() const; + + void setCorners( const unsigned int& corners ); protected: std::vector mColor; EE_BLEND_MODE mBlendMode; - unsigned int mCorners; + unsigned int mCorners; }; }} diff --git a/include/eepp/ui/uiborder.hpp b/include/eepp/ui/uiborder.hpp index 52cd10cfd..d22fc1e6e 100644 --- a/include/eepp/ui/uiborder.hpp +++ b/include/eepp/ui/uiborder.hpp @@ -10,14 +10,16 @@ class EE_API UIBorder { UIBorder(); UIBorder( const UIBorder& border ); - const ColorA& color() const; - void color( const ColorA& Col ); + const ColorA& getColor() const; - const unsigned int& width() const; - void width( const unsigned int& width ); + void setColor( const ColorA& Col ); + + const unsigned int& getWidth() const; + + void setWidth( const unsigned int& width ); protected: - ColorA mColor; - unsigned int mWidth; + ColorA mColor; + unsigned int mWidth; }; }} diff --git a/include/eepp/ui/uicombobox.hpp b/include/eepp/ui/uicombobox.hpp index 0205b2c24..28e692196 100644 --- a/include/eepp/ui/uicombobox.hpp +++ b/include/eepp/ui/uicombobox.hpp @@ -25,7 +25,7 @@ class EE_API UIComboBox : public UIDropDownList { void onButtonExit( const UIEvent * Event ); - Uint32 onMouseClick( const Vector2i& position, const Uint32 flags ); + Uint32 onMouseClick( const Vector2i& setPosition, const Uint32 flags ); void createButton(); diff --git a/include/eepp/ui/uicommondialog.hpp b/include/eepp/ui/uicommondialog.hpp index f4e761562..32f987fd3 100644 --- a/include/eepp/ui/uicommondialog.hpp +++ b/include/eepp/ui/uicommondialog.hpp @@ -60,7 +60,7 @@ class EE_API UICommonDialog : public UIWindow { UIPushButton * getButtonUp() const; - UIListBox * getList() const; + UIListBox * getList() const; UITextInput * getPathInput() const; diff --git a/include/eepp/ui/uicomplexcontrol.hpp b/include/eepp/ui/uicomplexcontrol.hpp index 27bf76496..c139d04d5 100644 --- a/include/eepp/ui/uicomplexcontrol.hpp +++ b/include/eepp/ui/uicomplexcontrol.hpp @@ -47,19 +47,19 @@ class EE_API UIComplexControl : public UIControlAnim { virtual void update(); - virtual void size( const Sizei &size ); + virtual void setSize( const Sizei &getSize ); - void size( const Int32& Width, const Int32& Height ); + void setSize( const Int32& Width, const Int32& Height ); - const Sizei& size(); + const Sizei& getSize(); UITooltip * getTooltip(); void tooltipRemove(); - void tooltipText( const String& Text ); + void setTooltipText( const String& Text ); - String tooltipText(); + String getTooltipText(); void updateAnchorsDistances(); protected: diff --git a/include/eepp/ui/uicontrol.hpp b/include/eepp/ui/uicontrol.hpp index c6768430e..269dfc19c 100644 --- a/include/eepp/ui/uicontrol.hpp +++ b/include/eepp/ui/uicontrol.hpp @@ -90,35 +90,35 @@ class EE_API UIControl { bool isInside( const Vector2i& position ) const; - void position( const Vector2i& position ); + void setPosition( const Vector2i& position ); - void position( const Int32& x, const Int32& y ); + void setPosition( const Int32& x, const Int32& y ); - const Vector2i& position() const; + const Vector2i& getPosition() const; - virtual void size( const Sizei& size ); + virtual void setSize( const Sizei& size ); - void size( const Int32& Width, const Int32& Height ); + void setSize( const Int32& Width, const Int32& Height ); - const Sizei& size(); + const Sizei& getSize(); Recti getRect() const; - void visible( const bool& visible ); + void setVisible( const bool& visible ); - bool visible() const; + bool isVisible() const; bool isHided() const; - void enabled( const bool& enabled ); + void setEnabled( const bool& enabled ); - bool enabled() const; + bool isEnabled() const; bool isDisabled() const; - UIControl * parent() const; + UIControl * getParent() const; - void parent( UIControl * parent ); + void setParent( UIControl * parent ); void centerHorizontal(); @@ -132,48 +132,48 @@ class EE_API UIControl { virtual void update(); - Uint32 hAlign() const; + Uint32 getHorizontalAlign() const; - void hAlign( Uint32 halign ); + void setHorizontalAlign( Uint32 halign ); - Uint32 vAlign() const; + Uint32 getVerticalAlign() const; - void vAlign( Uint32 valign ); + void setVerticalAlign( Uint32 valign ); - void fillBackground( bool enabled ); + void setBackgroundFillEnabled( bool enabled ); - void border( bool enabled ); + void setBorderEnabled( bool enabled ); - UIControl * nextGet() const; + UIControl * getNextControl() const; - UIControl * prevGet() const; + UIControl * getPrevControl() const; - UIControl * nextGetLoop() const; + UIControl * getNextControlLoop() const; - void data( const UintPtr& data ); + void setData( const UintPtr& data ); - const UintPtr& data() const; + const UintPtr& getData() const; UIControl * childGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel = 0 ); - const Uint32& flags() const; + const Uint32& getFlags() const; - void flags( const Uint32& flags ); + void setFlags( const Uint32& flags ); - void blend( const EE_BLEND_MODE& blend ); + void setBlendMode( const EE_BLEND_MODE& blend ); - EE_BLEND_MODE blend(); + EE_BLEND_MODE getBlendMode(); void toFront(); void toBack(); - void toPos( const Uint32& position ); + void toPosition( const Uint32& position ); - const Uint32& controlFlags() const; + const Uint32& getControlFlags() const; /** Use it at your own risk */ - void controlFlags( const Uint32& flags ); + void setControlFlags( const Uint32& flags ); Uint32 isAnimated(); @@ -187,9 +187,9 @@ class EE_API UIControl { void removeEventListener( const Uint32& CallbackId ); - UIBackground * background(); + UIBackground * getBackground(); - UIBorder * border(); + UIBorder * getBorder(); void setThemeByName( const std::string& Theme ); @@ -205,15 +205,15 @@ class EE_API UIControl { virtual void setSkin( const UISkin& Skin ); - UIControl * childGetFirst() const; + UIControl * getFirstChild() const; - UIControl * childGetLast() const; + UIControl * getLastChild() const; bool isMouseOver(); bool isMouseOverMeOrChilds(); - Polygon2f &getPolygon(); + Polygon2f& getPolygon(); const Vector2f& getPolygonCenter() const; @@ -233,7 +233,7 @@ class EE_API UIControl { Sizei getSkinSize(); - UIControl * nextComplexControl(); + UIControl * getNextComplexControl(); void applyDefaultTheme(); diff --git a/include/eepp/ui/uicontrolanim.hpp b/include/eepp/ui/uicontrolanim.hpp index a66b6986b..e025a978e 100644 --- a/include/eepp/ui/uicontrolanim.hpp +++ b/include/eepp/ui/uicontrolanim.hpp @@ -19,37 +19,37 @@ class EE_API UIControlAnim : public UIDragable { virtual void update(); - const Float& angle() const; + const Float& getRotation() const; - void angle( const Float& angle ); + void setRotation( const Float& angle ); - void angle( const Float& angle, const OriginPoint& center ); + void setRotation( const Float& angle, const OriginPoint& center ); - const OriginPoint& rotationOriginPoint() const; + const OriginPoint& getRotationOriginPoint() const; - void rotationOriginPoint( const OriginPoint& center ); + void setRotationOriginPoint( const OriginPoint& center ); - Vector2f rotationCenter(); + Vector2f getRotationCenter(); - const Vector2f& scale() const; + const Vector2f& getScale() const; - void scale( const Vector2f& scale ); + void setScale( const Vector2f& scale ); - void scale( const Vector2f& scale, const OriginPoint& center ); + void setScale( const Vector2f& scale, const OriginPoint& center ); - void scale( const Float& scale , const OriginPoint & center = OriginPoint::OriginCenter ); + void setScale( const Float& scale , const OriginPoint & center = OriginPoint::OriginCenter ); - const OriginPoint& scaleOriginPoint() const; + const OriginPoint& getScaleOriginPoint() const; - void scaleOriginPoint( const OriginPoint& center ); + void setScaleOriginPoint( const OriginPoint& center ); - Vector2f scaleCenter(); + Vector2f getScaleCenter(); - const Float& alpha() const; + const Float& getAlpha() const; - virtual void alpha( const Float& alpha ); + virtual void setAlpha( const Float& alpha ); - virtual void alphaChilds( const Float& alpha ); + virtual void setChildsAlpha( const Float& alpha ); bool isAnimating(); @@ -71,13 +71,13 @@ class EE_API UIControlAnim : public UIDragable { Interpolation * disableFadeOut( const Time & Time, const bool& alphaChilds = true, const Ease::Interpolation& getType = Ease::Linear ); - Interpolation * rotationInterpolation(); + Interpolation * getRotationInterpolation(); - Waypoints * scaleInterpolation(); + Waypoints * getScaleInterpolation(); - Interpolation * alphaInterpolation(); + Interpolation * getAlphaInterpolation(); - Waypoints * movementInterpolation(); + Waypoints * getMovementInterpolation(); virtual void draw(); diff --git a/include/eepp/ui/uidragable.hpp b/include/eepp/ui/uidragable.hpp index 839acc2a2..1dfa5f6a8 100644 --- a/include/eepp/ui/uidragable.hpp +++ b/include/eepp/ui/uidragable.hpp @@ -13,19 +13,19 @@ class EE_API UIDragable : public UIControl { virtual bool isType( const Uint32& type ) const; - bool dragging() const; - void dragging( const bool& dragging ); + bool isDragging() const; + void setDragging( const bool& dragging ); - const Vector2i& dragPoint() const; - void dragPoint( const Vector2i& Point ); + const Vector2i& getDragPoint() const; + void setDragPoint( const Vector2i& Point ); virtual void update(); - bool dragEnable() const; - void dragEnable( const bool& enable ); + bool isDragEnabled() const; + void setDragEnabled( const bool& enable ); - void dragButton( const Uint32& Button ); - const Uint32& dragButton() const; + void setDragButton( const Uint32& Button ); + const Uint32& getDragButton() const; protected: virtual ~UIDragable(); diff --git a/include/eepp/ui/uigfx.hpp b/include/eepp/ui/uigfx.hpp index 92499dc84..2d0960803 100644 --- a/include/eepp/ui/uigfx.hpp +++ b/include/eepp/ui/uigfx.hpp @@ -34,7 +34,7 @@ class EE_API UIGfx : public UIComplexControl { virtual void draw(); - virtual void alpha( const Float& alpha ); + virtual void setAlpha( const Float& alpha ); Graphics::SubTexture * subTexture() const; diff --git a/include/eepp/ui/uiitemcontainer.hpp b/include/eepp/ui/uiitemcontainer.hpp index 7ac347b50..442dd059c 100644 --- a/include/eepp/ui/uiitemcontainer.hpp +++ b/include/eepp/ui/uiitemcontainer.hpp @@ -32,7 +32,7 @@ UIItemContainer::~UIItemContainer() template void UIItemContainer::update() { - TContainer * tParent = reinterpret_cast ( parent() ); + TContainer * tParent = reinterpret_cast ( getParent() ); if ( tParent->mItems.size() ) { for ( Uint32 i = tParent->mVisibleFirst; i <= tParent->mVisibleLast; i++ ) { @@ -44,7 +44,7 @@ void UIItemContainer::update() { template void UIItemContainer::drawChilds() { - TContainer * tParent = reinterpret_cast ( parent() ); + TContainer * tParent = reinterpret_cast ( getParent() ); if ( tParent->mItems.size() ) { for ( Uint32 i = tParent->mVisibleFirst; i <= tParent->mVisibleLast; i++ ) @@ -55,7 +55,7 @@ void UIItemContainer::drawChilds() { template UIControl * UIItemContainer::overFind( const Vector2f& Point ) { - TContainer * tParent = reinterpret_cast ( parent() ); + TContainer * tParent = reinterpret_cast ( getParent() ); UIControl * pOver = NULL; diff --git a/include/eepp/ui/uimenusubmenu.hpp b/include/eepp/ui/uimenusubmenu.hpp index 55c66aad4..324f737c8 100644 --- a/include/eepp/ui/uimenusubmenu.hpp +++ b/include/eepp/ui/uimenusubmenu.hpp @@ -54,7 +54,7 @@ class EE_API UIMenuSubMenu : public UIMenuItem { virtual Uint32 onMouseExit( const Vector2i &position, const Uint32 flags ); - virtual Uint32 onMouseMove( const Vector2i &position, const Uint32 flags ); + virtual Uint32 onMouseMove( const Vector2i &position, const Uint32 getFlags ); virtual void onStateChange(); diff --git a/include/eepp/ui/uisprite.hpp b/include/eepp/ui/uisprite.hpp index f9a4b5d73..f2d928ea1 100644 --- a/include/eepp/ui/uisprite.hpp +++ b/include/eepp/ui/uisprite.hpp @@ -38,7 +38,7 @@ class EE_API UISprite : public UIComplexControl { virtual void draw(); - virtual void alpha( const Float& alpha ); + virtual void setAlpha( const Float& alpha ); Graphics::Sprite * sprite() const; diff --git a/include/eepp/ui/uitextbox.hpp b/include/eepp/ui/uitextbox.hpp index c193ffee8..36490565c 100644 --- a/include/eepp/ui/uitextbox.hpp +++ b/include/eepp/ui/uitextbox.hpp @@ -46,7 +46,7 @@ class EE_API UITextBox : public UIComplexControl { virtual void draw(); - virtual void alpha( const Float& alpha ); + virtual void setAlpha( const Float& alpha ); Graphics::Font * font() const; diff --git a/include/eepp/ui/uitooltip.hpp b/include/eepp/ui/uitooltip.hpp index 3d218a5de..8186f1cdc 100644 --- a/include/eepp/ui/uitooltip.hpp +++ b/include/eepp/ui/uitooltip.hpp @@ -55,7 +55,7 @@ class EE_API UITooltip : public UIControlAnim { virtual void draw(); - virtual void alpha( const Float& alpha ); + virtual void setAlpha( const Float& alpha ); Graphics::Font * font() const; diff --git a/include/eepp/ui/uiwindow.hpp b/include/eepp/ui/uiwindow.hpp index d839c0ed7..48ed8f07e 100644 --- a/include/eepp/ui/uiwindow.hpp +++ b/include/eepp/ui/uiwindow.hpp @@ -46,11 +46,11 @@ class EE_API UIWindow : public UIComplexControl { virtual bool isType( const Uint32& type ) const; - virtual void size( const Sizei& size ); + virtual void setSize( const Sizei& size ); - void size( const Int32& Width, const Int32& Height ); + void setSize( const Int32& Width, const Int32& Height ); - const Sizei& size(); + const Sizei& getSize(); virtual void setTheme( UITheme * Theme ); @@ -76,15 +76,15 @@ class EE_API UIWindow : public UIComplexControl { virtual void close(); - void baseAlpha( const Uint8& alpha ); + void setBaseAlpha( const Uint8& alpha ); - const Uint8& baseAlpha() const; + const Uint8& getBaseAlpha() const; - void title( const String& Text ); + void setTitle( const String& Text ); - String title() const; + String getTitle() const; - UITextBox * titleTextBox() const; + UITextBox * getTitleTextBox() const; bool addShortcut( const Uint32& KeyCode, const Uint32& Mod, UIPushButton * Button ); @@ -96,7 +96,7 @@ class EE_API UIWindow : public UIComplexControl { void maximize(); - bool isMaximixable(); + bool isMaximizable(); protected: class KeyboardShortcut { public: diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index a7f85997d..185ce3569 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index 25c25a9ec..5a41fbb82 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -66,7 +66,7 @@ MapEditor::MapEditor( UIWindow * AttatchTo, const MapEditorCloseCb& callback ) : mUIContainer = mUIWindow->getContainer(); } - mUIWindow->title( "Map Editor" ); + mUIWindow->setTitle( "Map Editor" ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapEditor::WindowClose ) ); CreateME(); @@ -87,8 +87,8 @@ void MapEditor::CreateWinMenu() { UIWinMenu * WinMenu = mTheme->createWinMenu( mUIContainer ); mTileBox = mTheme->createTextBox( "", mUIContainer, Sizei(), Vector2i(), UI_HALIGN_RIGHT | UI_VALIGN_CENTER | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT ); - mTileBox->size( 100, WinMenu->size().getHeight() ); - mTileBox->position( Vector2i( mUIContainer->size().getWidth() - mTileBox->size().getWidth(), 0 ) ); + mTileBox->setSize( 100, WinMenu->getSize().getHeight() ); + mTileBox->setPosition( Vector2i( mUIContainer->getSize().getWidth() - mTileBox->getSize().getWidth(), 0 ) ); mTileBox->updateAnchorsDistances(); UIPopUpMenu * PU1 = mTheme->createPopUpMenu( mUIContainer ); @@ -161,33 +161,33 @@ void MapEditor::CreateWinMenu() { UIComplexControl::CreateParams Params; Params.setParent( mUIContainer ); - Params.setPos( 0, WinMenu->size().getHeight() ); - Params.setSize( mUIContainer->size().getWidth(), mUIContainer->size().getHeight() - WinMenu->size().getHeight() ); + Params.setPos( 0, WinMenu->getSize().getHeight() ); + Params.setSize( mUIContainer->getSize().getWidth(), mUIContainer->getSize().getHeight() - WinMenu->getSize().getHeight() ); Params.Flags = UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_REPORT_SIZE_CHANGE_TO_CHILDS; mWinContainer = eeNew( UIComplexControl, ( Params ) ); - mWinContainer->visible( true ); - mWinContainer->enabled( true ); + mWinContainer->setVisible( true ); + mWinContainer->setEnabled( true ); } void MapEditor::CreateETGMenu() { Int32 Width = 200; Int32 DistToBorder = 5; - Int32 ContPosX = mWinContainer->size().getWidth() - Width - DistToBorder; + Int32 ContPosX = mWinContainer->getSize().getWidth() - Width - DistToBorder; Int32 DistFromTopMenu = 4; UIComplexControl::CreateParams CParams; CParams.setParent( mWinContainer ); - CParams.setSize( Sizei( Width + DistToBorder, mWinContainer->size().getHeight() ) ); + CParams.setSize( Sizei( Width + DistToBorder, mWinContainer->getSize().getHeight() ) ); CParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; mSubTextureCont = eeNew( UIComplexControl, ( CParams ) ); - mSubTextureCont->enabled( true ); - mSubTextureCont->visible( true ); + mSubTextureCont->setEnabled( true ); + mSubTextureCont->setVisible( true ); mLightCont = eeNew( UIComplexControl, ( CParams ) ); mObjectCont = eeNew( UIComplexControl, ( CParams ) ); - mTabWidget = mTheme->createTabWidget( mWinContainer, Sizei( Width + DistToBorder, mWinContainer->size().getHeight() - DistFromTopMenu ), Vector2i( ContPosX, DistFromTopMenu ), UI_HALIGN_CENTER | UI_VALIGN_BOTTOM | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM ); + mTabWidget = mTheme->createTabWidget( mWinContainer, Sizei( Width + DistToBorder, mWinContainer->getSize().getHeight() - DistFromTopMenu ), Vector2i( ContPosX, DistFromTopMenu ), UI_HALIGN_CENTER | UI_VALIGN_BOTTOM | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM ); mTabWidget->addEventListener( UIEvent::EventOnTabSelected, cb::Make1( this, &MapEditor::OnTabSelected ) ); CreateTabs(); @@ -243,81 +243,81 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) { Txt = mTheme->createTextBox( "Add Game Object as...", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, 4 ), TxtFlags ); - mGOTypeList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width - 26, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mGOTypeList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width - 26, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mGOTypeList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnTypeChange ) ); FillGotyList(); - mBtnGOTypeAdd = mTheme->createPushButton( mSubTextureCont, Sizei( 24, 21 ), Vector2i( mGOTypeList->position().x + mGOTypeList->size().getWidth() + 2, mGOTypeList->position().y ), UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mTheme->getIconByName( "add" ) ); - mBtnGOTypeAdd->tooltipText( "Adds a new game object type\nunknown by the map editor." ); + mBtnGOTypeAdd = mTheme->createPushButton( mSubTextureCont, Sizei( 24, 21 ), Vector2i( mGOTypeList->getPosition().x + mGOTypeList->getSize().getWidth() + 2, mGOTypeList->getPosition().y ), UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mTheme->getIconByName( "add" ) ); + mBtnGOTypeAdd->setTooltipText( "Adds a new game object type\nunknown by the map editor." ); mBtnGOTypeAdd->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::AddNewGOType ) ); if ( NULL == mBtnGOTypeAdd->icon()->subTexture() ) mBtnGOTypeAdd->text( "..." ); - Txt = mTheme->createTextBox( "Layers:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mGOTypeList->position().y + mGOTypeList->size().getHeight() + 4 ), TxtFlags ); + Txt = mTheme->createTextBox( "Layers:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mGOTypeList->getPosition().y + mGOTypeList->getSize().getHeight() + 4 ), TxtFlags ); - mLayerList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mLayerList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mLayerList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnLayerSelect ) ); - Txt = mTheme->createTextBox( "Game Object Flags:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mLayerList->position().y + mLayerList->size().getHeight() + 4 ), TxtFlags ); + Txt = mTheme->createTextBox( "Game Object Flags:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mLayerList->getPosition().y + mLayerList->getSize().getHeight() + 4 ), TxtFlags ); Uint32 ChkFlags = UI_CONTROL_DEFAULT_ALIGN | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; - mChkMirrored = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), ChkFlags ); + mChkMirrored = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ), ChkFlags ); mChkMirrored->text( "Mirrored" ); mChkMirrored->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickMirrored ) ); - mChkFliped = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->position().x + mChkMirrored->size().getWidth() + 32, mChkMirrored->position().y ), ChkFlags ); + mChkFliped = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->getPosition().x + mChkMirrored->getSize().getWidth() + 32, mChkMirrored->getPosition().y ), ChkFlags ); mChkFliped->text( "Fliped" ); mChkFliped->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickFliped ) ); - mChkBlocked = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->position().x, mChkMirrored->position().y + mChkMirrored->size().getHeight() + 4 ), ChkFlags ); + mChkBlocked = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->getPosition().x, mChkMirrored->getPosition().y + mChkMirrored->getSize().getHeight() + 4 ), ChkFlags ); mChkBlocked->text( "Blocked" ); - mChkBlocked->tooltipText( "Blocks the tile occupied by the sprite." ); + mChkBlocked->setTooltipText( "Blocks the tile occupied by the sprite." ); mChkBlocked->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickBlocked ) ); - mChkAnim = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkFliped->position().x, mChkFliped->position().y + mChkFliped->size().getHeight() + 4 ), ChkFlags ); + mChkAnim = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkFliped->getPosition().x, mChkFliped->getPosition().y + mChkFliped->getSize().getHeight() + 4 ), ChkFlags ); mChkAnim->text( "Animated" ); - mChkAnim->tooltipText( "Indicates if the Sprite is animated." ); + mChkAnim->setTooltipText( "Indicates if the Sprite is animated." ); mChkAnim->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAnimated ) ); - mChkRot90 = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->position().x, mChkBlocked->position().y + mChkBlocked->size().getHeight() + 4 ), ChkFlags ); + mChkRot90 = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->getPosition().x, mChkBlocked->getPosition().y + mChkBlocked->getSize().getHeight() + 4 ), ChkFlags ); mChkRot90->text( String::fromUtf8( "Rotate 90ยบ" ) ); mChkRot90->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickRot90 ) ); - mChkAutoFix = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->position().x, mChkAnim->position().y + mChkAnim->size().getHeight() + 4 ), ChkFlags ); + mChkAutoFix = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->getPosition().x, mChkAnim->getPosition().y + mChkAnim->getSize().getHeight() + 4 ), ChkFlags ); mChkAutoFix->text( "AutoFix TilePos" ); - mChkAutoFix->tooltipText( "In a tiled layer if the sprite is moved,\nit will update the current tile position automatically." ); + mChkAutoFix->setTooltipText( "In a tiled layer if the sprite is moved,\nit will update the current tile position automatically." ); mChkAutoFix->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAutoFix ) ); - Txt = mTheme->createTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->position().y + mChkRot90->size().getHeight() + 8 ), TxtFlags ); + Txt = mTheme->createTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->getPosition().y + mChkRot90->getSize().getHeight() + 8 ), TxtFlags ); - mChkDI = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), ChkFlags ); + mChkDI = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ), ChkFlags ); mChkDI->text( "Add as DataId" ); - mChkDI->tooltipText( "If the resource it's not a sprite,\nyou can reference it with a data id" ); + mChkDI->setTooltipText( "If the resource it's not a sprite,\nyou can reference it with a data id" ); mChkDI->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickDI ) ); UIComplexControl::CreateParams SGParams; SGParams.setParent( mSubTextureCont ); - SGParams.setPos( Vector2i( TAB_CONT_X_DIST, mChkDI->position().y + mChkDI->size().getHeight() + 8 ) ); + SGParams.setPos( Vector2i( TAB_CONT_X_DIST, mChkDI->getPosition().y + mChkDI->getSize().getHeight() + 8 ) ); SGParams.setSize( Sizei( Width, 400 ) ); SGParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; mSGCont = eeNew( UIComplexControl, ( SGParams ) ); - mSGCont->enabled( true ); - mSGCont->visible( true ); + mSGCont->setEnabled( true ); + mSGCont->setVisible( true ); Txt = mTheme->createTextBox( "Texture Atlases:", mSGCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, 0 ), TxtFlags ); - mTextureAtlasesList = mTheme->createDropDownList( mSGCont, Sizei( Width, 21 ), Vector2i( 0, Txt->position().y +Txt->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mTextureAtlasesList = mTheme->createDropDownList( mSGCont, Sizei( Width, 21 ), Vector2i( 0, Txt->getPosition().y +Txt->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mTextureAtlasesList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnTextureAtlasChange ) ); - mSubTextureList = mTheme->createListBox( mSGCont, Sizei( Width, 156 ), Vector2i( 0, mTextureAtlasesList->position().y + mTextureAtlasesList->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); - mSubTextureList->size( mSubTextureList->size().getWidth(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); + mSubTextureList = mTheme->createListBox( mSGCont, Sizei( Width, 156 ), Vector2i( 0, mTextureAtlasesList->getPosition().y + mTextureAtlasesList->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mSubTextureList->setSize( mSubTextureList->getSize().getWidth(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); mSubTextureList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnSubTextureChange ) ); - mGfxPreview = mTheme->createGfx( NULL, mSGCont, Sizei( Width, Width ), Vector2i( 0, mSubTextureList->position().y + mSubTextureList->size().getHeight() + 4 ), UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_AUTO_FIT ); - mGfxPreview->border( true ); - mGfxPreview->border()->color( ColorA( 0, 0, 0, 200 ) ); + mGfxPreview = mTheme->createGfx( NULL, mSGCont, Sizei( Width, Width ), Vector2i( 0, mSubTextureList->getPosition().y + mSubTextureList->getSize().getHeight() + 4 ), UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_AUTO_FIT ); + mGfxPreview->setBorderEnabled( true ); + mGfxPreview->getBorder()->setColor( ColorA( 0, 0, 0, 200 ) ); UIComplexControl::CreateParams DIParams; DIParams.setParent( mSubTextureCont ); @@ -325,18 +325,18 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) { DIParams.setSize( Sizei( Width, 400 ) ); DIParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; mDICont = eeNew( UIComplexControl, ( DIParams ) ); - mDICont->enabled( false ); - mDICont->visible( false ); + mDICont->setEnabled( false ); + mDICont->setVisible( false ); Txt = mTheme->createTextBox( "DataId String:", mDICont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, 0 ), TxtFlags ); - mDataIdInput = mTheme->createTextInput( mDICont, Sizei( Width / 4 * 3, 21 ), Vector2i( TAB_CONT_X_DIST + 8, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE ); + mDataIdInput = mTheme->createTextInput( mDICont, Sizei( Width / 4 * 3, 21 ), Vector2i( TAB_CONT_X_DIST + 8, Txt->getPosition().y + Txt->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE ); FillSGCombo(); } void MapEditor::CreateLighContainer() { - UIPushButton * NewLightBut = mTheme->createPushButton( mLightCont, Sizei( mLightCont->size().getWidth() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, 0 ) ); + UIPushButton * NewLightBut = mTheme->createPushButton( mLightCont, Sizei( mLightCont->getSize().getWidth() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, 0 ) ); NewLightBut->text( "New Light" ); NewLightBut->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::OnNewLight ) ); @@ -344,60 +344,60 @@ void MapEditor::CreateLighContainer() { UIComplexControl::CreateParams ComParams; ComParams.setParent( mLightCont ); - ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 4 ); + ComParams.setPos( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ); ComParams.setSize( 58, 64 ); - ComParams.Background.color( ColorA(255,255,255,255) ); - ComParams.Border.color( ColorA( 100, 100, 100, 200 ) ); + ComParams.Background.setColor( ColorA(255,255,255,255) ); + ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) ); ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER; mUIBaseColor = eeNew( UIComplexControl, ( ComParams ) ); - mUIBaseColor->visible( true ); - mUIBaseColor->enabled( true ); + mUIBaseColor->setVisible( true ); + mUIBaseColor->setEnabled( true ); - Txt = mTheme->createTextBox( "R:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "R:", mLightCont, Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth(), Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->maxValue( 255 ); mUIRedSlider->value( 255 ); mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnRedChange ) ); - mUIRedTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().getWidth() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIRedSlider->position().y + mUIRedSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIGreenSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIRedSlider->getPosition().y + mUIRedSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->maxValue( 255 ); mUIGreenSlider->value( 255 ); mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnGreenChange ) ); - mUIGreenTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().getWidth() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIBlueSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y + mUIGreenSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->maxValue( 255 ); mUIBlueSlider->value( 255 ); mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnBlueChange ) ); - mUIBlueTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().getWidth() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "Light Radius:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, mUIBlueTxt->position().y + mUIBlueTxt->size().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Light Radius:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, mUIBlueTxt->getPosition().y + mUIBlueTxt->getSize().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mLightRadius = mTheme->createSpinBox( mLightCont, Sizei( 100, 22 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED, 100, false ); + mLightRadius = mTheme->createSpinBox( mLightCont, Sizei( 100, 22 ), Vector2i( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED, 100, false ); mLightRadius->maxValue( 2000 ); mLightRadius->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnLightRadiusChangeVal ) ); - mLightTypeChk = mTheme->createCheckBox( mLightCont, Sizei(), Vector2i( mLightRadius->position().x, mLightRadius->position().y + mLightRadius->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mLightTypeChk = mTheme->createCheckBox( mLightCont, Sizei(), Vector2i( mLightRadius->getPosition().x, mLightRadius->getPosition().y + mLightRadius->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mLightTypeChk->text( "Isometric Light" ); mLightTypeChk->active( false ); mLightTypeChk->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnLightTypeChange ) ); } UISelectButton * MapEditor::AddObjContButton( String text, Uint32 mode ) { - UISelectButton * Button = mTheme->createSelectButton( mObjectCont, Sizei( mObjectCont->size().getWidth() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, mLastSelButtonY ) ); + UISelectButton * Button = mTheme->createSelectButton( mObjectCont, Sizei( mObjectCont->getSize().getWidth() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, mLastSelButtonY ) ); Button->text( text ); - Button->data( mode ); + Button->setData( mode ); Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::OnObjectModeSel ) ); - mLastSelButtonY += Button->size().getHeight() + 4; + mLastSelButtonY += Button->getSize().getHeight() + 4; mObjContButton.push_back( Button ); @@ -411,7 +411,7 @@ void MapEditor::CreateObjectsContainer() { AddObjContButton( "Insert Polygon", UIMap::INSERT_POLYGON ); UISelectButton * Button = AddObjContButton( "Insert Polyline", UIMap::INSERT_POLYLINE ); - Int32 nextY = Button->position().y + Button->size().getHeight() + 4; + Int32 nextY = Button->getPosition().y + Button->getSize().getHeight() + 4; Uint32 ChkFlags = UI_CONTROL_DEFAULT_ALIGN | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; @@ -433,7 +433,7 @@ void MapEditor::OnObjectModeSel( const UIEvent * Event ) { Button->select(); - mUIMap->EditingObjMode( (UIMap::EDITING_OBJ_MODE)Button->data() ); + mUIMap->EditingObjMode( (UIMap::EDITING_OBJ_MODE)Button->getData() ); } void MapEditor::CreateUIMap() { @@ -462,12 +462,12 @@ void MapEditor::CreateUIMap() { UIComplexControl::CreateParams Params; Params.setParent( mWinContainer ); Params.setPos( 0, 0 ); - Params.setSize( mWinContainer->size().getWidth() - 225 - ScrollV, mWinContainer->size().getHeight() - ScrollH ); + Params.setSize( mWinContainer->getSize().getWidth() - 225 - ScrollV, mWinContainer->getSize().getHeight() - ScrollH ); Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT; mUIMap = eeNew( UIMap, ( Params, mTheme ) ); - mUIMap->visible( true ); - mUIMap->enabled( true ); + mUIMap->setVisible( true ); + mUIMap->setEnabled( true ); CreateNewEmptyMap(); mUIMap->addEventListener( UIEvent::EventOnSizeChange, cb::Make1( this, &MapEditor::OnMapSizeChange ) ); mUIMap->addEventListener( UIEvent::EventMouseDown, cb::Make1( this, &MapEditor::OnMapMouseDown ) ); @@ -479,7 +479,7 @@ void MapEditor::CreateUIMap() { mUIMap->SetUpdateScrollCb( cb::Make0( this, &MapEditor::UpdateScroll ) ); mUIMap->SetTileBox( mTileBox ); - mMapHScroll = mTheme->createScrollBar( mWinContainer, Sizei( Params.Size.getWidth(), ScrollH ), Vector2i( 0, mWinContainer->size().getHeight() - ScrollH ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE ); + mMapHScroll = mTheme->createScrollBar( mWinContainer, Sizei( Params.Size.getWidth(), ScrollH ), Vector2i( 0, mWinContainer->getSize().getHeight() - ScrollH ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE ); mMapHScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnScrollMapH ) ); mMapVScroll = mTheme->createScrollBar( mWinContainer, Sizei( ScrollV, Params.Size.getHeight() ), Vector2i( Params.Size.getWidth() + ScrollV, 0 ), UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE , true ); @@ -545,14 +545,14 @@ void MapEditor::OnNewLight( const UIEvent * Event ) { if ( MEvent->getFlags() & EE_BUTTON_LMASK ) { Vector2i Pos = mUIMap->Map()->GetMouseMapPos(); - mUIMap->AddLight( eeNew( MapLight, ( mLightRadius->value(), Pos.x, Pos.y, mUIBaseColor->background()->color().toColor(), mLightTypeChk->active() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ) ) ); + mUIMap->AddLight( eeNew( MapLight, ( mLightRadius->value(), Pos.x, Pos.y, mUIBaseColor->getBackground()->getColor().toColor(), mLightTypeChk->active() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ) ) ); } } void MapEditor::OnRedChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Red = (Uint8)mUIRedSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->text( String::toStr( (Int32)mUIRedSlider->value() ) ); if ( NULL != mUIMap->GetSelectedLight() ) { @@ -563,9 +563,9 @@ void MapEditor::OnRedChange( const UIEvent * Event ) { } void MapEditor::OnGreenChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Green = (Uint8)mUIGreenSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->text( String::toStr( (Uint32)mUIGreenSlider->value() ) ); if ( NULL != mUIMap->GetSelectedLight() ) { @@ -576,9 +576,9 @@ void MapEditor::OnGreenChange( const UIEvent * Event ) { } void MapEditor::OnBlueChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Blue = (Uint8)mUIBlueSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->text( String::toStr( (Uint32)mUIBlueSlider->value() ) ); if ( NULL != mUIMap->GetSelectedLight() ) { @@ -590,15 +590,15 @@ void MapEditor::OnBlueChange( const UIEvent * Event ) { void MapEditor::ChkClickDI( const UIEvent * Event ) { if ( mChkDI->active() ) { - mSGCont->enabled( false ); - mSGCont->visible( false ); - mDICont->enabled( true ); - mDICont->visible( true ); + mSGCont->setEnabled( false ); + mSGCont->setVisible( false ); + mDICont->setEnabled( true ); + mDICont->setVisible( true ); } else { - mSGCont->enabled( true ); - mSGCont->visible( true ); - mDICont->enabled( false ); - mDICont->visible( false ); + mSGCont->setEnabled( true ); + mSGCont->setVisible( true ); + mDICont->setEnabled( false ); + mDICont->setVisible( false ); } } @@ -617,9 +617,9 @@ void MapEditor::UpdateGfx() { mGfxPreview->renderMode( RN_NORMAL ); if ( mChkRot90->active() ) - mGfxPreview->angle( 90 ); + mGfxPreview->setRotation( 90 ); else - mGfxPreview->angle( 0 ); + mGfxPreview->setRotation( 0 ); } void MapEditor::UpdateFlags() { @@ -779,7 +779,7 @@ void MapEditor::CreateNewMap() { } void MapEditor::CreateNewEmptyMap() { - mUIMap->Map()->Create( Sizei( 100, 100 ), 16, Sizei( 32, 32 ), MAP_EDITOR_DEFAULT_FLAGS | MAP_FLAG_LIGHTS_ENABLED, mUIMap->size() ); + mUIMap->Map()->Create( Sizei( 100, 100 ), 16, Sizei( 32, 32 ), MAP_EDITOR_DEFAULT_FLAGS | MAP_FLAG_LIGHTS_ENABLED, mUIMap->getSize() ); } void MapEditor::MapCreated() { @@ -854,7 +854,7 @@ void MapEditor::MapOpen( const UIEvent * Event ) { void MapEditor::OnMapLoad() { mCurLayer = NULL; - mUIMap->Map()->ViewSize( mUIMap->size() ); + mUIMap->Map()->ViewSize( mUIMap->getSize() ); MapCreated(); @@ -886,14 +886,14 @@ void MapEditor::FileMenuClick( const UIEvent * Event ) { } else if ( "Open..." == txt ) { UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS, "*.eem" ); - TGDialog->title( "Open Map" ); + TGDialog->setTitle( "Open Map" ); TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &MapEditor::MapOpen ) ); TGDialog->center(); TGDialog->show(); } else if ( "Save As..." == txt ) { UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*.eem" ); - TGDialog->title( "Save Map" ); + TGDialog->setTitle( "Save Map" ); TGDialog->addEventListener( UIEvent::EventSaveFile, cb::Make1( this, &MapEditor::MapSave ) ); TGDialog->center(); TGDialog->show(); @@ -904,7 +904,7 @@ void MapEditor::FileMenuClick( const UIEvent * Event ) { } else if ( "Close" == txt ) { UIMessageBox * MsgBox = mTheme->createMessageBox( MSGBOX_OKCANCEL, "Do you really want to close the current map?\nAll changes will be lost." ); MsgBox->addEventListener( UIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &MapEditor::OnMapClose ) ); - MsgBox->title( "Close Map?" ); + MsgBox->setTitle( "Close Map?" ); MsgBox->center(); MsgBox->show(); } else if ( "Quit" == txt ) { @@ -1019,7 +1019,7 @@ void MapEditor::MapMenuClick( const UIEvent * Event ) { } else if ( "Add External Texture Atlas..." == txt ) { UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS, std::string( "*" ) + EE_TEXTURE_ATLAS_EXTENSION ); - TGDialog->title( "Load Texture Atlas..." ); + TGDialog->setTitle( "Load Texture Atlas..." ); TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &MapEditor::TextureAtlasOpen ) ); TGDialog->center(); TGDialog->show(); @@ -1065,7 +1065,7 @@ void MapEditor::LayerMenuClick( const UIEvent * Event ) { UIMessageBox * MapEditor::CreateAlert( const String& title, const String& text ) { UIMessageBox * MsgBox = mTheme->createMessageBox( MSGBOX_OK, text ); - MsgBox->title( title ); + MsgBox->setTitle( title ); MsgBox->center(); MsgBox->show(); return MsgBox; @@ -1270,7 +1270,7 @@ GameObject * MapEditor::GetCurrentGOOver() { void MapEditor::OnMapMouseClick( const UIEvent * Event ) { const UIEventMouse * MEvent = reinterpret_cast ( Event ); - if ( mSubTextureCont->visible() ) { + if ( mSubTextureCont->isVisible() ) { if ( NULL == mCurLayer || NULL == mGfxPreview->subTexture() || UIManager::instance()->downControl() != mUIMap ) { if ( NULL == mCurLayer ) CreateNoLayerAlert( "No layers found" ); @@ -1315,7 +1315,7 @@ void MapEditor::OnMapMouseClick( const UIEvent * Event ) { void MapEditor::OnMapMouseDown( const UIEvent * Event ) { const UIEventMouse * MEvent = reinterpret_cast ( Event ); - if ( mSubTextureCont->visible() ) { + if ( mSubTextureCont->isVisible() ) { if ( NULL == mCurLayer || NULL == mGfxPreview->subTexture() || UIManager::instance()->downControl() != mUIMap ) return; diff --git a/src/eepp/gaming/mapeditor/maplayerproperties.cpp b/src/eepp/gaming/mapeditor/maplayerproperties.cpp index aead69eda..8439c3740 100644 --- a/src/eepp/gaming/mapeditor/maplayerproperties.cpp +++ b/src/eepp/gaming/mapeditor/maplayerproperties.cpp @@ -22,47 +22,47 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) mUIWindow = mUITheme->createWindow( NULL, Sizei( 500, 500 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 500, 500 ) ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapLayerProperties::WindowClose ) ); - mUIWindow->title( "Layer Properties" ); + mUIWindow->setTitle( "Layer Properties" ); Int32 InitialY = 16; Int32 DistFromTitle = 18; UITextBox * Txt = mUITheme->createTextBox( "Layer name:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); + mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); mUIInput->text( mLayer->Name() ); mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapLayerProperties::OKClick ) ); Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; - mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); - UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); + mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags ); + UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::CancelClick ) ); CancelButton->text( "Cancel" ); UIGenericGrid::CreateParams GridParams; GridParams.setParent( mUIWindow->getContainer() ); - GridParams.setPos( 50, TxtBox->position().y + TxtBox->size().getHeight() ); + GridParams.setPos( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() ); GridParams.setSize( 400, 350 ); GridParams.Flags = UI_AUTO_PADDING; GridParams.RowHeight = 24; GridParams.CollumnsCount = 5; mGenGrid = eeNew( UIGenericGrid, ( GridParams ) ); - mGenGrid->visible( true ); - mGenGrid->enabled( true ); + mGenGrid->setVisible( true ); + mGenGrid->setEnabled( true ); mGenGrid->collumnWidth( 0, 10 ); mGenGrid->collumnWidth( 1, 175 ); mGenGrid->collumnWidth( 2, 10 ); mGenGrid->collumnWidth( 3, 175 ); mGenGrid->collumnWidth( 4, 10 ); - Vector2i Pos( mGenGrid->position().x + mGenGrid->size().getWidth() + 10, mGenGrid->position().y ); + Vector2i Pos( mGenGrid->getPosition().x + mGenGrid->getSize().getWidth() + 10, mGenGrid->getPosition().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::AddCellClick ) ); @@ -70,7 +70,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) if ( NULL == AddButton->icon()->subTexture() ) AddButton->text( "+" ); - Pos.y += AddButton->size().getHeight() + 5; + Pos.y += AddButton->getSize().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::RemoveCellClick ) ); diff --git a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp index 038bb380e..4ab9fa13c 100644 --- a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp +++ b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp @@ -21,52 +21,52 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : mUIWindow = mUITheme->createWindow( NULL, Sizei( 500, 500 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 500, 500 ) ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapObjectProperties::WindowClose ) ); - mUIWindow->title( "Object Properties" ); + mUIWindow->setTitle( "Object Properties" ); Int32 InitialY = 16; Int32 DistFromTitle = 18; UITextBox * Txt = mUITheme->createTextBox( "Object name:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); + mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); mUIInput->text( mObj->Name() ); mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) ); UITextBox * Txt2 = mUITheme->createTextBox( "Object type:", mUIWindow->getContainer(), Sizei(), Vector2i( 50+192, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIInput2 = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt2->position().x + DistFromTitle, Txt2->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); + mUIInput2 = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt2->getPosition().x + DistFromTitle, Txt2->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); mUIInput2->text( mObj->TypeName() ); mUIInput2->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) ); Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; - mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); - UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); + mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags ); + UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::CancelClick ) ); CancelButton->text( "Cancel" ); UIGenericGrid::CreateParams GridParams; GridParams.setParent( mUIWindow->getContainer() ); - GridParams.setPos( 50, TxtBox->position().y + TxtBox->size().getHeight() ); + GridParams.setPos( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() ); GridParams.setSize( 400, 350 ); GridParams.Flags = UI_AUTO_PADDING; GridParams.RowHeight = 24; GridParams.CollumnsCount = 5; mGenGrid = eeNew( UIGenericGrid, ( GridParams ) ); - mGenGrid->visible( true ); - mGenGrid->enabled( true ); + mGenGrid->setVisible( true ); + mGenGrid->setEnabled( true ); mGenGrid->collumnWidth( 0, 10 ); mGenGrid->collumnWidth( 1, 175 ); mGenGrid->collumnWidth( 2, 10 ); mGenGrid->collumnWidth( 3, 175 ); mGenGrid->collumnWidth( 4, 10 ); - Vector2i Pos( mGenGrid->position().x + mGenGrid->size().getWidth() + 10, mGenGrid->position().y ); + Vector2i Pos( mGenGrid->getPosition().x + mGenGrid->getSize().getWidth() + 10, mGenGrid->getPosition().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::AddCellClick ) ); @@ -74,7 +74,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : if ( NULL == AddButton->icon()->subTexture() ) AddButton->text( "+" ); - Pos.y += AddButton->size().getHeight() + 5; + Pos.y += AddButton->getSize().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::RemoveCellClick ) ); diff --git a/src/eepp/gaming/mapeditor/tilemapproperties.cpp b/src/eepp/gaming/mapeditor/tilemapproperties.cpp index 8e89a0ad3..7c902a7da 100644 --- a/src/eepp/gaming/mapeditor/tilemapproperties.cpp +++ b/src/eepp/gaming/mapeditor/tilemapproperties.cpp @@ -20,7 +20,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : mUIWindow = mUITheme->createWindow( NULL, Sizei( 500, 500 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 500, 500 ) ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TileMapProperties::WindowClose ) ); - mUIWindow->title( "Map Properties" ); + mUIWindow->setTitle( "Map Properties" ); Uint32 DiffIfLights = 0; @@ -32,71 +32,71 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : UIComplexControl::CreateParams ComParams; ComParams.setParent( mUIWindow->getContainer() ); - ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 4 ); + ComParams.setPos( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ); ComParams.setSize( 64, 64 ); - ComParams.Background.color( mMap->BaseColor() ); - ComParams.Border.color( ColorA( 100, 100, 100, 200 ) ); + ComParams.Background.setColor( mMap->BaseColor() ); + ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) ); ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER; mUIBaseColor = eeNew( UIComplexControl, ( ComParams ) ); - mUIBaseColor->visible( true ); - mUIBaseColor->enabled( true ); + mUIBaseColor->setVisible( true ); + mUIBaseColor->setEnabled( true ); - Txt = mUITheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( Txt->position().x + Txt->size().getWidth() + 16, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mUITheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth() + 16, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->maxValue( 255 ); mUIRedSlider->value( mMap->BaseColor().r() ); mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnRedChange ) ); - mUIRedTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().getWidth() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mUITheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIRedSlider->position().y + mUIRedSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIGreenSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mUITheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIRedSlider->getPosition().y + mUIRedSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->maxValue( 255 ); mUIGreenSlider->value( mMap->BaseColor().g() ); mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnGreenChange ) ); - mUIGreenTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().getWidth() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mUITheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIBlueSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mUITheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y + mUIGreenSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->maxValue( 255 ); mUIBlueSlider->value( mMap->BaseColor().b() ); mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnBlueChange ) ); - mUIBlueTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().getWidth() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); } Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; UITextBox * TxtBox = mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, 10 + DiffIfLights ), TxtBoxFlags ); - mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i(50+192, TxtBox->position().y ), TxtBoxFlags ); + mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i(50+192, TxtBox->getPosition().y ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::CancelClick ) ); CancelButton->text( "Cancel" ); UIGenericGrid::CreateParams GridParams; GridParams.setParent( mUIWindow->getContainer() ); - GridParams.setPos( 50, TxtBox->position().y + 20 ); + GridParams.setPos( 50, TxtBox->getPosition().y + 20 ); GridParams.setSize( 400, 400 - DiffIfLights ); GridParams.Flags = UI_AUTO_PADDING; GridParams.RowHeight = 24; GridParams.CollumnsCount = 5; mGenGrid = eeNew( UIGenericGrid, ( GridParams ) ); - mGenGrid->visible( true ); - mGenGrid->enabled( true ); + mGenGrid->setVisible( true ); + mGenGrid->setEnabled( true ); mGenGrid->collumnWidth( 0, 10 ); mGenGrid->collumnWidth( 1, 175 ); mGenGrid->collumnWidth( 2, 10 ); mGenGrid->collumnWidth( 3, 175 ); mGenGrid->collumnWidth( 4, 10 ); - Vector2i Pos( mGenGrid->position().x + mGenGrid->size().getWidth() + 10, mGenGrid->position().y ); + Vector2i Pos( mGenGrid->getPosition().x + mGenGrid->getSize().getWidth() + 10, mGenGrid->getPosition().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::AddCellClick ) ); @@ -104,7 +104,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : if ( NULL == AddButton->icon()->subTexture() ) AddButton->text( "+" ); - Pos.y += AddButton->size().getHeight() + 5; + Pos.y += AddButton->getSize().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::RemoveCellClick ) ); @@ -122,9 +122,9 @@ TileMapProperties::~TileMapProperties() { } void TileMapProperties::OnRedChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Red = (Uint8)mUIRedSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->text( String::toStr( (Int32)mUIRedSlider->value() ) ); ColorA MapCol = mMap->BaseColor(); @@ -133,9 +133,9 @@ void TileMapProperties::OnRedChange( const UIEvent * Event ) { } void TileMapProperties::OnGreenChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Green = (Uint8)mUIGreenSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->text( String::toStr( (Uint32)mUIGreenSlider->value() ) ); ColorA MapCol = mMap->BaseColor(); @@ -144,9 +144,9 @@ void TileMapProperties::OnGreenChange( const UIEvent * Event ) { } void TileMapProperties::OnBlueChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Blue = (Uint8)mUIBlueSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->text( String::toStr( (Uint32)mUIBlueSlider->value() ) ); ColorA MapCol = mMap->BaseColor(); diff --git a/src/eepp/gaming/mapeditor/uigotypenew.cpp b/src/eepp/gaming/mapeditor/uigotypenew.cpp index 33a127f8f..be128e62c 100644 --- a/src/eepp/gaming/mapeditor/uigotypenew.cpp +++ b/src/eepp/gaming/mapeditor/uigotypenew.cpp @@ -16,23 +16,23 @@ UIGOTypeNew::UIGOTypeNew( cb::Callback2 Cb ) : mUIWindow = mUITheme->createWindow( NULL, Sizei( 278, 114 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 278, 114 ) ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIGOTypeNew::WindowClose ) ); - mUIWindow->title( "Add GameObject Type" ); + mUIWindow->setTitle( "Add GameObject Type" ); Int32 InitialY = 16; Int32 DistFromTitle = 18; UITextBox * Txt = mUITheme->createTextBox( "GameObject Type Name", mUIWindow->getContainer(), Sizei(), Vector2i( 16, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); + mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "add" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::OKClick ) ); mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIGOTypeNew::OKClick ) ); OKButton->text( "Add" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::CancelClick ) ); CancelButton->text( "Cancel" ); diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index 7aa38b2f6..fdc5c6c4d 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -35,7 +35,7 @@ UIMap::UIMap( const UIComplexControl::CreateParams& Params, UITheme * Theme, Til mMap->SetDrawCallback( cb::Make0( this, &UIMap::MapDraw ) ); mDragButton = EE_BUTTON_MMASK; - dragEnable( true ); + setDragEnabled( true ); updateScreenPos(); } @@ -576,7 +576,7 @@ void UIMap::CreateObjPopUpMenu() { if ( Menu->show() ) { Vector2i Pos = UIManager::instance()->getInput()->getMousePos(); UIMenu::FixMenuPos( Pos , Menu ); - Menu->position( Pos ); + Menu->setPosition( Pos ); } } diff --git a/src/eepp/gaming/mapeditor/uimap.hpp b/src/eepp/gaming/mapeditor/uimap.hpp index 944dc3074..bdeb37fb7 100644 --- a/src/eepp/gaming/mapeditor/uimap.hpp +++ b/src/eepp/gaming/mapeditor/uimap.hpp @@ -133,7 +133,7 @@ class EE_API UIMap : public UIComplexControl { virtual Uint32 onMessage( const UIMessage * Msg ); - virtual Uint32 onMouseMove( const Vector2i& position, const Uint32 flags ); + virtual Uint32 onMouseMove( const Vector2i& getPosition, const Uint32 flags ); virtual void onSizeChange(); @@ -141,7 +141,7 @@ class EE_API UIMap : public UIComplexControl { virtual void onAlphaChange(); - virtual Uint32 OnDrag( const Vector2i& position ); + virtual Uint32 OnDrag( const Vector2i& getPosition ); void ObjItemClick( const UIEvent * Event ); diff --git a/src/eepp/gaming/mapeditor/uimaplayernew.cpp b/src/eepp/gaming/mapeditor/uimaplayernew.cpp index 3589effc7..d4dfce7d6 100644 --- a/src/eepp/gaming/mapeditor/uimaplayernew.cpp +++ b/src/eepp/gaming/mapeditor/uimaplayernew.cpp @@ -20,26 +20,26 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapLayerNew::WindowClose ) ); if ( MAP_LAYER_TILED == mType ) - mUIWindow->title( "New Tile Layer" ); + mUIWindow->setTitle( "New Tile Layer" ); else if ( MAP_LAYER_OBJECT == mType ) - mUIWindow->title( "New Object Layer" ); + mUIWindow->setTitle( "New Object Layer" ); Int32 InitialY = 16; Int32 DistFromTitle = 18; UITextBox * Txt = mTheme->createTextBox( "Layer Name", mUIWindow->getContainer(), Sizei(), Vector2i( 16, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUILayerName = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); + mUILayerName = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); mUILayerName->text( "Layer " + String::toStr( mUIMap->Map()->LayerCount() + 1 ) ); UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "add" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::OKClick ) ); mUILayerName->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIMapLayerNew::OKClick ) ); OKButton->text( "Add" ); - UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::CancelClick ) ); CancelButton->text( "Cancel" ); diff --git a/src/eepp/gaming/mapeditor/uimapnew.cpp b/src/eepp/gaming/mapeditor/uimapnew.cpp index 01c49d6c9..30bf072fd 100644 --- a/src/eepp/gaming/mapeditor/uimapnew.cpp +++ b/src/eepp/gaming/mapeditor/uimapnew.cpp @@ -21,9 +21,9 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapNew::WindowClose ) ); if ( !mResizeMap ) { - mUIWindow->title( "New Map" ); + mUIWindow->setTitle( "New Map" ); } else { - mUIWindow->title( "Resize Map" ); + mUIWindow->setTitle( "Resize Map" ); } Int32 InitialY = 16; @@ -31,52 +31,52 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) UITextBox * Txt = mTheme->createTextBox( "Map Size", mUIWindow->getContainer(), Sizei(), Vector2i( 16, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "Width:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->createTextBox( "Width:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); + mUIMapWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth(), Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); mUIMapWidth->minValue(1); if ( ResizeMap ) { mUIMapWidth->value( mUIMap->Map()->Size().getWidth() ); } - Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); + mUIMapHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth(), Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); mUIMapHeight->minValue(1); if ( ResizeMap ) { mUIMapHeight->value( mUIMap->Map()->Size().getHeight() ); } - Txt = mTheme->createTextBox( "Tile Size", mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().getWidth() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Tile Size", mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "Width:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->createTextBox( "Width:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapTWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); + mUIMapTWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth(), Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); mUIMapTWidth->minValue(1); if ( ResizeMap ) { mUIMapTWidth->value( mUIMap->Map()->TileSize().getWidth() ); } - Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapTHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); + mUIMapTHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth(), Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); mUIMapTHeight->minValue(1); if ( ResizeMap ) { mUIMapTHeight->value( mUIMap->Map()->TileSize().getHeight() ); } - Txt = mTheme->createTextBox( "Max Layers", mUIWindow->getContainer(), Sizei(), Vector2i( 16, mUIMapTHeight->position().y + mUIMapTHeight->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Max Layers", mUIWindow->getContainer(), Sizei(), Vector2i( 16, mUIMapTHeight->getPosition().y + mUIMapTHeight->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIMapMaxLayers = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 8, false ); + mUIMapMaxLayers = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 8, false ); mUIMapMaxLayers->maxValue( 32 ); - Txt = mTheme->createTextBox( "Map Flags:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x, mUIMapMaxLayers->position().y + mUIMapMaxLayers->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Map Flags:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x, mUIMapMaxLayers->getPosition().y + mUIMapMaxLayers->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUILightsEnabled = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + Txt->size().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUILightsEnabled = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + Txt->getSize().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUILightsEnabled->text( "Lights Enabled" ); mUILightsEnabled->active( true ); @@ -84,7 +84,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUILightsEnabled->active( 0 != mUIMap->Map()->LightsEnabled() ); } - mUILightsByVertex = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().getWidth() / 2, mUILightsEnabled->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUILightsByVertex = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, mUILightsEnabled->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUILightsByVertex->text( "Lights By Vertex" ); mUILightsByVertex->active( true ); @@ -92,7 +92,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUILightsByVertex->active( 0 != mUIMap->Map()->LightsByVertex() ); } - mUIClampBorders = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x + DistFromTitle, mUILightsEnabled->position().y + mUILightsEnabled->size().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIClampBorders = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x + DistFromTitle, mUILightsEnabled->getPosition().y + mUILightsEnabled->getSize().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIClampBorders->text( "Clamp Borders" ); mUIClampBorders->active( true ); @@ -100,7 +100,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIClampBorders->active( 0 != mUIMap->Map()->ClampBorders() ); } - mUIClipArea = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().getWidth() / 2, mUIClampBorders->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIClipArea = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, mUIClampBorders->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIClipArea->text( "Clip View Area" ); mUIClipArea->active( true ); @@ -108,70 +108,70 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIClipArea->active( 0 != mUIMap->Map()->ClipedArea() ); } - Txt = mTheme->createTextBox( "Map Base Color:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x, mUIClipArea->position().y + mUIClipArea->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Map Base Color:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x, mUIClipArea->getPosition().y + mUIClipArea->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); UIComplexControl::CreateParams ComParams; ComParams.setParent( mUIWindow->getContainer() ); - ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 4 ); + ComParams.setPos( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ); ComParams.setSize( 64, 64 ); - ComParams.Background.color( ColorA( 255, 255, 255, 255 ) ); + ComParams.Background.setColor( ColorA( 255, 255, 255, 255 ) ); if ( ResizeMap ) { - ComParams.Background.color( mUIMap->Map()->BaseColor() ); + ComParams.Background.setColor( mUIMap->Map()->BaseColor() ); } - ComParams.Border.color( ColorA( 100, 100, 100, 200 ) ); + ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) ); ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER; mUIBaseColor = eeNew( UIComplexControl, ( ComParams ) ); - mUIBaseColor->visible( true ); - mUIBaseColor->enabled( true ); + mUIBaseColor->setVisible( true ); + mUIBaseColor->setEnabled( true ); - Txt = mTheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( Txt->position().x + Txt->size().getWidth() + 16, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIRedSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth() + 16, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->maxValue( 255 ); mUIRedSlider->value( 255 ); mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnRedChange ) ); - mUIRedTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().getWidth() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIRedSlider->value( mUIMap->Map()->BaseColor().r() ); } - Txt = mTheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIRedSlider->position().y + mUIRedSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIRedSlider->getPosition().y + mUIRedSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIGreenSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIGreenSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->maxValue( 255 ); mUIGreenSlider->value( 255 ); mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnGreenChange ) ); - mUIGreenTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().getWidth() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIGreenSlider->value( mUIMap->Map()->BaseColor().g() ); } - Txt = mTheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y + mUIGreenSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIBlueSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIBlueSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->maxValue( 255 ); mUIBlueSlider->value( 255 ); mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnBlueChange ) ); - mUIBlueTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().getWidth() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIBlueSlider->value( mUIMap->Map()->BaseColor().b() ); } UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::CancelClick ) ); CancelButton->text( "Cancel" ); @@ -183,23 +183,23 @@ UIMapNew::~UIMapNew() { } void UIMapNew::OnRedChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Red = (Uint8)mUIRedSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->text( String::toStr( (Int32)mUIRedSlider->value() ) ); } void UIMapNew::OnGreenChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Green = (Uint8)mUIGreenSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->text( String::toStr( (Uint32)mUIGreenSlider->value() ) ); } void UIMapNew::OnBlueChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->background()->color(); + ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Blue = (Uint8)mUIBlueSlider->value(); - mUIBaseColor->background()->color( Col ); + mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->text( String::toStr( (Uint32)mUIBlueSlider->value() ) ); } @@ -227,7 +227,7 @@ void UIMapNew::OKClick( const UIEvent * Event ) { if ( w > 0 && h > 0 && tw > 0 && th > 0 && ml > 0 ) { if ( !mResizeMap ) { mUIMap->Map()->Create( Sizei( w, h ), ml, Sizei( tw, th ), Flags, mUIMap->Map()->ViewSize() ); - mUIMap->Map()->BaseColor( mUIBaseColor->background()->color() ); + mUIMap->Map()->BaseColor( mUIBaseColor->getBackground()->getColor() ); } else { std::string oldPath( mUIMap->Map()->Path() ); std::string mapPath( Sys::getTempPath() + "temp.eepp.map.eem" ); diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index 03dd9ba99..ef8003ee9 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -39,85 +39,85 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos Uint32 Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED; Uint32 InitY = 230; - createTextBox( Vector2i( mUIContainer->size().getWidth() - 205, 30 ), "SubTexture List:" ); + createTextBox( Vector2i( mUIContainer->getSize().getWidth() - 205, 30 ), "SubTexture List:" ); - mSubTextureList = mTheme->createListBox( mUIContainer, Sizei( 200, 156 ), Vector2i( mUIContainer->size().getWidth() - 205, 50 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); - mSubTextureList->size( mSubTextureList->size().getWidth(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); + mSubTextureList = mTheme->createListBox( mUIContainer, Sizei( 200, 156 ), Vector2i( mUIContainer->getSize().getWidth() - 205, 50 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mSubTextureList->setSize( mSubTextureList->getSize().getWidth(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); mSubTextureList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &TextureAtlasEditor::onSubTextureChange ) ); - createTextBox( Vector2i( mUIContainer->size().getWidth() - 205, InitY ), "Current SubTexture:" ); + createTextBox( Vector2i( mUIContainer->getSize().getWidth() - 205, InitY ), "Current SubTexture:" ); InitY +=30; mSpinOffX = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinOffX->minValue( -32000 ); mSpinOffX->maxValue( 32000 ); - mSpinOffX->position( mUIContainer->size().getWidth() - mSpinOffX->size().getWidth() - 10, InitY ); + mSpinOffX->setPosition( mUIContainer->getSize().getWidth() - mSpinOffX->getSize().getWidth() - 10, InitY ); mSpinOffX->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffXChange ) ); TxtBox = createTextBox( Vector2i(), "Offset X:" ); - TxtBox->position( mSpinOffX->position().x - 10 - TxtBox->size().getWidth(), InitY ); + TxtBox->setPosition( mSpinOffX->getPosition().x - 10 - TxtBox->getSize().getWidth(), InitY ); InitY +=30; mSpinOffY = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinOffY->minValue( -32000 ); mSpinOffY->maxValue( 32000 ); - mSpinOffY->position( mUIContainer->size().getWidth() - mSpinOffY->size().getWidth() - 10, InitY ); + mSpinOffY->setPosition( mUIContainer->getSize().getWidth() - mSpinOffY->getSize().getWidth() - 10, InitY ); mSpinOffY->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffYChange ) ); TxtBox = createTextBox( Vector2i(), "Offset Y:" ); - TxtBox->position( mSpinOffY->position().x - 10 - TxtBox->size().getWidth(), InitY ); + TxtBox->setPosition( mSpinOffY->getPosition().x - 10 - TxtBox->getSize().getWidth(), InitY ); InitY +=30; mSpinDestW = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestW->maxValue( 32000 ); - mSpinDestW->position( mUIContainer->size().getWidth() - mSpinDestW->size().getWidth() - 10, InitY ); + mSpinDestW->setPosition( mUIContainer->getSize().getWidth() - mSpinDestW->getSize().getWidth() - 10, InitY ); mSpinDestW->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestWChange ) ); TxtBox = createTextBox( Vector2i(), "Dest. Width:" ); - TxtBox->position( mSpinDestW->position().x - 10 - TxtBox->size().getWidth(), InitY ); + TxtBox->setPosition( mSpinDestW->getPosition().x - 10 - TxtBox->getSize().getWidth(), InitY ); InitY +=30; mSpinDestH = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestH->maxValue( 32000 ); - mSpinDestH->position( mUIContainer->size().getWidth() - mSpinDestH->size().getWidth() - 10, InitY ); + mSpinDestH->setPosition( mUIContainer->getSize().getWidth() - mSpinDestH->getSize().getWidth() - 10, InitY ); mSpinDestH->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestHChange ) ); TxtBox = createTextBox( Vector2i(), "Dest. Height:" ); - TxtBox->position( mSpinDestH->position().x - 10 - TxtBox->size().getWidth(), InitY ); + TxtBox->setPosition( mSpinDestH->getPosition().x - 10 - TxtBox->getSize().getWidth(), InitY ); Uint32 ButFlags = UI_CONTROL_ALIGN_CENTER | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_AUTO_SIZE; - UIPushButton * ResetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( mUIContainer->size().getWidth() - 120 - 5 , mSpinDestH->position().y + mSpinDestH->size().getHeight() + 8 ), ButFlags ); + UIPushButton * ResetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( mUIContainer->getSize().getWidth() - 120 - 5 , mSpinDestH->getPosition().y + mSpinDestH->getSize().getHeight() + 8 ), ButFlags ); ResetButton->text( "Reset Dest. Size" ); ResetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onResetDestSize ) ); - UIPushButton * ResetOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetButton->position().x, ResetButton->position().y + ResetButton->size().getHeight() + 8 ), ButFlags ); + UIPushButton * ResetOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetButton->getPosition().x, ResetButton->getPosition().y + ResetButton->getSize().getHeight() + 8 ), ButFlags ); ResetOffsetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onResetOffset ) ); ResetOffsetButton->text( "Reset Offset" ); - UIPushButton * CenterOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetOffsetButton->position().x, ResetOffsetButton->position().y + ResetOffsetButton->size().getHeight() + 8 ), ButFlags ); + UIPushButton * CenterOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetOffsetButton->getPosition().x, ResetOffsetButton->getPosition().y + ResetOffsetButton->getSize().getHeight() + 8 ), ButFlags ); CenterOffsetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onCenterOffset ) ); CenterOffsetButton->text( "Centered Offset" ); - UIPushButton * HBOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( CenterOffsetButton->position().x, CenterOffsetButton->position().y + CenterOffsetButton->size().getHeight() + 8 ), ButFlags ); + UIPushButton * HBOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( CenterOffsetButton->getPosition().x, CenterOffsetButton->getPosition().y + CenterOffsetButton->getSize().getHeight() + 8 ), ButFlags ); HBOffsetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onHBOffset ) ); HBOffsetButton->text( "Half-Bottom Offset" ); - mUIWindow->title( "Texture Atlas Editor" ); + mUIWindow->setTitle( "Texture Atlas Editor" ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasEditor::windowClose ) ); createTGEditor(); UIComplexControl::CreateParams Params; Params.setParent( mUIContainer ); - Params.setPos( 0, mWinMenu->size().getHeight() ); + Params.setPos( 0, mWinMenu->getSize().getHeight() ); Params.setSize( 800, 600 ); - Params.Background.color( ColorA( 0, 0, 0, 50 ) ); + Params.Background.setColor( ColorA( 0, 0, 0, 50 ) ); Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT | UI_CLIP_ENABLE | UI_BORDER | UI_FILL_BACKGROUND; mSubTextureEditor = eeNew( TextureAtlasSubTextureEditor, ( Params, this ) ); - mSubTextureEditor->visible( true ); - mSubTextureEditor->enabled( true ); + mSubTextureEditor->setVisible( true ); + mSubTextureEditor->setEnabled( true ); mTGEU = eeNew( UITGEUpdater, ( UITGEUpdater::CreateParams(), this ) ); } @@ -242,7 +242,7 @@ void TextureAtlasEditor::fileMenuClick( const UIEvent * Event ) { } else if ( "Open..." == txt ) { UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS, std::string( "*" ) + EE_TEXTURE_ATLAS_EXTENSION ); - TGDialog->title( "Open Texture Atlas" ); + TGDialog->setTitle( "Open Texture Atlas" ); TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &TextureAtlasEditor::openTextureAtlas ) ); TGDialog->center(); TGDialog->show(); @@ -254,7 +254,7 @@ void TextureAtlasEditor::fileMenuClick( const UIEvent * Event ) { if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) { UIMessageBox * MsgBox = mTheme->createMessageBox( MSGBOX_OKCANCEL, "Do you really want to close the current texture atlas?\nAll changes will be lost." ); MsgBox->addEventListener( UIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &TextureAtlasEditor::onTextureAtlasClose ) ); - MsgBox->title( "Close Texture Atlas?" ); + MsgBox->setTitle( "Close Texture Atlas?" ); MsgBox->center(); MsgBox->show(); } else { diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index 3b8fad481..2b50ddde0 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -18,9 +18,9 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mUIWindow = mTheme->createWindow( NULL, Sizei( 378, 244 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL ); mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasNew::windowClose ) ); - mUIWindow->title( "New Texture Atlas" ); + mUIWindow->setTitle( "New Texture Atlas" ); - Int32 PosX = mUIWindow->getContainer()->size().getWidth() - 110; + Int32 PosX = mUIWindow->getContainer()->getSize().getWidth() - 110; createTxtBox( Vector2i( 10, 20 ), "Save File Format:" ); mSaveFileType = mTheme->createDropDownList( mUIWindow->getContainer(), Sizei( 100, 22 ), Vector2i( PosX, 20 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE ); @@ -57,19 +57,19 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mPixelSpace = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 100, 22 ), Vector2i( PosX, 110 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED, 0, false ); createTxtBox( Vector2i( 10, 140 ), "Texture Atlas Folder Path:" ); - mTGPath = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( mUIWindow->getContainer()->size().getWidth() - 60, 22 ), Vector2i( 10, 160 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE , false, 512 ); + mTGPath = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( mUIWindow->getContainer()->getSize().getWidth() - 60, 22 ), Vector2i( 10, 160 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE , false, 512 ); mTGPath->allowEditing( false ); - mSetPathButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 32, 32 ), Vector2i( mUIWindow->getContainer()->size().getWidth() - 10 - 32, 160 ) ); + mSetPathButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 32, 32 ), Vector2i( mUIWindow->getContainer()->getSize().getWidth() - 10 - 32, 160 ) ); mSetPathButton->text( "..." ); mSetPathButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::onDialogFolderSelect ) ); UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); + OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::okClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::cancelClick ) ); CancelButton->text( "Cancel" ); @@ -93,7 +93,7 @@ void TextureAtlasNew::okClick( const UIEvent * Event ) { UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*." + ext ); - TGDialog->title( "Save Texture Atlas" ); + TGDialog->setTitle( "Save Texture Atlas" ); TGDialog->addEventListener( UIEvent::EventSaveFile, cb::Make1( this, &TextureAtlasNew::textureAtlasSave ) ); TGDialog->center(); TGDialog->show(); @@ -161,7 +161,7 @@ void TextureAtlasNew::onDialogFolderSelect( const UIEvent * Event ) { if ( MouseEvent->getFlags() & EE_BUTTON_LMASK ) { UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_ALLOW_FOLDER_SELECT, "*" ); - TGDialog->title( "Create Texture Atlas ( Select Folder Containing Textures )" ); + TGDialog->setTitle( "Create Texture Atlas ( Select Folder Containing Textures )" ); TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &TextureAtlasNew::onSelectFolder ) ); TGDialog->center(); TGDialog->show(); @@ -201,13 +201,13 @@ void TextureAtlasNew::onSelectFolder( const UIEvent * Event ) { mTGPath->text( FPath ); } else { MsgBox = mTheme->createMessageBox( MSGBOX_OK, "The folder must contain at least one image!" ); - MsgBox->title( "Error" ); + MsgBox->setTitle( "Error" ); MsgBox->center(); MsgBox->show(); } } else { MsgBox = mTheme->createMessageBox( MSGBOX_OK, "You must select a folder!" ); - MsgBox->title( "Error" ); + MsgBox->setTitle( "Error" ); MsgBox->center(); MsgBox->show(); } diff --git a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp index 7517797e2..4b4a9d486 100644 --- a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp @@ -22,9 +22,9 @@ TextureAtlasSubTextureEditor::TextureAtlasSubTextureEditor( const UIComplexContr DragParams.setParent( this ); DragParams.setSize( 500000, 500000 ); mDrag = eeNew( UIDragable, ( DragParams ) ); - mDrag->enabled( true ); - mDrag->visible( true ); - mDrag->dragEnable( true ); + mDrag->setEnabled( true ); + mDrag->setVisible( true ); + mDrag->setDragEnabled( true ); getCenter(); } @@ -42,12 +42,12 @@ void TextureAtlasSubTextureEditor::draw() { } void TextureAtlasSubTextureEditor::update() { - Vector2i Pos = mDrag->position(); + Vector2i Pos = mDrag->getPosition(); UIComplexControl::update(); - if ( NULL != mGfx->subTexture() && mDrag->dragEnable() && mDrag->dragging() && Pos != mDrag->position() ) { - Vector2i Diff = -( Pos - mDrag->position() ); + if ( NULL != mGfx->subTexture() && mDrag->isDragEnabled() && mDrag->isDragging() && Pos != mDrag->getPosition() ) { + Vector2i Diff = -( Pos - mDrag->getPosition() ); mGfx->subTexture()->setOffset( Vector2i( mGfx->subTexture()->getOffset().x + Diff.x, mGfx->subTexture()->getOffset().y + Diff.y ) ); @@ -55,7 +55,7 @@ void TextureAtlasSubTextureEditor::update() { mEditor->spinOffY()->value( mGfx->subTexture()->getOffset().y ); } - mGfx->position( mUICenter ); + mGfx->setPosition( mUICenter ); } void TextureAtlasSubTextureEditor::onSizeChange() { diff --git a/src/eepp/ui/uibackground.cpp b/src/eepp/ui/uibackground.cpp index 29b0eaa36..eb2dc83f6 100644 --- a/src/eepp/ui/uibackground.cpp +++ b/src/eepp/ui/uibackground.cpp @@ -11,10 +11,10 @@ UIBackground::UIBackground() : UIBackground::UIBackground( const UIBackground& Back ) : mBlendMode( ALPHA_NORMAL ), - mCorners( Back.corners() ) + mCorners( Back.getCorners() ) { UIBackground * b = const_cast ( &Back ); // cheating - mColor = b->colors(); + mColor = b->getColors(); } UIBackground::UIBackground( const ColorA& Color, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode ) : @@ -28,22 +28,22 @@ UIBackground::UIBackground( const ColorA& TopLeftColor, const ColorA& BottomLeft mBlendMode( BlendMode ), mCorners( Corners ) { - colors( TopLeftColor, BottomLeftColor, BottomRightColor, TopRightColor ); + setColors( TopLeftColor, BottomLeftColor, BottomRightColor, TopRightColor ); } -ColorA& UIBackground::color( const unsigned int& index ) { +ColorA& UIBackground::getColor( const unsigned int& index ) { if ( index < mColor.size() ) return mColor[ index ]; return mColor[ 0 ]; } -void UIBackground::colorsTo( const ColorA& Color ) { +void UIBackground::setColorsTo( const ColorA& Color ) { for ( unsigned int i = 0; i < mColor.size(); i++ ) mColor[i] = Color; } -void UIBackground::colors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ) { +void UIBackground::setColors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ) { mColor[0] = TopLeftColor; if ( mColor.size() < 2 ) @@ -62,27 +62,27 @@ void UIBackground::colors( const ColorA& TopLeftColor, const ColorA& BottomLeftC mColor[3] = TopRightColor; } -const std::vector& UIBackground::colors() { +const std::vector& UIBackground::getColors() { return mColor; } -void UIBackground::color( const ColorA& Col ) { +void UIBackground::setColor( const ColorA& Col ) { mColor[0] = Col; } -const EE_BLEND_MODE& UIBackground::blend() const { +const EE_BLEND_MODE& UIBackground::getBlendMode() const { return mBlendMode; } -void UIBackground::blend( const EE_BLEND_MODE& blend ) { +void UIBackground::setBlendMode( const EE_BLEND_MODE& blend ) { mBlendMode = blend; } -const unsigned int& UIBackground::corners() const { +const unsigned int& UIBackground::getCorners() const { return mCorners; } -void UIBackground::corners( const unsigned int& corners ) { +void UIBackground::setCorners( const unsigned int& corners ) { mCorners = corners; } diff --git a/src/eepp/ui/uiborder.cpp b/src/eepp/ui/uiborder.cpp index 2a6e765e7..0126ad3de 100644 --- a/src/eepp/ui/uiborder.cpp +++ b/src/eepp/ui/uiborder.cpp @@ -3,21 +3,21 @@ namespace EE { namespace UI { UIBorder::UIBorder() : mColor( 0xFF404040 ), mWidth( 1 ) {} -UIBorder::UIBorder( const UIBorder& border ) : mColor( border.color() ), mWidth( border.width() ) {} +UIBorder::UIBorder( const UIBorder& border ) : mColor( border.getColor() ), mWidth( border.getWidth() ) {} -const ColorA& UIBorder::color() const { +const ColorA& UIBorder::getColor() const { return mColor; } -void UIBorder::color( const ColorA& Col ) { +void UIBorder::setColor( const ColorA& Col ) { mColor = Col; } -const unsigned int& UIBorder::width() const { +const unsigned int& UIBorder::getWidth() const { return mWidth; } -void UIBorder::width( const unsigned int& width ) { +void UIBorder::setWidth( const unsigned int& width ) { mWidth = width; } diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index ed2595034..c029c736e 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -16,12 +16,12 @@ UICheckBox::UICheckBox( const UITextBox::CreateParams& Params ) : ButtonParams.Size = Sizei( 16, 16 ); mActiveButton = eeNew( UIControlAnim, ( ButtonParams ) ); - mActiveButton->visible( false ); - mActiveButton->enabled( true ); + mActiveButton->setVisible( false ); + mActiveButton->setEnabled( true ); mInactiveButton = eeNew( UIControlAnim, ( ButtonParams ) ); - mInactiveButton->visible( true ); - mInactiveButton->enabled( true ); + mInactiveButton->setVisible( true ); + mInactiveButton->setEnabled( true ); padding( Recti(0,0,0,0) ); @@ -56,7 +56,7 @@ void UICheckBox::doAftersetTheme() { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mActiveButton->size( tSubTexture->getRealSize() ); + mActiveButton->setSize( tSubTexture->getRealSize() ); mActiveButton->centerVertical(); } } @@ -67,7 +67,7 @@ void UICheckBox::doAftersetTheme() { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mInactiveButton->size( tSubTexture->getRealSize() ); + mInactiveButton->setSize( tSubTexture->getRealSize() ); mInactiveButton->centerVertical(); } } @@ -82,7 +82,7 @@ void UICheckBox::autoSize() { mActiveButton->centerVertical(); mInactiveButton->centerVertical(); - mSize.setWidth( (int)mTextCache->getTextWidth() + mActiveButton->size().getWidth() ); + mSize.setWidth( (int)mTextCache->getTextWidth() + mActiveButton->getSize().getWidth() ); } } @@ -117,13 +117,13 @@ void UICheckBox::switchState() { void UICheckBox::active( const bool& active ) { if ( !active ) { - mActiveButton->visible( false ); - mInactiveButton->visible( true ); + mActiveButton->setVisible( false ); + mInactiveButton->setVisible( true ); mActive = false; } else { - mActiveButton->visible( true ); - mInactiveButton->visible( false ); + mActiveButton->setVisible( true ); + mInactiveButton->setVisible( false ); mActive = true; } @@ -141,7 +141,7 @@ const bool& UICheckBox::isActive() const { void UICheckBox::padding( const Recti& padding ) { mPadding = padding; - mPadding.Left = mPadding.Left + mActiveButton->size().getWidth(); + mPadding.Left = mPadding.Left + mActiveButton->getSize().getWidth(); } UIControlAnim * UICheckBox::activeButton() const { @@ -169,8 +169,8 @@ Uint32 UICheckBox::onKeyDown( const UIEventKey& Event ) { void UICheckBox::onAlphaChange() { UITextBox::onAlphaChange(); - mActiveButton->alpha( mAlpha ); - mInactiveButton->alpha( mAlpha ); + mActiveButton->setAlpha( mAlpha ); + mInactiveButton->setAlpha( mAlpha ); } }} diff --git a/src/eepp/ui/uicombobox.cpp b/src/eepp/ui/uicombobox.cpp index a6ff30ed8..7fcbb0a19 100644 --- a/src/eepp/ui/uicombobox.cpp +++ b/src/eepp/ui/uicombobox.cpp @@ -56,8 +56,8 @@ void UIComboBox::createButton() { Params.Size = Sizei( btnWidth, mSize.getHeight() ); Params.setPos( mSize.getWidth() - btnWidth, 0 ); mButton = eeNew( UIControl, ( Params ) ); - mButton->visible( true ); - mButton->enabled( true ); + mButton->setVisible( true ); + mButton->setEnabled( true ); mButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIComboBox::onButtonClick ) ); mButton->addEventListener( UIEvent::EventMouseEnter, cb::Make1( this, &UIComboBox::onButtonEnter ) ); mButton->addEventListener( UIEvent::EventMouseExit, cb::Make1( this, &UIComboBox::onButtonExit ) ); @@ -83,7 +83,7 @@ Uint32 UIComboBox::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) { if ( Flags & EE_BUTTON_LMASK ) { UITextInput::onMouseClick( Pos, Flags ); - if ( mListBox->visible() ) { + if ( mListBox->isVisible() ) { hide(); } } diff --git a/src/eepp/ui/uicommondialog.cpp b/src/eepp/ui/uicommondialog.cpp index 443999fb6..0b945b844 100644 --- a/src/eepp/ui/uicommondialog.cpp +++ b/src/eepp/ui/uicommondialog.cpp @@ -28,9 +28,9 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : mMinWindowSize.setHeight( CDLG_MIN_HEIGHT ); if ( allowFolderSelect() ) { - title( "Select a folder" ); + setTitle( "Select a folder" ); } else { - title( "Select a file" ); + setTitle( "Select a file" ); } UITextBox::CreateParams TxtBoxParams; @@ -38,26 +38,26 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : TxtBoxParams.setPos( 6, 13 ); TxtBoxParams.Flags |= UI_AUTO_SIZE; UITextBox * TBox = eeNew( UITextBox, ( TxtBoxParams ) ); - TBox->visible( true ); - TBox->enabled( false ); + TBox->setVisible( true ); + TBox->setEnabled( false ); TBox->text( "Look in:" ); UIPushButton::CreateParams ButtonParams; ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE; ButtonParams.setParent( getContainer() ); - ButtonParams.setPos( getContainer()->size().getWidth() - 86, getContainer()->size().getHeight() - 24 ); + ButtonParams.setPos( getContainer()->getSize().getWidth() - 86, getContainer()->getSize().getHeight() - 24 ); ButtonParams.setSize( 80, 22 ); mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) ); - mButtonCancel->visible( true ); - mButtonCancel->enabled( true ); + mButtonCancel->setVisible( true ); + mButtonCancel->setEnabled( true ); mButtonCancel->text( "Cancel" ); - mButtonCancel->position( Vector2i( mButtonCancel->position().x, getContainer()->size().getHeight() - mButtonCancel->size().getHeight() - 2 ) ); + mButtonCancel->setPosition( Vector2i( mButtonCancel->getPosition().x, getContainer()->getSize().getHeight() - mButtonCancel->getSize().getHeight() - 2 ) ); mButtonCancel->updateAnchorsDistances(); - ButtonParams.setPos( mButtonCancel->position().x, mButtonCancel->position().y - mButtonCancel->size().getHeight() ); + ButtonParams.setPos( mButtonCancel->getPosition().x, mButtonCancel->getPosition().y - mButtonCancel->getSize().getHeight() ); mButtonOpen = eeNew( UIPushButton, ( ButtonParams ) ); - mButtonOpen->visible( true ); - mButtonOpen->enabled( true ); + mButtonOpen->setVisible( true ); + mButtonOpen->setEnabled( true ); if ( isSaveDialog() ) mButtonOpen->text( "Save" ); @@ -68,30 +68,30 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : TInputParams.setParent( getContainer() ); TInputParams.Flags = UI_AUTO_PADDING | UI_CLIP_ENABLE | UI_ANCHOR_RIGHT | UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_VALIGN_CENTER | UI_TEXT_SELECTION_ENABLED; TInputParams.setPos( 70, 6 ); - TInputParams.setSize( getContainer()->size().getWidth() - TInputParams.Pos.x - 42, 22 ); + TInputParams.setSize( getContainer()->getSize().getWidth() - TInputParams.Pos.x - 42, 22 ); mPath = eeNew( UITextInput, ( TInputParams ) ); mPath->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressEnter ) ); - mPath->visible( true ); - mPath->enabled( true ); + mPath->setVisible( true ); + mPath->setEnabled( true ); mPath->text( mCurPath ); ButtonParams.setPos( TInputParams.Pos.x + TInputParams.Size.getWidth() + 6, TInputParams.Pos.y ); ButtonParams.setSize( 24, 22 ); ButtonParams.Flags |= UI_ANCHOR_TOP; mButtonUp = eeNew( UIPushButton, ( ButtonParams ) ); - mButtonUp->visible( true ); - mButtonUp->enabled( true ); + mButtonUp->setVisible( true ); + mButtonUp->setEnabled( true ); mButtonUp->text( "Up" ); UIListBox::CreateParams LBParams; LBParams.setParent( getContainer() ); - LBParams.setPos( 6, mButtonUp->position().y + mButtonUp->size().getHeight() + 4 ); - LBParams.Size = Sizei( getContainer()->size().getWidth() - 12, - getContainer()->size().getHeight() - - mButtonUp->size().getHeight() - - mButtonUp->position().y - - mButtonOpen->size().getHeight() - - mButtonCancel->size().getHeight() - + LBParams.setPos( 6, mButtonUp->getPosition().y + mButtonUp->getSize().getHeight() + 4 ); + LBParams.Size = Sizei( getContainer()->getSize().getWidth() - 12, + getContainer()->getSize().getHeight() - + mButtonUp->getSize().getHeight() - + mButtonUp->getPosition().y - + mButtonOpen->getSize().getHeight() - + mButtonCancel->getSize().getHeight() - 8 ); @@ -105,40 +105,40 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : } mList = eeNew( UIListBox, ( LBParams ) ); - mList->visible( true ); - mList->enabled( true ); + mList->setVisible( true ); + mList->setEnabled( true ); - TxtBoxParams.setPos( 6, getContainer()->size().getHeight() - 54 ); + TxtBoxParams.setPos( 6, getContainer()->getSize().getHeight() - 54 ); TxtBoxParams.setSize( 74, 19 ); TxtBoxParams.Flags = UI_ANCHOR_LEFT | UI_VALIGN_CENTER; TBox = eeNew( UITextBox, ( TxtBoxParams ) ); - TBox->visible( true ); - TBox->enabled( false ); + TBox->setVisible( true ); + TBox->setEnabled( false ); TBox->text( "File Name:" ); - TxtBoxParams.setPos( TBox->position().x, TBox->position().y + TBox->size().getHeight()+ 6 ); + TxtBoxParams.setPos( TBox->getPosition().x, TBox->getPosition().y + TBox->getSize().getHeight()+ 6 ); UITextBox * TBox2 = eeNew( UITextBox, ( TxtBoxParams ) ); - TBox2->visible( true ); - TBox2->enabled( false ); + TBox2->setVisible( true ); + TBox2->setEnabled( false ); TBox2->text( "Files of type:" ); TInputParams.Flags &= ~UI_ANCHOR_TOP; - TInputParams.setPos( TBox->position().x + TBox->size().getWidth(), TBox->position().y ); - TInputParams.setSize( getContainer()->size().getWidth() - mButtonOpen->size().getWidth() - TInputParams.Pos.x - 20, TInputParams.Size.getHeight() ); + TInputParams.setPos( TBox->getPosition().x + TBox->getSize().getWidth(), TBox->getPosition().y ); + TInputParams.setSize( getContainer()->getSize().getWidth() - mButtonOpen->getSize().getWidth() - TInputParams.Pos.x - 20, TInputParams.Size.getHeight() ); mFile = eeNew( UITextInput, ( TInputParams ) ); - mFile->visible( true ); - mFile->enabled( true ); + mFile->setVisible( true ); + mFile->setEnabled( true ); mFile->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressFileEnter ) ); UIDropDownList::CreateParams DDLParams; DDLParams.setParent( getContainer() ); - DDLParams.setPos( TBox2->position().x + TBox2->size().getWidth(), TBox2->position().y ); - DDLParams.setSize( getContainer()->size().getWidth() - mButtonCancel->size().getWidth() - DDLParams.Pos.x - 20, 22 ); + DDLParams.setPos( TBox2->getPosition().x + TBox2->getSize().getWidth(), TBox2->getPosition().y ); + DDLParams.setSize( getContainer()->getSize().getWidth() - mButtonCancel->getSize().getWidth() - DDLParams.Pos.x - 20, 22 ); DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_AUTO_SIZE; DDLParams.PopUpToMainControl = true; mFiletype = eeNew( UIDropDownList, ( DDLParams ) ); - mFiletype->visible( true ); - mFiletype->enabled( true ); + mFiletype->setVisible( true ); + mFiletype->setEnabled( true ); mFiletype->getListBox()->addListBoxItem( Params.DefaultFilePattern ); mFiletype->getListBox()->setSelected(0); @@ -220,7 +220,7 @@ void UICommonDialog::refreshFolder() { mList->addListBoxItems( files ); if ( NULL != mList->verticalScrollBar() ) { - mList->verticalScrollBar()->clickStep( 1.f / ( ( mList->count() * mList->rowHeight() ) / (Float)mList->size().getHeight() ) ); + mList->verticalScrollBar()->clickStep( 1.f / ( ( mList->count() * mList->rowHeight() ) / (Float)mList->getSize().getHeight() ) ); } } @@ -237,18 +237,18 @@ void UICommonDialog::onPressFileEnter( const UIEvent * Event ) { } void UICommonDialog::disableButtons() { - mButtonOpen->enabled( false ); - mButtonCancel->enabled( false ); - mButtonUp->enabled( false ); + mButtonOpen->setEnabled( false ); + mButtonCancel->setEnabled( false ); + mButtonUp->setEnabled( false ); if ( NULL != mButtonClose ) - mButtonClose->enabled( false ); + mButtonClose->setEnabled( false ); if ( NULL != mButtonMinimize ) - mButtonMinimize->enabled( false ); + mButtonMinimize->setEnabled( false ); if ( NULL != mButtonMaximize ) - mButtonMaximize->enabled( false ); + mButtonMaximize->setEnabled( false ); } Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) { diff --git a/src/eepp/ui/uicomplexcontrol.cpp b/src/eepp/ui/uicomplexcontrol.cpp index 4dce0d3a6..b793b5d8f 100644 --- a/src/eepp/ui/uicomplexcontrol.cpp +++ b/src/eepp/ui/uicomplexcontrol.cpp @@ -12,7 +12,7 @@ UIComplexControl::UIComplexControl( const UIComplexControl::CreateParams& Params updateAnchorsDistances(); - tooltipText( Params.TooltipText ); + setTooltipText( Params.TooltipText ); } UIComplexControl::~UIComplexControl() { @@ -29,7 +29,7 @@ bool UIComplexControl::isType( const Uint32& type ) const { void UIComplexControl::updateAnchorsDistances() { if ( NULL != mParentCtrl ) { - mDistToBorder = Recti( mPos.x, mPos.y, mParentCtrl->size().x - ( mPos.x + mSize.x ), mParentCtrl->size().y - ( mPos.y + mSize.y ) ); + mDistToBorder = Recti( mPos.x, mPos.y, mParentCtrl->getSize().x - ( mPos.x + mSize.x ), mParentCtrl->getSize().y - ( mPos.y + mSize.y ) ); } } @@ -40,17 +40,17 @@ void UIComplexControl::update() { Pos.x += UIThemeManager::instance()->cursorSize().x; Pos.y += UIThemeManager::instance()->cursorSize().y; - if ( Pos.x + mTooltip->size().getWidth() > UIManager::instance()->mainControl()->size().getWidth() ) { - Pos.x = UIManager::instance()->getMousePos().x - mTooltip->size().getWidth(); + if ( Pos.x + mTooltip->getSize().getWidth() > UIManager::instance()->mainControl()->getSize().getWidth() ) { + Pos.x = UIManager::instance()->getMousePos().x - mTooltip->getSize().getWidth(); } - if ( Pos.y + mTooltip->size().getHeight() > UIManager::instance()->mainControl()->size().getHeight() ) { - Pos.y = UIManager::instance()->getMousePos().y - mTooltip->size().getHeight(); + if ( Pos.y + mTooltip->getSize().getHeight() > UIManager::instance()->mainControl()->getSize().getHeight() ) { + Pos.y = UIManager::instance()->getMousePos().y - mTooltip->getSize().getHeight(); } if ( Time::Zero == UIThemeManager::instance()->tooltipTimeToShow() ) { - if ( !mTooltip->visible() || UIThemeManager::instance()->tooltipFollowMouse() ) - mTooltip->position( Pos ); + if ( !mTooltip->isVisible() || UIThemeManager::instance()->tooltipFollowMouse() ) + mTooltip->setPosition( Pos ); mTooltip->show(); } else { @@ -60,7 +60,7 @@ void UIComplexControl::update() { if ( mTooltip->tooltipTime() >= UIThemeManager::instance()->tooltipTimeToShow() ) { if ( mTooltip->tooltipTime().asMilliseconds() != -1.f ) { - mTooltip->position( Pos ); + mTooltip->setPosition( Pos ); mTooltip->show(); @@ -70,12 +70,12 @@ void UIComplexControl::update() { } if ( UIThemeManager::instance()->tooltipFollowMouse() ) { - mTooltip->position( Pos ); + mTooltip->setPosition( Pos ); } } else { mTooltip->tooltipTime( Milliseconds( 0.f ) ); - if ( mTooltip->visible() ) + if ( mTooltip->isVisible() ) mTooltip->hide(); } } @@ -91,8 +91,8 @@ void UIComplexControl::createTooltip() { if ( NULL != tTheme ) { mTooltip = tTheme->createTooltip( this, UIManager::instance()->mainControl() ); - mTooltip->visible( false ); - mTooltip->enabled( false ); + mTooltip->setVisible( false ); + mTooltip->setEnabled( false ); } else { UITooltip::CreateParams Params; Params.setParent( UIManager::instance()->mainControl() ); @@ -101,7 +101,7 @@ void UIComplexControl::createTooltip() { } } -void UIComplexControl::tooltipText( const String& Text ) { +void UIComplexControl::setTooltipText( const String& Text ) { if ( NULL == mTooltip ) { // If the tooltip wasn't created it will avoid to create a new one if the string is "" if ( Text.size() ) { createTooltip(); @@ -113,7 +113,7 @@ void UIComplexControl::tooltipText( const String& Text ) { } } -String UIComplexControl::tooltipText() { +String UIComplexControl::getTooltipText() { if ( NULL != mTooltip ) return mTooltip->text(); @@ -124,7 +124,7 @@ void UIComplexControl::tooltipRemove() { mTooltip = NULL; } -void UIComplexControl::size( const Sizei &Size ) { +void UIComplexControl::setSize( const Sizei &Size ) { Sizei s( Size ); if ( s.x < mMinControlSize.x ) @@ -133,15 +133,15 @@ void UIComplexControl::size( const Sizei &Size ) { if ( s.y < mMinControlSize.y ) s.y = mMinControlSize.y; - UIControlAnim::size( s ); + UIControlAnim::setSize( s ); } -void UIComplexControl::size( const Int32& Width, const Int32& Height ) { - UIControlAnim::size( Width, Height ); +void UIComplexControl::setSize( const Int32& Width, const Int32& Height ) { + UIControlAnim::setSize( Width, Height ); } -const Sizei& UIComplexControl::size() { - return UIControlAnim::size(); +const Sizei& UIComplexControl::getSize() { + return UIControlAnim::getSize(); } void UIComplexControl::onParentSizeChange( const Vector2i& SizeChange ) { @@ -150,12 +150,12 @@ void UIComplexControl::onParentSizeChange( const Vector2i& SizeChange ) { if ( mFlags & UI_ANCHOR_LEFT ) { // Nothing ? } else { - position( mPos.x += SizeChange.x, mPos.y ); + setPosition( mPos.x += SizeChange.x, mPos.y ); } if ( mFlags & UI_ANCHOR_RIGHT ) { if ( NULL != mParentCtrl ) { - newSize.x = mParentCtrl->size().getWidth() - mPos.x - mDistToBorder.Right; + newSize.x = mParentCtrl->getSize().getWidth() - mPos.x - mDistToBorder.Right; if ( newSize.x < mMinControlSize.getWidth() ) newSize.x = mMinControlSize.getWidth(); @@ -165,12 +165,12 @@ void UIComplexControl::onParentSizeChange( const Vector2i& SizeChange ) { if ( mFlags & UI_ANCHOR_TOP ) { // Nothing ? } else { - position( mPos.x, mPos.y += SizeChange.y ); + setPosition( mPos.x, mPos.y += SizeChange.y ); } if ( mFlags & UI_ANCHOR_BOTTOM ) { if ( NULL != mParentCtrl ) { - newSize.y = mParentCtrl->size().y - mPos.y - mDistToBorder.Bottom; + newSize.y = mParentCtrl->getSize().y - mPos.y - mDistToBorder.Bottom; if ( newSize.y < mMinControlSize.getHeight() ) newSize.y = mMinControlSize.getHeight(); @@ -178,7 +178,7 @@ void UIComplexControl::onParentSizeChange( const Vector2i& SizeChange ) { } if ( newSize != mSize ) - size( newSize ); + setSize( newSize ); UIControlAnim::onParentSizeChange( SizeChange ); } diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 4d6186eb8..12da906af 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -69,12 +69,12 @@ void UIControl::screenToControl( Vector2i& Pos ) const { Pos.y -= mPos.y; while ( NULL != ParentLoop ) { - const Vector2i& ParentPos = ParentLoop->position(); + const Vector2i& ParentPos = ParentLoop->getPosition(); Pos.x -= ParentPos.x; Pos.y -= ParentPos.y; - ParentLoop = ParentLoop->parent(); + ParentLoop = ParentLoop->getParent(); } } @@ -82,12 +82,12 @@ void UIControl::controlToScreen( Vector2i& Pos ) const { UIControl * ParentLoop = mParentCtrl; while ( NULL != ParentLoop ) { - const Vector2i& ParentPos = ParentLoop->position(); + const Vector2i& ParentPos = ParentLoop->getPosition(); Pos.x += ParentPos.x; Pos.y += ParentPos.y; - ParentLoop = ParentLoop->parent(); + ParentLoop = ParentLoop->getParent(); } } @@ -106,7 +106,7 @@ void UIControl::messagePost( const UIMessage * Msg ) { if ( Ctrl->onMessage( Msg ) ) break; - Ctrl = Ctrl->parent(); + Ctrl = Ctrl->getParent(); } } @@ -118,23 +118,23 @@ bool UIControl::isInside( const Vector2i& Pos ) const { return ( Pos.x >= 0 && Pos.y >= 0 && Pos.x < mSize.getWidth() && Pos.y < mSize.getHeight() ); } -void UIControl::position( const Vector2i& Pos ) { +void UIControl::setPosition( const Vector2i& Pos ) { mPos = Pos; onPositionChange(); } -void UIControl::position( const Int32& x, const Int32& y ) { +void UIControl::setPosition( const Int32& x, const Int32& y ) { mPos = Vector2i( x, y ); onPositionChange(); } -const Vector2i& UIControl::position() const { +const Vector2i& UIControl::getPosition() const { return mPos; } -void UIControl::size( const Sizei& Size ) { +void UIControl::setSize( const Sizei& Size ) { if ( Size != mSize ) { Vector2i sizeChange( Size.x - mSize.x, Size.y - mSize.y ); @@ -148,24 +148,24 @@ void UIControl::size( const Sizei& Size ) { } } -void UIControl::size( const Int32& Width, const Int32& Height ) { - size( Sizei( Width, Height ) ); +void UIControl::setSize( const Int32& Width, const Int32& Height ) { + setSize( Sizei( Width, Height ) ); } Recti UIControl::getRect() const { return Recti( mPos, mSize ); } -const Sizei& UIControl::size() { +const Sizei& UIControl::getSize() { return mSize; } -void UIControl::visible( const bool& visible ) { +void UIControl::setVisible( const bool& visible ) { mVisible = visible; onVisibleChange(); } -bool UIControl::visible() const { +bool UIControl::isVisible() const { return mVisible; } @@ -173,12 +173,12 @@ bool UIControl::isHided() const { return !mVisible; } -void UIControl::enabled( const bool& enabled ) { +void UIControl::setEnabled( const bool& enabled ) { mEnabled = enabled; onEnabledChange(); } -bool UIControl::enabled() const { +bool UIControl::isEnabled() const { return mEnabled; } @@ -186,11 +186,11 @@ bool UIControl::isDisabled() const { return !mEnabled; } -UIControl * UIControl::parent() const { +UIControl * UIControl::getParent() const { return mParentCtrl; } -void UIControl::parent( UIControl * parent ) { +void UIControl::setParent( UIControl * parent ) { if ( parent == mParentCtrl ) return; @@ -206,30 +206,30 @@ void UIControl::parent( UIControl * parent ) { bool UIControl::isParentOf( UIControl * Ctrl ) { eeASSERT( NULL != Ctrl ); - UIControl * tParent = Ctrl->parent(); + UIControl * tParent = Ctrl->getParent(); while ( NULL != tParent ) { if ( this == tParent ) return true; - tParent = tParent->parent(); + tParent = tParent->getParent(); } return false; } void UIControl::centerHorizontal() { - UIControl * Ctrl = parent(); + UIControl * Ctrl = getParent(); if ( NULL != Ctrl ) - position( Vector2i( ( Ctrl->size().getWidth() / 2 ) - ( mSize.getWidth() / 2 ), mPos.y ) ); + setPosition( Vector2i( ( Ctrl->getSize().getWidth() / 2 ) - ( mSize.getWidth() / 2 ), mPos.y ) ); } void UIControl::centerVertical(){ - UIControl * Ctrl = parent(); + UIControl * Ctrl = getParent(); if ( NULL != Ctrl ) - position( Vector2i( mPos.x, ( Ctrl->size().getHeight() / 2 ) - ( mSize.getHeight() / 2 ) ) ); + setPosition( Vector2i( mPos.x, ( Ctrl->getSize().getHeight() / 2 ) - ( mSize.getHeight() / 2 ) ) ); } void UIControl::center() { @@ -257,7 +257,7 @@ void UIControl::draw() { if ( UIManager::instance()->highlightFocus() && UIManager::instance()->focusControl() == this ) { Primitives P; P.setFillMode( DRAW_LINE ); - P.setBlendMode( blend() ); + P.setBlendMode( getBlendMode() ); P.setColor( UIManager::instance()->highlightFocusColor() ); P.drawRectangle( getRectf() ); } @@ -265,7 +265,7 @@ void UIControl::draw() { if ( UIManager::instance()->highlightOver() && UIManager::instance()->overControl() == this ) { Primitives P; P.setFillMode( DRAW_LINE ); - P.setBlendMode( blend() ); + P.setBlendMode( getBlendMode() ); P.setColor( UIManager::instance()->highlightOverColor() ); P.drawRectangle( getRectf() ); } @@ -399,23 +399,23 @@ void UIControl::onClose() { sendCommonEvent( UIEvent::EventOnClose ); } -Uint32 UIControl::hAlign() const { +Uint32 UIControl::getHorizontalAlign() const { return mFlags & UI_HALIGN_MASK; } -void UIControl::hAlign( Uint32 halign ) { +void UIControl::setHorizontalAlign( Uint32 halign ) { mFlags |= halign & UI_HALIGN_MASK; } -Uint32 UIControl::vAlign() const { +Uint32 UIControl::getVerticalAlign() const { return mFlags & UI_VALIGN_MASK; } -void UIControl::vAlign( Uint32 valign ) { +void UIControl::setVerticalAlign( Uint32 valign ) { mFlags |= valign & UI_VALIGN_MASK; } -void UIControl::fillBackground( bool enabled ) { +void UIControl::setBackgroundFillEnabled( bool enabled ) { writeFlag( UI_FILL_BACKGROUND, enabled ? 1 : 0 ); if ( enabled && NULL == mBackground ) { @@ -423,7 +423,7 @@ void UIControl::fillBackground( bool enabled ) { } } -void UIControl::border( bool enabled ) { +void UIControl::setBorderEnabled( bool enabled ) { writeFlag( UI_BORDER, enabled ? 1 : 0 ); if ( enabled && NULL == mBorder ) { @@ -435,42 +435,42 @@ void UIControl::border( bool enabled ) { } } -UIControl * UIControl::nextGet() const { +UIControl * UIControl::getNextControl() const { return mNext; } -UIControl * UIControl::prevGet() const { +UIControl * UIControl::getPrevControl() const { return mPrev; } -UIControl * UIControl::nextGetLoop() const { +UIControl * UIControl::getNextControlLoop() const { if ( NULL == mNext ) - return parent()->childGetFirst(); + return getParent()->getFirstChild(); else return mNext; } -void UIControl::data(const UintPtr& data ) { +void UIControl::setData(const UintPtr& data ) { mData = data; } -const UintPtr& UIControl::data() const { +const UintPtr& UIControl::getData() const { return mData; } -const Uint32& UIControl::flags() const { +const Uint32& UIControl::getFlags() const { return mFlags; } -void UIControl::flags( const Uint32& flags ) { +void UIControl::setFlags( const Uint32& flags ) { mFlags |= flags; } -void UIControl::blend( const EE_BLEND_MODE& blend ) { +void UIControl::setBlendMode( const EE_BLEND_MODE& blend ) { mBlend = static_cast ( blend ); } -EE_BLEND_MODE UIControl::blend() { +EE_BLEND_MODE UIControl::getBlendMode() { return static_cast ( mBlend ); } @@ -487,7 +487,7 @@ void UIControl::toBack() { } } -void UIControl::toPos( const Uint32& Pos ) { +void UIControl::toPosition( const Uint32& Pos ) { if ( NULL != mParentCtrl ) { mParentCtrl->childAddAt( this, Pos ); } @@ -498,7 +498,7 @@ void UIControl::onVisibleChange() { } void UIControl::onEnabledChange() { - if ( !enabled() && NULL != UIManager::instance()->focusControl() ) { + if ( !isEnabled() && NULL != UIManager::instance()->focusControl() ) { if ( isChild( UIManager::instance()->focusControl() ) ) { UIManager::instance()->focusControl( NULL ); } @@ -528,18 +528,18 @@ Rectf UIControl::getRectf() { void UIControl::backgroundDraw() { Primitives P; Rectf R = getRectf(); - P.setBlendMode( mBackground->blend() ); - P.setColor( mBackground->color() ); + P.setBlendMode( mBackground->getBlendMode() ); + P.setColor( mBackground->getColor() ); - if ( 4 == mBackground->colors().size() ) { - if ( mBackground->corners() ) { - P.drawRoundedRectangle( R, mBackground->colors()[0], mBackground->colors()[1], mBackground->colors()[2], mBackground->colors()[3], mBackground->corners() ); + if ( 4 == mBackground->getColors().size() ) { + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( R, mBackground->getColors()[0], mBackground->getColors()[1], mBackground->getColors()[2], mBackground->getColors()[3], mBackground->getCorners() ); } else { - P.drawRectangle( R, mBackground->colors()[0], mBackground->colors()[1], mBackground->colors()[2], mBackground->colors()[3] ); + P.drawRectangle( R, mBackground->getColors()[0], mBackground->getColors()[1], mBackground->getColors()[2], mBackground->getColors()[3] ); } } else { - if ( mBackground->corners() ) { - P.drawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->corners() ); + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->getCorners() ); } else { P.drawRectangle( R ); } @@ -549,33 +549,33 @@ void UIControl::backgroundDraw() { void UIControl::borderDraw() { Primitives P; P.setFillMode( DRAW_LINE ); - P.setBlendMode( blend() ); - P.setLineWidth( (Float)mBorder->width() ); - P.setColor( mBorder->color() ); + P.setBlendMode( getBlendMode() ); + P.setLineWidth( (Float)mBorder->getWidth() ); + P.setColor( mBorder->getColor() ); //! @TODO: Check why was this +0.1f -0.1f? if ( mFlags & UI_CLIP_ENABLE ) { Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.getWidth() - 0.1f, (Float)mSize.getHeight() - 0.1f ) ); - if ( mBackground->corners() ) { - P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->corners() ); + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->getCorners() ); } else { P.drawRectangle( R ); } } else { - if ( mBackground->corners() ) { - P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->corners() ); + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->getCorners() ); } else { P.drawRectangle( getRectf() ); } } } -const Uint32& UIControl::controlFlags() const { +const Uint32& UIControl::getControlFlags() const { return mControlFlags; } -void UIControl::controlFlags( const Uint32& Flags ) { +void UIControl::setControlFlags( const Uint32& Flags ) { mControlFlags = Flags; } @@ -650,7 +650,7 @@ void UIControl::childAddAt( UIControl * ChildCtrl, Uint32 Pos ) { UIControl * ChildLoop = mChild; - ChildCtrl->parent( this ); + ChildCtrl->setParent( this ); childRemove( ChildCtrl ); ChildCtrl->mParentCtrl = this; @@ -790,11 +790,11 @@ UIControl * UIControl::childNext( UIControl * Ctrl, bool Loop ) const { return Ctrl->mNext; } -UIControl * UIControl::childGetFirst() const { +UIControl * UIControl::getFirstChild() const { return mChild; } -UIControl * UIControl::childGetLast() const { +UIControl * UIControl::getLastChild() const { return mChildLast; } @@ -835,12 +835,12 @@ UIControl * UIControl::childGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel for( UIControl * pLoop = mChild; NULL != pLoop && NULL == Ctrl; pLoop = pLoop->mNext ) { - if ( !pLoop->visible() ) + if ( !pLoop->isVisible() ) continue; if ( pLoop->getRect().contains( CtrlPos ) ) { if ( RecursiveLevel ) - Ctrl = childGetAt( CtrlPos - pLoop->position(), RecursiveLevel - 1 ); + Ctrl = childGetAt( CtrlPos - pLoop->getPosition(), RecursiveLevel - 1 ); if ( NULL == Ctrl ) Ctrl = pLoop; @@ -877,17 +877,17 @@ const Vector2f& UIControl::getPolygonCenter() const { void UIControl::updateQuad() { mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mSize.getWidth(), mScreenPosf.y + mSize.getHeight() ) ); - UIControl * tParent = parent(); + UIControl * tParent = getParent(); while ( tParent ) { if ( tParent->isAnimated() ) { UIControlAnim * tP = reinterpret_cast ( tParent ); - mPoly.rotate( tP->angle(), tP->rotationCenter() ); - mPoly.scale( tP->scale(), tP->scaleCenter() ); + mPoly.rotate( tP->getRotation(), tP->getRotationCenter() ); + mPoly.scale( tP->getScale(), tP->getScaleCenter() ); } - tParent = tParent->parent(); + tParent = tParent->getParent(); }; } @@ -930,11 +930,11 @@ void UIControl::sendEvent( const UIEvent * Event ) { } } -UIBackground * UIControl::background() { +UIBackground * UIControl::getBackground() { return mBackground; } -UIBorder * UIControl::border() { +UIBorder * UIControl::getBorder() { return mBorder; } @@ -1180,16 +1180,16 @@ Sizei UIControl::getSkinSize() { return getSkinSize( getSkin(), UISkinState::StateNormal ); } -UIControl * UIControl::nextComplexControl() { +UIControl * UIControl::getNextComplexControl() { UIControl * Found = NULL; UIControl * ChildLoop = mChild; while( NULL != ChildLoop ) { - if ( ChildLoop->visible() && ChildLoop->enabled() ) { + if ( ChildLoop->isVisible() && ChildLoop->isEnabled() ) { if ( ChildLoop->isComplex() ) { return ChildLoop; } else { - Found = ChildLoop->nextComplexControl(); + Found = ChildLoop->getNextComplexControl(); if ( NULL != Found ) { return Found; @@ -1201,20 +1201,20 @@ UIControl * UIControl::nextComplexControl() { } if ( NULL != mNext ) { - if ( mNext->visible() && mNext->enabled() && mNext->isComplex() ) { + if ( mNext->isVisible() && mNext->isEnabled() && mNext->isComplex() ) { return mNext; } else { - return mNext->nextComplexControl(); + return mNext->getNextComplexControl(); } } else { ChildLoop = mParentCtrl; while ( NULL != ChildLoop ) { if ( NULL != ChildLoop->mNext ) { - if ( ChildLoop->mNext->visible() && ChildLoop->mNext->enabled() && ChildLoop->mNext->isComplex() ) { + if ( ChildLoop->mNext->isVisible() && ChildLoop->mNext->isEnabled() && ChildLoop->mNext->isComplex() ) { return ChildLoop->mNext; } else { - return ChildLoop->mNext->nextComplexControl(); + return ChildLoop->mNext->getNextComplexControl(); } } @@ -1237,7 +1237,7 @@ void UIControl::worldToControl( Vector2i& pos ) const { while ( NULL != ParentLoop ) { parents.push_front( ParentLoop ); - ParentLoop = ParentLoop->parent(); + ParentLoop = ParentLoop->getParent(); } parents.push_back( const_cast( reinterpret_cast( this ) ) ); @@ -1250,18 +1250,18 @@ void UIControl::worldToControl( Vector2i& pos ) const { Vector2f pPos ( tParent->mPos.x * scale.x , tParent->mPos.y * scale.y ); Vector2f Center; - if ( NULL != tP && 1.f != tP->scale() ) { - Center = tP->scaleOriginPoint() * scale; - scale *= tP->scale(); + if ( NULL != tP && 1.f != tP->getScale() ) { + Center = tP->getScaleOriginPoint() * scale; + scale *= tP->getScale(); pPos.scale( scale, pPos + Center ); } Pos -= pPos; - if ( NULL != tP && 0.f != tP->angle() ) { - Center = tP->rotationOriginPoint() * scale; - Pos.rotate( -tP->angle(), Center ); + if ( NULL != tP && 0.f != tP->getRotation() ) { + Center = tP->getRotationOriginPoint() * scale; + Pos.rotate( -tP->getRotation(), Center ); } } @@ -1277,7 +1277,7 @@ void UIControl::controlToWorld( Vector2i& pos ) const { while ( NULL != ParentLoop ) { parents.push_back( ParentLoop ); - ParentLoop = ParentLoop->parent(); + ParentLoop = ParentLoop->getParent(); } parents.push_front( const_cast( reinterpret_cast( this ) ) ); @@ -1293,8 +1293,8 @@ void UIControl::controlToWorld( Vector2i& pos ) const { Vector2f CenterAngle( pPos.x + tP->mRotationOriginPoint.x, pPos.y + tP->mRotationOriginPoint.y ); Vector2f CenterScale( pPos.x + tP->mScaleOriginPoint.x, pPos.y + tP->mScaleOriginPoint.y ); - Pos.rotate( tP->angle(), CenterAngle ); - Pos.scale( tP->scale(), CenterScale ); + Pos.rotate( tP->getRotation(), CenterAngle ); + Pos.scale( tP->getScale(), CenterScale ); } } diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index 9b39ce48c..1fc21a513 100644 --- a/src/eepp/ui/uicontrolanim.cpp +++ b/src/eepp/ui/uicontrolanim.cpp @@ -50,7 +50,7 @@ void UIControlAnim::draw() { if ( UIManager::instance()->highlightFocus() && UIManager::instance()->focusControl() == this ) { Primitives P; P.setFillMode( DRAW_LINE ); - P.setBlendMode( blend() ); + P.setBlendMode( getBlendMode() ); P.setColor( UIManager::instance()->highlightFocusColor() ); P.drawRectangle( getRectf() ); } @@ -58,27 +58,27 @@ void UIControlAnim::draw() { if ( UIManager::instance()->highlightOver() && UIManager::instance()->overControl() == this ) { Primitives P; P.setFillMode( DRAW_LINE ); - P.setBlendMode( blend() ); + P.setBlendMode( getBlendMode() ); P.setColor( UIManager::instance()->highlightOverColor() ); P.drawRectangle( getRectf() ); } } } -const Float& UIControlAnim::angle() const { +const Float& UIControlAnim::getRotation() const { return mAngle; } -const OriginPoint& UIControlAnim::rotationOriginPoint() const { +const OriginPoint& UIControlAnim::getRotationOriginPoint() const { return mRotationOriginPoint; } -void UIControlAnim::rotationOriginPoint( const OriginPoint & center ) { +void UIControlAnim::setRotationOriginPoint( const OriginPoint & center ) { mRotationOriginPoint = center; updateOriginPoint(); } -Vector2f UIControlAnim::rotationCenter() { +Vector2f UIControlAnim::getRotationCenter() { switch ( mRotationOriginPoint.OriginType ) { case OriginPoint::OriginCenter: return mCenter; case OriginPoint::OriginTopLeft: return mScreenPosf; @@ -86,36 +86,36 @@ Vector2f UIControlAnim::rotationCenter() { } } -void UIControlAnim::angle( const Float& angle ) { +void UIControlAnim::setRotation( const Float& angle ) { mAngle = angle; onAngleChange(); } -void UIControlAnim::angle( const Float& angle , const OriginPoint & center ) { +void UIControlAnim::setRotation( const Float& angle , const OriginPoint & center ) { mRotationOriginPoint = center; updateOriginPoint(); - this->angle( angle ); + this->setRotation( angle ); } -const Vector2f& UIControlAnim::scale() const { +const Vector2f& UIControlAnim::getScale() const { return mScale; } -void UIControlAnim::scale( const Vector2f & scale ) { +void UIControlAnim::setScale( const Vector2f & scale ) { mScale = scale; onScaleChange(); } -const OriginPoint& UIControlAnim::scaleOriginPoint() const { +const OriginPoint& UIControlAnim::getScaleOriginPoint() const { return mScaleOriginPoint; } -void UIControlAnim::scaleOriginPoint( const OriginPoint & center ) { +void UIControlAnim::setScaleOriginPoint( const OriginPoint & center ) { mScaleOriginPoint = center; updateOriginPoint(); } -Vector2f UIControlAnim::scaleCenter() { +Vector2f UIControlAnim::getScaleCenter() { switch ( mScaleOriginPoint.OriginType ) { case OriginPoint::OriginCenter: return mCenter; case OriginPoint::OriginTopLeft: return mScreenPosf; @@ -123,26 +123,26 @@ Vector2f UIControlAnim::scaleCenter() { } } -void UIControlAnim::scale( const Vector2f& scale, const OriginPoint& center ) { +void UIControlAnim::setScale( const Vector2f& scale, const OriginPoint& center ) { mScaleOriginPoint = center; updateOriginPoint(); - this->scale( scale ); + this->setScale( scale ); } -void UIControlAnim::scale( const Float& scale, const OriginPoint& center ) { - this->scale( Vector2f( scale, scale ), center ); +void UIControlAnim::setScale( const Float& scale, const OriginPoint& center ) { + this->setScale( Vector2f( scale, scale ), center ); } -const Float& UIControlAnim::alpha() const { +const Float& UIControlAnim::getAlpha() const { return mAlpha; } -void UIControlAnim::alpha( const Float& alpha ) { +void UIControlAnim::setAlpha( const Float& alpha ) { mAlpha = alpha; onAlphaChange(); } -void UIControlAnim::alphaChilds( const Float &alpha ) { +void UIControlAnim::setChildsAlpha( const Float &alpha ) { UIControlAnim * AnimChild; UIControl * CurChild = mChild; @@ -150,11 +150,11 @@ void UIControlAnim::alphaChilds( const Float &alpha ) { if ( CurChild->isAnimated() ) { AnimChild = reinterpret_cast ( CurChild ); - AnimChild->alpha( alpha ); - AnimChild->alphaChilds( alpha ); + AnimChild->setAlpha( alpha ); + AnimChild->setChildsAlpha( alpha ); } - CurChild = CurChild->nextGet(); + CurChild = CurChild->getNextControl(); } } @@ -164,12 +164,12 @@ void UIControlAnim::matrixSet() { GLi->pushMatrix(); - Vector2f scaleCenter = this->scaleCenter(); + Vector2f scaleCenter = this->getScaleCenter(); GLi->translatef( scaleCenter.x , scaleCenter.y, 0.f ); GLi->scalef( mScale.x, mScale.y, 1.0f ); GLi->translatef( -scaleCenter.x, -scaleCenter.y, 0.f ); - Vector2f rotationCenter = this->rotationCenter(); + Vector2f rotationCenter = this->getRotationCenter(); GLi->translatef( rotationCenter.x , rotationCenter.y, 0.f ); GLi->rotatef( mAngle, 0.0f, 0.0f, 1.0f ); GLi->translatef( -rotationCenter.x, -rotationCenter.y, 0.f ); @@ -189,7 +189,7 @@ void UIControlAnim::update() { if ( NULL != mMoveAnim && mMoveAnim->isEnabled() ) { mMoveAnim->update( elapsed() ); - position( (int)mMoveAnim->getPos().x, (int)mMoveAnim->getPos().y ); + setPosition( (int)mMoveAnim->getPos().x, (int)mMoveAnim->getPos().y ); if ( mMoveAnim->ended() ) eeSAFE_DELETE( mMoveAnim ); @@ -197,7 +197,7 @@ void UIControlAnim::update() { if ( NULL != mAlphaAnim && mAlphaAnim->isEnabled() ) { mAlphaAnim->update( elapsed() ); - alpha( mAlphaAnim->getRealPos() ); + setAlpha( mAlphaAnim->getRealPos() ); if ( mAlphaAnim->ended() ) { if ( ( mControlFlags & UI_CTRL_FLAG_CLOSE_FO ) ) @@ -206,7 +206,7 @@ void UIControlAnim::update() { if ( ( mControlFlags & UI_CTRL_FLAG_DISABLE_FADE_OUT ) ) { mControlFlags &= ~UI_CTRL_FLAG_DISABLE_FADE_OUT; - visible( false ); + setVisible( false ); } eeSAFE_DELETE( mAlphaAnim ); @@ -215,7 +215,7 @@ void UIControlAnim::update() { if ( NULL != mScaleAnim && mScaleAnim->isEnabled() ) { mScaleAnim->update( elapsed() ); - scale( mScaleAnim->getPos() ); + setScale( mScaleAnim->getPos() ); if ( mScaleAnim->ended() ) eeSAFE_DELETE( mScaleAnim ); @@ -223,7 +223,7 @@ void UIControlAnim::update() { if ( NULL != mAngleAnim && mAngleAnim->isEnabled() ) { mAngleAnim->update( elapsed() ); - angle( mAngleAnim->getRealPos() ); + setRotation( mAngleAnim->getRealPos() ); if ( mAngleAnim->ended() ) eeSAFE_DELETE( mAngleAnim ); @@ -249,7 +249,7 @@ Interpolation * UIControlAnim::startAlphaAnim( const Float& From, const Float& T mAlphaAnim->start( PathEndCallback ); mAlphaAnim->setType( Type ); - alpha( From ); + setAlpha( From ); if ( AlphaChilds ) { UIControlAnim * AnimChild; @@ -262,7 +262,7 @@ Interpolation * UIControlAnim::startAlphaAnim( const Float& From, const Float& T AnimChild->startAlphaAnim( From, To, TotalTime, AlphaChilds ); } - CurChild = CurChild->nextGet(); + CurChild = CurChild->getNextControl(); } } @@ -280,7 +280,7 @@ Waypoints * UIControlAnim::startScaleAnim( const Vector2f& From, const Vector2f& mScaleAnim->start( PathEndCallback ); mScaleAnim->setType( Type ); - scale( From ); + setScale( From ); return mScaleAnim; } @@ -300,7 +300,7 @@ Waypoints * UIControlAnim::startMovement( const Vector2i& From, const Vector2i& mMoveAnim->start( PathEndCallback ); mMoveAnim->setType( Type ); - position( From ); + setPosition( From ); return mMoveAnim; } @@ -316,7 +316,7 @@ Interpolation * UIControlAnim::startRotation( const Float& From, const Float& To mAngleAnim->start( PathEndCallback ); mAngleAnim->setType( Type ); - angle( From ); + setRotation( From ); return mAngleAnim; } @@ -336,7 +336,7 @@ Interpolation * UIControlAnim::closeFadeOut( const Time& Time, const bool& Alpha } Interpolation * UIControlAnim::disableFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { - enabled( false ); + setEnabled( false ); startAlphaAnim ( mAlpha, 0.f, Time, AlphaChilds, Type ); @@ -348,18 +348,18 @@ Interpolation * UIControlAnim::disableFadeOut( const Time& Time, const bool& Alp void UIControlAnim::backgroundDraw() { Primitives P; Rectf R = getRectf(); - P.setBlendMode( mBackground->blend() ); - P.setColor( getColor( mBackground->color() ) ); + P.setBlendMode( mBackground->getBlendMode() ); + P.setColor( getColor( mBackground->getColor() ) ); - if ( 4 == mBackground->colors().size() ) { - if ( mBackground->corners() ) { - P.drawRoundedRectangle( R, getColor( mBackground->colors()[0] ), getColor( mBackground->colors()[1] ), getColor( mBackground->colors()[2] ), getColor( mBackground->colors()[3] ), mBackground->corners() ); + if ( 4 == mBackground->getColors().size() ) { + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( R, getColor( mBackground->getColors()[0] ), getColor( mBackground->getColors()[1] ), getColor( mBackground->getColors()[2] ), getColor( mBackground->getColors()[3] ), mBackground->getCorners() ); } else { - P.drawRectangle( R, getColor( mBackground->colors()[0] ), getColor( mBackground->colors()[1] ), getColor( mBackground->colors()[2] ), getColor( mBackground->colors()[3] ) ); + P.drawRectangle( R, getColor( mBackground->getColors()[0] ), getColor( mBackground->getColors()[1] ), getColor( mBackground->getColors()[2] ), getColor( mBackground->getColors()[3] ) ); } } else { - if ( mBackground->corners() ) { - P.drawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->corners() ); + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->getCorners() ); } else { P.drawRectangle( R ); } @@ -369,22 +369,22 @@ void UIControlAnim::backgroundDraw() { void UIControlAnim::borderDraw() { Primitives P; P.setFillMode( DRAW_LINE ); - P.setBlendMode( blend() ); - P.setLineWidth( (Float)mBorder->width() ); - P.setColor( getColor( mBorder->color() ) ); + P.setBlendMode( getBlendMode() ); + P.setLineWidth( (Float)mBorder->getWidth() ); + P.setColor( getColor( mBorder->getColor() ) ); //! @TODO: Check why was this +0.1f -0.1f? if ( mFlags & UI_CLIP_ENABLE ) { Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.getWidth() - 0.1f, (Float)mSize.getHeight() - 0.1f ) ); - if ( mBackground->corners() ) { - P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->corners() ); + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->getCorners() ); } else { P.drawRectangle( R ); } } else { - if ( mBackground->corners() ) { - P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->corners() ); + if ( mBackground->getCorners() ) { + P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->getCorners() ); } else { P.drawRectangle( getRectf() ); } @@ -398,20 +398,20 @@ ColorA UIControlAnim::getColor( const ColorA& Col ) { void UIControlAnim::updateQuad() { mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mSize.getWidth(), mScreenPosf.y + mSize.getHeight() ) ); - mPoly.rotate( mAngle, rotationCenter() ); - mPoly.scale( mScale, scaleCenter() ); + mPoly.rotate( mAngle, getRotationCenter() ); + mPoly.scale( mScale, getScaleCenter() ); - UIControl * tParent = parent(); + UIControl * tParent = getParent(); while ( tParent ) { if ( tParent->isAnimated() ) { UIControlAnim * tP = reinterpret_cast ( tParent ); - mPoly.rotate( tP->angle(), tP->rotationCenter() ); - mPoly.scale( tP->scale(), tP->scaleCenter() ); + mPoly.rotate( tP->getRotation(), tP->getRotationCenter() ); + mPoly.scale( tP->getScale(), tP->getScaleCenter() ); } - tParent = tParent->parent(); + tParent = tParent->getParent(); }; } @@ -443,28 +443,28 @@ void UIControlAnim::updateOriginPoint() { } } -Interpolation * UIControlAnim::rotationInterpolation() { +Interpolation * UIControlAnim::getRotationInterpolation() { if ( NULL == mAngleAnim ) mAngleAnim = eeNew( Interpolation, () ); return mAngleAnim; } -Waypoints * UIControlAnim::scaleInterpolation() { +Waypoints * UIControlAnim::getScaleInterpolation() { if ( NULL == mScaleAnim ) mScaleAnim = eeNew( Waypoints, () ); return mScaleAnim; } -Interpolation * UIControlAnim::alphaInterpolation() { +Interpolation * UIControlAnim::getAlphaInterpolation() { if ( NULL == mAlphaAnim ) mAlphaAnim = eeNew( Interpolation, () ); return mAlphaAnim; } -Waypoints * UIControlAnim::movementInterpolation() { +Waypoints * UIControlAnim::getMovementInterpolation() { if ( NULL == mMoveAnim ) mMoveAnim = eeNew( Waypoints, () ); diff --git a/src/eepp/ui/uidefaulttheme.cpp b/src/eepp/ui/uidefaulttheme.cpp index 42eba358c..c2955342a 100644 --- a/src/eepp/ui/uidefaulttheme.cpp +++ b/src/eepp/ui/uidefaulttheme.cpp @@ -60,8 +60,8 @@ UIProgressBar * UIdefaultTheme::createProgressBar( UIControl * Parent, const Siz } UIProgressBar * Ctrl = eeNew( UIProgressBar, ( PBParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -81,8 +81,8 @@ UIWinMenu * UIdefaultTheme::createWinMenu( UIControl * Parent, const Sizei& Size } UIWinMenu * Ctrl = eeNew( UIWinMenu, ( WinMenuParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -166,8 +166,8 @@ UIComboBox * UIdefaultTheme::createComboBox( UIControl * Parent, const Sizei& Si } UIComboBox * Ctrl = eeNew( UIComboBox, ( ComboParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -186,8 +186,8 @@ UIDropDownList * UIdefaultTheme::createDropDownList( UIControl * Parent, const S } UIDropDownList * Ctrl = eeNew( UIDropDownList, ( DDLParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -215,8 +215,8 @@ UITabWidget * UIdefaultTheme::createTabWidget( UIControl *Parent, const Sizei &S } UITabWidget * Ctrl = eeNew( UITabWidget, ( TabWidgetParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -234,8 +234,8 @@ UITooltip * UIdefaultTheme::createTooltip( UIControl * TooltipOf, UIControl * Pa } UITooltip * Ctrl = eeNew( UITooltip, ( TooltipParams, TooltipOf ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } diff --git a/src/eepp/ui/uidragable.cpp b/src/eepp/ui/uidragable.cpp index 741dff491..8c08005ed 100644 --- a/src/eepp/ui/uidragable.cpp +++ b/src/eepp/ui/uidragable.cpp @@ -23,8 +23,8 @@ bool UIDragable::isType( const Uint32& type ) const { } Uint32 UIDragable::onMouseDown( const Vector2i& Pos, const Uint32 Flags ) { - if ( !( UIManager::instance()->lastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && dragEnable() && !dragging() ) { - dragging( true ); + if ( !( UIManager::instance()->lastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && isDragEnabled() && !isDragging() ) { + setDragging( true ); mDragPoint = Pos; } @@ -33,31 +33,31 @@ Uint32 UIDragable::onMouseDown( const Vector2i& Pos, const Uint32 Flags ) { } Uint32 UIDragable::onMouseUp( const Vector2i& Pos, const Uint32 Flags ) { - if ( dragEnable() && dragging() && ( Flags & mDragButton ) ) { - dragging( false ); + if ( isDragEnabled() && isDragging() && ( Flags & mDragButton ) ) { + setDragging( false ); } UIControl::onMouseUp( Pos, Flags ); return 1; } -const Vector2i& UIDragable::dragPoint() const { +const Vector2i& UIDragable::getDragPoint() const { return mDragPoint; } -void UIDragable::dragPoint( const Vector2i& Point ) { +void UIDragable::setDragPoint( const Vector2i& Point ) { mDragPoint = Point; } void UIDragable::update() { UIControl::update(); - if ( !dragEnable() ) + if ( !isDragEnabled() ) return; - if ( dragging() ) { + if ( isDragging() ) { if ( !( UIManager::instance()->pressTrigger() & mDragButton ) ) { - dragging( false ); + setDragging( false ); UIManager::instance()->setControlDragging( false ); return; } @@ -90,19 +90,19 @@ Uint32 UIDragable::OnDragEnd( const Vector2i& Pos ) { return 1; } -bool UIDragable::dragEnable() const { +bool UIDragable::isDragEnabled() const { return 0 != ( mFlags & UI_DRAG_ENABLE ); } -void UIDragable::dragEnable( const bool& enable ) { +void UIDragable::setDragEnabled( const bool& enable ) { writeFlag( UI_DRAG_ENABLE, true == enable ); } -bool UIDragable::dragging() const { +bool UIDragable::isDragging() const { return 0 != ( mControlFlags & UI_CTRL_FLAG_DRAGGING ); } -void UIDragable::dragging( const bool& dragging ) { +void UIDragable::setDragging( const bool& dragging ) { writeCtrlFlag( UI_CTRL_FLAG_DRAGGING, true == dragging ); if ( dragging ) { @@ -118,11 +118,11 @@ void UIDragable::dragging( const bool& dragging ) { } } -void UIDragable::dragButton( const Uint32& Button ) { +void UIDragable::setDragButton( const Uint32& Button ) { mDragButton = Button; } -const Uint32& UIDragable::dragButton() const { +const Uint32& UIDragable::getDragButton() const { return mDragButton; } diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 2d51ffbd6..a6bc9b6dc 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -35,8 +35,8 @@ UIDropDownList::UIDropDownList( UIDropDownList::CreateParams& Params ) : } } - mListBox->enabled( false ); - mListBox->visible( false ); + mListBox->setEnabled( false ); + mListBox->setVisible( false ); mListBox->addEventListener( UIEvent::EventOnComplexControlFocusLoss, cb::Make1( this, &UIDropDownList::onListBoxFocusLoss ) ); mListBox->addEventListener( UIEvent::EventOnItemSelected , cb::Make1( this, &UIDropDownList::onItemSelected ) ); @@ -74,7 +74,7 @@ void UIDropDownList::onSizeChange() { void UIDropDownList::autoSizeControl() { if ( mFlags & UI_AUTO_SIZE ) { - size( mSize.x, getSkinSize().getHeight() ); + setSize( mSize.x, getSkinSize().getHeight() ); } } @@ -93,21 +93,21 @@ Uint32 UIDropDownList::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) { } void UIDropDownList::showListBox() { - if ( !mListBox->visible() ) { + if ( !mListBox->isVisible() ) { if ( !mPopUpToMainControl ) - mListBox->parent( parent() ); + mListBox->setParent( getParent() ); else - mListBox->parent( UIManager::instance()->mainControl() ); + mListBox->setParent( UIManager::instance()->mainControl() ); mListBox->toFront(); Vector2i Pos( mPos.x, mPos.y + mSize.getHeight() ); if ( mPopUpToMainControl ) { - parent()->controlToWorld( Pos ); + getParent()->controlToWorld( Pos ); } - mListBox->position( Pos ); + mListBox->setPosition( Pos ); if ( mListBox->count() ) { Recti tPadding = mListBox->paddingContainer(); @@ -115,9 +115,9 @@ void UIDropDownList::showListBox() { Float sliderValue = mListBox->verticalScrollBar()->value(); if ( mMinNumVisibleItems < mListBox->count() ) - mListBox->size( mSize.getWidth(), (Int32)( mMinNumVisibleItems * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); + mListBox->setSize( mSize.getWidth(), (Int32)( mMinNumVisibleItems * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); else { - mListBox->size( mSize.getWidth(), (Int32)( mListBox->count() * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); + mListBox->setSize( mSize.getWidth(), (Int32)( mListBox->count() * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); } mListBox->updateQuad(); @@ -129,12 +129,12 @@ void UIDropDownList::showListBox() { Pos = Vector2i( mPos.x, mPos.y ); if ( mPopUpToMainControl ) { - parent()->controlToWorld( Pos ); + getParent()->controlToWorld( Pos ); } - Pos.y -= mListBox->size().getHeight(); + Pos.y -= mListBox->getSize().getHeight(); - mListBox->position( Pos ); + mListBox->setPosition( Pos ); } mListBox->verticalScrollBar()->value( sliderValue ); @@ -180,11 +180,11 @@ void UIDropDownList::onItemSelected( const UIEvent * Event ) { } void UIDropDownList::show() { - mListBox->enabled( true ); - mListBox->visible( true ); + mListBox->setEnabled( true ); + mListBox->setVisible( true ); if ( UIThemeManager::instance()->defaultEffectsEnabled() ) { - mListBox->startAlphaAnim( 255.f == mListBox->alpha() ? 0.f : mListBox->alpha(), 255.f, UIThemeManager::instance()->controlsFadeInTime() ); + mListBox->startAlphaAnim( 255.f == mListBox->getAlpha() ? 0.f : mListBox->getAlpha(), 255.f, UIThemeManager::instance()->controlsFadeInTime() ); } } @@ -192,8 +192,8 @@ void UIDropDownList::hide() { if ( UIThemeManager::instance()->defaultEffectsEnabled() ) { mListBox->disableFadeOut( UIThemeManager::instance()->controlsFadeOutTime() ); } else { - mListBox->enabled( false ); - mListBox->visible( false ); + mListBox->setEnabled( false ); + mListBox->setVisible( false ); } } diff --git a/src/eepp/ui/uigenericgrid.cpp b/src/eepp/ui/uigenericgrid.cpp index 21340534b..0fd81ba2f 100644 --- a/src/eepp/ui/uigenericgrid.cpp +++ b/src/eepp/ui/uigenericgrid.cpp @@ -34,8 +34,8 @@ UIGenericGrid::UIGenericGrid( const UIGenericGrid::CreateParams& Params ) : CParams.Size = Sizei( mSize.getWidth() - mPadding.Right - mPadding.Left, mSize.getHeight() - mPadding.Top - mPadding.Bottom ); CParams.Flags = Params.Flags; mContainer = eeNew( UIItemContainer , ( CParams ) ); - mContainer->visible( true ); - mContainer->enabled( true ); + mContainer->setVisible( true ); + mContainer->setEnabled( true ); if ( mFlags & UI_CLIP_ENABLE ) mFlags &= ~UI_CLIP_ENABLE; @@ -49,18 +49,18 @@ UIGenericGrid::UIGenericGrid( const UIGenericGrid::CreateParams& Params ) : mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); ScrollBarP.setPos ( 0, mSize.getHeight() - 15 ); - ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->size().getWidth(), 15 ); + ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); if ( UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); } if ( UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } mVScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIGenericGrid::onScrollValueChange ) ); @@ -85,7 +85,7 @@ void UIGenericGrid::setDefaultCollumnsWidth() { return; if ( mItemsNotVisible <= 0 ) { - Uint32 VisibleItems = mContainer->size().getHeight() / mRowHeight; + Uint32 VisibleItems = mContainer->getSize().getHeight() / mRowHeight; Int32 oItemsNotVisible = (Int32)mItems.size() - VisibleItems; if ( oItemsNotVisible > 0 ) { @@ -97,7 +97,7 @@ void UIGenericGrid::setDefaultCollumnsWidth() { } } - Uint32 CollumnWidh = mContainer->size().getWidth() / mCollumnsCount; + Uint32 CollumnWidh = mContainer->getSize().getWidth() / mCollumnsCount; for ( Uint32 i = 0; i < mCollumnsCount; i++ ) { mCollumnsWidth[ i ] = CollumnWidh; @@ -126,16 +126,16 @@ void UIGenericGrid::autoPadding() { } void UIGenericGrid::onSizeChange() { - mVScrollBar->position( mSize.getWidth() - mVScrollBar->size().getWidth(), 0 ); - mVScrollBar->size( mVScrollBar->size().getWidth(), mSize.getHeight() ); + mVScrollBar->setPosition( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 0 ); + mVScrollBar->setSize( mVScrollBar->getSize().getWidth(), mSize.getHeight() ); - mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); - mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth(), mHScrollBar->size().getHeight() ); + mHScrollBar->setPosition( 0, mSize.getHeight() - mHScrollBar->getSize().getHeight() ); + mHScrollBar->setSize( mSize.getWidth() - mVScrollBar->getSize().getWidth(), mHScrollBar->getSize().getHeight() ); if ( mContainer->isClipped() && UI_SCROLLBAR_AUTO == mHScrollMode ) { - if ( (Int32)mTotalWidth <= mContainer->size().getWidth() ) { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + if ( (Int32)mTotalWidth <= mContainer->getSize().getWidth() ) { + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); mHScrollInit = 0; } } @@ -146,15 +146,15 @@ void UIGenericGrid::onSizeChange() { } void UIGenericGrid::containerResize() { - mContainer->position( mPadding.Left, mPadding.Top ); + mContainer->setPosition( mPadding.Left, mPadding.Top ); - if( mHScrollBar->visible() ) - mContainer->size( mSize.getWidth() - mPadding.Right, mSize.getHeight() - mPadding.Top - mHScrollBar->size().getHeight() ); + if( mHScrollBar->isVisible() ) + mContainer->setSize( mSize.getWidth() - mPadding.Right, mSize.getHeight() - mPadding.Top - mHScrollBar->getSize().getHeight() ); else - mContainer->size( mSize.getWidth() - mPadding.Right, mSize.getHeight() - mPadding.Bottom - mPadding.Top ); + mContainer->setSize( mSize.getWidth() - mPadding.Right, mSize.getHeight() - mPadding.Bottom - mPadding.Top ); - if ( mVScrollBar->visible() ) - mContainer->size( mContainer->size().getWidth() - mVScrollBar->size().getWidth(), mContainer->size().getHeight() ); + if ( mVScrollBar->isVisible() ) + mContainer->setSize( mContainer->getSize().getWidth() - mVScrollBar->getSize().getWidth(), mContainer->getSize().getHeight() ); setDefaultCollumnsWidth(); } @@ -162,19 +162,19 @@ void UIGenericGrid::containerResize() { void UIGenericGrid::updateVScroll() { if ( mItemsNotVisible <= 0 ) { if ( UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } else { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); } } else { if ( UI_SCROLLBAR_AUTO == mVScrollMode || UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } else { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); } } @@ -183,21 +183,21 @@ void UIGenericGrid::updateVScroll() { void UIGenericGrid::updateHScroll() { if ( mContainer->isClipped() && ( UI_SCROLLBAR_AUTO == mHScrollMode || UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) ) { - if ( mContainer->size().getWidth() < (Int32)mTotalWidth ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + if ( mContainer->getSize().getWidth() < (Int32)mTotalWidth ) { + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); containerResize(); - Int32 ScrollH = mTotalWidth - mContainer->size().getWidth(); + Int32 ScrollH = mTotalWidth - mContainer->getSize().getWidth(); Int32 HScrolleable = (Uint32)( mHScrollBar->value() * ScrollH ); mHScrollInit = -HScrolleable; } else { if ( UI_SCROLLBAR_AUTO == mHScrollMode ) { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); mHScrollInit = 0; @@ -216,7 +216,7 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { Int32 ItemPos, ItemPosMax; Int32 tHLastScroll = mHScrollInit; - Uint32 VisibleItems = mContainer->size().getHeight() / mRowHeight; + Uint32 VisibleItems = mContainer->getSize().getHeight() / mRowHeight; mItemsNotVisible = (Int32)mItems.size() - VisibleItems; bool Clipped = 0 != mContainer->isClipped(); @@ -224,9 +224,9 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { updateHScroll(); - VisibleItems = mContainer->size().getHeight() / mRowHeight; + VisibleItems = mContainer->getSize().getHeight() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; - Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->size().getHeight(); + Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->getSize().getHeight(); bool FirstVisible = false; if ( Clipped && mSmoothScroll ) { @@ -235,7 +235,7 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { else RelPos = 0; - RelPosMax = RelPos + mContainer->size().getHeight() + mRowHeight; + RelPosMax = RelPos + mContainer->getSize().getHeight() + mRowHeight; if ( ( FromScrollChange && eeINDEX_NOT_FOUND != mLastPos && mLastPos == RelPos ) && ( tHLastScroll == mHScrollInit ) ) return; @@ -248,9 +248,9 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { ItemPosMax = ItemPos + mRowHeight; if ( ( ItemPos >= (Int32)RelPos || ItemPosMax >= (Int32)RelPos ) && ( ItemPos <= (Int32)RelPosMax ) ) { - Item->position( mHScrollInit, ItemPos - RelPos ); - Item->enabled( true ); - Item->visible( true ); + Item->setPosition( mHScrollInit, ItemPos - RelPos ); + Item->setEnabled( true ); + Item->setVisible( true ); if ( !FirstVisible ) { mVisibleFirst = i; @@ -259,8 +259,8 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { mVisibleLast = i; } else { - Item->enabled( false ); - Item->visible( false ); + Item->setEnabled( false ); + Item->setVisible( false ); } } } else { @@ -282,12 +282,12 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { if ( i >= RelPos && i < RelPosMax ) { if ( Clipped ) - Item->position( mHScrollInit, ItemPos ); + Item->setPosition( mHScrollInit, ItemPos ); else - Item->position( 0, ItemPos ); + Item->setPosition( 0, ItemPos ); - Item->enabled( true ); - Item->visible( true ); + Item->setEnabled( true ); + Item->setVisible( true ); if ( !FirstVisible ) { mVisibleFirst = i; @@ -296,18 +296,18 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { mVisibleLast = i; } else { - Item->enabled( false ); - Item->visible( false ); + Item->setEnabled( false ); + Item->setVisible( false ); } } } - if ( mHScrollBar->visible() && !mVScrollBar->visible() ) { - mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); - mHScrollBar->size( mSize.getWidth(), mHScrollBar->size().getHeight() ); + if ( mHScrollBar->isVisible() && !mVScrollBar->isVisible() ) { + mHScrollBar->setPosition( 0, mSize.getHeight() - mHScrollBar->getSize().getHeight() ); + mHScrollBar->setSize( mSize.getWidth(), mHScrollBar->getSize().getHeight() ); } else { - mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); - mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth(), mHScrollBar->size().getHeight() ); + mHScrollBar->setPosition( 0, mSize.getHeight() - mHScrollBar->getSize().getHeight() ); + mHScrollBar->setSize( mSize.getWidth() - mVScrollBar->getSize().getWidth(), mHScrollBar->getSize().getHeight() ); } } @@ -320,8 +320,8 @@ void UIGenericGrid::updateSize() { void UIGenericGrid::add( UIGridCell * Cell ) { mItems.push_back( Cell ); - if ( mContainer != Cell->parent() ) - Cell->parent( mContainer ); + if ( mContainer != Cell->getParent() ) + Cell->setParent( mContainer ); setDefaultCollumnsWidth(); @@ -449,8 +449,8 @@ void UIGenericGrid::updateCollumnsPos() { void UIGenericGrid::onAlphaChange() { UIControlAnim::onAlphaChange(); - mVScrollBar->alpha( mAlpha ); - mHScrollBar->alpha( mAlpha ); + mVScrollBar->setAlpha( mAlpha ); + mHScrollBar->setAlpha( mAlpha ); } void UIGenericGrid::verticalScrollMode( const UI_SCROLLBAR_MODE& Mode ) { @@ -470,12 +470,12 @@ void UIGenericGrid::horizontalScrollMode( const UI_SCROLLBAR_MODE& Mode ) { mHScrollMode = Mode; if ( UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); containerResize(); } else if ( UI_SCROLLBAR_ALWAYS_OFF == mHScrollMode ) { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); containerResize(); } diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index 4112a4539..4fd2f9758 100644 --- a/src/eepp/ui/uigfx.cpp +++ b/src/eepp/ui/uigfx.cpp @@ -10,8 +10,8 @@ UIGfx::UIGfx( const UIGfx::CreateParams& Params ) : mRender( Params.SubTextureRender ), mAlignOffset(0,0) { - if ( NULL != mSubTexture && ( ( flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) ) - size( mSubTexture->getSize() ); + if ( NULL != mSubTexture && ( ( getFlags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) ) + setSize( mSubTexture->getSize() ); mColor.Alpha = (Uint8)mAlpha; @@ -39,9 +39,9 @@ void UIGfx::subTexture( Graphics::SubTexture * subTexture ) { void UIGfx::autoSize() { if ( mFlags & UI_AUTO_SIZE ) { if ( NULL != mSubTexture ) { - size( mSubTexture->getSize() ); + setSize( mSubTexture->getSize() ); } else { - size( Sizei( 0, 0 ) ); + setSize( Sizei( 0, 0 ) ); } } } @@ -96,11 +96,11 @@ void UIGfx::draw() { } void UIGfx::drawSubTexture() { - mSubTexture->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, mColor, 0.f, Vector2f::One, blend(), mRender ); + mSubTexture->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, mColor, 0.f, Vector2f::One, getBlendMode(), mRender ); } -void UIGfx::alpha( const Float& alpha ) { - UIControlAnim::alpha( alpha ); +void UIGfx::setAlpha( const Float& alpha ) { + UIControlAnim::setAlpha( alpha ); mColor.Alpha = (Uint8)alpha; } @@ -114,7 +114,7 @@ const ColorA& UIGfx::color() const { void UIGfx::color( const ColorA& col ) { mColor = col; - alpha( col.a() ); + setAlpha( col.a() ); } const EE_RENDER_MODE& UIGfx::renderMode() const { diff --git a/src/eepp/ui/uigridcell.cpp b/src/eepp/ui/uigridcell.cpp index fc21beb70..f895aa5f5 100644 --- a/src/eepp/ui/uigridcell.cpp +++ b/src/eepp/ui/uigridcell.cpp @@ -25,7 +25,7 @@ void UIGridCell::setTheme( UITheme * Theme ) { } UIGenericGrid * UIGridCell::gridParent() const { - return reinterpret_cast ( mParentCtrl->parent() ); + return reinterpret_cast ( mParentCtrl->getParent() ); } void UIGridCell::cell( const Uint32& CollumnIndex, UIControl * Ctrl ) { @@ -35,14 +35,14 @@ void UIGridCell::cell( const Uint32& CollumnIndex, UIControl * Ctrl ) { mCells[ CollumnIndex ] = Ctrl; - if ( Ctrl->parent() != this ) - Ctrl->parent( this ); + if ( Ctrl->getParent() != this ) + Ctrl->setParent( this ); - Ctrl->position ( P->getCellPosition( CollumnIndex ) , 0 ); - Ctrl->size ( P->collumnWidth( CollumnIndex ) , P->rowHeight() ); + Ctrl->setPosition ( P->getCellPosition( CollumnIndex ) , 0 ); + Ctrl->setSize ( P->collumnWidth( CollumnIndex ) , P->rowHeight() ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); } UIControl * UIGridCell::cell( const Uint32& CollumnIndex ) const { @@ -57,28 +57,28 @@ void UIGridCell::fixCell() { UIGenericGrid * P = gridParent(); for ( Uint32 i = 0; i < mCells.size(); i++ ) { - mCells[i]->position ( P->getCellPosition( i ) , 0 ); - mCells[i]->size ( P->collumnWidth( i ) , P->rowHeight() ); + mCells[i]->setPosition ( P->getCellPosition( i ) , 0 ); + mCells[i]->setSize ( P->collumnWidth( i ) , P->rowHeight() ); } } void UIGridCell::update() { if ( mEnabled && mVisible ) { - UIGenericGrid * MyParent = reinterpret_cast ( parent()->parent() ); + UIGenericGrid * MyParent = reinterpret_cast ( getParent()->getParent() ); Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); - if ( NULL != MyParent && MyParent->alpha() != mAlpha ) { - alpha( MyParent->alpha() ); + if ( NULL != MyParent && MyParent->getAlpha() != mAlpha ) { + setAlpha( MyParent->getAlpha() ); for ( Uint32 i = 0; i < mCells.size(); i++ ) { if ( NULL != mCells[i] && mCells[i]->isAnimated() ) { - reinterpret_cast( mCells[i] )->alpha( MyParent->alpha() ); + reinterpret_cast( mCells[i] )->setAlpha( MyParent->getAlpha() ); } } } if ( isMouseOverMeOrChilds() ) { - if ( ( Flags & EE_BUTTONS_WUWD ) && MyParent->verticalScrollBar()->visible() ) { + if ( ( Flags & EE_BUTTONS_WUWD ) && MyParent->verticalScrollBar()->isVisible() ) { MyParent->verticalScrollBar()->getSlider()->manageClick( Flags ); } } @@ -88,7 +88,7 @@ void UIGridCell::update() { } void UIGridCell::select() { - UIGenericGrid * MyParent = reinterpret_cast ( parent()->parent() ); + UIGenericGrid * MyParent = reinterpret_cast ( getParent()->getParent() ); if ( MyParent->getItemSelected() != this ) { if ( NULL != MyParent->getItemSelected() ) @@ -158,9 +158,9 @@ Uint32 UIGridCell::onMessage( const UIMessage * Msg ) { } void UIGridCell::autoSize() { - UIGenericGrid * MyParent = reinterpret_cast ( parent()->parent() ); + UIGenericGrid * MyParent = reinterpret_cast ( getParent()->getParent() ); - size( MyParent->mTotalWidth, MyParent->mRowHeight ); + setSize( MyParent->mTotalWidth, MyParent->mRowHeight ); } void UIGridCell::onStateChange() { diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index 60a388a9b..7b5dd9219 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -41,8 +41,8 @@ UIListBox::UIListBox( UIListBox::CreateParams& Params ) : CParams.Size = Sizei( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Top - mPaddingContainer.Bottom ); CParams.Flags = Params.Flags; mContainer = eeNew( UIItemContainer, ( CParams ) ); - mContainer->visible( true ); - mContainer->enabled( true ); + mContainer->setVisible( true ); + mContainer->setEnabled( true ); if ( mFlags & UI_CLIP_ENABLE ) mFlags &= ~UI_CLIP_ENABLE; @@ -55,19 +55,19 @@ UIListBox::UIListBox( UIListBox::CreateParams& Params ) : ScrollBarP.VerticalScrollBar = true; mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); - ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->size().getWidth(), 15 ); + ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 15 ); ScrollBarP.setPos( 0, mSize.getHeight() - 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); if ( UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); } if ( UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } mVScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIListBox::onScrollValueChange ) ); @@ -129,8 +129,8 @@ Uint32 UIListBox::addListBoxItem( UIListBoxItem * Item ) { mItems.push_back( Item ); mTexts.push_back( Item->text() ); - if ( Item->parent() != mContainer ) - Item->parent( mContainer ); + if ( Item->getParent() != mContainer ) + Item->setParent( mContainer ); updateScroll(); @@ -279,16 +279,16 @@ void UIListBox::onHScrollValueChange( const UIEvent * Event ) { } void UIListBox::onSizeChange() { - mVScrollBar->position( mSize.getWidth() - mVScrollBar->size().getWidth() + mVScrollPadding.Left, mVScrollPadding.Top ); - mVScrollBar->size( mVScrollBar->size().getWidth() + mVScrollPadding.Right, mSize.getHeight() + mVScrollPadding.Bottom ); + mVScrollBar->setPosition( mSize.getWidth() - mVScrollBar->getSize().getWidth() + mVScrollPadding.Left, mVScrollPadding.Top ); + mVScrollBar->setSize( mVScrollBar->getSize().getWidth() + mVScrollPadding.Right, mSize.getHeight() + mVScrollPadding.Bottom ); - mHScrollBar->position( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->size().getHeight() + mHScrollPadding.Top ); - mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth() + mHScrollPadding.Right, mHScrollBar->size().getHeight() + mHScrollPadding.Bottom ); + mHScrollBar->setPosition( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->getSize().getHeight() + mHScrollPadding.Top ); + mHScrollBar->setSize( mSize.getWidth() - mVScrollBar->getSize().getWidth() + mHScrollPadding.Right, mHScrollBar->getSize().getHeight() + mHScrollPadding.Bottom ); if ( mContainer->isClipped() && UI_SCROLLBAR_AUTO == mHScrollMode ) { - if ( (Int32)mMaxTextWidth <= mContainer->size().getWidth() ) { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + if ( (Int32)mMaxTextWidth <= mContainer->getSize().getWidth() ) { + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); mHScrollInit = 0; } } @@ -353,27 +353,27 @@ void UIListBox::itemUpdateSize( UIListBoxItem * Item ) { if ( width > (Int32)mMaxTextWidth ) mMaxTextWidth = (Uint32)width; - if ( !mHScrollBar->visible() ) { - if ( width < mContainer->size().getWidth() ) - width = mContainer->size().getWidth(); + if ( !mHScrollBar->isVisible() ) { + if ( width < mContainer->getSize().getWidth() ) + width = mContainer->getSize().getWidth(); if ( ( mItemsNotVisible > 0 && UI_SCROLLBAR_AUTO == mVScrollMode ) || UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) - width -= mVScrollBar->size().getWidth(); + width -= mVScrollBar->getSize().getWidth(); } else { width = mMaxTextWidth; } - Item->size( width, mRowHeight ); + Item->setSize( width, mRowHeight ); } } void UIListBox::containerResize() { - mContainer->position( mPaddingContainer.Left, mPaddingContainer.Top ); + mContainer->setPosition( mPaddingContainer.Left, mPaddingContainer.Top ); - if( mHScrollBar->visible() ) - mContainer->size( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Top - mHScrollBar->size().getHeight() ); + if( mHScrollBar->isVisible() ) + mContainer->setSize( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Top - mHScrollBar->getSize().getHeight() ); else - mContainer->size( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Bottom - mPaddingContainer.Top ); + mContainer->setSize( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Bottom - mPaddingContainer.Top ); } void UIListBox::createItemIndex( const Uint32& i ) { @@ -401,54 +401,54 @@ void UIListBox::updateScroll( bool FromScrollChange ) { Int32 ItemPos, ItemPosMax; Int32 tHLastScroll = mHScrollInit; - Uint32 VisibleItems = mContainer->size().getHeight() / mRowHeight; + Uint32 VisibleItems = mContainer->getSize().getHeight() / mRowHeight; mItemsNotVisible = (Int32)mItems.size() - VisibleItems; - bool wasScrollVisible = mVScrollBar->visible(); - bool wasHScrollVisible = mHScrollBar->visible(); + bool wasScrollVisible = mVScrollBar->isVisible(); + bool wasHScrollVisible = mHScrollBar->isVisible(); bool Clipped = 0 != mContainer->isClipped(); if ( mItemsNotVisible <= 0 ) { if ( UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } else { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); } } else { if ( UI_SCROLLBAR_AUTO == mVScrollMode || UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } else { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); } } if ( Clipped && ( UI_SCROLLBAR_AUTO == mHScrollMode || UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) ) { - if ( ( mVScrollBar->visible() && mContainer->size().getWidth() - mVScrollBar->size().getWidth() < (Int32)mMaxTextWidth ) || - ( !mVScrollBar->visible() && mContainer->size().getWidth() < (Int32)mMaxTextWidth ) ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + if ( ( mVScrollBar->isVisible() && mContainer->getSize().getWidth() - mVScrollBar->getSize().getWidth() < (Int32)mMaxTextWidth ) || + ( !mVScrollBar->isVisible() && mContainer->getSize().getWidth() < (Int32)mMaxTextWidth ) ) { + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); containerResize(); Int32 ScrollH; - if ( mVScrollBar->visible() ) - ScrollH = mMaxTextWidth - mContainer->size().getWidth() + mVScrollBar->size().getWidth(); + if ( mVScrollBar->isVisible() ) + ScrollH = mMaxTextWidth - mContainer->getSize().getWidth() + mVScrollBar->getSize().getWidth(); else - ScrollH = mMaxTextWidth - mContainer->size().getWidth(); + ScrollH = mMaxTextWidth - mContainer->getSize().getWidth(); Int32 HScrolleable = (Uint32)( mHScrollBar->value() * ScrollH ); mHScrollInit = -HScrolleable; } else { if ( UI_SCROLLBAR_AUTO == mHScrollMode ) { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); mHScrollInit = 0; @@ -457,11 +457,11 @@ void UIListBox::updateScroll( bool FromScrollChange ) { } } - VisibleItems = mContainer->size().getHeight() / mRowHeight; + VisibleItems = mContainer->getSize().getHeight() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; - Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->size().getHeight(); - bool isScrollVisible = mVScrollBar->visible(); - bool isHScrollVisible = mHScrollBar->visible(); + Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->getSize().getHeight(); + bool isScrollVisible = mVScrollBar->isVisible(); + bool isHScrollVisible = mHScrollBar->isVisible(); bool FirstVisible = false; if ( Clipped && mSmoothScroll ) { @@ -470,7 +470,7 @@ void UIListBox::updateScroll( bool FromScrollChange ) { else RelPos = 0; - RelPosMax = RelPos + mContainer->size().getHeight() + mRowHeight; + RelPosMax = RelPos + mContainer->getSize().getHeight() + mRowHeight; if ( ( FromScrollChange && eeINDEX_NOT_FOUND != mLastPos && mLastPos == RelPos ) && ( tHLastScroll == mHScrollInit ) ) return; @@ -488,9 +488,9 @@ void UIListBox::updateScroll( bool FromScrollChange ) { Item = mItems[i]; } - Item->position( mHScrollInit, ItemPos - RelPos ); - Item->enabled( true ); - Item->visible( true ); + Item->setPosition( mHScrollInit, ItemPos - RelPos ); + Item->setEnabled( true ); + Item->setVisible( true ); if ( !FirstVisible ) { mVisibleFirst = i; @@ -532,12 +532,12 @@ void UIListBox::updateScroll( bool FromScrollChange ) { } if ( Clipped ) - Item->position( mHScrollInit, ItemPos ); + Item->setPosition( mHScrollInit, ItemPos ); else - Item->position( 0, ItemPos ); + Item->setPosition( 0, ItemPos ); - Item->enabled( true ); - Item->visible( true ); + Item->setEnabled( true ); + Item->setVisible( true ); if ( !FirstVisible ) { mVisibleFirst = i; @@ -558,12 +558,12 @@ void UIListBox::updateScroll( bool FromScrollChange ) { } - if ( mHScrollBar->visible() && !mVScrollBar->visible() ) { - mHScrollBar->position( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->size().getHeight() + mHScrollPadding.Top ); - mHScrollBar->size( mSize.getWidth() + mHScrollPadding.Right, mHScrollBar->size().getHeight() + mHScrollPadding.Bottom ); + if ( mHScrollBar->isVisible() && !mVScrollBar->isVisible() ) { + mHScrollBar->setPosition( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->getSize().getHeight() + mHScrollPadding.Top ); + mHScrollBar->setSize( mSize.getWidth() + mHScrollPadding.Right, mHScrollBar->getSize().getHeight() + mHScrollPadding.Bottom ); } else { - mHScrollBar->position( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->size().getHeight() + mHScrollPadding.Top ); - mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth() + mHScrollPadding.Right, mHScrollBar->size().getHeight() + mHScrollPadding.Bottom ); + mHScrollBar->setPosition( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->getSize().getHeight() + mHScrollPadding.Top ); + mHScrollBar->setSize( mSize.getWidth() - mVScrollBar->getSize().getWidth() + mHScrollPadding.Right, mHScrollBar->getSize().getHeight() + mHScrollPadding.Bottom ); } } @@ -795,7 +795,7 @@ void UIListBox::selectPrev() { if ( NULL == mItems[ SelIndex ] ) createItemIndex( SelIndex ); - if ( mItems[ SelIndex ]->position().y < 0 ) { + if ( mItems[ SelIndex ]->getPosition().y < 0 ) { mVScrollBar->value( (Float)( SelIndex * mRowHeight ) / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ); mItems[ SelIndex ]->setFocus(); @@ -817,7 +817,7 @@ void UIListBox::selectNext() { if ( NULL == mItems[ SelIndex ] ) createItemIndex( SelIndex ); - if ( mItems[ SelIndex ]->position().y + (Int32)rowHeight() > mContainer->size().getHeight() ) { + if ( mItems[ SelIndex ]->getPosition().y + (Int32)rowHeight() > mContainer->getSize().getHeight() ) { mVScrollBar->value( (Float)( SelIndex * mRowHeight ) / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ); mItems[ SelIndex ]->setFocus(); @@ -894,12 +894,12 @@ void UIListBox::onAlphaChange() { if ( mItems.size() ) { for ( Uint32 i = mVisibleFirst; i <= mVisibleLast; i++ ) { if ( NULL != mItems[i] ) - mItems[i]->alpha( mAlpha ); + mItems[i]->setAlpha( mAlpha ); } } - mVScrollBar->alpha( mAlpha ); - mHScrollBar->alpha( mAlpha ); + mVScrollBar->setAlpha( mAlpha ); + mHScrollBar->setAlpha( mAlpha ); } void UIListBox::verticalScrollMode( const UI_SCROLLBAR_MODE& Mode ) { @@ -919,12 +919,12 @@ void UIListBox::horizontalScrollMode( const UI_SCROLLBAR_MODE& Mode ) { mHScrollMode = Mode; if ( UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); containerResize(); } else if ( UI_SCROLLBAR_ALWAYS_OFF == mHScrollMode ) { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); containerResize(); } diff --git a/src/eepp/ui/uilistboxitem.cpp b/src/eepp/ui/uilistboxitem.cpp index 62fd97c09..5b6dfc7b1 100644 --- a/src/eepp/ui/uilistboxitem.cpp +++ b/src/eepp/ui/uilistboxitem.cpp @@ -32,7 +32,7 @@ void UIListBoxItem::setTheme( UITheme * Theme ) { Uint32 UIListBoxItem::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) { if ( Flags & EE_BUTTONS_LRM ) { - reinterpret_cast ( parent()->parent() )->itemClicked( this ); + reinterpret_cast ( getParent()->getParent() )->itemClicked( this ); select(); } @@ -41,7 +41,7 @@ Uint32 UIListBoxItem::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) { } void UIListBoxItem::select() { - UIListBox * LBParent = reinterpret_cast ( parent()->parent() ); + UIListBox * LBParent = reinterpret_cast ( getParent()->getParent() ); bool wasSelected = 0 != ( mControlFlags & UI_CTRL_FLAG_SELECTED ); @@ -77,11 +77,11 @@ void UIListBoxItem::update() { UITextBox::update(); if ( mEnabled && mVisible ) { - UIListBox * LBParent = reinterpret_cast ( parent()->parent() ); + UIListBox * LBParent = reinterpret_cast ( getParent()->getParent() ); Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( isMouseOver() ) { - if ( Flags & EE_BUTTONS_WUWD && LBParent->verticalScrollBar()->visible() ) { + if ( Flags & EE_BUTTONS_WUWD && LBParent->verticalScrollBar()->isVisible() ) { LBParent->verticalScrollBar()->getSlider()->manageClick( Flags ); } } @@ -109,7 +109,7 @@ bool UIListBoxItem::isSelected() const { } void UIListBoxItem::onStateChange() { - UIListBox * LBParent = reinterpret_cast ( parent()->parent() ); + UIListBox * LBParent = reinterpret_cast ( getParent()->getParent() ); if ( isSelected() && mSkinState->getState() != UISkinState::StateSelected ) { setSkinState( UISkinState::StateSelected ); diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 863467bfc..b87a52f8d 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -59,10 +59,10 @@ void UIManager::init( Uint32 Flags, EE::Window::Window * window ) { Params.DecorationAutoSize = false; mControl = eeNew( UIWindow, ( Params ) ); - mControl->visible( true ); - mControl->enabled( true ); - mControl->getContainer()->enabled( false ); - mControl->getContainer()->visible( false ); + mControl->setVisible( true ); + mControl->setEnabled( true ); + mControl->getContainer()->setEnabled( false ); + mControl->getContainer()->setVisible( false ); mFocusControl = mControl; mOverControl = mControl; @@ -111,7 +111,7 @@ void UIManager::inputCallback( InputEvent * Event ) { } void UIManager::resizeControl( EE::Window::Window * win ) { - mControl->size( mWindow->getWidth(), mWindow->getHeight() ); + mControl->setSize( mWindow->getWidth(), mWindow->getHeight() ); sendMsg( mControl, UIMessage::MsgWindowResize ); std::list::iterator it; @@ -126,10 +126,10 @@ void UIManager::sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint UIControl * CtrlLoop = mFocusControl; while( NULL != CtrlLoop ) { - if ( CtrlLoop->enabled() && CtrlLoop->onKeyUp( KeyEvent ) ) + if ( CtrlLoop->isEnabled() && CtrlLoop->onKeyUp( KeyEvent ) ) break; - CtrlLoop = CtrlLoop->parent(); + CtrlLoop = CtrlLoop->getParent(); } } @@ -138,10 +138,10 @@ void UIManager::sendKeyDown( const Uint32& KeyCode, const Uint16& Char, const Ui UIControl * CtrlLoop = mFocusControl; while( NULL != CtrlLoop ) { - if ( CtrlLoop->enabled() && CtrlLoop->onKeyDown( KeyEvent ) ) + if ( CtrlLoop->isEnabled() && CtrlLoop->onKeyDown( KeyEvent ) ) break; - CtrlLoop = CtrlLoop->parent(); + CtrlLoop = CtrlLoop->getParent(); } } @@ -329,7 +329,7 @@ void UIManager::checkTabPress( const Uint32& KeyCode ) { eeASSERT( NULL != mFocusControl ); if ( KeyCode == KEY_TAB ) { - UIControl * Ctrl = mFocusControl->nextComplexControl(); + UIControl * Ctrl = mFocusControl->getNextComplexControl(); if ( NULL != Ctrl ) Ctrl->setFocus(); diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index 330ce75b0..8ce68d373 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -74,8 +74,8 @@ UIMenuItem * UIMenu::CreateMenuItem( const String& Text, SubTexture * Icon ) { UIMenuItem * tCtrl = eeNew( UIMenuItem, ( Params ) ); tCtrl->text( Text ); - tCtrl->visible( true ); - tCtrl->enabled( true ); + tCtrl->setVisible( true ); + tCtrl->setEnabled( true ); return tCtrl; } @@ -107,8 +107,8 @@ UIMenuCheckBox * UIMenu::CreateMenuCheckBox( const String& Text, const bool &Act UIMenuCheckBox * tCtrl = eeNew( UIMenuCheckBox, ( Params ) ); tCtrl->text( Text ); - tCtrl->visible( true ); - tCtrl->enabled( true ); + tCtrl->setVisible( true ); + tCtrl->setEnabled( true ); if ( Active ) tCtrl->active( Active ); @@ -144,8 +144,8 @@ UIMenuSubMenu * UIMenu::CreateSubMenu( const String& Text, SubTexture * Icon, UI UIMenuSubMenu * tCtrl = eeNew( UIMenuSubMenu, ( Params ) ); tCtrl->text( Text ); - tCtrl->visible( true ); - tCtrl->enabled( true ); + tCtrl->setVisible( true ); + tCtrl->setEnabled( true ); return tCtrl; } @@ -158,16 +158,16 @@ bool UIMenu::CheckControlSize( UIControl * Control, const bool& Resize ) { if ( Control->isType( UI_TYPE_MENUITEM ) ) { UIMenuItem * tItem = reinterpret_cast ( Control ); - if ( NULL != tItem->icon() && tItem->iconHorizontalMargin() + tItem->icon()->size().getWidth() > (Int32)mBiggestIcon ) { - mBiggestIcon = tItem->iconHorizontalMargin() + tItem->icon()->size().getWidth(); + if ( NULL != tItem->icon() && tItem->iconHorizontalMargin() + tItem->icon()->getSize().getWidth() > (Int32)mBiggestIcon ) { + mBiggestIcon = tItem->iconHorizontalMargin() + tItem->icon()->getSize().getWidth(); } if ( mFlags & UI_AUTO_SIZE ) { if ( Control->isType( UI_TYPE_MENUSUBMENU ) ) { UIMenuSubMenu * tMenu = reinterpret_cast ( tItem ); - if ( tMenu->getTextBox()->getTextWidth() + mBiggestIcon + tMenu->getArrow()->size().getWidth() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { - mMaxWidth = tMenu->getTextBox()->getTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->getArrow()->size().getWidth() + mMinRightMargin; + if ( tMenu->getTextBox()->getTextWidth() + mBiggestIcon + tMenu->getArrow()->getSize().getWidth() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { + mMaxWidth = tMenu->getTextBox()->getTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->getArrow()->getSize().getWidth() + mMinRightMargin; if ( Resize ) { ResizeControls(); @@ -194,14 +194,14 @@ bool UIMenu::CheckControlSize( UIControl * Control, const bool& Resize ) { } Uint32 UIMenu::Add( UIControl * Control ) { - if ( this != Control->parent() ) - Control->parent( this ); + if ( this != Control->getParent() ) + Control->setParent( this ); CheckControlSize( Control ); SetControlSize( Control, Count() ); - Control->position( mPadding.Left, mPadding.Top + mNextPosY ); + Control->setPosition( mPadding.Left, mPadding.Top + mNextPosY ); mNextPosY += mRowHeight; @@ -214,9 +214,9 @@ Uint32 UIMenu::Add( UIControl * Control ) { void UIMenu::SetControlSize( UIControl * Control, const Uint32& Pos ) { if ( Control->isType( UI_TYPE_MENUITEM ) ) { - Control->size( mSize.getWidth() - mPadding.Left - mPadding.Right, mRowHeight ); + Control->setSize( mSize.getWidth() - mPadding.Left - mPadding.Right, mRowHeight ); } else { - Control->size( mSize.getWidth() - mPadding.Left - mPadding.Right, Control->size().getHeight() ); + Control->setSize( mSize.getWidth() - mPadding.Left - mPadding.Right, Control->getSize().getHeight() ); } } @@ -228,10 +228,10 @@ Uint32 UIMenu::AddSeparator() { UISeparator * Control = eeNew( UISeparator, ( Params ) ); - Control->visible( true ); - Control->enabled( true ); + Control->setVisible( true ); + Control->setEnabled( true ); - mNextPosY += Control->size().getHeight(); + mNextPosY += Control->getSize().getHeight(); mItems.push_back( Control ); @@ -333,7 +333,7 @@ Uint32 UIMenu::onMessage( const UIMessage * Msg ) { switch ( Msg->getMsg() ) { case UIMessage::MsgMouseUp: { - if ( Msg->getSender()->parent() == this && ( Msg->getFlags() & EE_BUTTONS_LRM ) ) { + if ( Msg->getSender()->getParent() == this && ( Msg->getFlags() & EE_BUTTONS_LRM ) ) { UIEvent ItemEvent( Msg->getSender(), UIEvent::EventOnItemClicked ); sendEvent( &ItemEvent ); } @@ -361,7 +361,7 @@ void UIMenu::onSizeChange() { } if ( 0 != mMinWidth && mSize.getWidth() < (Int32)mMinWidth ) { - size( mMinWidth, mNextPosY + mPadding.Top + mPadding.Bottom ); + setSize( mMinWidth, mNextPosY + mPadding.Top + mPadding.Bottom ); } } @@ -393,9 +393,9 @@ void UIMenu::ReposControls() { } for ( i = 0; i < mItems.size(); i++ ) { - mItems[i]->position( mPadding.Left, mPadding.Top + mNextPosY ); + mItems[i]->setPosition( mPadding.Left, mPadding.Top + mNextPosY ); - mNextPosY += mItems[i]->size().getHeight(); + mNextPosY += mItems[i]->getSize().getHeight(); } ResizeMe(); @@ -403,21 +403,21 @@ void UIMenu::ReposControls() { void UIMenu::ResizeMe() { if ( mFlags & UI_AUTO_SIZE ) { - size( mMaxWidth, mNextPosY + mPadding.Top + mPadding.Bottom ); + setSize( mMaxWidth, mNextPosY + mPadding.Top + mPadding.Bottom ); } else { - size( mSize.getWidth(), mNextPosY + mPadding.Top + mPadding.Bottom ); + setSize( mSize.getWidth(), mNextPosY + mPadding.Top + mPadding.Bottom ); } } bool UIMenu::show() { - enabled( true ); - visible( true ); + setEnabled( true ); + setVisible( true ); return true; } bool UIMenu::hide() { - enabled( false ); - visible( false ); + setEnabled( false ); + setVisible( false ); if ( NULL != mItemSelected ) mItemSelected->setSkinState( UISkinState::StateNormal ); @@ -560,66 +560,66 @@ const Recti& UIMenu::Padding() const { } void UIMenu::FixMenuPos( Vector2i& Pos, UIMenu * Menu, UIMenu * Parent, UIMenuSubMenu * SubMenu ) { - eeAABB qScreen( 0.f, 0.f, UIManager::instance()->mainControl()->size().getWidth(), UIManager::instance()->mainControl()->size().getHeight() ); - eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->size().getWidth(), Pos.y + Menu->size().getHeight() ); + eeAABB qScreen( 0.f, 0.f, UIManager::instance()->mainControl()->getSize().getWidth(), UIManager::instance()->mainControl()->getSize().getHeight() ); + eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->getSize().getWidth(), Pos.y + Menu->getSize().getHeight() ); if ( NULL != Parent && NULL != SubMenu ) { Vector2i addToPos( 0, 0 ); if ( NULL != SubMenu ) { - addToPos.y = SubMenu->size().getHeight(); + addToPos.y = SubMenu->getSize().getHeight(); } - Vector2i sPos = SubMenu->position(); + Vector2i sPos = SubMenu->getPosition(); SubMenu->controlToScreen( sPos ); - Vector2i pPos = Parent->position(); + Vector2i pPos = Parent->getPosition(); Parent->controlToScreen( pPos ); - eeAABB qParent( pPos.x, pPos.y, pPos.x + Parent->size().getWidth(), pPos.y + Parent->size().getHeight() ); + eeAABB qParent( pPos.x, pPos.y, pPos.x + Parent->getSize().getWidth(), pPos.y + Parent->getSize().getHeight() ); Pos.x = qParent.Right; Pos.y = sPos.y; qPos.Left = Pos.x; - qPos.Right = qPos.Left + Menu->size().getWidth(); + qPos.Right = qPos.Left + Menu->getSize().getWidth(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().getHeight(); + qPos.Bottom = qPos.Top + Menu->getSize().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.y = sPos.y + SubMenu->size().getHeight() - Menu->size().getHeight(); + Pos.y = sPos.y + SubMenu->getSize().getHeight() - Menu->getSize().getHeight(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().getHeight(); + qPos.Bottom = qPos.Top + Menu->getSize().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.x = qParent.Left - Menu->size().getWidth(); + Pos.x = qParent.Left - Menu->getSize().getWidth(); Pos.y = sPos.y; qPos.Left = Pos.x; - qPos.Right = qPos.Left + Menu->size().getWidth(); + qPos.Right = qPos.Left + Menu->getSize().getWidth(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().getHeight(); + qPos.Bottom = qPos.Top + Menu->getSize().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.y = sPos.y + SubMenu->size().getHeight() - Menu->size().getHeight(); + Pos.y = sPos.y + SubMenu->getSize().getHeight() - Menu->getSize().getHeight(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().getHeight(); + qPos.Bottom = qPos.Top + Menu->getSize().getHeight(); } } } } else { if ( !qScreen.contains( qPos ) ) { - Pos.y -= Menu->size().getHeight(); - qPos.Top -= Menu->size().getHeight(); - qPos.Bottom -= Menu->size().getHeight(); + Pos.y -= Menu->getSize().getHeight(); + qPos.Top -= Menu->getSize().getHeight(); + qPos.Bottom -= Menu->getSize().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.x -= Menu->size().getWidth(); - qPos.Left -= Menu->size().getWidth(); - qPos.Right -= Menu->size().getWidth(); + Pos.x -= Menu->getSize().getWidth(); + qPos.Left -= Menu->getSize().getWidth(); + qPos.Right -= Menu->getSize().getWidth(); if ( !qScreen.contains( qPos ) ) { - Pos.y += Menu->size().getHeight(); - qPos.Top += Menu->size().getHeight(); - qPos.Bottom += Menu->size().getHeight(); + Pos.y += Menu->getSize().getHeight(); + qPos.Top += Menu->getSize().getHeight(); + qPos.Bottom += Menu->getSize().getHeight(); } } } diff --git a/src/eepp/ui/uimenucheckbox.cpp b/src/eepp/ui/uimenucheckbox.cpp index a7a668e82..eea0aa4ef 100644 --- a/src/eepp/ui/uimenucheckbox.cpp +++ b/src/eepp/ui/uimenucheckbox.cpp @@ -65,7 +65,7 @@ void UIMenuCheckBox::active( const bool& active ) { } if ( oActive != active ) { - UIMenu * Menu = reinterpret_cast ( parent() ); + UIMenu * Menu = reinterpret_cast ( getParent() ); if ( !Menu->CheckControlSize( this ) ) { if ( NULL != icon()->subTexture() ) { @@ -84,7 +84,7 @@ void UIMenuCheckBox::switchActive() { Uint32 UIMenuCheckBox::onMouseUp( const Vector2i &Pos, const Uint32 Flags ) { UIMenuItem::onMouseUp( Pos, Flags ); - if ( parent()->visible() && ( Flags & EE_BUTTONS_LRM ) ) + if ( getParent()->isVisible() && ( Flags & EE_BUTTONS_LRM ) ) switchActive(); return 1; diff --git a/src/eepp/ui/uimenuitem.cpp b/src/eepp/ui/uimenuitem.cpp index d448875f9..b8a90f870 100644 --- a/src/eepp/ui/uimenuitem.cpp +++ b/src/eepp/ui/uimenuitem.cpp @@ -28,13 +28,13 @@ void UIMenuItem::setTheme( UITheme * Theme ) { Uint32 UIMenuItem::onMouseEnter( const Vector2i &Pos, const Uint32 Flags ) { UIPushButton::onMouseEnter( Pos, Flags ); - reinterpret_cast ( parent() )->SetItemSelected( this ); + reinterpret_cast ( getParent() )->SetItemSelected( this ); return 1; } void UIMenuItem::onStateChange() { - UIMenu * tMenu = reinterpret_cast ( parent() ); + UIMenu * tMenu = reinterpret_cast ( getParent() ); if ( mSkinState->getState() == UISkinState::StateSelected ) { mTextBox->color( tMenu->mFontSelectedColor ); diff --git a/src/eepp/ui/uimenusubmenu.cpp b/src/eepp/ui/uimenusubmenu.cpp index d3131fb3a..a89993132 100644 --- a/src/eepp/ui/uimenusubmenu.cpp +++ b/src/eepp/ui/uimenusubmenu.cpp @@ -19,8 +19,8 @@ UIMenuSubMenu::UIMenuSubMenu( UIMenuSubMenu::CreateParams& Params ) : GfxParams.SubTexture = NULL; GfxParams.Flags = UI_AUTO_SIZE; mArrow = eeNew( UIGfx, ( GfxParams ) ); - mArrow->visible( true ); - mArrow->enabled( false ); + mArrow->setVisible( true ); + mArrow->setEnabled( false ); subMenu( Params.SubMenu ); @@ -49,7 +49,7 @@ void UIMenuSubMenu::setTheme( UITheme * Theme ) { void UIMenuSubMenu::onSizeChange() { UIMenuItem::onSizeChange(); - mArrow->position( parent()->size().getWidth() - mArrow->size().getWidth() - 1, 0 ); + mArrow->setPosition( getParent()->getSize().getWidth() - mArrow->getSize().getWidth() - 1, 0 ); mArrow->centerVertical(); } @@ -87,7 +87,7 @@ UIMenu * UIMenuSubMenu::subMenu() const { Uint32 UIMenuSubMenu::onMouseMove( const Vector2i &Pos, const Uint32 Flags ) { UIMenuItem::onMouseMove( Pos, Flags ); - if ( NULL != mSubMenu && !mSubMenu->visible() ) { + if ( NULL != mSubMenu && !mSubMenu->isVisible() ) { mTimeOver += UIManager::instance()->elapsed().asMilliseconds(); if ( mTimeOver >= mMaxTime ) { @@ -99,18 +99,18 @@ Uint32 UIMenuSubMenu::onMouseMove( const Vector2i &Pos, const Uint32 Flags ) { } void UIMenuSubMenu::showSubMenu() { - mSubMenu->parent( parent()->parent() ); + mSubMenu->setParent( getParent()->getParent() ); - Vector2i Pos = this->position(); + Vector2i Pos = this->getPosition(); controlToScreen( Pos ); - Pos.x += mSize.getWidth() + reinterpret_cast ( parent() )->Padding().Right; + Pos.x += mSize.getWidth() + reinterpret_cast ( getParent() )->Padding().Right; - UIMenu::FixMenuPos( Pos, mSubMenu, reinterpret_cast ( parent() ), this ); + UIMenu::FixMenuPos( Pos, mSubMenu, reinterpret_cast ( getParent() ), this ); - mSubMenu->parent()->worldToControl( Pos ); - mSubMenu->position( Pos ); + mSubMenu->getParent()->worldToControl( Pos ); + mSubMenu->setPosition( Pos ); - if ( !mSubMenu->visible() ) { + if ( !mSubMenu->isVisible() ) { mSubMenu->show(); } } @@ -130,19 +130,19 @@ UIGfx * UIMenuSubMenu::getArrow() const { void UIMenuSubMenu::onSubMenuFocusLoss( const UIEvent * Event ) { UIControl * FocusCtrl = UIManager::instance()->focusControl(); - if ( parent() != FocusCtrl && !parent()->isParentOf( FocusCtrl ) ) { - parent()->setFocus(); + if ( getParent() != FocusCtrl && !getParent()->isParentOf( FocusCtrl ) ) { + getParent()->setFocus(); } if ( mSubMenu->mClickHide ) { - reinterpret_cast( parent() )->hide(); + reinterpret_cast( getParent() )->hide(); mSubMenu->mClickHide = false; } } void UIMenuSubMenu::onHideByClick( const UIEvent * Event ) { - UIMenu * tMenu = reinterpret_cast( parent() ); + UIMenu * tMenu = reinterpret_cast( getParent() ); tMenu->mClickHide = true; tMenu->hide(); diff --git a/src/eepp/ui/uimessagebox.cpp b/src/eepp/ui/uimessagebox.cpp index 2981f8628..50da83783 100644 --- a/src/eepp/ui/uimessagebox.cpp +++ b/src/eepp/ui/uimessagebox.cpp @@ -15,38 +15,38 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) : UIPushButton::CreateParams ButtonParams; ButtonParams.setParent( getContainer() ); ButtonParams.setSize( 90, 22 ); - ButtonParams.setPos( getContainer()->size().getWidth() - 96, getContainer()->size().getHeight() - ButtonParams.Size.getHeight() - 8 ); + ButtonParams.setPos( getContainer()->getSize().getWidth() - 96, getContainer()->getSize().getHeight() - ButtonParams.Size.getHeight() - 8 ); ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE; mButtonOK = eeNew( UIPushButton, ( ButtonParams ) ); - mButtonOK->visible( true ); - mButtonOK->enabled( true ); + mButtonOK->setVisible( true ); + mButtonOK->setEnabled( true ); - ButtonParams.Pos.x = mButtonOK->position().x - mButtonOK->size().getWidth() - 8; + ButtonParams.Pos.x = mButtonOK->getPosition().x - mButtonOK->getSize().getWidth() - 8; mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) ); - mButtonCancel->visible( true ); - mButtonCancel->enabled( true ); + mButtonCancel->setVisible( true ); + mButtonCancel->setEnabled( true ); } else { mButtonOK = Theme->createPushButton( getContainer(), Sizei( 90, 22 ), - Vector2i( getContainer()->size().getWidth() - 96, getContainer()->size().getHeight() - 22 - 8 ), + Vector2i( getContainer()->getSize().getWidth() - 96, getContainer()->getSize().getHeight() - 22 - 8 ), UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE ); mButtonCancel = Theme->createPushButton( getContainer(), - mButtonOK->size(), - Vector2i( mButtonOK->position().x - mButtonOK->size().getWidth() - 8, mButtonOK->position().y ), - mButtonOK->flags() ); + mButtonOK->getSize(), + Vector2i( mButtonOK->getPosition().x - mButtonOK->getSize().getWidth() - 8, mButtonOK->getPosition().y ), + mButtonOK->getFlags() ); } UITextBox::CreateParams TxtParams; TxtParams.setParent( getContainer() ); TxtParams.Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM; - TxtParams.setSize( getContainer()->size().getWidth(), mButtonOK->position().y ); + TxtParams.setSize( getContainer()->getSize().getWidth(), mButtonOK->getPosition().y ); mTextBox = eeNew( UITextBox, ( TxtParams ) ); - mTextBox->visible( true ); - mTextBox->enabled( true ); + mTextBox->setVisible( true ); + mTextBox->setEnabled( true ); mTextBox->text( Params.Message ); switch ( mMsgBoxType ) { @@ -71,8 +71,8 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) : case MSGBOX_OK: { mButtonOK->text( "OK" ); - mButtonCancel->visible( false ); - mButtonCancel->enabled( false ); + mButtonCancel->setVisible( false ); + mButtonCancel->setEnabled( false ); break; } } @@ -104,8 +104,8 @@ void UIMessageBox::setTheme( UITheme * Theme ) { } } - mButtonOK->position( mButtonOK->position().x, getContainer()->size().getHeight() - mButtonOK->size().getHeight() - 8 ); - mButtonCancel->position( mButtonCancel->position().x, mButtonOK->position().y ); + mButtonOK->setPosition( mButtonOK->getPosition().x, getContainer()->getSize().getHeight() - mButtonOK->getSize().getHeight() - 8 ); + mButtonCancel->setPosition( mButtonCancel->getPosition().x, mButtonOK->getPosition().y ); } Uint32 UIMessageBox::onMessage( const UIMessage * Msg ) { @@ -145,18 +145,18 @@ UIPushButton * UIMessageBox::getButtonCancel() const { } void UIMessageBox::autoSize() { - Sizei nSize( mTextBox->getTextWidth() + 48, mTextBox->getTextHeight() + mButtonOK->size().getHeight() + mDecoSize.getHeight() + 8 ); + Sizei nSize( mTextBox->getTextWidth() + 48, mTextBox->getTextHeight() + mButtonOK->getSize().getHeight() + mDecoSize.getHeight() + 8 ); - if ( !( nSize.getWidth() > getContainer()->size().getWidth() ) ) { - nSize.x = getContainer()->size().getWidth(); + if ( !( nSize.getWidth() > getContainer()->getSize().getWidth() ) ) { + nSize.x = getContainer()->getSize().getWidth(); } - if ( !( nSize.getHeight() > getContainer()->size().getHeight() ) ) { - nSize.y = getContainer()->size().getHeight(); + if ( !( nSize.getHeight() > getContainer()->getSize().getHeight() ) ) { + nSize.y = getContainer()->getSize().getHeight(); } - if ( nSize.x != getContainer()->size().getWidth() || nSize.y != getContainer()->size().getHeight() ) { - size( nSize ); + if ( nSize.x != getContainer()->getSize().getWidth() || nSize.y != getContainer()->getSize().getHeight() ) { + setSize( nSize ); mMinWindowSize = nSize; } diff --git a/src/eepp/ui/uipopupmenu.cpp b/src/eepp/ui/uipopupmenu.cpp index f5708ab25..4da052307 100644 --- a/src/eepp/ui/uipopupmenu.cpp +++ b/src/eepp/ui/uipopupmenu.cpp @@ -27,13 +27,13 @@ void UIPopUpMenu::setTheme( UITheme * Theme ) { } bool UIPopUpMenu::show() { - if ( !visible() || 0.f == mAlpha ) { + if ( !isVisible() || 0.f == mAlpha ) { #ifdef EE_PLATFORM_TOUCH mTE.Restart(); #endif - enabled( true ); - visible( true ); + setEnabled( true ); + setVisible( true ); toFront(); @@ -50,7 +50,7 @@ bool UIPopUpMenu::show() { } bool UIPopUpMenu::hide() { - if ( visible() ) { + if ( isVisible() ) { if ( !isFadingOut() ) { if ( NULL != mItemSelected ) mItemSelected->setSkinState( UISkinState::StateNormal ); @@ -61,8 +61,8 @@ bool UIPopUpMenu::hide() { if ( UIThemeManager::instance()->defaultEffectsEnabled() ) { disableFadeOut( UIThemeManager::instance()->controlsFadeOutTime() ); } else { - enabled( false ); - visible( false ); + setEnabled( false ); + setVisible( false ); } } @@ -88,7 +88,7 @@ Uint32 UIPopUpMenu::onMessage( const UIMessage * Msg ) { if ( !Msg->getSender()->isType( UI_TYPE_MENUSUBMENU ) && ( Msg->getFlags() & EE_BUTTONS_LRM ) ) { sendCommonEvent( UIEvent::EventOnHideByClick ); - if ( visible() ) + if ( isVisible() ) UIManager::instance()->mainControl()->setFocus(); hide(); diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index 8261edbee..229f63075 100644 --- a/src/eepp/ui/uiprogressbar.cpp +++ b/src/eepp/ui/uiprogressbar.cpp @@ -19,7 +19,7 @@ UIProgressBar::UIProgressBar( const UIProgressBar::CreateParams& Params ) : TxtBoxParams.setPos( 0, 0 ); mTextBox = eeNew( UITextBox, ( TxtBoxParams ) ); - mTextBox->enabled( false ); + mTextBox->setEnabled( false ); updateTextBox(); @@ -55,7 +55,7 @@ void UIProgressBar::setTheme( UITheme * Theme ) { UIControl::setThemeControl( Theme, "progressbar" ); if ( mFlags & UI_AUTO_SIZE ) { - size( mSize.x, getSkinSize().getHeight() ); + setSize( mSize.x, getSkinSize().getHeight() ); } UISkin * tSkin = Theme->getByName( Theme->abbr() + "_progressbar_filler" ); @@ -170,8 +170,8 @@ const bool& UIProgressBar::displayPercent() const { } void UIProgressBar::updateTextBox() { - mTextBox->visible( mDisplayPercent ); - mTextBox->size( mSize ); + mTextBox->setVisible( mDisplayPercent ); + mTextBox->setSize( mSize ); mTextBox->text( String::toStr( (Int32)( ( mProgress / mTotalSteps ) * 100.f ) ) + "%" ); } @@ -182,7 +182,7 @@ UITextBox * UIProgressBar::getTextBox() const { void UIProgressBar::onAlphaChange() { UIControlAnim::onAlphaChange(); - mTextBox->alpha( mAlpha ); + mTextBox->setAlpha( mAlpha ); } }} diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index 537d95060..ef0205a48 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -23,11 +23,11 @@ UIPushButton::UIPushButton( const UIPushButton::CreateParams& Params ) : mIcon = eeNew( UIGfx, ( GfxParams ) ); if ( Params.IconMinSize.x != 0 && Params.IconMinSize.y != 0 ) { - mIcon->size( Params.IconMinSize ); + mIcon->setSize( Params.IconMinSize ); } - mIcon->visible( true ); - mIcon->enabled( false ); + mIcon->setVisible( true ); + mIcon->setEnabled( false ); icon( Params.Icon ); @@ -42,8 +42,8 @@ UIPushButton::UIPushButton( const UIPushButton::CreateParams& Params ) : TxtParams.Flags &= ~UI_CLIP_ENABLE; mTextBox = eeNew( UITextBox, ( TxtParams ) ); - mTextBox->visible( true ); - mTextBox->enabled( false ); + mTextBox->setVisible( true ); + mTextBox->setEnabled( false ); if ( Params.IconAutoMargin ) mControlFlags |= UI_CTRL_FLAG_FREE_USE; @@ -66,23 +66,23 @@ bool UIPushButton::isType( const Uint32& type ) const { void UIPushButton::onSizeChange() { if ( NULL != mTextBox ) { - mTextBox->size( mSize ); - mTextBox->position( 0, 0 ); + mTextBox->setSize( mSize ); + mTextBox->setPosition( 0, 0 ); } - mIcon->position( mIconSpace, 0 ); + mIcon->setPosition( mIconSpace, 0 ); mIcon->centerVertical(); if ( NULL != mTextBox ) { - switch ( FontHAlignGet( flags() ) ) { + switch ( FontHAlignGet( getFlags() ) ) { case UI_HALIGN_LEFT: - mTextBox->position( mIcon->position().x + mIcon->size().getWidth(), 0 ); - mTextBox->size( mSize.getWidth() - mIcon->position().x + mIcon->size().getWidth(), mSize.getHeight() ); + mTextBox->setPosition( mIcon->getPosition().x + mIcon->getSize().getWidth(), 0 ); + mTextBox->setSize( mSize.getWidth() - mIcon->getPosition().x + mIcon->getSize().getWidth(), mSize.getHeight() ); break; case UI_HALIGN_CENTER: if ( NULL != mIcon->subTexture() ) { - if ( mIcon->position().x + mIcon->size().getWidth() >= mTextBox->alignOffset().x ) { - mTextBox->position( mIcon->position().x + mIcon->size().getWidth() + 1 - mTextBox->alignOffset().x, mTextBox->position().y ); + if ( mIcon->getPosition().x + mIcon->getSize().getWidth() >= mTextBox->alignOffset().x ) { + mTextBox->setPosition( mIcon->getPosition().x + mIcon->getSize().getWidth() + 1 - mTextBox->alignOffset().x, mTextBox->getPosition().y ); } } @@ -193,8 +193,8 @@ UITextBox * UIPushButton::getTextBox() const { void UIPushButton::onAlphaChange() { UIControlAnim::onAlphaChange(); - mIcon->alpha( mAlpha ); - mTextBox->alpha( mAlpha ); + mIcon->setAlpha( mAlpha ); + mTextBox->setAlpha( mAlpha ); } void UIPushButton::onStateChange() { @@ -204,7 +204,7 @@ void UIPushButton::onStateChange() { mTextBox->color( mFontColor ); } - mTextBox->alpha( mAlpha ); + mTextBox->setAlpha( mAlpha ); } Uint32 UIPushButton::onKeyDown( const UIEventKey& Event ) { diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index 22e6aca11..98dc7e46a 100644 --- a/src/eepp/ui/uiradiobutton.cpp +++ b/src/eepp/ui/uiradiobutton.cpp @@ -18,12 +18,12 @@ UIRadioButton::UIRadioButton( const UITextBox::CreateParams& Params ) : ButtonParams.Size = Sizei( 16, 16 ); mActiveButton = eeNew( UIControlAnim, ( ButtonParams ) ); - mActiveButton->visible( false ); - mActiveButton->enabled( true ); + mActiveButton->setVisible( false ); + mActiveButton->setEnabled( true ); mInactiveButton = eeNew( UIControlAnim, ( ButtonParams ) ); - mInactiveButton->visible( true ); - mInactiveButton->enabled( true ); + mInactiveButton->setVisible( true ); + mInactiveButton->setEnabled( true ); padding( Recti(0,0,0,0) ); @@ -56,7 +56,7 @@ void UIRadioButton::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mActiveButton->size( tSubTexture->getRealSize() ); + mActiveButton->setSize( tSubTexture->getRealSize() ); mActiveButton->centerVertical(); } } @@ -67,7 +67,7 @@ void UIRadioButton::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mInactiveButton->size( tSubTexture->getRealSize() ); + mInactiveButton->setSize( tSubTexture->getRealSize() ); mInactiveButton->centerVertical(); } } @@ -82,7 +82,7 @@ void UIRadioButton::autoSize() { mActiveButton->centerVertical(); mInactiveButton->centerVertical(); - mSize.setWidth( (int)mTextCache->getTextWidth() + mActiveButton->size().getWidth() ); + mSize.setWidth( (int)mTextCache->getTextWidth() + mActiveButton->getSize().getWidth() ); } } @@ -118,16 +118,16 @@ void UIRadioButton::switchState() { void UIRadioButton::active( const bool& active ) { if ( !active ) { if ( checkActives() ) { - mActiveButton->visible( false ); - mInactiveButton->visible( true ); + mActiveButton->setVisible( false ); + mInactiveButton->setVisible( true ); mActive = false; onValueChange(); } } else { - mActiveButton->visible( true ); - mInactiveButton->visible( false ); + mActiveButton->setVisible( true ); + mInactiveButton->setVisible( false ); mActive = true; @@ -135,7 +135,7 @@ void UIRadioButton::active( const bool& active ) { } if ( active && NULL != mParentCtrl ) { - UIControl * tChild = mParentCtrl->childGetFirst(); + UIControl * tChild = mParentCtrl->getFirstChild(); while ( NULL != tChild ) { if ( tChild->isType( UI_TYPE_RADIOBUTTON ) ) { @@ -147,14 +147,14 @@ void UIRadioButton::active( const bool& active ) { } } - tChild = tChild->nextGet(); + tChild = tChild->getNextControl(); } } } bool UIRadioButton::checkActives() { if ( NULL != mParentCtrl ) { - UIControl * tChild = mParentCtrl->childGetFirst(); + UIControl * tChild = mParentCtrl->getFirstChild(); while ( NULL != tChild ) { if ( tChild->isType( UI_TYPE_RADIOBUTTON ) ) { @@ -166,7 +166,7 @@ bool UIRadioButton::checkActives() { } } - tChild = tChild->nextGet(); + tChild = tChild->getNextControl(); } } @@ -177,7 +177,7 @@ void UIRadioButton::autoActivate() { eeASSERT( NULL != mParentCtrl ); if ( NULL != mParentCtrl ) { - UIControl * tChild = mParentCtrl->childGetFirst(); + UIControl * tChild = mParentCtrl->getFirstChild(); while ( NULL != tChild ) { if ( tChild->isType( UI_TYPE_RADIOBUTTON ) ) { @@ -190,7 +190,7 @@ void UIRadioButton::autoActivate() { } } - tChild = tChild->nextGet(); + tChild = tChild->getNextControl(); } } @@ -207,7 +207,7 @@ const bool& UIRadioButton::isActive() const { void UIRadioButton::padding( const Recti& padding ) { mPadding = padding; - mPadding.Left = mPadding.Left + mActiveButton->size().getWidth(); + mPadding.Left = mPadding.Left + mActiveButton->getSize().getWidth(); } UIControlAnim * UIRadioButton::activeButton() const { @@ -233,8 +233,8 @@ Uint32 UIRadioButton::onKeyDown( const UIEventKey& Event ) { void UIRadioButton::onAlphaChange() { UITextBox::onAlphaChange(); - mActiveButton->alpha( mAlpha ); - mInactiveButton->alpha( mAlpha ); + mActiveButton->setAlpha( mAlpha ); + mInactiveButton->setAlpha( mAlpha ); } }} diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 485d9bfa6..e226ef438 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -14,10 +14,10 @@ UIScrollBar::UIScrollBar( const UIScrollBar::CreateParams& Params ) : mBtnDown = eeNew( UIControlAnim, ( CParams ) ); mBtnUp = eeNew( UIControlAnim, ( CParams ) ); - mBtnDown->visible( true ); - mBtnDown->enabled( true ); - mBtnUp->visible( true ); - mBtnUp->enabled( true ); + mBtnDown->setVisible( true ); + mBtnDown->setEnabled( true ); + mBtnUp->setVisible( true ); + mBtnUp->setEnabled( true ); UISlider::CreateParams SParams; SParams.Background = Params.Background; @@ -32,8 +32,8 @@ UIScrollBar::UIScrollBar( const UIScrollBar::CreateParams& Params ) : SParams.ExpandBackground = true; mSlider = eeNew( UISlider, ( SParams ) ); - mSlider->visible( true ); - mSlider->enabled( true ); + mSlider->setVisible( true ); + mSlider->setEnabled( true ); mSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIScrollBar::onValueChangeCb ) ); @@ -79,7 +79,7 @@ void UIScrollBar::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mBtnUp->size( tSubTexture->getRealSize() ); + mBtnUp->setSize( tSubTexture->getRealSize() ); } } @@ -89,7 +89,7 @@ void UIScrollBar::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mBtnDown->size( tSubTexture->getRealSize() ); + mBtnDown->setSize( tSubTexture->getRealSize() ); } } @@ -101,12 +101,12 @@ void UIScrollBar::setTheme( UITheme * Theme ) { if ( NULL != tSubTexture ) { if ( mSlider->isVertical() ) { - mSlider->size( tSubTexture->getRealSize().getWidth() , mSize.getHeight() ); - size( tSubTexture->getRealSize().getWidth() , mSize.getHeight() ); + mSlider->setSize( tSubTexture->getRealSize().getWidth() , mSize.getHeight() ); + setSize( tSubTexture->getRealSize().getWidth() , mSize.getHeight() ); mMinControlSize.x = mSize.getWidth(); } else { - mSlider->size( mSize.getWidth(), tSubTexture->getRealSize().getHeight() ); - size( mSize.getWidth(), tSubTexture->getRealSize().getHeight() ); + mSlider->setSize( mSize.getWidth(), tSubTexture->getRealSize().getHeight() ); + setSize( mSize.getWidth(), tSubTexture->getRealSize().getHeight() ); mMinControlSize.y = mSize.getHeight(); } } @@ -125,20 +125,20 @@ void UIScrollBar::onSizeChange() { } void UIScrollBar::adjustChilds() { - mBtnUp->position( 0, 0 ); + mBtnUp->setPosition( 0, 0 ); if ( !isVertical() ) { - mBtnDown->position( mSize.getWidth() - mBtnDown->size().getWidth(), 0 ); - mSlider->size( mSize.getWidth() - mBtnDown->size().getWidth() - mBtnUp->size().getWidth(), mSlider->size().getHeight() ); - mSlider->position( mBtnUp->size().getWidth(), 0 ); + mBtnDown->setPosition( mSize.getWidth() - mBtnDown->getSize().getWidth(), 0 ); + mSlider->setSize( mSize.getWidth() - mBtnDown->getSize().getWidth() - mBtnUp->getSize().getWidth(), mSlider->getSize().getHeight() ); + mSlider->setPosition( mBtnUp->getSize().getWidth(), 0 ); mBtnDown->centerVertical(); mBtnUp->centerVertical(); mSlider->centerVertical(); } else { - mBtnDown->position( 0, mSize.getHeight() - mBtnDown->size().getHeight() ); - mSlider->size( mSlider->size().getWidth(), mSize.getHeight() - mBtnDown->size().getHeight() - mBtnUp->size().getHeight() ); - mSlider->position( 0, mBtnUp->size().getHeight() ); + mBtnDown->setPosition( 0, mSize.getHeight() - mBtnDown->getSize().getHeight() ); + mSlider->setSize( mSlider->getSize().getWidth(), mSize.getHeight() - mBtnDown->getSize().getHeight() - mBtnUp->getSize().getHeight() ); + mSlider->setPosition( 0, mBtnUp->getSize().getHeight() ); mBtnDown->centerHorizontal(); mBtnUp->centerHorizontal(); @@ -237,9 +237,9 @@ UIControlAnim * UIScrollBar::getButtonDown() const { void UIScrollBar::onAlphaChange() { UIControlAnim::onAlphaChange(); - mSlider->alpha( mAlpha ); - mBtnUp->alpha( mAlpha ); - mBtnDown->alpha( mAlpha ); + mSlider->setAlpha( mAlpha ); + mBtnUp->setAlpha( mAlpha ); + mBtnDown->setAlpha( mAlpha ); } }} diff --git a/src/eepp/ui/uiselectbutton.cpp b/src/eepp/ui/uiselectbutton.cpp index 2b2aecfe3..ad8137eb3 100644 --- a/src/eepp/ui/uiselectbutton.cpp +++ b/src/eepp/ui/uiselectbutton.cpp @@ -50,8 +50,8 @@ void UISelectButton::onStateChange() { } } - if ( parent()->getType() & UI_TYPE_WINMENU ) { - UIWinMenu * Menu = reinterpret_cast ( parent() ); + if ( getParent()->getType() & UI_TYPE_WINMENU ) { + UIWinMenu * Menu = reinterpret_cast ( getParent() ); if ( mSkinState->getState() == UISkinState::StateSelected ) { getTextBox()->color( Menu->fontSelectedColor() ); diff --git a/src/eepp/ui/uiseparator.cpp b/src/eepp/ui/uiseparator.cpp index ee8c2fbb9..a3e78b3e8 100644 --- a/src/eepp/ui/uiseparator.cpp +++ b/src/eepp/ui/uiseparator.cpp @@ -24,7 +24,7 @@ void UISeparator::setTheme( UITheme * Theme ) { UIControl::setThemeControl( Theme, "separator" ); if ( NULL != mSkinState && NULL != mSkinState->getSkin() && NULL != mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal ) ) { - size( mSize.getWidth(), mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal )->getRealSize().getHeight() ); + setSize( mSize.getWidth(), mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal )->getRealSize().getHeight() ); } } diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index bcf5235b5..76369bb4c 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -26,8 +26,8 @@ UISlider::UISlider( const UISlider::CreateParams& Params ) : BgParams.Size = Sizei( 8, mSize.getWidth() - 16 ); mBackSlider = eeNew( UIControlAnim, ( BgParams ) ); - mBackSlider->visible( true ); - mBackSlider->enabled( true ); + mBackSlider->setVisible( true ); + mBackSlider->setEnabled( true ); mBackSlider->center(); UIDragable::CreateParams SlideParams; @@ -36,9 +36,9 @@ UISlider::UISlider( const UISlider::CreateParams& Params ) : SlideParams.setPos( Vector2i( 0, 0 ) ); mSlider = eeNew( Private::UISliderButton, ( SlideParams ) ); - mSlider->enabled( true ); - mSlider->visible( true ); - mSlider->dragEnable( true ); + mSlider->setEnabled( true ); + mSlider->setVisible( true ); + mSlider->setDragEnabled( true ); if ( !mVertical ) mSlider->centerVertical(); @@ -92,7 +92,7 @@ void UISlider::adjustChilds() { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mSlider->size( tSubTexture->getRealSize() ); + mSlider->setSize( tSubTexture->getRealSize() ); if ( !mVertical ) mSlider->centerVertical(); @@ -116,9 +116,9 @@ void UISlider::adjustChilds() { Height = tSubTexture->getRealSize().getHeight(); if ( mAllowHalfSliderOut ) - mBackSlider->size( Sizei( mSize.getWidth() - mSlider->size().getWidth(), Height ) ); + mBackSlider->setSize( Sizei( mSize.getWidth() - mSlider->getSize().getWidth(), Height ) ); else - mBackSlider->size( Sizei( mSize.getWidth(), Height ) ); + mBackSlider->setSize( Sizei( mSize.getWidth(), Height ) ); } else { Int32 Width; @@ -128,9 +128,9 @@ void UISlider::adjustChilds() { Width = tSubTexture->getRealSize().getWidth(); if ( mAllowHalfSliderOut ) - mBackSlider->size( Sizei( Width, mSize.getHeight() - mSlider->size().getHeight() ) ); + mBackSlider->setSize( Sizei( Width, mSize.getHeight() - mSlider->getSize().getHeight() ) ); else - mBackSlider->size( Sizei( Width, mSize.getHeight() ) ); + mBackSlider->setSize( Sizei( Width, mSize.getHeight() ) ); } mBackSlider->center(); @@ -143,45 +143,45 @@ void UISlider::fixSliderPos() { mOnPosChange = true; if ( !mVertical ) { - mSlider->position( mSlider->position().x, 0 ); + mSlider->setPosition( mSlider->getPosition().x, 0 ); - if ( mSlider->position().x < 0 ) - mSlider->position( 0, 0 ); + if ( mSlider->getPosition().x < 0 ) + mSlider->setPosition( 0, 0 ); if ( mAllowHalfSliderOut ) { - if ( mSlider->position().x > mBackSlider->size().getWidth() ) - mSlider->position( mBackSlider->size().getWidth(), 0 ); + if ( mSlider->getPosition().x > mBackSlider->getSize().getWidth() ) + mSlider->setPosition( mBackSlider->getSize().getWidth(), 0 ); } else { - if ( mSlider->position().x > mBackSlider->size().getWidth() - mSlider->size().getWidth() ) - mSlider->position( mBackSlider->size().getWidth() - mSlider->size().getWidth(), 0 ); + if ( mSlider->getPosition().x > mBackSlider->getSize().getWidth() - mSlider->getSize().getWidth() ) + mSlider->setPosition( mBackSlider->getSize().getWidth() - mSlider->getSize().getWidth(), 0 ); } mSlider->centerVertical(); if ( mAllowHalfSliderOut ) - value( mMinValue + (Float)mSlider->position().x * ( mMaxValue - mMinValue ) / (Float)mBackSlider->size().getWidth() ); + value( mMinValue + (Float)mSlider->getPosition().x * ( mMaxValue - mMinValue ) / (Float)mBackSlider->getSize().getWidth() ); else - value( mMinValue + (Float)mSlider->position().x * ( mMaxValue - mMinValue ) / ( (Float)mSize.getWidth() - mSlider->size().getWidth() ) ); + value( mMinValue + (Float)mSlider->getPosition().x * ( mMaxValue - mMinValue ) / ( (Float)mSize.getWidth() - mSlider->getSize().getWidth() ) ); } else { - mSlider->position( 0, mSlider->position().y ); + mSlider->setPosition( 0, mSlider->getPosition().y ); - if ( mSlider->position().y < 0 ) - mSlider->position( 0, 0 ); + if ( mSlider->getPosition().y < 0 ) + mSlider->setPosition( 0, 0 ); if ( mAllowHalfSliderOut ) { - if ( mSlider->position().y > mBackSlider->size().getHeight() ) - mSlider->position( 0, mBackSlider->size().getHeight() ); + if ( mSlider->getPosition().y > mBackSlider->getSize().getHeight() ) + mSlider->setPosition( 0, mBackSlider->getSize().getHeight() ); } else { - if ( mSlider->position().y > mBackSlider->size().getHeight() - mSlider->size().getHeight() ) - mSlider->position( 0, mBackSlider->size().getHeight() - mSlider->size().getHeight() ); + if ( mSlider->getPosition().y > mBackSlider->getSize().getHeight() - mSlider->getSize().getHeight() ) + mSlider->setPosition( 0, mBackSlider->getSize().getHeight() - mSlider->getSize().getHeight() ); } mSlider->centerHorizontal(); if ( mAllowHalfSliderOut ) - value( mMinValue + (Float)mSlider->position().y * ( mMaxValue - mMinValue ) / (Float)mBackSlider->size().getHeight() ); + value( mMinValue + (Float)mSlider->getPosition().y * ( mMaxValue - mMinValue ) / (Float)mBackSlider->getSize().getHeight() ); else - value( mMinValue + (Float)mSlider->position().y * ( mMaxValue - mMinValue ) / ( (Float)mSize.getHeight() - mSlider->size().getHeight() ) ); + value( mMinValue + (Float)mSlider->getPosition().y * ( mMaxValue - mMinValue ) / ( (Float)mSize.getHeight() - mSlider->getSize().getHeight() ) ); } mOnPosChange = false; @@ -202,14 +202,14 @@ void UISlider::value( Float Val ) { if ( !mVertical ) { if ( mAllowHalfSliderOut ) - mSlider->position( (Int32)( (Float)mBackSlider->size().getWidth() * Percent ), mSlider->position().y ); + mSlider->setPosition( (Int32)( (Float)mBackSlider->getSize().getWidth() * Percent ), mSlider->getPosition().y ); else - mSlider->position( (Int32)( ( (Float)mSize.getWidth() - mSlider->size().getWidth() ) * Percent ), mSlider->position().y ); + mSlider->setPosition( (Int32)( ( (Float)mSize.getWidth() - mSlider->getSize().getWidth() ) * Percent ), mSlider->getPosition().y ); } else { if ( mAllowHalfSliderOut ) - mSlider->position( mSlider->position().x, (Int32)( (Float)mBackSlider->size().getHeight() * Percent ) ); + mSlider->setPosition( mSlider->getPosition().x, (Int32)( (Float)mBackSlider->getSize().getHeight() * Percent ) ); else - mSlider->position( mSlider->position().x, (Int32)( ( (Float)mSize.getHeight() - mSlider->size().getHeight() ) * Percent ) ); + mSlider->setPosition( mSlider->getPosition().x, (Int32)( ( (Float)mSize.getHeight() - mSlider->getSize().getHeight() ) * Percent ) ); } mOnPosChange = false; @@ -338,8 +338,8 @@ const bool& UISlider::expandBackground() const { void UISlider::onAlphaChange() { UIControlAnim::onAlphaChange(); - mBackSlider->alpha( mAlpha ); - mSlider->alpha( mAlpha ); + mBackSlider->setAlpha( mAlpha ); + mSlider->setAlpha( mAlpha ); } }} diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 4810093d5..703446c33 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -34,12 +34,12 @@ UISpinBox::UISpinBox( const UISpinBox::CreateParams& Params ) : mPushUp = eeNew( UIControlAnim, ( BtnParams ) ); mPushDown = eeNew( UIControlAnim, ( BtnParams ) ); - mInput->visible ( true ); - mInput->enabled ( true ); - mPushUp->visible ( true ); - mPushUp->enabled ( true ); - mPushDown->visible ( true ); - mPushDown->enabled ( true ); + mInput->setVisible ( true ); + mInput->setEnabled ( true ); + mPushUp->setVisible ( true ); + mPushUp->setEnabled ( true ); + mPushDown->setVisible ( true ); + mPushDown->setEnabled ( true ); mInput->getInputTextBuffer()->setAllowOnlyNumbers( true, Params.AllowDotsInNumbers ); @@ -77,7 +77,7 @@ void UISpinBox::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mPushUp->size( tSubTexture->getRealSize() ); + mPushUp->setSize( tSubTexture->getRealSize() ); } } @@ -87,7 +87,7 @@ void UISpinBox::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mPushDown->size( tSubTexture->getRealSize() ); + mPushDown->setSize( tSubTexture->getRealSize() ); } } @@ -99,9 +99,9 @@ void UISpinBox::setTheme( UITheme * Theme ) { } void UISpinBox::adjustChilds() { - mPushUp->position( mSize.getWidth() - mPushUp->size().getWidth(), 0 ); - mPushDown->position( mSize.getWidth() - mPushDown->size().getWidth(), mPushUp->size().getHeight() ); - mInput->size( mSize.getWidth() - mPushUp->size().getWidth(), mSize.getHeight() ); + mPushUp->setPosition( mSize.getWidth() - mPushUp->getSize().getWidth(), 0 ); + mPushDown->setPosition( mSize.getWidth() - mPushDown->getSize().getWidth(), mPushUp->getSize().getHeight() ); + mInput->setSize( mSize.getWidth() - mPushUp->getSize().getWidth(), mSize.getHeight() ); } void UISpinBox::padding( const Recti& padding ) { @@ -241,9 +241,9 @@ UITextInput * UISpinBox::getTextInput() const { void UISpinBox::onAlphaChange() { UIControlAnim::onAlphaChange(); - mInput->alpha( mAlpha ); - mPushUp->alpha( mAlpha ); - mPushDown->alpha( mAlpha ); + mInput->setAlpha( mAlpha ); + mPushUp->setAlpha( mAlpha ); + mPushDown->setAlpha( mAlpha ); } }} diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index 5eb4ee560..bdeef885b 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -13,9 +13,9 @@ UISprite::UISprite( const UISprite::CreateParams& Params ) : if ( Params.DealloSprite ) mControlFlags |= UI_CTRL_FLAG_FREE_USE; - if ( ( flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) { + if ( ( getFlags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) { if ( NULL != mSprite && NULL != mSprite->getCurrentSubTexture() ) { - size( mSprite->getCurrentSubTexture()->getSize() ); + setSize( mSprite->getCurrentSubTexture()->getSize() ); } } } @@ -53,7 +53,7 @@ void UISprite::draw() { if ( NULL != mSprite && 0.f != mAlpha ) { checkSubTextureUpdate(); mSprite->setPosition( (Float)( mScreenPos.x + mAlignOffset.x ), (Float)( mScreenPos.y + mAlignOffset.y ) ); - mSprite->draw( blend(), mRender ); + mSprite->draw( getBlendMode(), mRender ); } } } @@ -66,8 +66,8 @@ void UISprite::checkSubTextureUpdate() { } } -void UISprite::alpha( const Float& alpha ) { - UIControlAnim::alpha( alpha ); +void UISprite::setAlpha( const Float& alpha ) { + UIControlAnim::setAlpha( alpha ); if ( NULL != mSprite ) mSprite->setAlpha( alpha ); @@ -88,7 +88,7 @@ void UISprite::color( const ColorA& color ) { if ( NULL != mSprite ) mSprite->setColor( color ); - alpha( color.a() ); + setAlpha( color.a() ); } const EE_RENDER_MODE& UISprite::renderMode() const { @@ -100,10 +100,10 @@ void UISprite::renderMode( const EE_RENDER_MODE& render ) { } void UISprite::updateSize() { - if ( flags() & UI_AUTO_SIZE ) { + if ( getFlags() & UI_AUTO_SIZE ) { if ( NULL != mSprite ) { if ( NULL != mSprite->getCurrentSubTexture() && mSprite->getCurrentSubTexture()->getSize() != mSize ) - size( mSprite->getCurrentSubTexture()->getSize() ); + setSize( mSprite->getCurrentSubTexture()->getSize() ); } } } diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index bdee97256..f86c96c69 100644 --- a/src/eepp/ui/uitab.cpp +++ b/src/eepp/ui/uitab.cpp @@ -23,8 +23,8 @@ bool UITab::isType( const Uint32& type ) const { } UITabWidget * UITab::getTabWidget() { - if ( parent()->parent()->isType( UI_TYPE_TABWIDGET ) ) { - return reinterpret_cast ( parent()->parent() ); + if ( getParent()->getParent()->isType( UI_TYPE_TABWIDGET ) ) { + return reinterpret_cast ( getParent()->getParent() ); } return NULL; @@ -70,7 +70,7 @@ void UITab::onStateChange() { UITabWidget * tTabW = getTabWidget(); if ( NULL != tTabW ) { - size( mSize.getWidth(), getSkinSize( getSkin(), mSkinState->getState() ).getHeight() ); + setSize( mSize.getWidth(), getSkinSize( getSkin(), mSkinState->getState() ).getHeight() ); if ( mSkinState->getState() == UISkinState::StateSelected ) { mTextBox->color( tTabW->mFontSelectedColor ); @@ -115,7 +115,7 @@ void UITab::setRealSize() { w = eemin( w, tTabW->mMaxTabWidth ); } - size( w, mSize.getHeight() ); + setSize( w, mSize.getHeight() ); } } diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index 4399958c5..8fcbdf7a2 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -32,8 +32,8 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) : TabParams.setSize( mSize.getWidth(), mTabWidgetHeight ); mTabContainer = eeNew( UIComplexControl, ( TabParams ) ); - mTabContainer->visible( true ); - mTabContainer->enabled( true ); + mTabContainer->setVisible( true ); + mTabContainer->setEnabled( true ); UIComplexControl::CreateParams CtrlParams; CtrlParams.setParent( this ); @@ -42,8 +42,8 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) : CtrlParams.Flags |= UI_CLIP_ENABLE | UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT; mCtrlContainer = eeNew( UIComplexControl, ( CtrlParams ) ); - mCtrlContainer->visible( true ); - mCtrlContainer->enabled( true ); + mCtrlContainer->setVisible( true ); + mCtrlContainer->setEnabled( true ); onSizeChange(); @@ -86,9 +86,9 @@ void UITabWidget::doAftersetTheme() { } void UITabWidget::seContainerSize() { - mTabContainer->size( mSize.getWidth(), mTabWidgetHeight ); - mCtrlContainer->position( 0, mTabWidgetHeight ); - mCtrlContainer->size( mSize.getWidth(), mSize.getHeight() - mTabWidgetHeight ); + mTabContainer->setSize( mSize.getWidth(), mTabWidgetHeight ); + mCtrlContainer->setPosition( 0, mTabWidgetHeight ); + mCtrlContainer->setSize( mSize.getWidth(), mSize.getHeight() - mTabWidgetHeight ); } void UITabWidget::draw() { @@ -97,8 +97,8 @@ void UITabWidget::draw() { if ( smooth ) GLi->lineSmooth( false ); Primitives P; - Vector2i p1( mPos.x, mPos.y + mTabContainer->size().getHeight() + mLineBewowTabsYOffset ); - Vector2i p2( mPos.x + mTabContainer->position().x, p1.y ); + Vector2i p1( mPos.x, mPos.y + mTabContainer->getSize().getHeight() + mLineBewowTabsYOffset ); + Vector2i p2( mPos.x + mTabContainer->getPosition().x, p1.y ); controlToScreen( p1 ); controlToScreen( p2 ); @@ -107,7 +107,7 @@ void UITabWidget::draw() { P.setColor( mLineBelowTabsColor ); P.drawLine( Line2f( Vector2f( p1.x, p1.y ), Vector2f( p2.x, p2.y ) ) ); - Vector2i p3( mPos.x + mTabContainer->position().x + mTabContainer->size().getWidth(), mPos.y + mTabContainer->size().getHeight() + mLineBewowTabsYOffset ); + Vector2i p3( mPos.x + mTabContainer->getPosition().x + mTabContainer->getSize().getWidth(), mPos.y + mTabContainer->getSize().getHeight() + mLineBewowTabsYOffset ); Vector2i p4( mPos.x + mSize.getWidth(), p3.y ); controlToScreen( p3 ); @@ -124,24 +124,24 @@ void UITabWidget::setTabContainerSize() { if ( mTabs.size() > 0 ) { for ( Uint32 i = 0; i < mTabs.size(); i++ ) { - s += mTabs[i]->size().getWidth() + mTabSeparation; + s += mTabs[i]->getSize().getWidth() + mTabSeparation; } s -= mTabSeparation; } - mTabContainer->size( s, mTabWidgetHeight ); + mTabContainer->setSize( s, mTabWidgetHeight ); switch ( HAlignGet( mFlags ) ) { case UI_HALIGN_LEFT: - mTabContainer->position( 0, 0 ); + mTabContainer->setPosition( 0, 0 ); break; case UI_HALIGN_CENTER: mTabContainer->centerHorizontal(); break; case UI_HALIGN_RIGHT: - mTabContainer->position( mSize.getWidth() - mTabContainer->size().getWidth(), 0 ); + mTabContainer->setPosition( mSize.getWidth() - mTabContainer->getSize().getWidth(), 0 ); break; } } @@ -155,19 +155,19 @@ void UITabWidget::posTabs() { switch ( VA ) { case UI_VALIGN_BOTTOM: - h = mTabWidgetHeight - mTabs[i]->size().getHeight(); + h = mTabWidgetHeight - mTabs[i]->getSize().getHeight(); break; case UI_VALIGN_TOP: h = 0; break; case UI_VALIGN_CENTER: - h = mTabWidgetHeight / 2 - mTabs[i]->size().getHeight() / 2; + h = mTabWidgetHeight / 2 - mTabs[i]->getSize().getHeight() / 2; break; } - mTabs[i]->position( w, h ); + mTabs[i]->setPosition( w, h ); - w += mTabs[i]->size().getHeight() + mTabSeparation; + w += mTabs[i]->getSize().getHeight() + mTabSeparation; } } @@ -204,12 +204,12 @@ UITab * UITabWidget::createTab( const String& Text, UIControl * CtrlOwned, SubTe UITab * tCtrl = eeNew( UITab, ( Params, CtrlOwned ) ); tCtrl->text( Text ); - tCtrl->visible( true ); - tCtrl->enabled( true ); + tCtrl->setVisible( true ); + tCtrl->setEnabled( true ); - CtrlOwned->parent( mCtrlContainer ); - CtrlOwned->visible( false ); - CtrlOwned->enabled( true ); + CtrlOwned->setParent( mCtrlContainer ); + CtrlOwned->setVisible( false ); + CtrlOwned->setEnabled( true ); return tCtrl; } @@ -219,7 +219,7 @@ Uint32 UITabWidget::add( const String& Text, UIControl * CtrlOwned, SubTexture * } Uint32 UITabWidget::add( UITab * Tab ) { - Tab->parent( mTabContainer ); + Tab->setParent( mTabContainer ); mTabs.push_back( Tab ); @@ -267,7 +267,7 @@ void UITabWidget::remove( const Uint32& Index ) { eeASSERT( Index < mTabs.size() ); if ( mTabs[ Index ] == mTabSelected ) { - mTabSelected->ctrlOwned()->visible( false ); + mTabSelected->ctrlOwned()->setVisible( false ); } eeSAFE_DELETE( mTabs[ Index ] ); @@ -332,7 +332,7 @@ void UITabWidget::setTabSelected( UITab * Tab ) { if ( NULL != mTabSelected ) { mTabSelected->unselect(); - mTabSelected->ctrlOwned()->visible( false ); + mTabSelected->ctrlOwned()->setVisible( false ); } if ( NULL != Tab ) { @@ -347,9 +347,9 @@ void UITabWidget::setTabSelected( UITab * Tab ) { mTabSelected = Tab; mTabSelectedIndex = TabIndex; - mTabSelected->ctrlOwned()->visible( true ); - mTabSelected->ctrlOwned()->size( mCtrlContainer->size() ); - mTabSelected->ctrlOwned()->position( 0, 0 ); + mTabSelected->ctrlOwned()->setVisible( true ); + mTabSelected->ctrlOwned()->setSize( mCtrlContainer->getSize() ); + mTabSelected->ctrlOwned()->setPosition( 0, 0 ); orderTabs(); @@ -383,7 +383,7 @@ void UITabWidget::onSizeChange() { posTabs(); if ( NULL != mTabSelected ) { - mTabSelected->ctrlOwned()->size( mCtrlContainer->size() ); + mTabSelected->ctrlOwned()->setSize( mCtrlContainer->getSize() ); } UIControl::onSizeChange(); diff --git a/src/eepp/ui/uitextbox.cpp b/src/eepp/ui/uitextbox.cpp index 3b3366ff7..b686b5918 100644 --- a/src/eepp/ui/uitextbox.cpp +++ b/src/eepp/ui/uitextbox.cpp @@ -60,8 +60,8 @@ void UITextBox::draw() { ); } - mTextCache->setFlags( flags() ); - mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, blend() ); + mTextCache->setFlags( getFlags() ); + mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, getBlendMode() ); if ( mFlags & UI_CLIP_ENABLE ) { UIManager::instance()->clipDisable(); @@ -113,7 +113,7 @@ void UITextBox::color( const ColorA& color ) { mFontColor = color; mTextCache->setColor( color ); - alpha( color.a() ); + setAlpha( color.a() ); } const ColorA& UITextBox::shadowColor() const { @@ -133,8 +133,8 @@ void UITextBox::selectionBackColor( const ColorA& color ) { mFontSelectionBackColor = color; } -void UITextBox::alpha( const Float& alpha ) { - UIControlAnim::alpha( alpha ); +void UITextBox::setAlpha( const Float& alpha ) { + UIControlAnim::setAlpha( alpha ); mFontColor.Alpha = (Uint8)alpha; mFontShadowColor.Alpha = (Uint8)alpha; @@ -163,7 +163,7 @@ void UITextBox::autoSize() { } void UITextBox::autoAlign() { - switch ( FontHAlignGet( flags() ) ) { + switch ( FontHAlignGet( getFlags() ) ) { case UI_HALIGN_CENTER: mAlignOffset.x = (Float)( (Int32)( mSize.x - mTextCache->getTextWidth() ) / 2 ); break; @@ -175,7 +175,7 @@ void UITextBox::autoAlign() { break; } - switch ( FontVAlignGet( flags() ) ) { + switch ( FontVAlignGet( getFlags() ) ) { case UI_VALIGN_CENTER: mAlignOffset.y = (Float)( ( (Int32)( mSize.y - mTextCache->getTextHeight() ) ) / 2 ) - 1; break; diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index 8ab1d39bc..7fa222907 100644 --- a/src/eepp/ui/uitextedit.cpp +++ b/src/eepp/ui/uitextedit.cpp @@ -42,8 +42,8 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) : mTextInput = eeNew( UITextInput, ( TIParams ) ); mTextInput->getInputTextBuffer()->isNewLineEnabled( true ); - mTextInput->visible( true ); - mTextInput->enabled( true ); + mTextInput->setVisible( true ); + mTextInput->setEnabled( true ); mTextInput->addEventListener( UIEvent::EventOnSizeChange , cb::Make1( this, &UITextEdit::onInputSizeChange ) ); mTextInput->addEventListener( UIEvent::EventOnTextChanged , cb::Make1( this, &UITextEdit::onInputSizeChange ) ); mTextInput->addEventListener( UIEvent::EventOnPressEnter , cb::Make1( this, &UITextEdit::onInputSizeChange ) ); @@ -59,7 +59,7 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) : mVScrollBar->value( 1 ); ScrollBarP.setPos( 0, mSize.getHeight() - 15 ); - ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->size().getWidth(), 15 ); + ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); @@ -72,7 +72,7 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) : applyDefaultTheme(); - mTextInput->size( mSize - Sizei( mPadding.Left + mPadding.Right, mPadding.Top + mPadding.Bottom ) ); + mTextInput->setSize( mSize - Sizei( mPadding.Left + mPadding.Right, mPadding.Top + mPadding.Bottom ) ); } UITextEdit::~UITextEdit() { @@ -97,13 +97,13 @@ void UITextEdit::setTheme( UITheme * Theme ) { } void UITextEdit::onSizeChange() { - mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); - mVScrollBar->position( mSize.getWidth() - mVScrollBar->size().getWidth(), 0 ); + mHScrollBar->setPosition( 0, mSize.getHeight() - mHScrollBar->getSize().getHeight() ); + mVScrollBar->setPosition( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 0 ); - mHScrollBar->size( mSize.getWidth(), mHScrollBar->size().getHeight() ); - mVScrollBar->size( mVScrollBar->size().getWidth(), mSize.getHeight() ); + mHScrollBar->setSize( mSize.getWidth(), mHScrollBar->getSize().getHeight() ); + mVScrollBar->setSize( mVScrollBar->getSize().getWidth(), mSize.getHeight() ); - mTextInput->position( mPadding.Left, mPadding.Top ); + mTextInput->setPosition( mPadding.Left, mPadding.Top ); scrollbarsSet(); @@ -117,9 +117,9 @@ void UITextEdit::onParentSizeChange( const Vector2i& SizeChange ) { } void UITextEdit::onAlphaChange() { - mTextInput->alpha( mAlpha ); - mHScrollBar->alpha( mAlpha ); - mVScrollBar->alpha( mAlpha ); + mTextInput->setAlpha( mAlpha ); + mHScrollBar->setAlpha( mAlpha ); + mVScrollBar->setAlpha( mAlpha ); UIComplexControl::onAlphaChange(); } @@ -128,26 +128,26 @@ void UITextEdit::fixScroll() { int Width = mSize.getWidth() - mPadding.Left - mPadding.Right; int Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; - if ( mHScrollBar->visible() ) - Height -= mHScrollBar->size().getHeight(); + if ( mHScrollBar->isVisible() ) + Height -= mHScrollBar->getSize().getHeight(); int diff; Float pos; - if ( mTextInput->size().getHeight() - Height >= 0 ) { - diff = mTextInput->size().getHeight() - Height; + if ( mTextInput->getSize().getHeight() - Height >= 0 ) { + diff = mTextInput->getSize().getHeight() - Height; pos = diff * mVScrollBar->value(); - mTextInput->position( mTextInput->position().x, mPadding.Top - pos ); + mTextInput->setPosition( mTextInput->getPosition().x, mPadding.Top - pos ); } - if ( mTextInput->size().getWidth() - Width >= 0 ) { - diff = mTextInput->size().getWidth() - Width; + if ( mTextInput->getSize().getWidth() - Width >= 0 ) { + diff = mTextInput->getSize().getWidth() - Width; pos = diff * mHScrollBar->value(); - mTextInput->position( mPadding.Left - pos, mTextInput->position().y ); + mTextInput->setPosition( mPadding.Left - pos, mTextInput->getPosition().y ); } } @@ -155,24 +155,24 @@ void UITextEdit::scrollbarsSet() { switch ( mHScrollBarMode ) { case UI_SCROLLBAR_ALWAYS_OFF: { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); break; } case UI_SCROLLBAR_ALWAYS_ON: { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); break; } case UI_SCROLLBAR_AUTO: { if ( mTextInput->getTextWidth() > mSize.getWidth() - mPadding.Left - mPadding.Right ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); } else { - mHScrollBar->visible( false ); - mHScrollBar->enabled( false ); + mHScrollBar->setVisible( false ); + mHScrollBar->setEnabled( false ); } break; } @@ -181,50 +181,50 @@ void UITextEdit::scrollbarsSet() { switch ( mVScrollBarMode ) { case UI_SCROLLBAR_ALWAYS_OFF: { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); break; } case UI_SCROLLBAR_ALWAYS_ON: { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); break; } case UI_SCROLLBAR_AUTO: { int extraH = 0; - if ( mHScrollBar->visible() ) - extraH = mHScrollBar->size().getHeight(); + if ( mHScrollBar->isVisible() ) + extraH = mHScrollBar->getSize().getHeight(); if ( mTextInput->getTextHeight() > mSize.getHeight() - mPadding.Top - mPadding.Bottom - extraH ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } else { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); } break; } } - if ( !mVScrollBar->visible() && mHScrollBar->visible() ) { - mHScrollBar->size( mSize.getWidth(), mHScrollBar->size().getHeight() ); + if ( !mVScrollBar->isVisible() && mHScrollBar->isVisible() ) { + mHScrollBar->setSize( mSize.getWidth(), mHScrollBar->getSize().getHeight() ); } else { - mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth(), mHScrollBar->size().getHeight() ); + mHScrollBar->setSize( mSize.getWidth() - mVScrollBar->getSize().getWidth(), mHScrollBar->getSize().getHeight() ); } - if ( UI_SCROLLBAR_AUTO == mHScrollBarMode && mVScrollBar->visible() && !mHScrollBar->visible() ) { - if ( mTextInput->getTextWidth() > mSize.getWidth() - mPadding.Left - mPadding.Right - mVScrollBar->size().getWidth() ) { - mHScrollBar->visible( true ); - mHScrollBar->enabled( true ); + if ( UI_SCROLLBAR_AUTO == mHScrollBarMode && mVScrollBar->isVisible() && !mHScrollBar->isVisible() ) { + if ( mTextInput->getTextWidth() > mSize.getWidth() - mPadding.Left - mPadding.Right - mVScrollBar->getSize().getWidth() ) { + mHScrollBar->setVisible( true ); + mHScrollBar->setEnabled( true ); } } if ( mFlags & UI_AUTO_SHRINK_TEXT ) { - mVScrollBar->visible( true ); - mVScrollBar->enabled( true ); + mVScrollBar->setVisible( true ); + mVScrollBar->setEnabled( true ); } } @@ -280,43 +280,43 @@ void UITextEdit::onInputSizeChange( const UIEvent * Event ) { scrollbarsSet(); - if ( mHScrollBar->visible() ) - Height -= mHScrollBar->size().getHeight(); + if ( mHScrollBar->isVisible() ) + Height -= mHScrollBar->getSize().getHeight(); - if ( mVScrollBar->visible() ) - Width -= mVScrollBar->size().getWidth(); + if ( mVScrollBar->isVisible() ) + Width -= mVScrollBar->getSize().getWidth(); shrinkText( Width ); if ( ( mFlags & UI_AUTO_SHRINK_TEXT ) && mTextInput->getTextHeight() < Height ) { - mVScrollBar->visible( false ); - mVScrollBar->enabled( false ); + mVScrollBar->setVisible( false ); + mVScrollBar->setEnabled( false ); } - if ( mTextInput->size().getWidth() < Width || mTextInput->size().getHeight() < Height ) { - if ( mTextInput->size().getWidth() < Width && mTextInput->size().getHeight() < Height ) { - mTextInput->size( Width, Height ); + if ( mTextInput->getSize().getWidth() < Width || mTextInput->getSize().getHeight() < Height ) { + if ( mTextInput->getSize().getWidth() < Width && mTextInput->getSize().getHeight() < Height ) { + mTextInput->setSize( Width, Height ); } else { - if ( mTextInput->size().getWidth() < Width ) { - mTextInput->size( Width, mTextInput->size().getHeight() ); + if ( mTextInput->getSize().getWidth() < Width ) { + mTextInput->setSize( Width, mTextInput->getSize().getHeight() ); } else { - mTextInput->size( mTextInput->size().getWidth(), Height ); + mTextInput->setSize( mTextInput->getSize().getWidth(), Height ); } } } if ( mTextInput->getTextWidth() > Width || mTextInput->getTextHeight() > Height ) { if ( mTextInput->getTextWidth() > Width && mTextInput->getTextHeight() > Height ) { - mTextInput->size( mTextInput->getTextWidth(), mTextInput->getTextHeight() ); + mTextInput->setSize( mTextInput->getTextWidth(), mTextInput->getTextHeight() ); } else { if ( mTextInput->getTextWidth() > Width ) { - mTextInput->size( mTextInput->getTextWidth(), Height ); + mTextInput->setSize( mTextInput->getTextWidth(), Height ); } else { - mTextInput->size( Width, mTextInput->getTextHeight() ); + mTextInput->setSize( Width, mTextInput->getTextHeight() ); } } } else { - mTextInput->size( Width, Height ); + mTextInput->setSize( Width, Height ); } fixScroll(); @@ -331,13 +331,13 @@ void UITextEdit::fixScrollToCursor() { int Width = mSize.getWidth() - mPadding.Left - mPadding.Right; int Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; - if ( mVScrollBar->visible() ) - Width -= mVScrollBar->size().getWidth(); + if ( mVScrollBar->isVisible() ) + Width -= mVScrollBar->getSize().getWidth(); - if ( mHScrollBar->visible() ) - Height -= mHScrollBar->size().getHeight(); + if ( mHScrollBar->isVisible() ) + Height -= mHScrollBar->getSize().getHeight(); - if ( FontHAlignGet( mTextInput->flags() ) == UI_HALIGN_LEFT ) { + if ( FontHAlignGet( mTextInput->getFlags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; Uint32 LineNum = mTextInput->getInputTextBuffer()->getCurPosLinePos( NLPos ); @@ -353,26 +353,26 @@ void UITextEdit::fixScrollToCursor() { Float tH = (Float)(LineNum + 1) * (Float)mTextInput->getTextCache()->getFont()->getFontHeight(); if ( tW > Width ) { - mTextInput->position( mPadding.Left + Width - tW, mTextInput->position().y ); + mTextInput->setPosition( mPadding.Left + Width - tW, mTextInput->getPosition().y ); } else { - mTextInput->position( mPadding.Left, mTextInput->position().y ); + mTextInput->setPosition( mPadding.Left, mTextInput->getPosition().y ); } if ( tH > Height ) { - mTextInput->position( mTextInput->position().x, mPadding.Top + Height - tH ); + mTextInput->setPosition( mTextInput->getPosition().x, mPadding.Top + Height - tH ); } else { - mTextInput->position( mTextInput->position().x, mPadding.Top ); + mTextInput->setPosition( mTextInput->getPosition().x, mPadding.Top ); } - mHScrollBar->value( tW / mTextInput->size().getWidth() ); - mVScrollBar->value( tH / mTextInput->size().getHeight() ); + mHScrollBar->value( tW / mTextInput->getSize().getWidth() ); + mVScrollBar->value( tH / mTextInput->getSize().getHeight() ); mSkipValueChange = false; } } void UITextEdit::shrinkText( const Uint32& Width ) { - if ( flags() & UI_AUTO_SHRINK_TEXT ) { + if ( getFlags() & UI_AUTO_SHRINK_TEXT ) { mTextInput->shrinkText( Width ); } } @@ -380,7 +380,7 @@ void UITextEdit::shrinkText( const Uint32& Width ) { void UITextEdit::update() { UIControlAnim::update(); - if ( mTextInput->enabled() && mTextInput->visible() && mTextInput->isMouseOver() && mVScrollBar->visible() ) { + if ( mTextInput->isEnabled() && mTextInput->isVisible() && mTextInput->isMouseOver() && mVScrollBar->isVisible() ) { Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 608b6397a..b0506efc6 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -147,7 +147,7 @@ void UITextInput::resetWaitCursor() { } void UITextInput::alignFix() { - if ( FontHAlignGet( flags() ) == UI_HALIGN_LEFT ) { + if ( FontHAlignGet( getFlags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); @@ -177,7 +177,7 @@ void UITextInput::setTheme( UITheme * Theme ) { void UITextInput::autoSize() { if ( mFlags & UI_AUTO_SIZE ) { - size( mSize.x, getSkinSize().getHeight() ); + setSize( mSize.x, getSkinSize().getHeight() ); } } diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index 52a1bd882..1ab18858c 100644 --- a/src/eepp/ui/uitextinputpassword.cpp +++ b/src/eepp/ui/uitextinputpassword.cpp @@ -38,8 +38,8 @@ void UITextInputPassword::draw() { ); } - mPassCache->setFlags( flags() ); - mPassCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, blend() ); + mPassCache->setFlags( getFlags() ); + mPassCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, getBlendMode() ); if ( mFlags & UI_CLIP_ENABLE ) { UIManager::instance()->clipDisable(); @@ -51,7 +51,7 @@ void UITextInputPassword::draw() { } void UITextInputPassword::alignFix() { - if ( FontHAlignGet( flags() ) == UI_HALIGN_LEFT ) { + if ( FontHAlignGet( getFlags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); @@ -79,7 +79,7 @@ void UITextInputPassword::alignFix() { } void UITextInputPassword::autoAlign() { - switch ( FontHAlignGet( flags() ) ) { + switch ( FontHAlignGet( getFlags() ) ) { case UI_HALIGN_CENTER: mAlignOffset.x = (Float)( (Int32)( mSize.x - mPassCache->getTextWidth() ) / 2 ); break; @@ -91,7 +91,7 @@ void UITextInputPassword::autoAlign() { break; } - switch ( FontVAlignGet( flags() ) ) { + switch ( FontVAlignGet( getFlags() ) ) { case UI_VALIGN_CENTER: mAlignOffset.y = (Float)( ( (Int32)( mSize.y - mPassCache->getTextHeight() ) ) / 2 ) - 1; break; diff --git a/src/eepp/ui/uitheme.cpp b/src/eepp/ui/uitheme.cpp index f0c6290d5..b98b43f3d 100644 --- a/src/eepp/ui/uitheme.cpp +++ b/src/eepp/ui/uitheme.cpp @@ -434,8 +434,8 @@ UIGfx * UITheme::createGfx( SubTexture * SubTexture, UIControl * Parent, const S GfxParams.SubTextureColor = SubTextureColor; GfxParams.SubTextureRender = SubTextureRender; UIGfx * Gfx = eeNew( UIGfx, ( GfxParams ) ); - Gfx->visible( true ); - Gfx->enabled( true ); + Gfx->setVisible( true ); + Gfx->setEnabled( true ); return Gfx; } @@ -449,8 +449,8 @@ UISprite * UITheme::createSprite( Sprite * Sprite, UIControl * Parent, const Siz SpriteParams.SpriteRender = SpriteRender; SpriteParams.DealloSprite = DealloSprite; UISprite * Spr = eeNew( UISprite, ( SpriteParams ) ); - Spr->visible( true ); - Spr->enabled( true ); + Spr->setVisible( true ); + Spr->setEnabled( true ); return Spr; } @@ -461,8 +461,8 @@ UICheckBox * UITheme::createCheckBox( UIControl * Parent, const Sizei& Size, con CheckBoxParams.setSize( Size ); CheckBoxParams.Flags = Flags; UICheckBox * Ctrl = eeNew( UICheckBox, ( CheckBoxParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -473,8 +473,8 @@ UIRadioButton * UITheme::createRadioButton( UIControl * Parent, const Sizei& Siz RadioButtonParams.setSize( Size ); RadioButtonParams.Flags = Flags; UIRadioButton * Ctrl = eeNew( UIRadioButton, ( RadioButtonParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -485,8 +485,8 @@ UITextBox * UITheme::createTextBox( const String& Text, UIControl * Parent, cons TextBoxParams.setSize( Size ); TextBoxParams.Flags = Flags; UITextBox * Ctrl = eeNew( UITextBox, ( TextBoxParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( false ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( false ); Ctrl->text( Text ); return Ctrl; } @@ -498,8 +498,8 @@ UITooltip * UITheme::createTooltip( UIControl * TooltipOf, UIControl * Parent, c TooltipParams.setSize( Size ); TooltipParams.Flags = Flags; UITooltip * Ctrl = eeNew( UITooltip, ( TooltipParams, TooltipOf ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -513,8 +513,8 @@ UITextEdit * UITheme::createTextEdit( UIControl * Parent, const Sizei& Size, con TextEditParams.VScrollBar = VScrollBar; TextEditParams.WordWrap = WordWrap; UITextEdit * Ctrl = eeNew( UITextEdit, ( TextEditParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -527,8 +527,8 @@ UITextInput * UITheme::createTextInput( UIControl * Parent, const Sizei& Size, c TextInputParams.SupportFreeEditing = SupportFreeEditing; TextInputParams.MaxLength = MaxLength; UITextInput * Ctrl = eeNew( UITextInput, ( TextInputParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -541,8 +541,8 @@ UITextInputPassword * UITheme::createTextInputPassword( UIControl * Parent, cons TextInputParams.SupportFreeEditing = SupportFreeEditing; TextInputParams.MaxLength = MaxLength; UITextInputPassword * Ctrl = eeNew( UITextInputPassword, ( TextInputParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -555,8 +555,8 @@ UISpinBox * UITheme::createSpinBox( UIControl * Parent, const Sizei& Size, const SpinBoxParams.DefaultValue = DefaultValue; SpinBoxParams.AllowDotsInNumbers = AllowDotsInNumbers; UISpinBox * Ctrl = eeNew( UISpinBox, ( SpinBoxParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -568,8 +568,8 @@ UIScrollBar * UITheme::createScrollBar( UIControl * Parent, const Sizei& Size, c ScrollBarParams.Flags = Flags; ScrollBarParams.VerticalScrollBar = VerticalScrollBar; UIScrollBar * Ctrl = eeNew( UIScrollBar, ( ScrollBarParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -583,8 +583,8 @@ UISlider * UITheme::createSlider( UIControl * Parent, const Sizei& Size, const V SliderParams.AllowHalfSliderOut = AllowHalfSliderOut; SliderParams.ExpandBackground = ExpandBackground; UISlider * Ctrl = eeNew( UISlider, ( SliderParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -598,8 +598,8 @@ UIComboBox * UITheme::createComboBox( UIControl * Parent, const Sizei& Size, con ComboParams.PopUpToMainControl = PopUpToMainControl; ComboParams.ListBox = ListBox; UIComboBox * Ctrl = eeNew( UIComboBox, ( ComboParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -613,8 +613,8 @@ UIDropDownList * UITheme::createDropDownList( UIControl * Parent, const Sizei& S DDLParams.PopUpToMainControl = PopUpToMainControl; DDLParams.ListBox = ListBox; UIDropDownList * Ctrl = eeNew( UIDropDownList, ( DDLParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -630,8 +630,8 @@ UIListBox * UITheme::createListBox( UIControl * Parent, const Sizei& Size, const LBParams.HScrollMode = HScrollMode; LBParams.PaddingContainer = PaddingContainer; UIListBox * Ctrl = eeNew( UIListBox, ( LBParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -648,8 +648,8 @@ UIMenu * UITheme::createMenu( UIControl * Parent, const Sizei& Size, const Vecto MenuParams.MinRightMargin = MinRightMargin; UIMenu * Ctrl = eeNew( UIMenu, ( MenuParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -679,8 +679,8 @@ UIProgressBar * UITheme::createProgressBar( UIControl * Parent, const Sizei& Siz PBParams.FillerMargin = FillerMargin; UIProgressBar * Ctrl = eeNew( UIProgressBar, ( PBParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -698,8 +698,8 @@ UIPushButton * UITheme::createPushButton( UIControl * Parent, const Sizei& Size, ButtonParams.SetIcon( Icon ); UIPushButton * Ctrl = eeNew( UIPushButton, ( ButtonParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -717,8 +717,8 @@ UISelectButton * UITheme::createSelectButton( UIControl * Parent, const Sizei& S ButtonParams.SetIcon( Icon ); UISelectButton * Ctrl = eeNew( UISelectButton, ( ButtonParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -734,8 +734,8 @@ UIWinMenu * UITheme::createWinMenu( UIControl * Parent, const Sizei& Size, const WinMenuParams.FirstButtonMargin = FirstButtonMargin; UIWinMenu * Ctrl = eeNew( UIWinMenu, ( WinMenuParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } @@ -796,8 +796,8 @@ UITabWidget * UITheme::createTabWidget( UIControl *Parent, const Sizei &Size, co TabWidgetParams.MaxTabWidth = MaxTabWidth; UITabWidget * Ctrl = eeNew( UITabWidget, ( TabWidgetParams ) ); - Ctrl->visible( true ); - Ctrl->enabled( true ); + Ctrl->setVisible( true ); + Ctrl->setEnabled( true ); return Ctrl; } diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index e932c57f6..2d59854d4 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -29,7 +29,7 @@ UITooltip::UITooltip( UITooltip::CreateParams& Params, UIControl * TooltipOf ) : autoPadding(); if ( Params.ParentCtrl != UIManager::instance()->mainControl() ) - parent( UIManager::instance()->mainControl() ); + setParent( UIManager::instance()->mainControl() ); applyDefaultTheme(); } @@ -67,10 +67,10 @@ void UITooltip::autoPadding() { } void UITooltip::show() { - if ( !visible() || 0 == mAlpha ) { + if ( !isVisible() || 0 == mAlpha ) { toFront(); - visible( true ); + setVisible( true ); if ( UIThemeManager::instance()->defaultEffectsEnabled() ) { startAlphaAnim( 255.f == mAlpha ? 0.f : mAlpha, 255.f, UIThemeManager::instance()->controlsFadeInTime() ); @@ -79,11 +79,11 @@ void UITooltip::show() { } void UITooltip::hide() { - if ( visible() ) { + if ( isVisible() ) { if ( UIThemeManager::instance()->defaultEffectsEnabled() ) { disableFadeOut( UIThemeManager::instance()->controlsFadeOutTime() ); } else { - visible( false ); + setVisible( false ); } } } @@ -93,8 +93,8 @@ void UITooltip::draw() { UIControlAnim::draw(); if ( mTextCache->getTextWidth() ) { - mTextCache->setFlags( flags() ); - mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, Vector2f::One, 0.f, blend() ); + mTextCache->setFlags( getFlags() ); + mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, Vector2f::One, 0.f, getBlendMode() ); } } } @@ -131,7 +131,7 @@ const ColorA& UITooltip::color() const { void UITooltip::color( const ColorA& color ) { mFontColor = color; - alpha( color.a() ); + setAlpha( color.a() ); } const ColorA& UITooltip::shadowColor() const { @@ -140,12 +140,12 @@ const ColorA& UITooltip::shadowColor() const { void UITooltip::shadowColor( const ColorA& color ) { mFontShadowColor = color; - alpha( color.a() ); + setAlpha( color.a() ); mTextCache->setShadowColor( mFontColor ); } -void UITooltip::alpha( const Float& alpha ) { - UIControlAnim::alpha( alpha ); +void UITooltip::setAlpha( const Float& alpha ) { + UIControlAnim::setAlpha( alpha ); mFontColor.Alpha = (Uint8)alpha; mFontShadowColor.Alpha = (Uint8)alpha; @@ -163,7 +163,7 @@ void UITooltip::autoAlign() { Uint32 Width = mSize.getWidth() - mPadding.Left - mPadding.Right; Uint32 Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; - switch ( FontHAlignGet( flags() ) ) { + switch ( FontHAlignGet( getFlags() ) ) { case UI_HALIGN_CENTER: mAlignOffset.x = mPadding.Left + (Float)( (Int32)( Width - mTextCache->getTextWidth() ) / 2 ); break; @@ -175,7 +175,7 @@ void UITooltip::autoAlign() { break; } - switch ( FontVAlignGet( flags() ) ) { + switch ( FontVAlignGet( getFlags() ) ) { case UI_VALIGN_CENTER: mAlignOffset.y = mPadding.Top + (Float)( ( (Int32)( Height - mTextCache->getTextHeight() ) ) / 2 ); break; diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index 01247c397..9a39af493 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -32,9 +32,9 @@ UIWindow::UIWindow( const UIWindow::CreateParams& Params ) : tcParams.Flags |= UI_REPORT_SIZE_CHANGE_TO_CHILDS; mContainer = eeNew( UIComplexControl, ( tcParams ) ); - mContainer->enabled( true ); - mContainer->visible( true ); - mContainer->size( mSize ); + mContainer->setEnabled( true ); + mContainer->setVisible( true ); + mContainer->setSize( mSize ); mContainer->addEventListener( UIEvent::EventOnPosChange, cb::Make1( this, &UIWindow::containerPosChange ) ); if ( !( mWinFlags & UI_WIN_NO_BORDER ) ) { @@ -42,31 +42,31 @@ UIWindow::UIWindow( const UIWindow::CreateParams& Params ) : tParams.setParent( this ); mWindowDecoration = eeNew( UIControlAnim, ( tParams ) ); - mWindowDecoration->visible( true ); - mWindowDecoration->enabled( false ); + mWindowDecoration->setVisible( true ); + mWindowDecoration->setEnabled( false ); mBorderLeft = eeNew( UIControlAnim, ( tParams ) ); - mBorderLeft->enabled( true ); - mBorderLeft->visible( true ); + mBorderLeft->setEnabled( true ); + mBorderLeft->setVisible( true ); mBorderRight = eeNew( UIControlAnim, ( tParams ) ); - mBorderRight->enabled( true ); - mBorderRight->visible( true ); + mBorderRight->setEnabled( true ); + mBorderRight->setVisible( true ); mBorderBottom = eeNew( UIControlAnim, ( tParams ) ); - mBorderBottom->enabled( true ); - mBorderBottom->visible( true ); + mBorderBottom->setEnabled( true ); + mBorderBottom->setVisible( true ); if ( mWinFlags & UI_WIN_DRAGABLE_CONTAINER ) - mContainer->dragEnable( true ); + mContainer->setDragEnabled( true ); UIComplexControl::CreateParams ButtonParams; ButtonParams.setParent( this ); if ( mWinFlags & UI_WIN_CLOSE_BUTTON ) { mButtonClose = eeNew( UIComplexControl, ( ButtonParams ) ); - mButtonClose->visible( true ); - mButtonClose->enabled( true ); + mButtonClose->setVisible( true ); + mButtonClose->setEnabled( true ); if ( mWinFlags & UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS ) { mButtonClose->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIWindow::buttonCloseClick ) ); @@ -75,8 +75,8 @@ UIWindow::UIWindow( const UIWindow::CreateParams& Params ) : if ( ( mWinFlags & UI_WIN_RESIZEABLE ) && ( mWinFlags & UI_WIN_MAXIMIZE_BUTTON ) ) { mButtonMaximize = eeNew( UIComplexControl, ( ButtonParams ) ); - mButtonMaximize->visible( true ); - mButtonMaximize->enabled( true ); + mButtonMaximize->setVisible( true ); + mButtonMaximize->setEnabled( true ); if ( mWinFlags & UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS ) { mButtonMaximize->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIWindow::buttonMaximizeClick ) ); @@ -85,22 +85,22 @@ UIWindow::UIWindow( const UIWindow::CreateParams& Params ) : if ( mWinFlags & UI_WIN_MINIMIZE_BUTTON ) { mButtonMinimize = eeNew( UIComplexControl, ( ButtonParams ) ); - mButtonMinimize->visible( true ); - mButtonMinimize->enabled( true ); + mButtonMinimize->setVisible( true ); + mButtonMinimize->setEnabled( true ); if ( mWinFlags & UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS ) { mButtonMinimize->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIWindow::buttonMinimizeClick ) ); } } - dragEnable( true ); + setDragEnabled( true ); } if ( isModal() ) { createModalControl(); } - alpha( mBaseAlpha ); + setAlpha( mBaseAlpha ); applyDefaultTheme(); } @@ -117,10 +117,10 @@ void UIWindow::createModalControl() { UIControl * Ctrl = UIManager::instance()->mainControl(); if ( NULL == mModalCtrl ) { - mModalCtrl = eeNew( UIControlAnim, ( UIControlAnim::CreateParams( Ctrl , Vector2i(0,0), Ctrl->size(), UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ) ) ); + mModalCtrl = eeNew( UIControlAnim, ( UIControlAnim::CreateParams( Ctrl , Vector2i(0,0), Ctrl->getSize(), UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ) ) ); } else { - mModalCtrl->position( 0, 0 ); - mModalCtrl->size( Ctrl->size() ); + mModalCtrl->setPosition( 0, 0 ); + mModalCtrl->setSize( Ctrl->getSize() ); } disableByModal(); @@ -128,38 +128,38 @@ void UIWindow::createModalControl() { void UIWindow::enableByModal() { if ( isModal() ) { - UIControl * CtrlChild = UIManager::instance()->mainControl()->childGetFirst(); + UIControl * CtrlChild = UIManager::instance()->mainControl()->getFirstChild(); while ( NULL != CtrlChild ) { if ( CtrlChild != mModalCtrl && CtrlChild != this && - CtrlChild->controlFlags() & UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW ) + CtrlChild->getControlFlags() & UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW ) { - CtrlChild->enabled( true ); + CtrlChild->setEnabled( true ); CtrlChild->writeCtrlFlag( UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW, 0 ); } - CtrlChild = CtrlChild->nextGet(); + CtrlChild = CtrlChild->getNextControl(); } } } void UIWindow::disableByModal() { if ( isModal() ) { - UIControl * CtrlChild = UIManager::instance()->mainControl()->childGetFirst(); + UIControl * CtrlChild = UIManager::instance()->mainControl()->getFirstChild(); while ( NULL != CtrlChild ) { if ( CtrlChild != mModalCtrl && CtrlChild != this && - CtrlChild->enabled() ) + CtrlChild->isEnabled() ) { - CtrlChild->enabled( false ); + CtrlChild->setEnabled( false ); CtrlChild->writeCtrlFlag( UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW, 1 ); } - CtrlChild = CtrlChild->nextGet(); + CtrlChild = CtrlChild->getNextControl(); } } } @@ -173,12 +173,12 @@ bool UIWindow::isType( const Uint32& type ) const { } void UIWindow::containerPosChange( const UIEvent * Event ) { - Vector2i PosDiff = mContainer->position() - Vector2i( mBorderLeft->size().getWidth(), mWindowDecoration->size().getHeight() ); + Vector2i PosDiff = mContainer->getPosition() - Vector2i( mBorderLeft->getSize().getWidth(), mWindowDecoration->getSize().getHeight() ); if ( PosDiff.x != 0 || PosDiff.y != 0 ) { - mContainer->position( mBorderLeft->size().getWidth(), mWindowDecoration->size().getHeight() ); + mContainer->setPosition( mBorderLeft->getSize().getWidth(), mWindowDecoration->getSize().getHeight() ); - position( mPos + PosDiff ); + setPosition( mPos + PosDiff ); } } @@ -190,13 +190,13 @@ void UIWindow::buttonCloseClick( const UIEvent * Event ) { void UIWindow::CloseWindow() { if ( NULL != mButtonClose ) - mButtonClose->enabled( false ); + mButtonClose->setEnabled( false ); if ( NULL != mButtonMaximize ) - mButtonMaximize->enabled( false ); + mButtonMaximize->setEnabled( false ); if ( NULL != mButtonMinimize ) - mButtonMinimize->enabled( false ); + mButtonMinimize->setEnabled( false ); if ( NULL != mModalCtrl ) { mModalCtrl->close(); @@ -240,17 +240,17 @@ void UIWindow::setTheme( UITheme *Theme ) { if ( NULL != mButtonClose ) { mButtonClose->setThemeControl( Theme, "winclose" ); - mButtonClose->size( mButtonClose->getSkinSize() ); + mButtonClose->setSize( mButtonClose->getSkinSize() ); } if ( NULL != mButtonMaximize ) { mButtonMaximize->setThemeControl( Theme, "winmax" ); - mButtonMaximize->size( mButtonMaximize->getSkinSize() ); + mButtonMaximize->setSize( mButtonMaximize->getSkinSize() ); } if ( NULL != mButtonMinimize ) { mButtonMinimize->setThemeControl( Theme, "winmin" ); - mButtonMinimize->size( mButtonMinimize->getSkinSize() ); + mButtonMinimize->setSize( mButtonMinimize->getSkinSize() ); } fixChildsSize(); @@ -264,17 +264,17 @@ void UIWindow::getMinWinSize() { Sizei tSize; - tSize.x = mBorderLeft->size().getWidth() + mBorderRight->size().getWidth() - mButtonsPositionFixer.x; - tSize.y = mWindowDecoration->size().getHeight() + mBorderBottom->size().getHeight(); + tSize.x = mBorderLeft->getSize().getWidth() + mBorderRight->getSize().getWidth() - mButtonsPositionFixer.x; + tSize.y = mWindowDecoration->getSize().getHeight() + mBorderBottom->getSize().getHeight(); if ( NULL != mButtonClose ) - tSize.x += mButtonClose->size().getWidth(); + tSize.x += mButtonClose->getSize().getWidth(); if ( NULL != mButtonMaximize ) - tSize.x += mButtonMaximize->size().getWidth(); + tSize.x += mButtonMaximize->getSize().getWidth(); if ( NULL != mButtonMinimize ) - tSize.x += mButtonMinimize->size().getWidth(); + tSize.x += mButtonMinimize->getSize().getWidth(); if ( mMinWindowSize.x < tSize.x ) mMinWindowSize.x = tSize.x; @@ -286,11 +286,11 @@ void UIWindow::getMinWinSize() { void UIWindow::onSizeChange() { if ( mSize.x < mMinWindowSize.x || mSize.y < mMinWindowSize.y ) { if ( mSize.x < mMinWindowSize.x && mSize.y < mMinWindowSize.y ) { - size( mMinWindowSize ); + setSize( mMinWindowSize ); } else if ( mSize.x < mMinWindowSize.x ) { - size( Sizei( mMinWindowSize.x, mSize.y ) ); + setSize( Sizei( mMinWindowSize.x, mSize.y ) ); } else { - size( Sizei( mSize.x, mMinWindowSize.y ) ); + setSize( Sizei( mSize.x, mMinWindowSize.y ) ); } } else { fixChildsSize(); @@ -299,30 +299,30 @@ void UIWindow::onSizeChange() { } } -void UIWindow::size( const Sizei& Size ) { +void UIWindow::setSize( const Sizei& Size ) { if ( NULL != mWindowDecoration ) { Sizei size = Size; - size.x += mBorderLeft->size().getWidth() + mBorderRight->size().getWidth(); - size.y += mWindowDecoration->size().getHeight() + mBorderBottom->size().getHeight(); + size.x += mBorderLeft->getSize().getWidth() + mBorderRight->getSize().getWidth(); + size.y += mWindowDecoration->getSize().getHeight() + mBorderBottom->getSize().getHeight(); - UIComplexControl::size( size ); + UIComplexControl::setSize( size ); } else { - UIComplexControl::size( Size ); + UIComplexControl::setSize( Size ); } } -void UIWindow::size( const Int32& Width, const Int32& Height ) { - size( Sizei( Width, Height ) ); +void UIWindow::setSize( const Int32& Width, const Int32& Height ) { + setSize( Sizei( Width, Height ) ); } -const Sizei& UIWindow::size() { - return UIComplexControl::size(); +const Sizei& UIWindow::getSize() { + return UIComplexControl::getSize(); } void UIWindow::fixChildsSize() { if ( NULL == mWindowDecoration ) { - mContainer->size( mSize.getWidth(), mSize.getHeight() ); + mContainer->setSize( mSize.getWidth(), mSize.getHeight() ); return; } @@ -330,59 +330,59 @@ void UIWindow::fixChildsSize() { mDecoSize = Sizei( mSize.getWidth(), mWindowDecoration->getSkinSize().getHeight() ); } - mWindowDecoration->size( mDecoSize ); + mWindowDecoration->setSize( mDecoSize ); if ( mBorderAutoSize ) { - mBorderBottom->size( mSize.getWidth(), mBorderBottom->getSkinSize().getHeight() ); + mBorderBottom->setSize( mSize.getWidth(), mBorderBottom->getSkinSize().getHeight() ); } else { - mBorderBottom->size( mSize.getWidth(), mBorderSize.getHeight() ); + mBorderBottom->setSize( mSize.getWidth(), mBorderSize.getHeight() ); } - Uint32 BorderHeight = mSize.getHeight() - mDecoSize.getHeight() - mBorderBottom->size().getHeight(); + Uint32 BorderHeight = mSize.getHeight() - mDecoSize.getHeight() - mBorderBottom->getSize().getHeight(); if ( mBorderAutoSize ) { - mBorderLeft->size( mBorderLeft->getSkinSize().getWidth() , BorderHeight ); - mBorderRight->size( mBorderRight->getSkinSize().getWidth(), BorderHeight ); + mBorderLeft->setSize( mBorderLeft->getSkinSize().getWidth() , BorderHeight ); + mBorderRight->setSize( mBorderRight->getSkinSize().getWidth(), BorderHeight ); } else { - mBorderLeft->size( mBorderSize.getWidth(), BorderHeight ); - mBorderRight->size( mBorderSize.getWidth(), BorderHeight ); + mBorderLeft->setSize( mBorderSize.getWidth(), BorderHeight ); + mBorderRight->setSize( mBorderSize.getWidth(), BorderHeight ); } - mBorderLeft->position( 0, mWindowDecoration->size().getHeight() ); - mBorderRight->position( mSize.getWidth() - mBorderRight->size().getWidth(), mWindowDecoration->size().getHeight() ); - mBorderBottom->position( 0, mSize.getHeight() - mBorderBottom->size().getHeight() ); + mBorderLeft->setPosition( 0, mWindowDecoration->getSize().getHeight() ); + mBorderRight->setPosition( mSize.getWidth() - mBorderRight->getSize().getWidth(), mWindowDecoration->getSize().getHeight() ); + mBorderBottom->setPosition( 0, mSize.getHeight() - mBorderBottom->getSize().getHeight() ); - mContainer->position( mBorderLeft->size().getWidth(), mWindowDecoration->size().getHeight() ); - mContainer->size( mSize.getWidth() - mBorderLeft->size().getWidth() - mBorderRight->size().getWidth(), mSize.getHeight() - mWindowDecoration->size().getHeight() - mBorderBottom->size().getHeight() ); + mContainer->setPosition( mBorderLeft->getSize().getWidth(), mWindowDecoration->getSize().getHeight() ); + mContainer->setSize( mSize.getWidth() - mBorderLeft->getSize().getWidth() - mBorderRight->getSize().getWidth(), mSize.getHeight() - mWindowDecoration->getSize().getHeight() - mBorderBottom->getSize().getHeight() ); Uint32 yPos; if ( NULL != mButtonClose ) { - yPos = mWindowDecoration->size().getHeight() / 2 - mButtonClose->size().getHeight() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->getSize().getHeight() / 2 - mButtonClose->getSize().getHeight() / 2 + mButtonsPositionFixer.y; - mButtonClose->position( mWindowDecoration->size().getWidth() - mBorderRight->size().getWidth() - mButtonClose->size().getWidth() + mButtonsPositionFixer.x, yPos ); + mButtonClose->setPosition( mWindowDecoration->getSize().getWidth() - mBorderRight->getSize().getWidth() - mButtonClose->getSize().getWidth() + mButtonsPositionFixer.x, yPos ); } if ( NULL != mButtonMaximize ) { - yPos = mWindowDecoration->size().getHeight() / 2 - mButtonMaximize->size().getHeight() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->getSize().getHeight() / 2 - mButtonMaximize->getSize().getHeight() / 2 + mButtonsPositionFixer.y; if ( NULL != mButtonClose ) { - mButtonMaximize->position( mButtonClose->position().x - mButtonsSeparation - mButtonMaximize->size().getWidth(), yPos ); + mButtonMaximize->setPosition( mButtonClose->getPosition().x - mButtonsSeparation - mButtonMaximize->getSize().getWidth(), yPos ); } else { - mButtonMaximize->position( mWindowDecoration->size().getWidth() - mBorderRight->size().getWidth() - mButtonMaximize->size().getWidth() + mButtonsPositionFixer.x, yPos ); + mButtonMaximize->setPosition( mWindowDecoration->getSize().getWidth() - mBorderRight->getSize().getWidth() - mButtonMaximize->getSize().getWidth() + mButtonsPositionFixer.x, yPos ); } } if ( NULL != mButtonMinimize ) { - yPos = mWindowDecoration->size().getHeight() / 2 - mButtonMinimize->size().getHeight() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->getSize().getHeight() / 2 - mButtonMinimize->getSize().getHeight() / 2 + mButtonsPositionFixer.y; if ( NULL != mButtonMaximize ) { - mButtonMinimize->position( mButtonMaximize->position().x - mButtonsSeparation - mButtonMinimize->size().getWidth(), yPos ); + mButtonMinimize->setPosition( mButtonMaximize->getPosition().x - mButtonsSeparation - mButtonMinimize->getSize().getWidth(), yPos ); } else { if ( NULL != mButtonClose ) { - mButtonMinimize->position( mButtonClose->position().x - mButtonsSeparation - mButtonMinimize->size().getWidth(), yPos ); + mButtonMinimize->setPosition( mButtonClose->getPosition().x - mButtonsSeparation - mButtonMinimize->getSize().getWidth(), yPos ); } else { - mButtonMinimize->position( mWindowDecoration->size().getWidth() - mBorderRight->size().getWidth() - mButtonMinimize->size().getWidth() + mButtonsPositionFixer.x, yPos ); + mButtonMinimize->setPosition( mWindowDecoration->getSize().getWidth() - mBorderRight->getSize().getWidth() - mButtonMinimize->getSize().getWidth() + mButtonsPositionFixer.x, yPos ); } } } @@ -405,7 +405,7 @@ Uint32 UIWindow::onMessage( const UIMessage * Msg ) { case UIMessage::MsgWindowResize: { if ( isModal() && NULL != mModalCtrl ) { - mModalCtrl->size( UIManager::instance()->mainControl()->size() ); + mModalCtrl->setSize( UIManager::instance()->mainControl()->getSize() ); } break; @@ -450,11 +450,11 @@ void UIWindow::decideResizeType( UIControl * Control ) { worldToControl( Pos ); if ( Control == this ) { - if ( Pos.x <= mBorderLeft->size().getWidth() ) { + if ( Pos.x <= mBorderLeft->getSize().getWidth() ) { tryResize( RESIZE_TOPLEFT ); - } else if ( Pos.x >= ( mSize.getWidth() - mBorderRight->size().getWidth() ) ) { + } else if ( Pos.x >= ( mSize.getWidth() - mBorderRight->getSize().getWidth() ) ) { tryResize( RESIZE_TOPRIGHT ); - } else if ( Pos.y <= mBorderBottom->size().getHeight() ) { + } else if ( Pos.y <= mBorderBottom->getSize().getHeight() ) { if ( Pos.x < mMinCornerDistance ) { tryResize( RESIZE_TOPLEFT ); } else if ( Pos.x > mSize.getWidth() - mMinCornerDistance ) { @@ -490,7 +490,7 @@ void UIWindow::tryResize( const UI_RESIZE_TYPE& Type ) { if ( RESIZE_NONE != mResizeType ) return; - dragEnable( false ); + setDragEnabled( false ); Vector2i Pos = UIManager::instance()->getMousePos(); @@ -560,7 +560,7 @@ void UIWindow::updateResize() { if ( !( UIManager::instance()->pressTrigger() & EE_BUTTON_LMASK ) ) { endResize(); - dragEnable( true ); + setDragEnabled( true ); return; } @@ -582,14 +582,14 @@ void UIWindow::updateResize() { case RESIZE_LEFT: { Pos.x -= mResizePos.x; - UIControl::position( mPos.x + Pos.x, mPos.y ); + UIControl::setPosition( mPos.x + Pos.x, mPos.y ); internalSize( mSize.getWidth() - Pos.x, mSize.getHeight() ); break; } case RESIZE_TOP: { Pos.y -= mResizePos.y; - UIControl::position( mPos.x, mPos.y + Pos.y ); + UIControl::setPosition( mPos.x, mPos.y + Pos.y ); internalSize( mSize.getWidth(), mSize.getHeight() - Pos.y ); break; } @@ -602,7 +602,7 @@ void UIWindow::updateResize() { case RESIZE_TOPLEFT: { Pos -= mResizePos; - UIControl::position( mPos.x + Pos.x, mPos.y + Pos.y ); + UIControl::setPosition( mPos.x + Pos.x, mPos.y + Pos.y ); internalSize( mSize.getWidth() - Pos.x, mSize.getHeight() - Pos.y ); break; } @@ -610,7 +610,7 @@ void UIWindow::updateResize() { { Pos.y -= mResizePos.y; Pos.x += mResizePos.x; - UIControl::position( mPos.x, mPos.y + Pos.y ); + UIControl::setPosition( mPos.x, mPos.y + Pos.y ); internalSize( Pos.x, mSize.getHeight() - Pos.y ); break; } @@ -618,7 +618,7 @@ void UIWindow::updateResize() { { Pos.x -= mResizePos.x; Pos.y += mResizePos.y; - UIControl::position( mPos.x + Pos.x, mPos.y ); + UIControl::setPosition( mPos.x + Pos.x, mPos.y ); internalSize( mSize.getWidth() - Pos.x, Pos.y ); break; } @@ -656,7 +656,7 @@ void UIWindow::draw() { Primitives P; P.setForceDraw( false ); - ColorA BeginC( 0, 0, 0, 25 * ( alpha() / (Float)255 ) ); + ColorA BeginC( 0, 0, 0, 25 * ( getAlpha() / (Float)255 ) ); ColorA EndC( 0, 0, 0, 0 ); Float SSize = 16.f; @@ -709,19 +709,19 @@ UIComplexControl * UIWindow::getButtonMinimize() const { } bool UIWindow::show() { - if ( !visible() ) { - enabled( true ); - visible( true ); + if ( !isVisible() ) { + setEnabled( true ); + setVisible( true ); setFocus(); - startAlphaAnim( mBaseAlpha == alpha() ? 0.f : mAlpha, mBaseAlpha, UIThemeManager::instance()->controlsFadeInTime() ); + startAlphaAnim( mBaseAlpha == getAlpha() ? 0.f : mAlpha, mBaseAlpha, UIThemeManager::instance()->controlsFadeInTime() ); if ( isModal() ) { createModalControl(); - mModalCtrl->enabled( true ); - mModalCtrl->visible( true ); + mModalCtrl->setEnabled( true ); + mModalCtrl->setVisible( true ); mModalCtrl->toFront(); toFront(); @@ -734,19 +734,19 @@ bool UIWindow::show() { } bool UIWindow::Hide() { - if ( visible() ) { + if ( isVisible() ) { if ( UIThemeManager::instance()->defaultEffectsEnabled() ) { disableFadeOut( UIThemeManager::instance()->controlsFadeOutTime() ); } else { - enabled( false ); - visible( false ); + setEnabled( false ); + setVisible( false ); } UIManager::instance()->mainControl()->setFocus(); if ( NULL != mModalCtrl ) { - mModalCtrl->enabled( false ); - mModalCtrl->visible( false ); + mModalCtrl->setEnabled( false ); + mModalCtrl->setVisible( false ); } return true; @@ -763,29 +763,29 @@ void UIWindow::onAlphaChange() { while ( NULL != CurChild ) { if ( CurChild->isAnimated() ) { AnimChild = reinterpret_cast ( CurChild ); - AnimChild->alpha( mAlpha ); + AnimChild->setAlpha( mAlpha ); } - CurChild = CurChild->nextGet(); + CurChild = CurChild->getNextControl(); } } UIComplexControl::onAlphaChange(); } -void UIWindow::baseAlpha( const Uint8& Alpha ) { +void UIWindow::setBaseAlpha( const Uint8& Alpha ) { if ( mAlpha == mBaseAlpha ) { - UIControlAnim::alpha( Alpha ); + UIControlAnim::setAlpha( Alpha ); } mBaseAlpha = Alpha; } -const Uint8& UIWindow::baseAlpha() const { +const Uint8& UIWindow::getBaseAlpha() const { return mBaseAlpha; } -void UIWindow::title( const String& Text ) { +void UIWindow::setTitle( const String& Text ) { if ( NULL == mTitle ) { UITextBox::CreateParams Params; Params.setParent( this ); @@ -799,8 +799,8 @@ void UIWindow::title( const String& Text ) { Params.Flags |= UI_DRAW_SHADOW; mTitle = eeNew( UITextBox, ( Params ) ); - mTitle->enabled( false ); - mTitle->visible( true ); + mTitle->setEnabled( false ); + mTitle->setVisible( true ); } mTitle->text( Text ); @@ -810,34 +810,34 @@ void UIWindow::title( const String& Text ) { void UIWindow::fixTitleSize() { if ( NULL != mWindowDecoration && NULL != mTitle ) { - mTitle->size( mWindowDecoration->size().getWidth() - mBorderLeft->size().getWidth() - mBorderRight->size().getWidth(), mWindowDecoration->size().getHeight() ); - mTitle->position( mBorderLeft->size().getWidth(), 0 ); + mTitle->setSize( mWindowDecoration->getSize().getWidth() - mBorderLeft->getSize().getWidth() - mBorderRight->getSize().getWidth(), mWindowDecoration->getSize().getHeight() ); + mTitle->setPosition( mBorderLeft->getSize().getWidth(), 0 ); } } -String UIWindow::title() const { +String UIWindow::getTitle() const { if ( NULL != mTitle ) return mTitle->text(); return String(); } -UITextBox * UIWindow::titleTextBox() const { +UITextBox * UIWindow::getTitleTextBox() const { return mTitle; } void UIWindow::maximize() { UIControl * Ctrl = UIManager::instance()->mainControl(); - if ( Ctrl->size() == mSize ) { - position( mNonMaxPos ); + if ( Ctrl->getSize() == mSize ) { + setPosition( mNonMaxPos ); internalSize( mNonMaxSize ); } else { mNonMaxPos = mPos; mNonMaxSize = mSize; - position( 0, 0 ); - internalSize( UIManager::instance()->mainControl()->size() ); + setPosition( 0, 0 ); + internalSize( UIManager::instance()->mainControl()->getSize() ); } } @@ -897,7 +897,7 @@ bool UIWindow::removeShortcut( const Uint32& KeyCode, const Uint32& Mod ) { return false; } -bool UIWindow::isMaximixable() { +bool UIWindow::isMaximizable() { return 0 != ( ( mWinFlags & UI_WIN_RESIZEABLE ) && ( mWinFlags & UI_WIN_MAXIMIZE_BUTTON ) ); } @@ -922,11 +922,11 @@ void UIWindow::resizeCursor() { const UIControl * Control = Man->overControl(); if ( Control == this ) { - if ( Pos.x <= mBorderLeft->size().getWidth() ) { + if ( Pos.x <= mBorderLeft->getSize().getWidth() ) { Man->setCursor( EE_CURSOR_SIZENWSE ); // RESIZE_TOPLEFT - } else if ( Pos.x >= ( mSize.getWidth() - mBorderRight->size().getWidth() ) ) { + } else if ( Pos.x >= ( mSize.getWidth() - mBorderRight->getSize().getWidth() ) ) { Man->setCursor( EE_CURSOR_SIZENESW ); // RESIZE_TOPRIGHT - } else if ( Pos.y <= mBorderBottom->size().getHeight() ) { + } else if ( Pos.y <= mBorderBottom->getSize().getHeight() ) { if ( Pos.x < mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENWSE ); // RESIZE_TOPLEFT } else if ( Pos.x > mSize.getWidth() - mMinCornerDistance ) { diff --git a/src/eepp/ui/uiwinmenu.cpp b/src/eepp/ui/uiwinmenu.cpp index 701243060..a746dbbd0 100644 --- a/src/eepp/ui/uiwinmenu.cpp +++ b/src/eepp/ui/uiwinmenu.cpp @@ -20,7 +20,7 @@ UIWinMenu::UIWinMenu( const UIWinMenu::CreateParams& Params ) : if ( !(mFlags & UI_ANCHOR_RIGHT) ) mFlags |= UI_ANCHOR_RIGHT; - size( parent()->size().getWidth(), mMenuHeight ); + setSize( getParent()->getSize().getWidth(), mMenuHeight ); updateAnchorsDistances(); @@ -56,13 +56,13 @@ void UIWinMenu::addMenuButton( const String& ButtonText, UIPopUpMenu * Menu ) { UISelectButton * Button = eeNew( UISelectButton, ( ButtonParams ) ); Button->text( ButtonText ); - Button->visible( true ); - Button->enabled( true ); + Button->setVisible( true ); + Button->setEnabled( true ); Button->setThemeControl( mSkinState->getSkin()->theme(), "winmenubutton" ); - Menu->visible( false ); - Menu->enabled( false ); - Menu->parent( parent() ); + Menu->setVisible( false ); + Menu->setEnabled( false ); + Menu->setParent( getParent() ); Menu->addEventListener( UIEvent::EventOnComplexControlFocusLoss, cb::Make1( this, &UIWinMenu::onMenuFocusLoss ) ); mButtons.push_back( std::make_pair( Button, Menu ) ); @@ -80,7 +80,7 @@ void UIWinMenu::setTheme( UITheme * Theme ) { if ( 0 == mMenuHeight && NULL != getSkin() && NULL != getSkin()->getSubTexture( UISkinState::StateNormal ) ) { mMenuHeight = getSkin()->getSubTexture( UISkinState::StateNormal )->getSize().getHeight(); - size( parent()->size().getWidth(), mMenuHeight ); + setSize( getParent()->getSize().getWidth(), mMenuHeight ); updateAnchorsDistances(); } @@ -137,7 +137,7 @@ void UIWinMenu::refreshButtons() { if ( NULL != tSubTexture2 ) { th = tSubTexture2->getSize().getHeight(); - switch ( VAlignGet( flags() ) ) { + switch ( VAlignGet( getFlags() ) ) { case UI_VALIGN_CENTER: ycenter = ( h - th ) / 2; break; @@ -158,10 +158,10 @@ void UIWinMenu::refreshButtons() { UISelectButton * pbut = it->first; UITextBox * tbox = pbut->getTextBox(); - pbut->size( tbox->getTextWidth() + mButtonMargin, size().getHeight() ); - pbut->position( xpos, ycenter ); + pbut->setSize( tbox->getTextWidth() + mButtonMargin, getSize().getHeight() ); + pbut->setPosition( xpos, ycenter ); - xpos += pbut->size().getWidth() + mMarginBetweenButtons; + xpos += pbut->getSize().getWidth() + mMarginBetweenButtons; } } @@ -174,8 +174,8 @@ Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) { UISelectButton * tbut = reinterpret_cast ( Msg->getSender() ); UIPopUpMenu * tpop = getMenuFromButton( tbut ); - Vector2i pos( tbut->position().x, tbut->position().y + tbut->size().getHeight() ); - tpop->position( pos ); + Vector2i pos( tbut->getPosition().x, tbut->getPosition().y + tbut->getSize().getHeight() ); + tpop->setPosition( pos ); if ( Msg->getMsg() == UIMessage::MsgMouseEnter ) { if ( NULL != mCurrentMenu ) { diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 2805f1ece..c26671148 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -223,13 +223,13 @@ void EETest::OnWinMouseUp( const UIEvent * Event ) { if ( Event->getControl()->isType( UI_TYPE_WINDOW ) ) { CtrlAnim = reinterpret_cast( Event->getControl() ); } else { - CtrlAnim = reinterpret_cast( Event->getControl()->parent() ); + CtrlAnim = reinterpret_cast( Event->getControl()->getParent() ); } if ( MEvent->getFlags() & EE_BUTTON_WUMASK ) { - CtrlAnim->scale( CtrlAnim->scale() + 0.1f ); + CtrlAnim->setScale( CtrlAnim->getScale() + 0.1f ); } else if ( MEvent->getFlags() & EE_BUTTON_WDMASK ) { - CtrlAnim->scale( CtrlAnim->scale() - 0.1f ); + CtrlAnim->setScale( CtrlAnim->getScale() - 0.1f ); } } @@ -239,7 +239,7 @@ void EETest::OnShowMenu( const UIEvent * Event ) { if ( Menu->show() ) { Vector2i Pos = Vector2i( (Int32)PB->getPolygon()[0].x, (Int32)PB->getPolygon()[0].y - 2 ); UIMenu::FixMenuPos( Pos , Menu ); - Menu->position( Pos ); + Menu->setPosition( Pos ); } } @@ -269,39 +269,39 @@ void EETest::CreateUI() { UIControl::CreateParams Params( UIManager::instance()->mainControl(), Vector2i(0,0), Sizei( 530, 380 ), UI_FILL_BACKGROUND | UI_CLIP_ENABLE | UI_BORDER ); - Params.Border.width( 2 ); - Params.Border.color( 0x979797CC ); - Params.Background.colors( ColorA( 0xEDEDED66 ), ColorA( 0xEDEDEDCC ), ColorA( 0xEDEDEDCC ), ColorA( 0xEDEDED66 ) ); + Params.Border.setWidth( 2 ); + Params.Border.setColor( 0x979797CC ); + Params.Background.setColors( ColorA( 0xEDEDED66 ), ColorA( 0xEDEDEDCC ), ColorA( 0xEDEDEDCC ), ColorA( 0xEDEDED66 ) ); UIWindow * tWin = mTheme->createWindow( NULL, Sizei( 530, 405 ), Vector2i( 320, 240 ), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DRAGABLE_CONTAINER , Sizei( 530, 405 ), 200 ); C = tWin->getContainer(); - tWin->title( "Controls Test" ); + tWin->setTitle( "Controls Test" ); tWin->addEventListener( UIEvent::EventMouseUp, cb::Make1( this, &EETest::OnWinMouseUp ) ); C->addEventListener( UIEvent::EventMouseUp, cb::Make1( this, &EETest::OnWinMouseUp ) ); Params.Flags &= ~UI_CLIP_ENABLE; - Params.Background.corners(0); - Params.Background.colors( ColorA( 0x00FF0077 ), ColorA( 0x00CC0077 ), ColorA( 0x00CC0077 ), ColorA( 0x00FF0077 ) ); + Params.Background.setCorners(0); + Params.Background.setColors( ColorA( 0x00FF0077 ), ColorA( 0x00CC0077 ), ColorA( 0x00CC0077 ), ColorA( 0x00FF0077 ) ); Params.setParent( C ); Params.Size = Sizei( 50, 50 ); UITest * Child = eeNew( UITest, ( Params ) ); - Child->position( 240, 130 ); - Child->visible( true ); - Child->enabled( true ); + Child->setPosition( 240, 130 ); + Child->setVisible( true ); + Child->setEnabled( true ); Child->startRotation( 0.f, 360.f, Milliseconds( 5000.f ) ); - Child->rotationInterpolation()->setLoop( true ); + Child->getRotationInterpolation()->setLoop( true ); - Params.Background.colors( ColorA( 0xFFFF0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xFFFF0077 ) ); + Params.Background.setColors( ColorA( 0xFFFF0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xFFFF0077 ) ); Params.setParent( Child ); Params.Size = Sizei( 25, 25 ); UITest * Child2 = eeNew( UITest, ( Params ) ); - Child2->position( 15, 15 ); - Child2->visible( true ); - Child2->enabled( true ); + Child2->setPosition( 15, 15 ); + Child2->setVisible( true ); + Child2->setEnabled( true ); Child2->startRotation( 0.f, 360.f, Milliseconds( 5000.f ) ); - Child2->rotationInterpolation()->setLoop( true ); + Child2->getRotationInterpolation()->setLoop( true ); mTheme->createSprite( eeNew( Sprite, ( "gn" ) ), C, Sizei(), Vector2i( 160, 100 ) ); @@ -311,8 +311,8 @@ void EETest::CreateUI() { TextParams.Size = Sizei( 320, 240 ); TextParams.Flags = UI_VALIGN_TOP | UI_HALIGN_RIGHT; UITextBox * Text = eeNew( UITextBox, ( TextParams ) ); - Text->visible( true ); - Text->enabled( false ); + Text->setVisible( true ); + Text->setEnabled( false ); Text->text( "Turn around\nJust Turn Around\nAround!" ); UITextInput::CreateParams InputParams; @@ -321,8 +321,8 @@ void EETest::CreateUI() { InputParams.Size = Sizei( 200, 22 ); InputParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_TEXT_SELECTION_ENABLED; UITextInput * Input = eeNew( UITextInput, ( InputParams ) ); - Input->visible( true ); - Input->enabled( true ); + Input->setVisible( true ); + Input->setEnabled( true ); UIPushButton::CreateParams ButtonParams; ButtonParams.setParent( C ); @@ -331,52 +331,52 @@ void EETest::CreateUI() { ButtonParams.Size = Sizei( 90, 0 ); ButtonParams.SetIcon( mTheme->getIconByName( "ok" ) ); UIPushButton * Button = eeNew( UIPushButton, ( ButtonParams ) ); - Button->visible( true ); - Button->enabled( true ); + Button->setVisible( true ); + Button->setEnabled( true ); Button->text( "Click Me" ); Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::ButtonClick ) ); - Button->tooltipText( "Click and see what happens..." ); + Button->setTooltipText( "Click and see what happens..." ); TextParams.setPos( 130, 20 ); TextParams.Size = Sizei( 80, 22 ); TextParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT; UICheckBox * Checkbox = eeNew( UICheckBox, ( TextParams ) ); - Checkbox->visible( true ); + Checkbox->setVisible( true ); Checkbox->text( "Check Me" ); - Checkbox->enabled( true ); + Checkbox->setEnabled( true ); TextParams.setPos( 130, 40 ); UIRadioButton * RadioButton = eeNew( UIRadioButton, ( TextParams ) ); - RadioButton->visible( true ); + RadioButton->setVisible( true ); RadioButton->text( "Check Me" ); - RadioButton->enabled( true ); + RadioButton->setEnabled( true ); TextParams.setPos( 130, 60 ); RadioButton = eeNew( UIRadioButton, ( TextParams ) ); - RadioButton->visible( true ); + RadioButton->setVisible( true ); RadioButton->text( "Check Me 2" ); - RadioButton->enabled( true ); + RadioButton->setEnabled( true ); UISlider::CreateParams SliderParams; SliderParams.setParent( C ); SliderParams.setPos( 220, 80 ); SliderParams.Size = Sizei( 80, 24 ); mSlider = eeNew( UISlider, ( SliderParams ) ); - mSlider->visible( true ); - mSlider->enabled( true ); + mSlider->setVisible( true ); + mSlider->setEnabled( true ); mSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &EETest::OnSliderValueChange ) ); SliderParams.setPos( 40, 110 ); SliderParams.Size = Sizei( 24, 80 ); SliderParams.VerticalSlider = true; mSlider = eeNew( UISlider, ( SliderParams ) ); - mSlider->visible( true ); - mSlider->enabled( true ); + mSlider->setVisible( true ); + mSlider->setEnabled( true ); SliderParams.setPos( 60, 110 ); mSlider = eeNew( UISlider, ( SliderParams ) ); - mSlider->visible( true ); - mSlider->enabled( true ); + mSlider->setVisible( true ); + mSlider->setEnabled( true ); UISpinBox::CreateParams SpinBoxParams; SpinBoxParams.setParent( C ); @@ -385,8 +385,8 @@ void EETest::CreateUI() { SpinBoxParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_CLIP_ENABLE; SpinBoxParams.AllowDotsInNumbers = true; UISpinBox * mSpinBox = eeNew( UISpinBox, ( SpinBoxParams ) ); - mSpinBox->visible( true ); - mSpinBox->enabled( true ); + mSpinBox->setVisible( true ); + mSpinBox->setEnabled( true ); UIScrollBar::CreateParams ScrollBarP; ScrollBarP.setParent( C ); @@ -395,15 +395,15 @@ void EETest::CreateUI() { ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; mScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); - mScrollBar->visible( true ); - mScrollBar->enabled( true ); + mScrollBar->setVisible( true ); + mScrollBar->setEnabled( true ); mScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &EETest::OnValueChange ) ); mProgressBar = mTheme->createProgressBar( C, Sizei( 200, 20 ), Vector2i( 20, 190 ) ); TextParams.setPos( 20, 5 ); mTextBoxValue = eeNew( UITextBox, ( TextParams ) ); - mTextBoxValue->visible( true ); + mTextBoxValue->setVisible( true ); OnValueChange( NULL ); UIListBox::CreateParams LBParams; @@ -412,8 +412,8 @@ void EETest::CreateUI() { LBParams.Size = Sizei( 200, 240-16 ); LBParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_TOUCH_DRAG_ENABLED; // | UI_MULTI_SELECT mListBox = eeNew( UIListBox, ( LBParams ) ); - mListBox->visible( true ); - mListBox->enabled( true ); + mListBox->setVisible( true ); + mListBox->setEnabled( true ); Int32 wsize = 100; @@ -432,8 +432,8 @@ void EETest::CreateUI() { DDLParams.Size = Sizei( 100, 21 ); DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_TOUCH_DRAG_ENABLED; UIDropDownList * mDropDownList = eeNew( UIDropDownList, ( DDLParams ) ); - mDropDownList->visible( true ); - mDropDownList->enabled( true ); + mDropDownList->setVisible( true ); + mDropDownList->setEnabled( true ); std::vector combostrs; combostrs.push_back( "Plane" ); @@ -454,8 +454,8 @@ void EETest::CreateUI() { ComboParams.Size = Sizei( 100, 1 ); ComboParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_AUTO_SIZE | UI_TOUCH_DRAG_ENABLED | UI_TEXT_SELECTION_ENABLED; UIComboBox * mComboBox = eeNew( UIComboBox, ( ComboParams ) ); - mComboBox->visible( true ); - mComboBox->enabled( true ); + mComboBox->setVisible( true ); + mComboBox->setEnabled( true ); mComboBox->getListBox()->addListBoxItems( combostrs ); mComboBox->getListBox()->setSelected( 0 ); @@ -510,8 +510,8 @@ void EETest::CreateUI() { TEParams.Size = Sizei( 315, 130 ); TEParams.Flags = UI_AUTO_PADDING | UI_CLIP_ENABLE | UI_TEXT_SELECTION_ENABLED; UITextEdit * TextEdit = eeNew( UITextEdit, ( TEParams ) ); - TextEdit->visible( true ); - TextEdit->enabled( true ); + TextEdit->setVisible( true ); + TextEdit->setEnabled( true ); TextEdit->text( mBuda ); UIGenericGrid::CreateParams GridParams; @@ -522,8 +522,8 @@ void EETest::CreateUI() { GridParams.RowHeight = 24; GridParams.CollumnsCount = 3; UIGenericGrid * mGenGrid = eeNew( UIGenericGrid, ( GridParams ) ); - mGenGrid->visible( true ); - mGenGrid->enabled( true ); + mGenGrid->setVisible( true ); + mGenGrid->setEnabled( true ); UIGridCell::CreateParams CellParams; CellParams.setParent( mGenGrid->getContainer() ); @@ -571,7 +571,7 @@ void EETest::CreateUI() { mShowMenu->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::OnShowMenu ) ); #endif - C = reinterpret_cast ( C->parent() ); + C = reinterpret_cast ( C->getParent() ); eePRINTL( "CreateUI time: %4.3f ms.", TE.getElapsed().asMilliseconds() ); } @@ -631,7 +631,7 @@ void EETest::CreateDecoratedWindow() { mUIWindow = mTheme->createWindow( NULL, Sizei( 530, 350 ), Vector2i( 200, 50 ), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON, Sizei( 100, 200 ) ); mUIWindow->addEventListener( UIEvent::EventOnWindowCloseClick, cb::Make1( this, &EETest::CloseClick ) ); - mUIWindow->title( "Test Window" ); + mUIWindow->setTitle( "Test Window" ); mUIWindow->toBack(); UIPushButton * Button = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 510, 22 ), Vector2i( 10, 28 ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_ANCHOR_RIGHT ); @@ -689,17 +689,17 @@ void EETest::ItemClick( const UIEvent * Event ) { } else if ( "Show Window" == txt ) { UIMenuCheckBox * Chk = reinterpret_cast ( Event->getControl() ); - C->visible( true ); - C->enabled( true ); + C->setVisible( true ); + C->setEnabled( true ); if ( Chk->active() ) { - if ( C->scale() == 1.f ) C->scale( 0.f ); - C->startScaleAnim( C->scale(), Vector2f::One, Milliseconds( 500.f ), Ease::SineOut ); - C->startAlphaAnim( C->alpha(), 255.f, Milliseconds( 500.f ) ); + if ( C->getScale() == 1.f ) C->setScale( 0.f ); + C->startScaleAnim( C->getScale(), Vector2f::One, Milliseconds( 500.f ), Ease::SineOut ); + C->startAlphaAnim( C->getAlpha(), 255.f, Milliseconds( 500.f ) ); C->startRotation( 0, 360, Milliseconds( 500.f ), Ease::SineOut ); } else { - C->startScaleAnim( C->scale(), Vector2f::Zero, Milliseconds( 500.f ), Ease::SineIn ); - C->startAlphaAnim( C->alpha(), 0.f, Milliseconds( 500.f ) ); + C->startScaleAnim( C->getScale(), Vector2f::Zero, Milliseconds( 500.f ), Ease::SineIn ); + C->startAlphaAnim( C->getAlpha(), 0.f, Milliseconds( 500.f ) ); C->startRotation( 0, 360, Milliseconds( 500.f ), Ease::SineIn ); } } else if ( "Show Window 2" == txt ) { @@ -732,7 +732,7 @@ void EETest::OnValueChange( const UIEvent * Event ) { void EETest::OnSliderValueChange( const UIEvent * Event ) { UISlider * slider = static_cast( Event->getControl() ); - C->angle( slider->value() * 90.f ); + C->setRotation( slider->value() * 90.f ); } void EETest::QuitClick( const UIEvent * Event ) { @@ -747,7 +747,7 @@ void EETest::ShowMenu() { if ( Menu->show() ) { Vector2i Pos = mWindow->getInput()->getMousePos(); UIMenu::FixMenuPos( Pos , Menu ); - Menu->position( Pos ); + Menu->setPosition( Pos ); } } @@ -767,8 +767,8 @@ void EETest::ButtonClick( const UIEvent * Event ) { GfxParams.setParent( UIManager::instance()->mainControl() ); GfxParams.SubTexture = mTheme->getIconByName( "ok" ); UIGfx * Gfx = eeNew( UIGfx, ( GfxParams ) ); - Gfx->visible( true ); - Gfx->enabled( false ); + Gfx->setVisible( true ); + Gfx->setEnabled( false ); Gfx->startRotation( 0, 2500, Milliseconds( 2500 ) ); Gfx->startMovement( Vector2i( Math::randi( 0, mWindow->getWidth() ), -64 ), Vector2i( Math::randi( 0, mWindow->getWidth() ), mWindow->getHeight() + 64 ), Milliseconds( 2500 ) ); @@ -779,7 +779,7 @@ void EETest::ButtonClick( const UIEvent * Event ) { } void EETest::SetScreen( Uint32 num ) { - if ( NULL != mTerrainBut ) mTerrainBut->visible( 1 == num ); + if ( NULL != mTerrainBut ) mTerrainBut->setVisible( 1 == num ); if ( 0 == num || 5 == num ) mWindow->setBackColor( RGB( 240, 240, 240 ) ); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index f9a93c7f2..ede7aae79 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -7,17 +7,17 @@ namespace Demo_Test { class UITest : public UIControlAnim { public: - UITest( UIControlAnim::CreateParams& Params ) : UIControlAnim( Params ) { mOldColor = mBackground->colors(); } + UITest( UIControlAnim::CreateParams& Params ) : UIControlAnim( Params ) { mOldColor = mBackground->getColors(); } virtual Uint32 onMouseEnter( const Vector2i& Pos, const Uint32 Flags ) { if ( 4 == mOldColor.size() ) { - mBackground->colors( ColorA( mOldColor[0].r(), mOldColor[0].g(), mOldColor[0].b(), 200 ), + mBackground->setColors( ColorA( mOldColor[0].r(), mOldColor[0].g(), mOldColor[0].b(), 200 ), ColorA( mOldColor[1].r(), mOldColor[1].g(), mOldColor[1].b(), 200 ), ColorA( mOldColor[2].r(), mOldColor[2].g(), mOldColor[2].b(), 200 ), ColorA( mOldColor[3].r(), mOldColor[3].g(), mOldColor[3].b(), 200 ) ); } else { - mBackground->color( ColorA( mOldColor[0].r(), mOldColor[0].g(), mOldColor[0].b(), 200 ) ); + mBackground->setColor( ColorA( mOldColor[0].r(), mOldColor[0].g(), mOldColor[0].b(), 200 ) ); } return 1; @@ -25,9 +25,9 @@ class UITest : public UIControlAnim { virtual Uint32 onMouseExit( const Vector2i& Pos, const Uint32 Flags ) { if ( 4 == mOldColor.size() ) { - mBackground->colors( mOldColor[0], mOldColor[1], mOldColor[2], mOldColor[3] ); + mBackground->setColors( mOldColor[0], mOldColor[1], mOldColor[2], mOldColor[3] ); } else { - mBackground->color( mOldColor[0] ); + mBackground->setColor( mOldColor[0] ); } return 1; @@ -37,9 +37,9 @@ class UITest : public UIControlAnim { UIDragable::onMouseUp( Pos, Flags ); if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelScrolledUp() ) - scale( scale() + 0.1f ); + setScale( getScale() + 0.1f ); else if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelScrolledDown() ) - scale( scale() - 0.1f ); + setScale( getScale() - 0.1f ); return 1; }