Renamed UIControl to UINode.

Removed UIControlAnim and UIDragableControl.
UIControlAnim and UIDragableControl implemented in base UINode.

--HG--
branch : dev-2.1
This commit is contained in:
Martí­n Lucas Golini
2018-01-02 02:37:23 -03:00
parent 04a605c684
commit e21daabe65
92 changed files with 1665 additions and 1959 deletions

View File

@@ -43,7 +43,7 @@ class EE_API MapEditor {
~MapEditor();
protected:
UIWindow * mUIWindow;
UIControl * mUIContainer;
UINode * mUIContainer;
UITheme * mTheme;
Private::UIMap * mUIMap;
MapEditorCloseCb mCloseCb;

View File

@@ -13,9 +13,7 @@
#include <eepp/ui/uiskincomplex.hpp>
#include <eepp/ui/uitheme.hpp>
#include <eepp/ui/uithememanager.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uidragablecontrol.hpp>
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uiwidget.hpp>
#include <eepp/ui/uitouchdragablewidget.hpp>
#include <eepp/ui/uiimage.hpp>

View File

@@ -26,10 +26,10 @@ class EE_API TextureAtlasEditor {
UISpinBox * getSpinOffY() const { return mSpinOffY; }
protected:
class UITGEUpdater : public UIControl
class UITGEUpdater : public UINode
{
public:
UITGEUpdater( TextureAtlasEditor * TGEditor ) : UIControl(), mTGEditor( TGEditor ) {}
UITGEUpdater( TextureAtlasEditor * TGEditor ) : UINode(), mTGEditor( TGEditor ) {}
virtual void update() { mTGEditor->update(); }
protected:
@@ -38,7 +38,7 @@ class EE_API TextureAtlasEditor {
friend class UITGEUpdater;
UIWindow * mUIWindow;
UIControl * mUIContainer;
UINode * mUIContainer;
UITheme * mTheme;
TGEditorCloseCb mCloseCb;
TexturePacker * mTexturePacker;

View File

@@ -6,13 +6,13 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIBackground {
public:
static UIBackground * New( UIControl * control );
static UIBackground * New( UINode * control );
UIBackground( UIControl * control );
UIBackground( UINode * control );
~UIBackground();
@@ -42,7 +42,7 @@ class EE_API UIBackground {
protected:
std::vector<Color> mColor;
UIControl * mControl;
UINode * mControl;
BlendMode mBlendMode;
unsigned int mCorners;
Drawable * mDrawable;

View File

@@ -5,13 +5,13 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIBorder {
public:
static UIBorder * New( UIControl * control );
static UIBorder * New( UINode * control );
UIBorder( UIControl * control );
UIBorder( UINode * control );
const Color& getColor() const;
@@ -23,7 +23,7 @@ class EE_API UIBorder {
void draw( Rectf R, const Float& alpha, const int& corners, const bool& clipping );
protected:
UIControl * mControl;
UINode * mControl;
Color mColor;
unsigned int mWidth;
};

View File

@@ -24,9 +24,9 @@ class EE_API UICheckBox : public UITextView {
void setActive( const bool& active );
UIControlAnim * getActiveButton() const;
UINode * getActiveButton() const;
UIControlAnim * getInactiveButton() const;
UINode * getInactiveButton() const;
Int32 getTextSeparation() const;
@@ -34,8 +34,8 @@ class EE_API UICheckBox : public UITextView {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UIControlAnim * mActiveButton;
UIControlAnim * mInactiveButton;
UINode * mActiveButton;
UINode * mInactiveButton;
bool mActive;
Uint32 mLastTick;
Int32 mTextSeparation;

View File

@@ -23,7 +23,7 @@ class EE_API UIComboBox : public UIWidget {
UIDropDownList * getDropDownList() const { return mDropDownList; }
UIControlAnim * getButton() const { return mButton; }
UINode * getButton() const { return mButton; }
InputTextBuffer * getInputTextBuffer();
@@ -32,7 +32,7 @@ class EE_API UIComboBox : public UIWidget {
void loadFromXmlNode(const pugi::xml_node & node);
protected:
UIDropDownList * mDropDownList;
UIControlAnim * mButton;
UINode * mButton;
void onButtonClick( const UIEvent * Event );

View File

@@ -1,458 +0,0 @@
#ifndef EE_UICUICONTROL_H
#define EE_UICUICONTROL_H
#include <eepp/ui/base.hpp>
#include <eepp/ui/uihelper.hpp>
#include <eepp/ui/uibackground.hpp>
#include <eepp/ui/uiborder.hpp>
#include <eepp/ui/uimessage.hpp>
#include <eepp/ui/uievent.hpp>
#include <eepp/ui/uieventkey.hpp>
#include <eepp/ui/uieventmouse.hpp>
#include <eepp/ui/uiskin.hpp>
#include <eepp/ui/uiskinstate.hpp>
#include <eepp/ui/uiskinsimple.hpp>
#include <eepp/ui/uiskincomplex.hpp>
#include <eepp/ui/uithememanager.hpp>
namespace EE { namespace UI {
class UITheme;
class UIWindow;
class UIManager;
class EE_API UIControl {
public:
static UIControl * New();
typedef cb::Callback1<void, const UIEvent*> UIEventCallback;
UIControl();
virtual ~UIControl();
void screenToControl( Vector2i& position ) const;
void controlToScreen( Vector2i& position ) const;
void worldToControl( Vector2i& pos ) const;
void controlToWorld( Vector2i& pos ) const;
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void messagePost( const UIMessage * Msg );
UIControl * setPosition( const Vector2i& position );
UIControl * setPosition( const Int32& x, const Int32& y );
void setPixelsPosition( const Vector2i& position );
void setPixelsPosition( const Int32& x, const Int32& y );
const Vector2i& getPosition() const;
const Vector2i& getRealPosition() const;
virtual UIControl * setSize( const Sizei& size );
UIControl * setSize( const Int32& Width, const Int32& Height );
void setPixelsSize( const Sizei& size );
void setPixelsSize( const Int32& x, const Int32& y );
const Sizei& getSize();
const Sizei& getRealSize();
Rect getRect() const;
UIControl * setVisible( const bool& visible );
bool isVisible() const;
bool isHided() const;
UIControl * setEnabled( const bool& enabled );
bool isEnabled() const;
bool isDisabled() const;
UIControl * getParent() const;
UIControl * setParent( UIControl * parent );
void centerHorizontal();
void centerVertical();
void center();
virtual void close();
virtual void draw();
virtual void update();
Uint32 getHorizontalAlign() const;
UIControl * setHorizontalAlign( Uint32 halign );
Uint32 getVerticalAlign() const;
UIControl * setVerticalAlign( Uint32 valign );
UIControl * setGravity( Uint32 hvalign );
UIBackground * setBackgroundFillEnabled( bool enabled );
UIBorder * setBorderEnabled( bool enabled );
UIControl * getNextControl() const;
UIControl * getPrevControl() const;
UIControl * getNextControlLoop() const;
UIControl * setData( const UintPtr& data );
const UintPtr& getData() const;
UIControl * childGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel = 0 );
const Uint32& getFlags() const;
virtual UIControl * setFlags( const Uint32& flags );
virtual UIControl * unsetFlags( const Uint32& flags );
virtual UIControl * resetFlags( Uint32 newFlags = 0 );
UIControl * setBlendMode( const BlendMode& blend );
BlendMode getBlendMode();
void toFront();
void toBack();
void toPosition( const Uint32& position );
const Uint32& getControlFlags() const;
/** Use it at your own risk */
void setControlFlags( const Uint32& flags );
Uint32 isAnimated();
Uint32 isDragable();
Uint32 isWidget();
Uint32 isWindow();
Uint32 isClipped();
Uint32 isRotated();
Uint32 isScaled();
Uint32 isFrameBuffer();
bool isMeOrParentTreeRotated();
bool isMeOrParentTreeScaled();
bool isMeOrParentTreeScaledOrRotated();
bool isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
Uint32 addEventListener( const Uint32& EventType, const UIEventCallback& Callback );
void removeEventListener( const Uint32& CallbackId );
UIBackground * getBackground();
UIBorder * getBorder();
void setThemeByName( const std::string& Theme );
virtual void setTheme( UITheme * Theme );
virtual UIControl * setThemeSkin( UITheme * Theme, const std::string& skinName );
virtual UIControl * setThemeSkin( const std::string& skinName );
void setThemeToChilds( UITheme * Theme );
UISkin * getSkin();
virtual UIControl * setSkin( const UISkin& Skin );
UIControl * setSkin( UISkin * skin );
void removeSkin();
UIControl * getFirstChild() const;
UIControl * getLastChild() const;
bool isMouseOver();
bool isMouseOverMeOrChilds();
Polygon2f& getPolygon();
const Vector2f& getPolygonCenter() const;
void setSkinState( const Uint32& State );
bool hasFocus() const;
virtual void setFocus();
bool isParentOf( UIControl * Ctrl );
void sendEvent( const UIEvent * Event );
void sendMouseEvent( const Uint32& Event, const Vector2i& position, const Uint32& flags );
void sendCommonEvent( const Uint32& Event );
Sizei getSkinSize();
UIControl * getNextWidget();
void applyDefaultTheme();
Rect getScreenRect();
void childsCloseAll();
std::string getId() const;
UIControl * setId( const std::string & id );
Uint32 getIdHash() const;
UIControl * getWindowContainer();
UIControl * find( const std::string& id );
template<typename T>
T * find( const std::string& id )
{
return reinterpret_cast<T*>( find( id ) );
}
template<typename T>
T * bind( const std::string& id, T*& ctrl )
{
ctrl = find<T>( id );
return ctrl;
}
bool isReverseDraw() const;
void setReverseDraw( bool reverseDraw );
UIWindow * getOwnerWindow();
void invalidateDraw();
void setClipEnabled();
void setClipDisabled();
protected:
typedef std::map< Uint32, std::map<Uint32, UIEventCallback> > UIEventsMap;
friend class UIManager;
friend class UIWindow;
std::string mId;
Uint32 mIdHash;
Vector2i mPos;
Vector2i mRealPos;
Vector2i mScreenPos;
Vector2f mScreenPosf;
Sizei mSize;
Sizei mRealSize;
Uint32 mFlags;
UintPtr mData;
UIControl * mParentCtrl;
UIWindow * mParentWindowCtrl;
UIControl * mChild; //! Pointer to the first child of the control
UIControl * mChildLast; //! Pointer to the last child added
UIControl * mNext; //! Pointer to the next child of the father
UIControl * mPrev; //! Pointer to the prev child of the father
UISkinState * mSkinState;
UIBackground * mBackground;
UIBorder * mBorder;
Uint32 mControlFlags;
BlendMode mBlend;
Uint16 mNumCallBacks;
Polygon2f mPoly;
Vector2f mCenter;
UIEventsMap mEvents;
bool mVisible;
bool mEnabled;
virtual Uint32 onMessage( const UIMessage * Msg );
virtual Uint32 onKeyDown( const UIEventKey& Event );
virtual Uint32 onKeyUp( const UIEventKey& Event );
virtual Uint32 onMouseMove( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDoubleClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseEnter( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseExit( const Vector2i& position, const Uint32 flags );
virtual Uint32 onFocus();
virtual Uint32 onFocusLoss();
virtual void onClose();
virtual Uint32 onValueChange();
virtual void onVisibilityChange();
virtual void onEnabledChange();
virtual void onPositionChange();
virtual void onSizeChange();
virtual void onParentSizeChange( const Vector2i& SizeChange );
virtual void onStateChange();
virtual void onParentChange();
virtual void onAlignChange();
virtual void onWidgetFocusLoss();
virtual void drawSkin();
virtual void drawBackground();
virtual void drawBorder();
virtual void updateQuad();
virtual void updateCenter();
virtual void matrixSet();
virtual void matrixUnset();
virtual void drawChilds();
virtual void onThemeLoaded();
virtual void onChildCountChange();
virtual UIControl * overFind( const Vector2f& Point );
virtual void onParentWindowControlChange();
virtual void clipMe();
void checkClose();
virtual void internalDraw();
void childDeleteAll();
void childAdd( UIControl * ChildCtrl );
void childAddAt( UIControl * ChildCtrl, Uint32 position );
void childRemove( UIControl * ChildCtrl );
bool isChild( UIControl * ChildCtrl ) const;
bool inParentTreeOf( UIControl * Child ) const;
Uint32 childCount() const;
UIControl * childAt( Uint32 Index ) const;
UIControl * childPrev( UIControl * Ctrl, bool Loop = false ) const;
UIControl * childNext( UIControl * Ctrl, bool Loop = false ) const;
virtual void clipDisable();
void setPrevSkinState();
virtual void updateScreenPos();
void updateChildsScreenPos();
void writeCtrlFlag( const Uint32& Flag, const Uint32& Val );
void writeFlag( const Uint32& Flag, const Uint32& Val );
void sendParentSizeChange( const Vector2i& SizeChange );
Time getElapsed();
Rect makePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false );
Sizei getSkinSize( UISkin * Skin, const Uint32& State = UISkinState::StateNormal );
Rectf getRectf();
void drawHighlightFocus();
void drawOverControl();
void drawDebugData();
void drawBox();
void setInternalPosition( const Vector2i& Pos );
void setInternalSize( const Sizei& size );
void setInternalWidth( const Int32& width );
void setInternalHeight( const Int32& height );
void setInternalPixelsSize( const Sizei& size );
void setInternalPixelsWidth( const Int32& width );
void setInternalPixelsHeight( const Int32& height );
UIControl * findIdHash( const Uint32& idHash );
UIWindow * getParentWindow();
};
}}
#endif

View File

@@ -1,139 +0,0 @@
#ifndef EE_UICUICONTROLANIM_H
#define EE_UICUICONTROLANIM_H
#include <eepp/ui/base.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uidragablecontrol.hpp>
namespace EE { namespace UI {
class EE_API UIControlAnim : public UIDragableControl {
public:
static UIControlAnim * New();
UIControlAnim();
virtual ~UIControlAnim();
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void update();
const Float& getRotation() const;
void setRotation( const Float& angle );
void setRotation( const Float& angle, const OriginPoint& center );
const OriginPoint& getRotationOriginPoint() const;
void setRotationOriginPoint( const OriginPoint& center );
Vector2f getRotationCenter();
const Vector2f& getScale() const;
void setScale( const Vector2f& scale );
void setScale( const Vector2f& scale, const OriginPoint& center );
void setScale( const Float& scale , const OriginPoint & center = OriginPoint::OriginCenter );
const OriginPoint& getScaleOriginPoint() const;
void setScaleOriginPoint( const OriginPoint& center );
Vector2f getScaleCenter();
const Float& getAlpha() const;
virtual void setAlpha( const Float& alpha );
virtual void setChildsAlpha( const Float& alpha );
bool isAnimating();
Interpolation1d * startAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * startAlphaAnim( const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * createFadeIn( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * createFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * closeFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * disableFadeOut( const Time & Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * getRotationInterpolation();
Interpolation2d * getScaleInterpolation();
Interpolation1d * getAlphaInterpolation();
Interpolation2d * getTranslationInterpolation();
virtual void draw();
bool isFadingOut();
protected:
friend class UIManager;
friend class UIControl;
Float mAngle;
OriginPoint mRotationOriginPoint;
Vector2f mScale;
OriginPoint mScaleOriginPoint;
Float mAlpha;
Interpolation1d * mAngleAnim;
Interpolation2d * mScaleAnim;
Interpolation1d * mAlphaAnim;
Interpolation2d * mMoveAnim;
virtual void drawBackground();
virtual void drawBorder();
virtual void drawSkin();
Color getColor( const Color& Col );
virtual void updateQuad();
virtual void onSizeChange();
virtual void onAngleChange();
virtual void onScaleChange();
virtual void onAlphaChange();
virtual void matrixSet();
virtual void matrixUnset();
void updateOriginPoint();
};
}}
#endif

View File

@@ -1,55 +0,0 @@
#ifndef EE_UICUIDRAGABLE_H
#define EE_UICUIDRAGABLE_H
#include <eepp/ui/uicontrol.hpp>
namespace EE { namespace UI {
class EE_API UIDragableControl : public UIControl {
public:
static UIDragableControl * New();
UIDragableControl();
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
bool isDragging() const;
void setDragging( const bool& dragging );
const Vector2i& getDragPoint() const;
void setDragPoint( const Vector2i& Point );
virtual void update();
bool isDragEnabled() const;
void setDragEnabled( const bool& enable );
void setDragButton( const Uint32& Button );
const Uint32& getDragButton() const;
protected:
virtual ~UIDragableControl();
Vector2i mDragPoint;
Uint32 mDragButton;
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags );
virtual Uint32 onDrag( const Vector2i& position );
virtual Uint32 onDragStart( const Vector2i& position );
virtual Uint32 onDragStop( const Vector2i& position );
};
}}
#endif

View File

@@ -44,7 +44,7 @@ class EE_API UIDropDownList : public UITextInput {
UIDropDownListStyleConfig mStyleConfig;
UIListBox * mListBox;
UIControl * mFriendCtrl;
UINode * mFriendCtrl;
void onListBoxFocusLoss( const UIEvent * Event );
@@ -72,7 +72,7 @@ class EE_API UIDropDownList : public UITextInput {
virtual void onThemeLoaded();
void setFriendControl( UIControl * friendCtrl );
void setFriendControl( UINode * friendCtrl );
void destroyListBox();
};

View File

@@ -5,7 +5,7 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIEvent {
public:
@@ -56,15 +56,15 @@ class EE_API UIEvent {
NoEvent = eeINDEX_NOT_FOUND
};
UIEvent( UIControl * control, const Uint32& eventType = NoEvent );
UIEvent( UINode * control, const Uint32& eventType = NoEvent );
~UIEvent();
UIControl * getControl() const;
UINode * getControl() const;
const Uint32& getEventType() const;
protected:
UIControl * mCtrl;
UINode * mCtrl;
Uint32 mEventType;
};

View File

@@ -6,11 +6,11 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIEventKey : public UIEvent {
public:
UIEventKey( UIControl * getControl, const Uint32& EventNum, const Uint32& getKeyCode, const Uint16& getChar, const Uint32& getMod );
UIEventKey( UINode * getControl, const Uint32& EventNum, const Uint32& getKeyCode, const Uint16& getChar, const Uint32& getMod );
~UIEventKey();

View File

@@ -6,11 +6,11 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIEventMouse : public UIEvent {
public:
UIEventMouse( UIControl * getControl, const Uint32& EventNum, const Vector2i& getPosition, const Uint32& getFlags );
UIEventMouse( UINode * getControl, const Uint32& EventNum, const Vector2i& getPosition, const Uint32& getFlags );
~UIEventMouse();

View File

@@ -8,29 +8,27 @@ namespace EE { namespace UI {
enum UI_CONTROL_FLAGS_VALUES {
UI_CTRL_FLAG_CLOSE = (1<<0),
UI_CTRL_FLAG_CLOSE_FO = (1<<1),
UI_CTRL_FLAG_ANIM = (1<<2),
UI_CTRL_FLAG_MOUSEOVER = (1<<3),
UI_CTRL_FLAG_HAS_FOCUS = (1<<4),
UI_CTRL_FLAG_SELECTED = (1<<5),
UI_CTRL_FLAG_DISABLE_FADE_OUT = (1<<6),
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD = (1<<7),
UI_CTRL_FLAG_DRAGGING = (1<<8),
UI_CTRL_FLAG_DRAGABLE = (1<<9),
UI_CTRL_FLAG_WIDGET = (1<<10),
UI_CTRL_FLAG_SKIN_OWNER = (1<<11),
UI_CTRL_FLAG_TOUCH_DRAGGING = (1<<12),
UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW = (1<<13),
UI_CTRL_FLAG_SELECTING = (1<<14),
UI_CTRL_FLAG_ROTATED = (1<<15),
UI_CTRL_FLAG_SCALED = (1<<16),
UI_CTRL_FLAG_OWNED_BY_WINDOW = (1<<17),
UI_CTRL_FLAG_DRAWABLE_OWNER = (1<<18),
UI_CTRL_FLAG_REVERSE_DRAW = (1<<19),
UI_CTRL_FLAG_FRAME_BUFFER = (1<<20),
UI_CTRL_FLAG_NEEDS_REDRAW = (1<<21),
UI_CTRL_FLAG_DIRTY_POLY = (1<<22),
UI_CTRL_FLAG_WINDOW = (1<<23),
UI_CTRL_FLAG_FREE_USE = (1<<31)
UI_CTRL_FLAG_MOUSEOVER = (1<<2),
UI_CTRL_FLAG_HAS_FOCUS = (1<<3),
UI_CTRL_FLAG_SELECTED = (1<<4),
UI_CTRL_FLAG_DISABLE_FADE_OUT = (1<<5),
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD = (1<<6),
UI_CTRL_FLAG_DRAGGING = (1<<7),
UI_CTRL_FLAG_WIDGET = (1<<8),
UI_CTRL_FLAG_SKIN_OWNER = (1<<9),
UI_CTRL_FLAG_TOUCH_DRAGGING = (1<<10),
UI_CTRL_FLAG_DISABLED_BY_MODAL_WINDOW = (1<<11),
UI_CTRL_FLAG_SELECTING = (1<<12),
UI_CTRL_FLAG_ROTATED = (1<<13),
UI_CTRL_FLAG_SCALED = (1<<14),
UI_CTRL_FLAG_OWNED_BY_WINDOW = (1<<15),
UI_CTRL_FLAG_DRAWABLE_OWNER = (1<<16),
UI_CTRL_FLAG_REVERSE_DRAW = (1<<17),
UI_CTRL_FLAG_FRAME_BUFFER = (1<<18),
UI_CTRL_FLAG_NEEDS_REDRAW = (1<<19),
UI_CTRL_FLAG_DIRTY_POLY = (1<<20),
UI_CTRL_FLAG_WINDOW = (1<<21),
UI_CTRL_FLAG_FREE_USE = (1<<22)
};
#define UI_HALIGN_LEFT TEXT_ALIGN_LEFT
@@ -71,9 +69,7 @@ enum UI_FLAGS {
};
enum UI_CONTROL_TYPES {
UI_TYPE_CONTROL = 0,
UI_TYPE_CONTROL_DRAGABLE,
UI_TYPE_CONTROL_ANIM,
UI_TYPE_NODE = 0,
UI_TYPE_WIDGET,
UI_TYPE_IMAGE,
UI_TYPE_SUBTEXTURE,

View File

@@ -1,12 +1,12 @@
#ifndef EE_UITUIITEMCONTAINER_HPP
#define EE_UITUIITEMCONTAINER_HPP
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace UI {
template<class TContainer>
class UIItemContainer : public UIControl {
class UIItemContainer : public UINode {
public:
UIItemContainer();
@@ -16,12 +16,12 @@ class UIItemContainer : public UIControl {
void drawChilds();
protected:
UIControl * overFind( const Vector2f& Point );
UINode * overFind( const Vector2f& Point );
};
template<class TContainer>
UIItemContainer<TContainer>::UIItemContainer() :
UIControl()
UINode()
{
}
@@ -54,10 +54,10 @@ void UIItemContainer<TContainer>::drawChilds() {
}
template<class TContainer>
UIControl * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
UINode * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
TContainer * tParent = reinterpret_cast<TContainer*> ( getParent() );
UIControl * pOver = NULL;
UINode * pOver = NULL;
if ( mEnabled && mVisible && tParent->mItems.size() ) {
updateQuad();
@@ -67,7 +67,7 @@ UIControl * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
for ( Uint32 i = tParent->mVisibleFirst; i <= tParent->mVisibleLast; i++ ) {
if ( NULL != tParent->mItems[i] ) {
UIControl * ChildOver = tParent->mItems[i]->overFind( Point );
UINode * ChildOver = tParent->mItems[i]->overFind( Point );
if ( NULL != ChildOver ) {
pOver = ChildOver;
@@ -78,7 +78,7 @@ UIControl * UIItemContainer<TContainer>::overFind( const Vector2f& Point ) {
}
if ( NULL == pOver )
pOver = const_cast<UIControl *>( reinterpret_cast<const UIControl *>( this ) );
pOver = const_cast<UINode *>( reinterpret_cast<const UINode *>( this ) );
}
}

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUILISTBOX_HPP
#define EE_UICUILISTBOX_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uiscrollbar.hpp>
#include <eepp/ui/uiitemcontainer.hpp>
#include <eepp/ui/uilistboxitem.hpp>

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUIMANAGER_H
#define EE_UICUIMANAGER_H
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uiwindow.hpp>
#include <eepp/window/input.hpp>
#include <eepp/window/window.hpp>
@@ -23,13 +23,13 @@ class EE_API UIManager {
UIWindow * getMainControl() const;
UIControl * getFocusControl() const;
UINode * getFocusControl() const;
void setFocusControl( UIControl * Ctrl );
void setFocusControl( UINode * Ctrl );
UIControl * getOverControl() const;
UINode * getOverControl() const;
void setOverControl( UIControl * Ctrl );
void setOverControl( UINode * Ctrl );
void init( Uint32 Flags = 0, EE::Window::Window * window = NULL );
@@ -43,7 +43,7 @@ class EE_API UIManager {
void resizeControl( EE::Window::Window * win );
void sendMsg( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flags = 0 );
void sendMsg( UINode * Ctrl, const Uint32& Msg, const Uint32& Flags = 0 );
Vector2i getMousePos();
@@ -53,9 +53,9 @@ class EE_API UIManager {
const Uint32& getLastPressTrigger() const;
void clipSmartEnable( UIControl * ctrl, const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height );
void clipSmartEnable( UINode * ctrl, const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height );
void clipSmartDisable( UIControl * ctrl );
void clipSmartDisable( UINode * ctrl );
void sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod );
@@ -105,18 +105,18 @@ class EE_API UIManager {
const Color& getHighlightOverColor() const;
void sendMouseClick( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseClick( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseUp( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseUp( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseDown( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
void sendMouseDown( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags );
EE::Window::Window * getWindow() const;
/** Control where the mouse click started to be down */
UIControl * getDownControl() const;
UINode * getDownControl() const;
UIControl * getLossFocusControl() const;
UINode * getLossFocusControl() const;
const bool& isShootingDown() const;
@@ -134,17 +134,17 @@ class EE_API UIManager {
void setCursor( EE_CURSOR_TYPE cursor );
UIWidget * loadLayoutFromFile( const std::string& layoutPath, UIControl * parent = NULL );
UIWidget * loadLayoutFromFile( const std::string& layoutPath, UINode * parent = NULL );
UIWidget * loadLayoutFromString( const std::string& layoutString, UIControl * parent = NULL );
UIWidget * loadLayoutFromString( const std::string& layoutString, UINode * parent = NULL );
UIWidget * loadLayoutFromMemory( const void * buffer, Int32 bufferSize, UIControl * parent = NULL );
UIWidget * loadLayoutFromMemory( const void * buffer, Int32 bufferSize, UINode * parent = NULL );
UIWidget * loadLayoutFromStream( IOStream& stream, UIControl * parent = NULL );
UIWidget * loadLayoutFromStream( IOStream& stream, UINode * parent = NULL );
UIWidget * loadLayoutFromPack( Pack * pack, const std::string& FilePackPath, UIControl * parent = NULL );
UIWidget * loadLayoutFromPack( Pack * pack, const std::string& FilePackPath, UINode * parent = NULL );
UIWidget * loadLayoutNodes( pugi::xml_node node, UIControl * parent );
UIWidget * loadLayoutNodes( pugi::xml_node node, UINode * parent );
void setTranslator( Translator translator );
@@ -153,18 +153,18 @@ class EE_API UIManager {
String getTranslatorString( const std::string& str );
protected:
friend class UIControl;
friend class UINode;
friend class UIWindow;
EE::Window::Window *mWindow;
Input * mKM;
UIWindow * mControl;
UIControl * mFocusControl;
UIControl * mOverControl;
UIControl * mDownControl;
UIControl * mLossFocusControl;
UINode * mFocusControl;
UINode * mOverControl;
UINode * mDownControl;
UINode * mLossFocusControl;
std::list<UIWindow*> mWindowsList;
std::list<UIControl*> mCloseList;
std::list<UINode*> mCloseList;
Clock mClock;
Time mElapsed;
@@ -201,7 +201,7 @@ class EE_API UIManager {
bool windowExists( UIWindow * win );
void addToCloseQueue( UIControl * Ctrl );
void addToCloseQueue( UINode * Ctrl );
void checkClose();
};

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUIMENU_HPP
#define EE_UICUIMENU_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uimenuitem.hpp>
#include <eepp/ui/uimenucheckbox.hpp>
#include <eepp/ui/uimenusubmenu.hpp>
@@ -26,7 +26,7 @@ class EE_API UIMenu : public UIWidget {
Uint32 add( const String& Text, Drawable * Icon = NULL );
Uint32 add( UIControl * Control );
Uint32 add( UINode * Control );
Uint32 addSeparator();
@@ -34,23 +34,23 @@ class EE_API UIMenu : public UIWidget {
Uint32 addSubMenu( const String& Text, Drawable * Icon = NULL, UIMenu * SubMenu = NULL );
UIControl * getItem( const Uint32& Index );
UINode * getItem( const Uint32& Index );
UIControl * getItem( const String& Text );
UINode * getItem( const String& Text );
Uint32 getItemIndex( UIControl * Item );
Uint32 getItemIndex( UINode * Item );
Uint32 getCount() const;
void remove( const Uint32& Index );
void remove( UIControl * Ctrl );
void remove( UINode * Ctrl );
void removeAll();
void insert( const String& Text, Drawable * Icon, const Uint32& Index );
void insert( UIControl * Control, const Uint32& Index );
void insert( UINode * Control, const Uint32& Index );
virtual void setTheme( UITheme * Theme );
@@ -74,12 +74,12 @@ class EE_API UIMenu : public UIWidget {
friend class UIMenuCheckBox;
friend class UIMenuSubMenu;
std::deque<UIControl *> mItems;
std::deque<UINode *> mItems;
UIMenuStyleConfig mStyleConfig;
Uint32 mMaxWidth;
Uint32 mNextPosY;
Uint32 mBiggestIcon;
UIControl * mItemSelected;
UINode * mItemSelected;
Uint32 mItemSelectedIndex;
bool mClickHide;
Uint32 mLastTickMove;
@@ -90,7 +90,7 @@ class EE_API UIMenu : public UIWidget {
virtual Uint32 onMessage( const UIMessage * Msg );
void setControlSize( UIControl * Control, const Uint32& position );
void setControlSize( UINode * Control, const Uint32& position );
void resizeControls();
@@ -106,11 +106,11 @@ class EE_API UIMenu : public UIWidget {
void onThemeLoaded();
bool checkControlSize( UIControl * Control, const bool& Resize = true );
bool checkControlSize( UINode * Control, const bool& Resize = true );
bool isSubMenu( UIControl * Ctrl );
bool isSubMenu( UINode * Ctrl );
void setItemSelected( UIControl * Item );
void setItemSelected( UINode * Item );
virtual Uint32 onKeyDown( const UIEventKey& Event );
@@ -118,7 +118,7 @@ class EE_API UIMenu : public UIWidget {
void nextSel();
void trySelect( UIControl * Ctrl, bool Up );
void trySelect( UINode * Ctrl, bool Up );
};
}}

View File

@@ -25,7 +25,7 @@ class EE_API UIMenuSubMenu : public UIMenuItem {
UIMenu * getSubMenu() const;
UIControl * getArrow() const;
UINode * getArrow() const;
void showSubMenu();
@@ -37,7 +37,7 @@ class EE_API UIMenuSubMenu : public UIMenuItem {
protected:
UIMenu * mSubMenu;
UIControlAnim * mArrow;
UINode * mArrow;
Float mTimeOver;
Float mMaxTime;
Uint32 mCbId;

View File

@@ -5,7 +5,7 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIMessage {
public:
@@ -29,17 +29,17 @@ class EE_API UIMessage {
NoMessage = eeINDEX_NOT_FOUND
};
UIMessage( UIControl * Ctrl, const Uint32& getMsg, const Uint32& getFlags = NoMessage );
UIMessage( UINode * Ctrl, const Uint32& getMsg, const Uint32& getFlags = NoMessage );
~UIMessage();
UIControl * getSender() const;
UINode * getSender() const;
const Uint32& getMsg() const;
const Uint32& getFlags() const;
private:
UIControl * mCtrl;
UINode * mCtrl;
Uint32 mMsg;
Uint32 mFlags;
};

572
include/eepp/ui/uinode.hpp Normal file
View File

@@ -0,0 +1,572 @@
#ifndef EE_UIUINODE_HPP
#define EE_UIUINODE_HPP
#include <eepp/ui/base.hpp>
#include <eepp/ui/uihelper.hpp>
#include <eepp/ui/uibackground.hpp>
#include <eepp/ui/uiborder.hpp>
#include <eepp/ui/uimessage.hpp>
#include <eepp/ui/uievent.hpp>
#include <eepp/ui/uieventkey.hpp>
#include <eepp/ui/uieventmouse.hpp>
#include <eepp/ui/uiskin.hpp>
#include <eepp/ui/uiskinstate.hpp>
#include <eepp/ui/uiskinsimple.hpp>
#include <eepp/ui/uiskincomplex.hpp>
#include <eepp/ui/uithememanager.hpp>
namespace EE { namespace UI {
class UITheme;
class UIWindow;
class UIManager;
class EE_API UINode {
public:
static UINode * New();
typedef cb::Callback1<void, const UIEvent*> UIEventCallback;
UINode();
virtual ~UINode();
void screenToControl( Vector2i& position ) const;
void controlToScreen( Vector2i& position ) const;
void worldToControl( Vector2i& pos ) const;
void controlToWorld( Vector2i& pos ) const;
virtual Uint32 getType() const;
virtual bool isType( const Uint32& type ) const;
virtual void messagePost( const UIMessage * Msg );
UINode * setPosition( const Vector2i& position );
UINode * setPosition( const Int32& x, const Int32& y );
void setPixelsPosition( const Vector2i& position );
void setPixelsPosition( const Int32& x, const Int32& y );
const Vector2i& getPosition() const;
const Vector2i& getRealPosition() const;
virtual UINode * setSize( const Sizei& size );
UINode * setSize( const Int32& Width, const Int32& Height );
void setPixelsSize( const Sizei& size );
void setPixelsSize( const Int32& x, const Int32& y );
const Sizei& getSize();
const Sizei& getRealSize();
Rect getRect() const;
UINode * setVisible( const bool& visible );
bool isVisible() const;
bool isHided() const;
UINode * setEnabled( const bool& enabled );
bool isEnabled() const;
bool isDisabled() const;
UINode * getParent() const;
UINode * setParent( UINode * parent );
void centerHorizontal();
void centerVertical();
void center();
virtual void close();
virtual void draw();
virtual void update();
Uint32 getHorizontalAlign() const;
UINode * setHorizontalAlign( Uint32 halign );
Uint32 getVerticalAlign() const;
UINode * setVerticalAlign( Uint32 valign );
UINode * setGravity( Uint32 hvalign );
UIBackground * setBackgroundFillEnabled( bool enabled );
UIBorder * setBorderEnabled( bool enabled );
UINode * getNextControl() const;
UINode * getPrevControl() const;
UINode * getNextControlLoop() const;
UINode * setData( const UintPtr& data );
const UintPtr& getData() const;
UINode * childGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel = 0 );
const Uint32& getFlags() const;
virtual UINode * setFlags( const Uint32& flags );
virtual UINode * unsetFlags( const Uint32& flags );
virtual UINode * resetFlags( Uint32 newFlags = 0 );
UINode * setBlendMode( const BlendMode& blend );
BlendMode getBlendMode();
void toFront();
void toBack();
void toPosition( const Uint32& position );
const Uint32& getControlFlags() const;
/** Use it at your own risk */
void setControlFlags( const Uint32& flags );
Uint32 isWidget();
Uint32 isWindow();
Uint32 isClipped();
Uint32 isRotated();
Uint32 isScaled();
Uint32 isFrameBuffer();
bool isMeOrParentTreeRotated();
bool isMeOrParentTreeScaled();
bool isMeOrParentTreeScaledOrRotated();
bool isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
Uint32 addEventListener( const Uint32& EventType, const UIEventCallback& Callback );
void removeEventListener( const Uint32& CallbackId );
UIBackground * getBackground();
UIBorder * getBorder();
void setThemeByName( const std::string& Theme );
virtual void setTheme( UITheme * Theme );
virtual UINode * setThemeSkin( UITheme * Theme, const std::string& skinName );
virtual UINode * setThemeSkin( const std::string& skinName );
void setThemeToChilds( UITheme * Theme );
UISkin * getSkin();
virtual UINode * setSkin( const UISkin& Skin );
UINode * setSkin( UISkin * skin );
void removeSkin();
UINode * getFirstChild() const;
UINode * getLastChild() const;
bool isMouseOver();
bool isMouseOverMeOrChilds();
Polygon2f& getPolygon();
const Vector2f& getPolygonCenter() const;
void setSkinState( const Uint32& State );
bool hasFocus() const;
virtual void setFocus();
bool isParentOf( UINode * Ctrl );
void sendEvent( const UIEvent * Event );
void sendMouseEvent( const Uint32& Event, const Vector2i& position, const Uint32& flags );
void sendCommonEvent( const Uint32& Event );
Sizei getSkinSize();
UINode * getNextWidget();
void applyDefaultTheme();
Rect getScreenRect();
void childsCloseAll();
std::string getId() const;
UINode * setId( const std::string & id );
Uint32 getIdHash() const;
UINode * getWindowContainer();
UINode * find( const std::string& id );
template<typename T>
T * find( const std::string& id )
{
return reinterpret_cast<T*>( find( id ) );
}
template<typename T>
T * bind( const std::string& id, T*& ctrl )
{
ctrl = find<T>( id );
return ctrl;
}
bool isReverseDraw() const;
void setReverseDraw( bool reverseDraw );
UIWindow * getOwnerWindow();
void invalidateDraw();
void setClipEnabled();
void setClipDisabled();
bool isDragging() const;
void setDragging( const bool& dragging );
const Vector2i& getDragPoint() const;
void setDragPoint( const Vector2i& Point );
bool isDragEnabled() const;
void setDragEnabled( const bool& enable );
void setDragButton( const Uint32& Button );
const Uint32& getDragButton() const;
const Float& getRotation() const;
void setRotation( const Float& angle );
void setRotation( const Float& angle, const OriginPoint& center );
const OriginPoint& getRotationOriginPoint() const;
void setRotationOriginPoint( const OriginPoint& center );
Vector2f getRotationCenter();
const Vector2f& getScale() const;
void setScale( const Vector2f& scale );
void setScale( const Vector2f& scale, const OriginPoint& center );
void setScale( const Float& scale , const OriginPoint & center = OriginPoint::OriginCenter );
const OriginPoint& getScaleOriginPoint() const;
void setScaleOriginPoint( const OriginPoint& center );
Vector2f getScaleCenter();
const Float& getAlpha() const;
virtual void setAlpha( const Float& alpha );
virtual void setChildsAlpha( const Float& alpha );
bool isAnimating();
Interpolation1d * startAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * startAlphaAnim( const Float& To, const Time& TotalTime, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startScaleAnim( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation2d * startTranslation( const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation2d::OnPathEndCallback PathEndCallback = Interpolation2d::OnPathEndCallback() );
Interpolation1d * startRotation( const Float& To, const Time& TotalTime, const Ease::Interpolation& type = Ease::Linear, Interpolation1d::OnPathEndCallback PathEndCallback = Interpolation1d::OnPathEndCallback() );
Interpolation1d * createFadeIn( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * createFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * closeFadeOut( const Time& Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * disableFadeOut( const Time & Time, const bool& alphaChilds = true, const Ease::Interpolation& type = Ease::Linear );
Interpolation1d * getRotationInterpolation();
Interpolation2d * getScaleInterpolation();
Interpolation1d * getAlphaInterpolation();
Interpolation2d * getTranslationInterpolation();
bool isFadingOut();
protected:
typedef std::map< Uint32, std::map<Uint32, UIEventCallback> > UIEventsMap;
friend class UIManager;
friend class UIWindow;
std::string mId;
Uint32 mIdHash;
Vector2i mPos;
Vector2i mRealPos;
Vector2i mScreenPos;
Vector2f mScreenPosf;
Sizei mSize;
Sizei mRealSize;
Uint32 mFlags;
UintPtr mData;
UINode * mParentCtrl;
UIWindow * mParentWindowCtrl;
UINode * mChild; //! Pointer to the first child of the control
UINode * mChildLast; //! Pointer to the last child added
UINode * mNext; //! Pointer to the next child of the father
UINode * mPrev; //! Pointer to the prev child of the father
UISkinState * mSkinState;
UIBackground * mBackground;
UIBorder * mBorder;
Uint32 mControlFlags;
BlendMode mBlend;
Uint16 mNumCallBacks;
Polygon2f mPoly;
Vector2f mCenter;
UIEventsMap mEvents;
bool mVisible;
bool mEnabled;
Vector2i mDragPoint;
Uint32 mDragButton;
Float mAngle;
OriginPoint mRotationOriginPoint;
Vector2f mScale;
OriginPoint mScaleOriginPoint;
Float mAlpha;
Interpolation1d * mAngleAnim;
Interpolation2d * mScaleAnim;
Interpolation1d * mAlphaAnim;
Interpolation2d * mMoveAnim;
virtual Uint32 onMessage( const UIMessage * Msg );
virtual Uint32 onKeyDown( const UIEventKey& Event );
virtual Uint32 onKeyUp( const UIEventKey& Event );
virtual Uint32 onMouseMove( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseDoubleClick( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseEnter( const Vector2i& position, const Uint32 flags );
virtual Uint32 onMouseExit( const Vector2i& position, const Uint32 flags );
virtual Uint32 onFocus();
virtual Uint32 onFocusLoss();
virtual void onClose();
virtual Uint32 onValueChange();
virtual void onVisibilityChange();
virtual void onEnabledChange();
virtual void onPositionChange();
virtual void onSizeChange();
virtual void onParentSizeChange( const Vector2i& SizeChange );
virtual void onStateChange();
virtual void onParentChange();
virtual void onAlignChange();
virtual void onWidgetFocusLoss();
virtual void drawSkin();
virtual void drawBackground();
virtual void drawBorder();
virtual void updateQuad();
virtual void updateCenter();
virtual void matrixSet();
virtual void matrixUnset();
virtual void drawChilds();
virtual void onThemeLoaded();
virtual void onChildCountChange();
virtual void onAngleChange();
virtual void onScaleChange();
virtual void onAlphaChange();
virtual UINode * overFind( const Vector2f& Point );
virtual void onParentWindowControlChange();
virtual void clipMe();
virtual Uint32 onDrag( const Vector2i& position );
virtual Uint32 onDragStart( const Vector2i& position );
virtual Uint32 onDragStop( const Vector2i& position );
void checkClose();
virtual void internalDraw();
void childDeleteAll();
void childAdd( UINode * ChildCtrl );
void childAddAt( UINode * ChildCtrl, Uint32 position );
void childRemove( UINode * ChildCtrl );
bool isChild( UINode * ChildCtrl ) const;
bool inParentTreeOf( UINode * Child ) const;
Uint32 childCount() const;
UINode * childAt( Uint32 Index ) const;
UINode * childPrev( UINode * Ctrl, bool Loop = false ) const;
UINode * childNext( UINode * Ctrl, bool Loop = false ) const;
virtual void clipDisable();
void setPrevSkinState();
virtual void updateScreenPos();
void updateChildsScreenPos();
void writeCtrlFlag( const Uint32& Flag, const Uint32& Val );
void writeFlag( const Uint32& Flag, const Uint32& Val );
void sendParentSizeChange( const Vector2i& SizeChange );
Time getElapsed();
Rect makePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false );
Sizei getSkinSize( UISkin * Skin, const Uint32& State = UISkinState::StateNormal );
Rectf getRectf();
void drawHighlightFocus();
void drawOverControl();
void drawDebugData();
void drawBox();
void setInternalPosition( const Vector2i& Pos );
void setInternalSize( const Sizei& size );
void setInternalWidth( const Int32& width );
void setInternalHeight( const Int32& height );
void setInternalPixelsSize( const Sizei& size );
void setInternalPixelsWidth( const Int32& width );
void setInternalPixelsHeight( const Int32& height );
Color getColor( const Color& Col );
UINode * findIdHash( const Uint32& idHash );
UIWindow * getParentWindow();
void updateOriginPoint();
};
}}
#endif

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICPROGRESSBAR_HPP
#define EE_UICPROGRESSBAR_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitextview.hpp>
#include <eepp/graphics/scrollparallax.hpp>

View File

@@ -24,9 +24,9 @@ class EE_API UIRadioButton : public UITextView {
void setActive( const bool& active );
UIControlAnim * getActiveButton() const;
UINode * getActiveButton() const;
UIControlAnim * getInactiveButton() const;
UINode * getInactiveButton() const;
Int32 getTextSeparation() const;
@@ -34,8 +34,8 @@ class EE_API UIRadioButton : public UITextView {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UIControlAnim * mActiveButton;
UIControlAnim * mInactiveButton;
UINode * mActiveButton;
UINode * mInactiveButton;
bool mActive;
Uint32 mLastTick;
Int32 mTextSeparation;

View File

@@ -51,13 +51,13 @@ class EE_API UIScrollBar : public UIWidget {
UISlider * getSlider() const;
UIControlAnim * getButtonUp() const;
UINode * getButtonUp() const;
UIControlAnim * getButtonDown() const;
UINode * getButtonDown() const;
UI_ORIENTATION getOrientation() const;
UIControl * setOrientation( const UI_ORIENTATION & orientation );
UINode * setOrientation( const UI_ORIENTATION & orientation );
ScrollBarType getScrollBarType() const;
@@ -72,8 +72,8 @@ class EE_API UIScrollBar : public UIWidget {
protected:
ScrollBarType mScrollBarType;
UISlider * mSlider;
UIControlAnim * mBtnUp;
UIControlAnim * mBtnDown;
UINode * mBtnUp;
UINode * mBtnDown;
virtual void onSizeChange();

View File

@@ -38,7 +38,7 @@ class EE_API UIScrollView : public UITouchDragableWidget {
UIScrollBar * getHorizontalScrollBar() const;
UIControlAnim * getContainer() const;
UINode * getContainer() const;
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
@@ -47,8 +47,8 @@ class EE_API UIScrollView : public UITouchDragableWidget {
UI_SCROLLBAR_MODE mHScrollMode;
UIScrollBar * mVScroll;
UIScrollBar * mHScroll;
UIControlAnim * mContainer;
UIControl * mScrollView;
UINode * mContainer;
UINode * mScrollView;
Uint32 mSizeChangeCb;
virtual void onSizeChange();

View File

@@ -37,7 +37,7 @@ class EE_API UISkinState {
const Uint32& getPrevState() const;
protected:
friend class UIControl;
friend class UINode;
UISkin * mSkin;
Uint32 mCurState;

View File

@@ -40,9 +40,9 @@ class EE_API UISlider : public UIWidget {
virtual void update();
UIControl * getBackSlider() const;
UINode * getBackSlider() const;
UIDragableControl * getSliderButton() const;
UINode * getSliderButton() const;
void adjustChilds();
@@ -70,7 +70,7 @@ class EE_API UISlider : public UIWidget {
UI_ORIENTATION mOrientation;
UISliderStyleConfig mStyleConfig;
UIControlAnim * mBackSlider;
UINode * mBackSlider;
Private::UISliderButton * mSlider;
Float mMinValue;
Float mMaxValue;

View File

@@ -46,9 +46,9 @@ class EE_API UISpinBox : public UIWidget {
virtual void update();
UIControlAnim * getButtonPushUp() const;
UINode * getButtonPushUp() const;
UIControlAnim * getButtonPushDown() const;
UINode * getButtonPushDown() const;
UITextInput * getTextInput() const;
@@ -59,8 +59,8 @@ class EE_API UISpinBox : public UIWidget {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UITextInput * mInput;
UIControlAnim * mPushUp;
UIControlAnim * mPushDown;
UINode * mPushUp;
UINode * mPushDown;
Float mMinValue;
Float mMaxValue;
Float mValue;

View File

@@ -13,9 +13,9 @@ class EE_API UITab : public UISelectButton {
UITab();
UIControl * getControlOwned() const;
UINode * getControlOwned() const;
void setControlOwned( UIControl * controlOwned );
void setControlOwned( UINode * controlOwned );
virtual ~UITab();
@@ -33,7 +33,7 @@ class EE_API UITab : public UISelectButton {
virtual void loadFromXmlNode( const pugi::xml_node& node );
protected:
UIControl * mControlOwned;
UINode * mControlOwned;
std::string mOwnedName;
virtual Uint32 onMouseClick( const Vector2i &position, const Uint32 flags );

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUIGENERICGRID_HPP
#define EE_UICUIGENERICGRID_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitablecell.hpp>
#include <eepp/ui/uiscrollbar.hpp>
#include <eepp/ui/uiitemcontainer.hpp>

View File

@@ -18,9 +18,9 @@ class EE_API UITableCell : public UIWidget {
virtual void setTheme( UITheme * Theme );
void setCell( const Uint32& CollumnIndex, UIControl * Ctrl );
void setCell( const Uint32& CollumnIndex, UINode * Ctrl );
UIControl * getCell( const Uint32& CollumnIndex ) const;
UINode * getCell( const Uint32& CollumnIndex ) const;
virtual void update();
@@ -35,7 +35,7 @@ class EE_API UITableCell : public UIWidget {
friend class UIItemContainer<UITable>;
friend class UITable;
std::vector<UIControl*> mCells;
std::vector<UINode*> mCells;
UITable * gridParent() const;

View File

@@ -19,7 +19,7 @@ class EE_API UITabWidget : public UIWidget {
virtual bool isType( const Uint32& type ) const;
UITabWidget * add( const String& Text, UIControl * CtrlOwned, Drawable * Icon = NULL );
UITabWidget * add( const String& Text, UINode * CtrlOwned, Drawable * Icon = NULL );
UITabWidget * add( UITab * Tab );
@@ -37,7 +37,7 @@ class EE_API UITabWidget : public UIWidget {
void removeAll();
void insert( const String& Text, UIControl * CtrlOwned, Drawable * Icon, const Uint32& Index );
void insert( const String& Text, UINode * CtrlOwned, Drawable * Icon, const Uint32& Index );
void insert( UITab * Tab, const Uint32& Index );
@@ -148,7 +148,7 @@ class EE_API UITabWidget : public UIWidget {
void onThemeLoaded();
UITab * createTab( const String& Text, UIControl * CtrlOwned, Drawable * Icon );
UITab * createTab( const String& Text, UINode * CtrlOwned, Drawable * Icon );
virtual void onSizeChange();

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUITEXTEDIT_HPP
#define EE_UICUITEXTEDIT_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitextinput.hpp>
#include <eepp/ui/uiscrollbar.hpp>

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUITEXTINPUT_H
#define EE_UICUITEXTINPUT_H
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitextview.hpp>
#include <eepp/window/inputtextbuffer.hpp>

View File

@@ -6,7 +6,7 @@
namespace EE { namespace UI {
class UIControl;
class UINode;
class EE_API UIThemeManager : public ResourceManager<UITheme> {
SINGLETON_DECLARE_HEADERS(UIThemeManager)
@@ -28,7 +28,7 @@ class EE_API UIThemeManager : public ResourceManager<UITheme> {
UITheme * getDefaultTheme() const;
void applyDefaultTheme( UIControl * Control );
void applyDefaultTheme( UINode * Control );
void setAutoApplyDefaultTheme( const bool& apply );

View File

@@ -1,7 +1,7 @@
#ifndef EE_UICUITOOLTIP_HPP
#define EE_UICUITOOLTIP_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace Graphics {
class Text;
@@ -9,7 +9,7 @@ class Text;
namespace EE { namespace UI {
class EE_API UITooltip : public UIControlAnim {
class EE_API UITooltip : public UINode {
public:
static UITooltip * New();
@@ -71,9 +71,9 @@ class EE_API UITooltip : public UIControlAnim {
const Time & getTooltipTime() const;
UIControl * getTooltipOf() const;
UINode * getTooltipOf() const;
void setTooltipOf(UIControl * tooltipOf);
void setTooltipOf(UINode * tooltipOf);
UITooltipStyleConfig getStyleConfig() const;
@@ -84,7 +84,7 @@ class EE_API UITooltip : public UIControlAnim {
Vector2f mAlignOffset;
Rect mRealPadding;
Time mTooltipTime;
UIControl * mTooltipOf;
UINode * mTooltipOf;
virtual void onSizeChange();

View File

@@ -1,7 +1,7 @@
#ifndef EE_UIUIWIDGET_HPP
#define EE_UIUIWIDGET_HPP
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uitooltip.hpp>
namespace pugi {
@@ -10,7 +10,7 @@ class xml_node;
namespace EE { namespace UI {
class EE_API UIWidget : public UIControlAnim {
class EE_API UIWidget : public UINode {
public:
static UIWidget * New();
@@ -24,21 +24,21 @@ class EE_API UIWidget : public UIControlAnim {
virtual void update();
virtual UIControl * setSize( const Sizei& size );
virtual UINode * setSize( const Sizei& size );
virtual UIControl * setFlags( const Uint32& flags );
virtual UINode * setFlags( const Uint32& flags );
virtual UIControl * unsetFlags( const Uint32& flags );
virtual UINode * unsetFlags( const Uint32& flags );
virtual UIWidget * setAnchors( const Uint32& flags );
virtual void setTheme( UITheme * Theme );
virtual UIControl * setThemeSkin( const std::string& skinName );
virtual UINode * setThemeSkin( const std::string& skinName );
virtual UIControl * setThemeSkin( UITheme * Theme, const std::string& skinName );
virtual UINode * setThemeSkin( UITheme * Theme, const std::string& skinName );
UIControl * setSize( const Int32& Width, const Int32& Height );
UINode * setSize( const Int32& Width, const Int32& Height );
const Sizei& getSize();

View File

@@ -33,9 +33,9 @@ class EE_API UIWindow : public UIWidget {
virtual bool isType( const Uint32& type ) const;
virtual UIControl * setSize( const Sizei& size );
virtual UINode * setSize( const Sizei& size );
UIControl * setSize( const Int32& Width, const Int32& Height );
UINode * setSize( const Int32& Width, const Int32& Height );
UIWindow * setSizeWithDecoration( const Int32& Width, const Int32& Height );
@@ -49,11 +49,11 @@ class EE_API UIWindow : public UIWidget {
UIWidget * getContainer() const;
UIControlAnim * getButtonClose() const;
UINode * getButtonClose() const;
UIControlAnim * getButtonMaximize() const;
UINode * getButtonMaximize() const;
UIControlAnim * getButtonMinimize() const;
UINode * getButtonMinimize() const;
virtual bool show();
@@ -150,15 +150,15 @@ class EE_API UIWindow : public UIWidget {
FrameBuffer * mFrameBuffer;
UIWindowStyleConfig mStyleConfig;
UIControlAnim * mWindowDecoration;
UIControlAnim * mBorderLeft;
UIControlAnim * mBorderRight;
UIControlAnim * mBorderBottom;
UINode * mWindowDecoration;
UINode * mBorderLeft;
UINode * mBorderRight;
UINode * mBorderBottom;
UIWidget * mContainer;
UIControlAnim * mButtonClose;
UIControlAnim * mButtonMinimize;
UIControlAnim * mButtonMaximize;
UINode * mButtonClose;
UINode * mButtonMinimize;
UINode * mButtonMaximize;
UITextView * mTitle;
UIWidget * mModalCtrl;
@@ -199,7 +199,7 @@ class EE_API UIWindow : public UIWidget {
void doResize( const UIMessage * Msg );
void decideResizeType( UIControl * Control );
void decideResizeType( UINode * Control );
void tryResize( const UI_RESIZE_TYPE& getType );

View File

@@ -56,7 +56,7 @@ class EE_API UIWinMenu : public UIWidget {
UIPopUpMenu * getMenuFromButton( UISelectButton * Button );
bool isPopUpMenuChild( UIControl * Ctrl );
bool isPopUpMenuChild( UINode * Ctrl );
void onMenuFocusLoss( const UIEvent * Event );

View File

@@ -31,13 +31,13 @@
../../include/eepp/math/interpolation2d.hpp
../../include/eepp/system/color.hpp
../../include/eepp/system/translator.hpp
../../include/eepp/ui/uidragablecontrol.hpp
../../include/eepp/ui/uieventmouse.hpp
../../include/eepp/ui/uigridlayout.hpp
../../include/eepp/ui/uiimage.hpp
../../include/eepp/ui/uilayout.hpp
../../include/eepp/ui/uilinearlayout.hpp
../../include/eepp/ui/uimenuseparator.hpp
../../include/eepp/ui/uinode.hpp
../../include/eepp/ui/uirelativelayout.hpp
../../include/eepp/ui/uiscrollview.hpp
../../include/eepp/ui/uisubtexture.hpp
@@ -81,13 +81,13 @@
../../src/eepp/math/interpolation2d.cpp
../../src/eepp/system/color.cpp
../../src/eepp/system/translator.cpp
../../src/eepp/ui/uidragablecontrol.cpp
../../src/eepp/ui/uigridlayout.cpp
../../src/eepp/ui/uiimage.cpp
../../src/eepp/ui/uilayout.cpp
../../src/eepp/ui/uilinearlayout.cpp
../../src/eepp/ui/uiloader.cpp
../../src/eepp/ui/uimenuseparator.cpp
../../src/eepp/ui/uinode.cpp
../../src/eepp/ui/uirelativelayout.cpp
../../src/eepp/ui/uiscrollview.cpp
../../src/eepp/ui/uisubtexture.cpp
@@ -342,8 +342,6 @@
../../include/eepp/ui/uieventkey.hpp
../../include/eepp/ui/uievent.hpp
../../include/eepp/ui/uidropdownlist.hpp
../../include/eepp/ui/uicontrolanim.hpp
../../include/eepp/ui/uicontrol.hpp
../../include/eepp/ui/uicommondialog.hpp
../../include/eepp/ui/uicombobox.hpp
../../include/eepp/ui/uicheckbox.hpp
@@ -390,8 +388,6 @@
../../src/eepp/ui/uieventkey.cpp
../../src/eepp/ui/uievent.cpp
../../src/eepp/ui/uidropdownlist.cpp
../../src/eepp/ui/uicontrolanim.cpp
../../src/eepp/ui/uicontrol.cpp
../../src/eepp/ui/uicommondialog.cpp
../../src/eepp/ui/uicombobox.cpp
../../src/eepp/ui/uicheckbox.cpp

View File

@@ -29,7 +29,7 @@ using namespace EE::Maps::Private;
namespace EE { namespace Maps {
static UITextView * createTextBox( const String& Text = "", UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
static UITextView * createTextBox( const String& Text = "", UINode * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
UITextView * Ctrl = UITextView::New();
Ctrl->setFontStyle( fontStyle );
Ctrl->resetFlags( Flags )->setParent( Parent )->setPosition( Pos )->setSize( Size )->setVisible( true )->setEnabled( false );

View File

@@ -3,7 +3,7 @@
namespace EE { namespace Maps { namespace Private {
static UITextView * createTextBox( const String& Text = "", UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
static UITextView * createTextBox( const String& Text = "", UINode * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
UITextView * Ctrl = UITextView::New();
Ctrl->setFontStyle( fontStyle );
Ctrl->resetFlags( Flags )->setParent( Parent )->setPosition( Pos )->setSize( Size )->setVisible( true )->setEnabled( false );

View File

@@ -2,7 +2,7 @@
namespace EE { namespace Maps { namespace Private {
static UITextView * createTextBox( const String& Text = "", UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
static UITextView * createTextBox( const String& Text = "", UINode * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
UITextView * Ctrl = UITextView::New();
Ctrl->setFontStyle( fontStyle );
Ctrl->resetFlags( Flags )->setParent( Parent )->setPosition( Pos )->setSize( Size )->setVisible( true )->setEnabled( false );

View File

@@ -2,7 +2,7 @@
namespace EE { namespace Maps { namespace Private {
static UITextView * createTextBox( const String& Text = "", UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
static UITextView * createTextBox( const String& Text = "", UINode * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, const Uint32& fontStyle = Text::Regular ) {
UITextView * Ctrl = UITextView::New();
Ctrl->setFontStyle( fontStyle );
Ctrl->resetFlags( Flags )->setParent( Parent )->setPosition( Pos )->setSize( Size )->setVisible( true )->setEnabled( false );

View File

@@ -25,7 +25,7 @@ TextureAtlasSubTextureEditor::TextureAtlasSubTextureEditor( TextureAtlasEditor *
mGfx->setVisible( true );
mGfx->setEnabled( true );
mDrag = UIDragableControl::New();
mDrag = UINode::New();
mDrag->setParent( this );
mDrag->setSize( 64000, 64000 );
mDrag->setEnabled( true );

View File

@@ -30,7 +30,7 @@ class EE_API TextureAtlasSubTextureEditor : public UIWidget {
protected:
UITheme * mTheme;
UISubTexture * mGfx;
UIDragableControl * mDrag;
UINode * mDrag;
Vector2i mUICenter;
TextureAtlasEditor * mEditor;

View File

@@ -1,16 +1,16 @@
#include <eepp/ui/uibackground.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/graphics/primitives.hpp>
using namespace EE::Graphics;
namespace EE { namespace UI {
UIBackground * UIBackground::New( UIControl * control ) {
UIBackground * UIBackground::New( UINode * control ) {
return eeNew( UIBackground, ( control ) );
}
UIBackground::UIBackground( UIControl * control ) :
UIBackground::UIBackground( UINode * control ) :
mControl( control ),
mBlendMode( BlendAlpha ),
mCorners(0),

View File

@@ -1,16 +1,16 @@
#include <eepp/ui/uiborder.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/graphics/primitives.hpp>
using namespace EE::Graphics;
namespace EE { namespace UI {
UIBorder * UIBorder::New( UIControl * control ) {
UIBorder * UIBorder::New( UINode * control ) {
return eeNew( UIBorder, ( control ) );
}
UIBorder::UIBorder( UIControl * control ) :
UIBorder::UIBorder( UINode * control ) :
mControl( control ),
mColor( Color::Black ),
mWidth( 1 )

View File

@@ -15,14 +15,14 @@ UICheckBox::UICheckBox() :
mActive( false ),
mTextSeparation( 4 )
{
mActiveButton = UIControlAnim::New();
mActiveButton = UINode::New();
mActiveButton->setVisible( false );
mActiveButton->setEnabled( true );
mActiveButton->setParent( this );
mActiveButton->setPosition( 0, 0 );
mActiveButton->setSize( 16, 16 );
mInactiveButton = UIControlAnim::New();
mInactiveButton = UINode::New();
mInactiveButton->setVisible( true );
mInactiveButton->setEnabled( true );
mInactiveButton->setParent( this );
@@ -150,11 +150,11 @@ void UICheckBox::onPaddingChange() {
mRealPadding.Left = mActiveButton->getRealPosition().x + mActiveButton->getRealSize().getWidth() + PixelDensity::dpToPxI( mTextSeparation );
}
UIControlAnim * UICheckBox::getActiveButton() const {
UINode * UICheckBox::getActiveButton() const {
return mActiveButton;
}
UIControlAnim * UICheckBox::getInactiveButton() const {
UINode * UICheckBox::getInactiveButton() const {
return mInactiveButton;
}

View File

@@ -39,7 +39,7 @@ void UIComboBox::setTheme( UITheme * Theme ) {
}
if ( NULL == mButton ) {
mButton = UIControlAnim::New();
mButton = UINode::New();
mButton->setParent( this );
mButton->setVisible( true );
mButton->setEnabled( true );

View File

@@ -1,480 +0,0 @@
#include <eepp/ui/uicontrolanim.hpp>
#include <eepp/ui/uimanager.hpp>
#include <eepp/graphics/renderer/renderer.hpp>
#include <eepp/graphics/globalbatchrenderer.hpp>
#include <eepp/graphics/primitives.hpp>
namespace EE { namespace UI {
UIControlAnim * UIControlAnim::New() {
return eeNew( UIControlAnim, () );
}
UIControlAnim::UIControlAnim() :
UIDragableControl(),
mAngle(0.f),
mScale(1.f,1.f),
mAlpha(255.f),
mAngleAnim(NULL),
mScaleAnim(NULL),
mAlphaAnim(NULL),
mMoveAnim(NULL)
{
mControlFlags |= UI_CTRL_FLAG_ANIM;
updateOriginPoint();
}
UIControlAnim::~UIControlAnim() {
eeSAFE_DELETE( mAlphaAnim );
eeSAFE_DELETE( mAngleAnim );
eeSAFE_DELETE( mScaleAnim );
eeSAFE_DELETE( mMoveAnim );
}
Uint32 UIControlAnim::getType() const {
return UI_TYPE_CONTROL_ANIM;
}
bool UIControlAnim::isType( const Uint32& type ) const {
return UIControlAnim::getType() == type ? true : UIControl::isType( type );
}
void UIControlAnim::drawSkin() {
if ( NULL != mSkinState ) {
if ( mFlags & UI_SKIN_KEEP_SIZE_ON_DRAW ) {
Sizei rSize = PixelDensity::dpToPxI( mSkinState->getSkin()->getSize( mSkinState->getState() ) );
Sizei diff = ( mRealSize - rSize ) / 2;
mSkinState->draw( mScreenPosf.x + diff.x, mScreenPosf.y + diff.y, (Float)rSize.getWidth(), (Float)rSize.getHeight(), (Uint32)mAlpha );
} else {
mSkinState->draw( mScreenPosf.x, mScreenPosf.y, (Float)mRealSize.getWidth(), (Float)mRealSize.getHeight(), (Uint32)mAlpha );
}
}
}
void UIControlAnim::draw() {
if ( mVisible && 0.f != mAlpha ) {
drawBackground();
drawBorder();
drawSkin();
drawHighlightFocus();
drawOverControl();
drawDebugData();
drawBox();
}
}
const Float& UIControlAnim::getRotation() const {
return mAngle;
}
const OriginPoint& UIControlAnim::getRotationOriginPoint() const {
return mRotationOriginPoint;
}
void UIControlAnim::setRotationOriginPoint( const OriginPoint & center ) {
mRotationOriginPoint = PixelDensity::dpToPx( center );
updateOriginPoint();
}
Vector2f UIControlAnim::getRotationCenter() {
switch ( mRotationOriginPoint.OriginType ) {
case OriginPoint::OriginCenter: return mCenter;
case OriginPoint::OriginTopLeft: return mScreenPosf;
case OriginPoint::OriginCustom: default: return mScreenPosf + mRotationOriginPoint;
}
}
void UIControlAnim::setRotation( const Float& angle ) {
mAngle = angle;
if ( mAngle != 0.f ) {
mControlFlags |= UI_CTRL_FLAG_ROTATED;
} else {
if ( mControlFlags & UI_CTRL_FLAG_ROTATED )
mControlFlags &= ~UI_CTRL_FLAG_ROTATED;
}
onAngleChange();
}
void UIControlAnim::setRotation( const Float& angle , const OriginPoint & center ) {
mRotationOriginPoint = center;
updateOriginPoint();
this->setRotation( angle );
}
const Vector2f& UIControlAnim::getScale() const {
return mScale;
}
void UIControlAnim::setScale( const Vector2f & scale ) {
mScale = scale;
if ( mScale != 1.f ) {
mControlFlags |= UI_CTRL_FLAG_SCALED;
} else {
if ( mControlFlags & UI_CTRL_FLAG_SCALED )
mControlFlags &= ~UI_CTRL_FLAG_SCALED;
}
onScaleChange();
}
const OriginPoint& UIControlAnim::getScaleOriginPoint() const {
return mScaleOriginPoint;
}
void UIControlAnim::setScaleOriginPoint( const OriginPoint & center ) {
mScaleOriginPoint = PixelDensity::dpToPx( center );
updateOriginPoint();
}
Vector2f UIControlAnim::getScaleCenter() {
switch ( mScaleOriginPoint.OriginType ) {
case OriginPoint::OriginCenter: return mCenter;
case OriginPoint::OriginTopLeft: return mScreenPosf;
case OriginPoint::OriginCustom: default: return mScreenPosf + mScaleOriginPoint;
}
}
void UIControlAnim::setScale( const Vector2f& scale, const OriginPoint& center ) {
mScaleOriginPoint = center;
updateOriginPoint();
this->setScale( scale );
}
void UIControlAnim::setScale( const Float& scale, const OriginPoint& center ) {
this->setScale( Vector2f( scale, scale ), center );
}
const Float& UIControlAnim::getAlpha() const {
return mAlpha;
}
void UIControlAnim::setAlpha( const Float& alpha ) {
mAlpha = alpha;
onAlphaChange();
}
void UIControlAnim::setChildsAlpha( const Float &alpha ) {
UIControlAnim * AnimChild;
UIControl * CurChild = mChild;
while ( NULL != CurChild ) {
if ( CurChild->isAnimated() ) {
AnimChild = reinterpret_cast<UIControlAnim*> ( CurChild );
AnimChild->setAlpha( alpha );
AnimChild->setChildsAlpha( alpha );
}
CurChild = CurChild->getNextControl();
}
}
void UIControlAnim::matrixSet() {
if ( mScale != 1.f || mAngle != 0.f ) {
GlobalBatchRenderer::instance()->draw();
GLi->pushMatrix();
Vector2f scaleCenter = 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 = 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 );
}
}
void UIControlAnim::matrixUnset() {
if ( mScale != 1.f || mAngle != 0.f ) {
GlobalBatchRenderer::instance()->draw();
GLi->popMatrix();
}
}
void UIControlAnim::update() {
UIDragableControl::update();
if ( NULL != mMoveAnim && mMoveAnim->isEnabled() ) {
mMoveAnim->update( getElapsed() );
setPosition( (int)mMoveAnim->getPosition().x, (int)mMoveAnim->getPosition().y );
if ( mMoveAnim->ended() )
eeSAFE_DELETE( mMoveAnim );
}
if ( NULL != mAlphaAnim && mAlphaAnim->isEnabled() ) {
mAlphaAnim->update( getElapsed() );
setAlpha( mAlphaAnim->getPosition() );
if ( mAlphaAnim->ended() ) {
if ( ( mControlFlags & UI_CTRL_FLAG_CLOSE_FO ) )
close();
if ( ( mControlFlags & UI_CTRL_FLAG_DISABLE_FADE_OUT ) ) {
mControlFlags &= ~UI_CTRL_FLAG_DISABLE_FADE_OUT;
setVisible( false );
}
eeSAFE_DELETE( mAlphaAnim );
}
}
if ( NULL != mScaleAnim && mScaleAnim->isEnabled() ) {
mScaleAnim->update( getElapsed() );
setScale( mScaleAnim->getPosition() );
if ( mScaleAnim->ended() )
eeSAFE_DELETE( mScaleAnim );
}
if ( NULL != mAngleAnim && mAngleAnim->isEnabled() ) {
mAngleAnim->update( getElapsed() );
setRotation( mAngleAnim->getPosition() );
if ( mAngleAnim->ended() )
eeSAFE_DELETE( mAngleAnim );
}
}
bool UIControlAnim::isFadingOut() {
return 0 != ( mControlFlags & UI_CTRL_FLAG_DISABLE_FADE_OUT );
}
bool UIControlAnim::isAnimating() {
return ( NULL != mAlphaAnim && mAlphaAnim->isEnabled() ) || ( NULL != mAngleAnim && mAngleAnim->isEnabled() ) || ( NULL != mScaleAnim && mScaleAnim->isEnabled() ) || ( NULL != mMoveAnim && mMoveAnim->isEnabled() );
}
Interpolation1d * UIControlAnim::startAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, Interpolation1d::OnPathEndCallback PathEndCallback ) {
if ( NULL == mAlphaAnim )
mAlphaAnim = eeNew( Interpolation1d, () );
mAlphaAnim->clear().add( From, TotalTime ).add( To ).setType( Type ).start( PathEndCallback );
setAlpha( From );
if ( AlphaChilds ) {
UIControlAnim * AnimChild;
UIControl * CurChild = mChild;
while ( NULL != CurChild ) {
if ( CurChild->isAnimated() ) {
AnimChild = reinterpret_cast<UIControlAnim*> ( CurChild );
AnimChild->startAlphaAnim( From, To, TotalTime, AlphaChilds );
}
CurChild = CurChild->getNextControl();
}
}
return mAlphaAnim;
}
Interpolation2d * UIControlAnim::startScaleAnim( const Vector2f& From, const Vector2f& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation2d::OnPathEndCallback PathEndCallback ) {
if ( NULL == mScaleAnim )
mScaleAnim = eeNew( Interpolation2d, () );
mScaleAnim->clear().add( From ).add( To ).setDuration( TotalTime ).setType( Type ).start( PathEndCallback );
setScale( From );
return mScaleAnim;
}
Interpolation2d * UIControlAnim::startScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation2d::OnPathEndCallback PathEndCallback ) {
return startScaleAnim( Vector2f( From, From ), Vector2f( To, To ), TotalTime, Type, PathEndCallback );
}
Interpolation2d * UIControlAnim::startTranslation( const Vector2i& From, const Vector2i& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation2d::OnPathEndCallback PathEndCallback ) {
if ( NULL == mMoveAnim )
mMoveAnim = eeNew( Interpolation2d, () );
mMoveAnim->clear().add( Vector2f( (Float)From.x, (Float)From.y ) ).add( Vector2f( (Float)To.x, (Float)To.y ) ).setType( Type ).setDuration( TotalTime ).start( PathEndCallback );
setPosition( From );
return mMoveAnim;
}
Interpolation1d * UIControlAnim::startRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, Interpolation1d::OnPathEndCallback PathEndCallback ) {
if ( NULL == mAngleAnim )
mAngleAnim = eeNew( Interpolation1d, () );
mAngleAnim->clear().add( From ).add( To ).setDuration( TotalTime ).setType( Type ).start( PathEndCallback );
setRotation( From );
return mAngleAnim;
}
Interpolation1d * UIControlAnim::startAlphaAnim(const Float & To, const Time & TotalTime, const bool & alphaChilds, const Ease::Interpolation & type, Interpolation1d::OnPathEndCallback PathEndCallback) {
return startAlphaAnim( mAlpha, To, TotalTime, alphaChilds, type, PathEndCallback );
}
Interpolation2d * UIControlAnim::startScaleAnim(const Vector2f & To, const Time & TotalTime, const Ease::Interpolation & type, Interpolation2d::OnPathEndCallback PathEndCallback) {
return startScaleAnim( mScale, To, TotalTime, type, PathEndCallback );
}
Interpolation2d * UIControlAnim::startScaleAnim(const Float & To, const Time & TotalTime, const Ease::Interpolation & type, Interpolation2d::OnPathEndCallback PathEndCallback) {
return startScaleAnim( mScale, Vector2f(To,To), TotalTime, type, PathEndCallback );
}
Interpolation2d * UIControlAnim::startTranslation(const Vector2i & To, const Time & TotalTime, const Ease::Interpolation & type, Interpolation2d::OnPathEndCallback PathEndCallback) {
return startTranslation( mPos, To, TotalTime, type, PathEndCallback );
}
Interpolation1d * UIControlAnim::startRotation(const Float & To, const Time & TotalTime, const Ease::Interpolation & type, Interpolation1d::OnPathEndCallback PathEndCallback) {
return startRotation( mAngle, To, TotalTime, type, PathEndCallback );
}
Interpolation1d * UIControlAnim::createFadeIn( const Time& time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
return startAlphaAnim( mAlpha, 255.f, time, AlphaChilds, Type );
}
Interpolation1d * UIControlAnim::createFadeOut( const Time& time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
return startAlphaAnim( 255.f, mAlpha, time, AlphaChilds, Type );
}
Interpolation1d * UIControlAnim::closeFadeOut( const Time& time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
startAlphaAnim ( mAlpha, 0.f, time, AlphaChilds, Type );
mControlFlags |= UI_CTRL_FLAG_CLOSE_FO;
return mAlphaAnim;
}
Interpolation1d * UIControlAnim::disableFadeOut( const Time& time, const bool& AlphaChilds, const Ease::Interpolation& Type ) {
setEnabled( false );
startAlphaAnim ( mAlpha, 0.f, time, AlphaChilds, Type );
mControlFlags |= UI_CTRL_FLAG_DISABLE_FADE_OUT;
return mAlphaAnim;
}
void UIControlAnim::drawBackground() {
if ( mFlags & UI_FILL_BACKGROUND ) {
mBackground->draw( getRectf(), mAlpha );
}
}
void UIControlAnim::drawBorder() {
if ( mFlags & UI_BORDER ) {
mBorder->draw( getRectf(), mAlpha, mBackground->getCorners(), ( mFlags & UI_CLIP_ENABLE ) != 0 );
}
}
Color UIControlAnim::getColor( const Color& Col ) {
return Color( Col.r, Col.g, Col.b, static_cast<Uint8>( (Float)Col.a * ( mAlpha / 255.f ) ) );
}
void UIControlAnim::updateQuad() {
mPoly = Polygon2f( Rectf( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mRealSize.getWidth(), mScreenPosf.y + mRealSize.getHeight() ) );
mPoly.rotate( mAngle, getRotationCenter() );
mPoly.scale( mScale, getScaleCenter() );
UIControl * tParent = getParent();
while ( tParent ) {
if ( tParent->isAnimated() ) {
UIControlAnim * tP = reinterpret_cast<UIControlAnim *> ( tParent );
mPoly.rotate( tP->getRotation(), tP->getRotationCenter() );
mPoly.scale( tP->getScale(), tP->getScaleCenter() );
}
tParent = tParent->getParent();
};
}
void UIControlAnim::onSizeChange() {
UIDragableControl::onSizeChange();
updateOriginPoint();
}
void UIControlAnim::updateOriginPoint() {
switch ( mRotationOriginPoint.OriginType ) {
case OriginPoint::OriginCenter:
mRotationOriginPoint.x = mRealSize.x * 0.5f;
mRotationOriginPoint.y = mRealSize.y * 0.5f;
break;
case OriginPoint::OriginTopLeft:
mRotationOriginPoint.x = mRotationOriginPoint.y = 0;
break;
default: {}
}
switch ( mScaleOriginPoint.OriginType ) {
case OriginPoint::OriginCenter:
mScaleOriginPoint.x = mRealSize.x * 0.5f;
mScaleOriginPoint.y = mRealSize.y * 0.5f;
break;
case OriginPoint::OriginTopLeft:
mScaleOriginPoint.x = mScaleOriginPoint.y = 0;
break;
default: {}
}
}
Interpolation1d * UIControlAnim::getRotationInterpolation() {
if ( NULL == mAngleAnim )
mAngleAnim = eeNew( Interpolation1d, () );
return mAngleAnim;
}
Interpolation2d * UIControlAnim::getScaleInterpolation() {
if ( NULL == mScaleAnim )
mScaleAnim = eeNew( Interpolation2d, () );
return mScaleAnim;
}
Interpolation1d * UIControlAnim::getAlphaInterpolation() {
if ( NULL == mAlphaAnim )
mAlphaAnim = eeNew( Interpolation1d, () );
return mAlphaAnim;
}
Interpolation2d * UIControlAnim::getTranslationInterpolation() {
if ( NULL == mMoveAnim )
mMoveAnim = eeNew( Interpolation2d, () );
return mMoveAnim;
}
void UIControlAnim::onAngleChange() {
sendCommonEvent( UIEvent::OnAngleChange );
invalidateDraw();
}
void UIControlAnim::onScaleChange() {
sendCommonEvent( UIEvent::OnScaleChange );
invalidateDraw();
}
void UIControlAnim::onAlphaChange() {
sendCommonEvent( UIEvent::OnAlphaChange );
invalidateDraw();
}
}}

View File

@@ -1,140 +0,0 @@
#include <eepp/ui/uidragablecontrol.hpp>
#include <eepp/ui/uimanager.hpp>
#include <eepp/window/input.hpp>
namespace EE { namespace UI {
UIDragableControl * UIDragableControl::New() {
return eeNew( UIDragableControl, () );
}
UIDragableControl::UIDragableControl() :
UIControl(),
mDragButton( EE_BUTTON_LMASK )
{
mControlFlags |= UI_CTRL_FLAG_DRAGABLE;
}
UIDragableControl::~UIDragableControl() {
}
Uint32 UIDragableControl::getType() const {
return UI_TYPE_CONTROL_DRAGABLE;
}
bool UIDragableControl::isType( const Uint32& type ) const {
return UIDragableControl::getType() == type ? true : UIControl::isType( type );
}
Uint32 UIDragableControl::onMouseDown( const Vector2i& Pos, const Uint32 Flags ) {
if ( !( UIManager::instance()->getLastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && isDragEnabled() && !isDragging() ) {
setDragging( true );
mDragPoint = Pos;
}
UIControl::onMouseDown( Pos, Flags );
return 1;
}
Uint32 UIDragableControl::onMouseUp( const Vector2i& Pos, const Uint32 Flags ) {
if ( isDragEnabled() && isDragging() && ( Flags & mDragButton ) ) {
setDragging( false );
}
UIControl::onMouseUp( Pos, Flags );
return 1;
}
const Vector2i& UIDragableControl::getDragPoint() const {
return mDragPoint;
}
void UIDragableControl::setDragPoint( const Vector2i& Point ) {
mDragPoint = Point;
}
void UIDragableControl::update() {
UIControl::update();
if ( !isDragEnabled() )
return;
if ( isDragging() ) {
if ( !( UIManager::instance()->getPressTrigger() & mDragButton ) ) {
setDragging( false );
UIManager::instance()->setControlDragging( false );
return;
}
Vector2i Pos( UIManager::instance()->getMousePos() );
if ( mDragPoint != Pos && ( abs( mDragPoint.x - Pos.x ) > PixelDensity::getPixelDensity() || abs( mDragPoint.y - Pos.y ) > PixelDensity::getPixelDensity() ) ) {
if ( onDrag( Pos ) ) {
Sizei dragDiff;
dragDiff.x = (Int32)( (Float)( mDragPoint.x - Pos.x ) / PixelDensity::getPixelDensity() );
dragDiff.y = (Int32)( (Float)( mDragPoint.y - Pos.y ) / PixelDensity::getPixelDensity() );
setInternalPosition( mPos - dragDiff );
mDragPoint = Pos;
onPositionChange();
UIManager::instance()->setControlDragging( true );
}
}
}
}
Uint32 UIDragableControl::onDrag( const Vector2i& Pos ) {
return 1;
}
Uint32 UIDragableControl::onDragStart( const Vector2i& Pos ) {
sendCommonEvent( UIEvent::OnDragStart );
return 1;
}
Uint32 UIDragableControl::onDragStop( const Vector2i& Pos ) {
sendCommonEvent( UIEvent::OnDragStop );
return 1;
}
bool UIDragableControl::isDragEnabled() const {
return 0 != ( mFlags & UI_DRAG_ENABLE );
}
void UIDragableControl::setDragEnabled( const bool& enable ) {
writeFlag( UI_DRAG_ENABLE, true == enable );
}
bool UIDragableControl::isDragging() const {
return 0 != ( mControlFlags & UI_CTRL_FLAG_DRAGGING );
}
void UIDragableControl::setDragging( const bool& dragging ) {
writeCtrlFlag( UI_CTRL_FLAG_DRAGGING, dragging );
if ( dragging ) {
UIMessage tMsg( this, UIMessage::DragStart, 0 );
messagePost( &tMsg );
onDragStart( UIManager::instance()->getMousePos() );
} else {
UIMessage tMsg( this, UIMessage::DragStop, 0 );
messagePost( &tMsg );
onDragStop( UIManager::instance()->getMousePos() );
}
}
void UIDragableControl::setDragButton( const Uint32& Button ) {
mDragButton = Button;
}
const Uint32& UIDragableControl::getDragButton() const {
return mDragButton;
}
}}

View File

@@ -77,7 +77,7 @@ void UIDropDownList::onThemeLoaded() {
autoSizeControl();
}
void UIDropDownList::setFriendControl( UIControl * friendCtrl ) {
void UIDropDownList::setFriendControl( UINode * friendCtrl ) {
mFriendCtrl = friendCtrl;
}
@@ -116,8 +116,8 @@ void UIDropDownList::showList() {
} else if ( NULL != mFriendCtrl ) {
Pos = Vector2i( mFriendCtrl->getPosition().x, mFriendCtrl->getPosition().y + mFriendCtrl->getSize().getHeight() );
} else {
UIControl * ParentLoop = getParent();
UIControl * rp = getWindowContainer();
UINode * ParentLoop = getParent();
UINode * rp = getWindowContainer();
while ( rp != ParentLoop ) {
Pos += ParentLoop->getPosition();
ParentLoop = ParentLoop->getParent();
@@ -151,8 +151,8 @@ void UIDropDownList::showList() {
} else if ( NULL != mFriendCtrl ) {
Pos = Vector2i( mFriendCtrl->getPosition().x, mFriendCtrl->getPosition().y + mFriendCtrl->getSize().getHeight() );
} else {
UIControl * ParentLoop = getParent();
UIControl * rp = getWindowContainer();
UINode * ParentLoop = getParent();
UINode * rp = getWindowContainer();
while ( rp != ParentLoop ) {
Pos += ParentLoop->getPosition();
ParentLoop = ParentLoop->getParent();

View File

@@ -1,9 +1,9 @@
#include <eepp/ui/uievent.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace UI {
UIEvent::UIEvent(UIControl * control, const Uint32& eventType ) :
UIEvent::UIEvent(UINode * control, const Uint32& eventType ) :
mCtrl( control ),
mEventType( eventType )
{
@@ -13,7 +13,7 @@ UIEvent::~UIEvent()
{
}
UIControl * UIEvent::getControl() const {
UINode * UIEvent::getControl() const {
return mCtrl;
}

View File

@@ -1,9 +1,9 @@
#include <eepp/ui/uieventkey.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace UI {
UIEventKey::UIEventKey( UIControl * Ctrl, const Uint32& EventNum, const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod ) :
UIEventKey::UIEventKey( UINode * Ctrl, const Uint32& EventNum, const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod ) :
UIEvent( Ctrl, EventNum ),
mKeyCode( KeyCode ),
mChar( Char ),

View File

@@ -1,9 +1,9 @@
#include <eepp/ui/uieventmouse.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace UI {
UIEventMouse::UIEventMouse( UIControl * Ctrl, const Uint32& EventNum, const Vector2i& Pos, const Uint32& Flags ) :
UIEventMouse::UIEventMouse( UINode * Ctrl, const Uint32& EventNum, const Vector2i& Pos, const Uint32& Flags ) :
UIEvent( Ctrl, EventNum ),
mPos( Pos ),
mFlags( Flags )

View File

@@ -143,7 +143,7 @@ void UIGridLayout::pack() {
setInternalHeight( getParent()->getSize().getHeight() - mLayoutMargin.Top - mLayoutMargin.Bottom );
}
UIControl * ChildLoop = mChild;
UINode * ChildLoop = mChild;
Vector2i pos(mPadding.Left,mPadding.Top);
Sizei targetSize( getTargetElementSize() );

View File

@@ -92,7 +92,7 @@ void UIImage::calcDestSize() {
}
void UIImage::draw() {
UIControlAnim::draw();
UINode::draw();
if ( mVisible ) {
if ( NULL != mDrawable && 0.f != mAlpha ) {
@@ -106,7 +106,7 @@ void UIImage::draw() {
}
void UIImage::setAlpha( const Float& alpha ) {
UIControlAnim::setAlpha( alpha );
UINode::setAlpha( alpha );
mColor.a = (Uint8)alpha;
}

View File

@@ -77,7 +77,7 @@ void UILinearLayout::packVertical() {
setInternalHeight( getParent()->getSize().getHeight() - mLayoutMargin.Top - mLayoutMargin.Bottom );
}
UIControl * ChildLoop = mChild;
UINode * ChildLoop = mChild;
while ( NULL != ChildLoop ) {
if ( ChildLoop->isWidget() && ChildLoop->isVisible() ) {
@@ -191,7 +191,7 @@ void UILinearLayout::packHorizontal() {
setInternalHeight( getParent()->getSize().getHeight() - mLayoutMargin.Top - mLayoutMargin.Bottom );
}
UIControl * ChildLoop = mChild;
UINode * ChildLoop = mChild;
while ( NULL != ChildLoop ) {
if ( ChildLoop->isWidget() ) {
@@ -297,7 +297,7 @@ void UILinearLayout::packHorizontal() {
}
Sizei UILinearLayout::getTotalUsedSize() {
UIControl * ChildLoop = mChild;
UINode * ChildLoop = mChild;
Sizei size( 0, 0 );
while ( NULL != ChildLoop ) {

View File

@@ -858,7 +858,7 @@ void UIListBox::selectNext() {
}
Uint32 UIListBox::onKeyDown( const UIEventKey &Event ) {
UIControlAnim::onKeyDown( Event );
UINode::onKeyDown( Event );
if ( !mSelected.size() || mFlags & UI_MULTI_SELECT )
return 0;
@@ -904,7 +904,7 @@ Uint32 UIListBox::onMessage( const UIMessage * Msg ) {
switch ( Msg->getMsg() ) {
case UIMessage::FocusLoss:
{
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
UINode * FocusCtrl = UIManager::instance()->getFocusControl();
if ( this != FocusCtrl && !isParentOf( FocusCtrl ) ) {
onWidgetFocusLoss();

View File

@@ -96,7 +96,7 @@ void UIListBoxItem::update() {
}
Uint32 UIListBoxItem::onMouseExit( const Vector2i& Pos, const Uint32 Flags ) {
UIControl::onMouseExit( Pos, Flags );
UINode::onMouseExit( Pos, Flags );
if ( mControlFlags & UI_CTRL_FLAG_SELECTED )
setSkinState( UISkinState::StateSelected );

View File

@@ -146,7 +146,7 @@ void UIManager::resizeControl( EE::Window::Window * win ) {
void UIManager::sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod ) {
UIEventKey KeyEvent = UIEventKey( mFocusControl, UIEvent::KeyUp, KeyCode, Char, Mod );
UIControl * CtrlLoop = mFocusControl;
UINode * CtrlLoop = mFocusControl;
while( NULL != CtrlLoop ) {
if ( CtrlLoop->isEnabled() && CtrlLoop->onKeyUp( KeyEvent ) )
@@ -158,7 +158,7 @@ void UIManager::sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint
void UIManager::sendKeyDown( const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod ) {
UIEventKey KeyEvent = UIEventKey( mFocusControl, UIEvent::KeyDown, KeyCode, Char, Mod );
UIControl * CtrlLoop = mFocusControl;
UINode * CtrlLoop = mFocusControl;
while( NULL != CtrlLoop ) {
if ( CtrlLoop->isEnabled() && CtrlLoop->onKeyDown( KeyEvent ) )
@@ -168,15 +168,15 @@ void UIManager::sendKeyDown( const Uint32& KeyCode, const Uint16& Char, const Ui
}
}
UIControl * UIManager::getFocusControl() const {
UINode * UIManager::getFocusControl() const {
return mFocusControl;
}
UIControl * UIManager::getLossFocusControl() const {
UINode * UIManager::getLossFocusControl() const {
return mLossFocusControl;
}
void UIManager::setFocusControl( UIControl * Ctrl ) {
void UIManager::setFocusControl( UINode * Ctrl ) {
if ( NULL != mFocusControl && NULL != Ctrl && Ctrl != mFocusControl ) {
mLossFocusControl = mFocusControl;
@@ -190,15 +190,15 @@ void UIManager::setFocusControl( UIControl * Ctrl ) {
}
}
UIControl * UIManager::getOverControl() const {
UINode * UIManager::getOverControl() const {
return mOverControl;
}
void UIManager::setOverControl( UIControl * Ctrl ) {
void UIManager::setOverControl( UINode * Ctrl ) {
mOverControl = Ctrl;
}
void UIManager::sendMsg( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flags ) {
void UIManager::sendMsg( UINode * Ctrl, const Uint32& Msg, const Uint32& Flags ) {
UIMessage tMsg( Ctrl, Msg, Flags );
Ctrl->messagePost( &tMsg );
@@ -211,7 +211,7 @@ void UIManager::update() {
mControl->update();
UIControl * pOver = mControl->overFind( mKM->getMousePosf() );
UINode * pOver = mControl->overFind( mKM->getMousePosf() );
if ( pOver != mOverControl ) {
if ( NULL != mOverControl ) {
@@ -271,7 +271,7 @@ void UIManager::update() {
checkClose();
}
UIControl * UIManager::getDownControl() const {
UINode * UIManager::getDownControl() const {
return mDownControl;
}
@@ -305,7 +305,7 @@ const Uint32& UIManager::getLastPressTrigger() const {
return mKM->getLastPressTrigger();
}
void UIManager::clipSmartEnable(UIControl * ctrl, const Int32 & x, const Int32 & y, const Uint32 & Width, const Uint32 & Height) {
void UIManager::clipSmartEnable(UINode * ctrl, const Int32 & x, const Int32 & y, const Uint32 & Width, const Uint32 & Height) {
if ( ctrl->isMeOrParentTreeScaledOrRotatedOrFrameBuffer() ) {
GLi->getClippingMask()->clipPlaneEnable( x, y, Width, Height );
} else {
@@ -313,7 +313,7 @@ void UIManager::clipSmartEnable(UIControl * ctrl, const Int32 & x, const Int32 &
}
}
void UIManager::clipSmartDisable(UIControl * ctrl) {
void UIManager::clipSmartDisable(UINode * ctrl) {
if ( ctrl->isMeOrParentTreeScaledOrRotatedOrFrameBuffer() ) {
GLi->getClippingMask()->clipPlaneDisable();
} else {
@@ -413,24 +413,24 @@ void UIManager::checkTabPress( const Uint32& KeyCode ) {
eeASSERT( NULL != mFocusControl );
if ( KeyCode == KEY_TAB ) {
UIControl * Ctrl = mFocusControl->getNextWidget();
UINode * Ctrl = mFocusControl->getNextWidget();
if ( NULL != Ctrl )
Ctrl->setFocus();
}
}
void UIManager::sendMouseClick( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
void UIManager::sendMouseClick( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
sendMsg( ToCtrl, UIMessage::Click, Flags );
ToCtrl->onMouseClick( Pos, Flags );
}
void UIManager::sendMouseUp( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
void UIManager::sendMouseUp( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
sendMsg( ToCtrl, UIMessage::MouseUp, Flags );
ToCtrl->onMouseUp( Pos, Flags );
}
void UIManager::sendMouseDown( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
void UIManager::sendMouseDown( UINode * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
sendMsg( ToCtrl, UIMessage::MouseDown, Flags );
ToCtrl->onMouseDown( Pos, Flags );
}
@@ -473,11 +473,11 @@ const Vector2i &UIManager::getMouseDownPos() const {
return mMouseDownPos;
}
void UIManager::addToCloseQueue( UIControl * Ctrl ) {
void UIManager::addToCloseQueue( UINode * Ctrl ) {
eeASSERT( NULL != Ctrl );
std::list<UIControl*>::iterator it;
UIControl * itCtrl = NULL;
std::list<UINode*>::iterator it;
UINode * itCtrl = NULL;
for ( it = mCloseList.begin(); it != mCloseList.end(); it++ ) {
itCtrl = *it;
@@ -490,7 +490,7 @@ void UIManager::addToCloseQueue( UIControl * Ctrl ) {
}
}
std::list< std::list<UIControl*>::iterator > itEraseList;
std::list< std::list<UINode*>::iterator > itEraseList;
for ( it = mCloseList.begin(); it != mCloseList.end(); it++ ) {
itCtrl = *it;
@@ -507,7 +507,7 @@ void UIManager::addToCloseQueue( UIControl * Ctrl ) {
// We delete all the controls that don't need to be deleted
// because of the new added control to the queue
std::list< std::list<UIControl*>::iterator >::iterator ite;
std::list< std::list<UINode*>::iterator >::iterator ite;
for ( ite = itEraseList.begin(); ite != itEraseList.end(); ite++ ) {
mCloseList.erase( *ite );
@@ -518,7 +518,7 @@ void UIManager::addToCloseQueue( UIControl * Ctrl ) {
void UIManager::checkClose() {
if ( !mCloseList.empty() ) {
for ( std::list<UIControl*>::iterator it = mCloseList.begin(); it != mCloseList.end(); it++ ) {
for ( std::list<UINode*>::iterator it = mCloseList.begin(); it != mCloseList.end(); it++ ) {
eeDelete( *it );
}
@@ -571,7 +571,7 @@ void UIManager::setHighlightInvalidationColor(const Color & highlightInvalidatio
mHighlightInvalidationColor = highlightInvalidationColor;
}
UIWidget * UIManager::loadLayoutNodes( pugi::xml_node node, UIControl * parent ) {
UIWidget * UIManager::loadLayoutNodes( pugi::xml_node node, UINode * parent ) {
UIWidget * firstWidget = NULL;
if ( NULL == parent )
@@ -599,7 +599,7 @@ UIWidget * UIManager::loadLayoutNodes( pugi::xml_node node, UIControl * parent )
return firstWidget;
}
UIWidget * UIManager::loadLayoutFromFile( const std::string& layoutPath, UIControl * parent ) {
UIWidget * UIManager::loadLayoutFromFile( const std::string& layoutPath, UINode * parent ) {
if ( FileSystem::fileExists( layoutPath ) ) {
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file( layoutPath.c_str() );
@@ -623,7 +623,7 @@ UIWidget * UIManager::loadLayoutFromFile( const std::string& layoutPath, UIContr
return NULL;
}
UIWidget * UIManager::loadLayoutFromString( const std::string& layoutString, UIControl * parent ) {
UIWidget * UIManager::loadLayoutFromString( const std::string& layoutString, UINode * parent ) {
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_string( layoutString.c_str() );
@@ -638,7 +638,7 @@ UIWidget * UIManager::loadLayoutFromString( const std::string& layoutString, UIC
return NULL;
}
UIWidget * UIManager::loadLayoutFromMemory( const void * buffer, Int32 bufferSize, UIControl * parent ) {
UIWidget * UIManager::loadLayoutFromMemory( const void * buffer, Int32 bufferSize, UINode * parent ) {
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_buffer( buffer, bufferSize);
@@ -653,7 +653,7 @@ UIWidget * UIManager::loadLayoutFromMemory( const void * buffer, Int32 bufferSiz
return NULL;
}
UIWidget * UIManager::loadLayoutFromStream( IOStream& stream, UIControl * parent ) {
UIWidget * UIManager::loadLayoutFromStream( IOStream& stream, UINode * parent ) {
if ( !stream.isOpen() )
return NULL;
@@ -675,7 +675,7 @@ UIWidget * UIManager::loadLayoutFromStream( IOStream& stream, UIControl * parent
return NULL;
}
UIWidget * UIManager::loadLayoutFromPack( Pack * pack, const std::string& FilePackPath, UIControl * parent ) {
UIWidget * UIManager::loadLayoutFromPack( Pack * pack, const std::string& FilePackPath, UINode * parent ) {
SafeDataPointer PData;
if ( pack->isOpen() && pack->extractFileToMemory( FilePackPath, PData ) ) {

View File

@@ -121,7 +121,7 @@ Uint32 UIMenu::addSubMenu( const String& Text, Drawable * Icon, UIMenu * SubMenu
return add( createSubMenu( Text, Icon, SubMenu ) );
}
bool UIMenu::checkControlSize( UIControl * Control, const bool& Resize ) {
bool UIMenu::checkControlSize( UINode * Control, const bool& Resize ) {
if ( Control->isType( UI_TYPE_MENUITEM ) ) {
UIMenuItem * tItem = reinterpret_cast<UIMenuItem*> ( Control );
@@ -161,7 +161,7 @@ bool UIMenu::checkControlSize( UIControl * Control, const bool& Resize ) {
return false;
}
Uint32 UIMenu::add( UIControl * Control ) {
Uint32 UIMenu::add( UINode * Control ) {
if ( this != Control->getParent() )
Control->setParent( this );
@@ -180,7 +180,7 @@ Uint32 UIMenu::add( UIControl * Control ) {
return mItems.size() - 1;
}
void UIMenu::setControlSize( UIControl * Control, const Uint32& Pos ) {
void UIMenu::setControlSize( UINode * Control, const Uint32& Pos ) {
Control->setPixelsSize( mRealSize.getWidth(), Control->getRealSize().getHeight() );
}
@@ -199,12 +199,12 @@ Uint32 UIMenu::addSeparator() {
return mItems.size() - 1;
}
UIControl * UIMenu::getItem( const Uint32& Index ) {
UINode * UIMenu::getItem( const Uint32& Index ) {
eeASSERT( Index < mItems.size() );
return mItems[ Index ];
}
UIControl * UIMenu::getItem( const String& Text ) {
UINode * UIMenu::getItem( const String& Text ) {
for ( Uint32 i = 0; i < mItems.size(); i++ ) {
if ( mItems[i]->isType( UI_TYPE_MENUITEM ) ) {
UIMenuItem * tMenuItem = reinterpret_cast<UIMenuItem*>( mItems[i] );
@@ -217,7 +217,7 @@ UIControl * UIMenu::getItem( const String& Text ) {
return NULL;
}
Uint32 UIMenu::getItemIndex( UIControl * Item ) {
Uint32 UIMenu::getItemIndex( UINode * Item ) {
for ( Uint32 i = 0; i < mItems.size(); i++ ) {
if ( mItems[i] == Item )
return i;
@@ -241,7 +241,7 @@ void UIMenu::remove( const Uint32& Index ) {
resizeControls();
}
void UIMenu::remove( UIControl * Ctrl ) {
void UIMenu::remove( UINode * Ctrl ) {
for ( Uint32 i = 0; i < mItems.size(); i++ ) {
if ( mItems[i] == Ctrl ) {
remove( i );
@@ -266,7 +266,7 @@ void UIMenu::insert( const String& Text, Drawable * Icon, const Uint32& Index )
insert( createMenuItem( Text, Icon ), Index );
}
void UIMenu::insert( UIControl * Control, const Uint32& Index ) {
void UIMenu::insert( UINode * Control, const Uint32& Index ) {
mItems.insert( mItems.begin() + Index, Control );
childAddAt( Control, Index );
@@ -275,7 +275,7 @@ void UIMenu::insert( UIControl * Control, const Uint32& Index ) {
resizeControls();
}
bool UIMenu::isSubMenu( UIControl * Ctrl ) {
bool UIMenu::isSubMenu( UINode * Ctrl ) {
for ( Uint32 i = 0; i < mItems.size(); i++ ) {
if ( mItems[i]->isType( UI_TYPE_MENUSUBMENU ) ) {
UIMenuSubMenu * tMenu = reinterpret_cast<UIMenuSubMenu*> ( mItems[i] );
@@ -301,7 +301,7 @@ Uint32 UIMenu::onMessage( const UIMessage * Msg ) {
}
case UIMessage::FocusLoss:
{
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
UINode * FocusCtrl = UIManager::instance()->getFocusControl();
if ( this != FocusCtrl && !isParentOf( FocusCtrl ) && !isSubMenu( FocusCtrl ) ) {
onWidgetFocusLoss();
@@ -350,7 +350,7 @@ void UIMenu::rePosControls() {
}
for ( i = 0; i < mItems.size(); i++ ) {
UIControl * ctrl = mItems[i];
UINode * ctrl = mItems[i];
ctrl->setPixelsPosition( PixelDensity::dpToPxI( mStyleConfig.Padding.Left ), PixelDensity::dpToPxI( mStyleConfig.Padding.Top ) + mNextPosY );
@@ -388,7 +388,7 @@ bool UIMenu::hide() {
return true;
}
void UIMenu::setItemSelected( UIControl * Item ) {
void UIMenu::setItemSelected( UINode * Item ) {
if ( NULL != mItemSelected ) {
if ( mItemSelected->isType( UI_TYPE_MENUSUBMENU ) ) {
UIMenuSubMenu * tMenu = reinterpret_cast<UIMenuSubMenu*> ( mItemSelected );
@@ -409,7 +409,7 @@ void UIMenu::setItemSelected( UIControl * Item ) {
}
}
void UIMenu::trySelect( UIControl * Ctrl, bool Up ) {
void UIMenu::trySelect( UINode * Ctrl, bool Up ) {
if ( mItems.size() ) {
if ( !Ctrl->isType( UI_TYPE_MENU_SEPARATOR ) ) {
setItemSelected( Ctrl );

View File

@@ -21,7 +21,7 @@ Uint32 UIMenuSeparator::getType() const {
}
bool UIMenuSeparator::isType( const Uint32& type ) const {
return UIMenuSeparator::getType() == type ? true : UIControlAnim::isType( type );
return UIMenuSeparator::getType() == type ? true : UINode::isType( type );
}
void UIMenuSeparator::setTheme( UITheme * Theme ) {

View File

@@ -17,7 +17,7 @@ UIMenuSubMenu::UIMenuSubMenu() :
mCbId( 0 ),
mCbId2( 0 )
{
mArrow = UIControlAnim::New();
mArrow = UINode::New();
mArrow->setParent( this );
mArrow->setFlags( UI_AUTO_SIZE );
mArrow->setVisible( true );
@@ -122,12 +122,12 @@ Uint32 UIMenuSubMenu::onMouseExit( const Vector2i &Pos, const Uint32 Flags ) {
return 1;
}
UIControl * UIMenuSubMenu::getArrow() const {
UINode * UIMenuSubMenu::getArrow() const {
return mArrow;
}
void UIMenuSubMenu::onSubMenuFocusLoss( const UIEvent * Event ) {
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
UINode * FocusCtrl = UIManager::instance()->getFocusControl();
if ( getParent() != FocusCtrl && !getParent()->isParentOf( FocusCtrl ) ) {
getParent()->setFocus();

View File

@@ -1,9 +1,9 @@
#include <eepp/ui/uimessage.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
namespace EE { namespace UI {
UIMessage::UIMessage( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flags ) :
UIMessage::UIMessage( UINode * Ctrl, const Uint32& Msg, const Uint32& Flags ) :
mCtrl( Ctrl ),
mMsg( Msg ),
mFlags( Flags )
@@ -14,7 +14,7 @@ UIMessage::~UIMessage()
{
}
UIControl * UIMessage::getSender() const {
UINode * UIMessage::getSender() const {
return mCtrl;
}

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@ bool UIProgressBar::isType( const Uint32& type ) const {
}
void UIProgressBar::draw() {
UIControlAnim::draw();
UINode::draw();
if ( NULL == mFillerSkin )
return;
@@ -78,7 +78,7 @@ void UIProgressBar::draw() {
}
void UIProgressBar::update() {
UIControlAnim::update();
UINode::update();
if ( NULL == mFillerSkin )
return;
@@ -129,7 +129,7 @@ void UIProgressBar::onThemeLoaded() {
}
Uint32 UIProgressBar::onValueChange() {
UIControlAnim::onValueChange();
UINode::onValueChange();
onSizeChange();
@@ -248,7 +248,7 @@ void UIProgressBar::loadFromXmlNode(const pugi::xml_node & node) {
}
void UIProgressBar::onAlphaChange() {
UIControlAnim::onAlphaChange();
UINode::onAlphaChange();
mTextBox->setAlpha( mAlpha );
}

View File

@@ -17,14 +17,14 @@ UIRadioButton::UIRadioButton() :
mActive( false ),
mTextSeparation( 4 )
{
mActiveButton = UIControlAnim::New();
mActiveButton = UINode::New();
mActiveButton->setVisible( false );
mActiveButton->setEnabled( true );
mActiveButton->setParent( this );
mActiveButton->setPosition( 0, 0 );
mActiveButton->setSize( 16, 16 );
mInactiveButton = UIControlAnim::New();
mInactiveButton = UINode::New();
mInactiveButton->setVisible( true );
mInactiveButton->setEnabled( true );
mInactiveButton->setParent( this );
@@ -137,7 +137,7 @@ void UIRadioButton::setActive( const bool& active ) {
}
if ( active && NULL != mParentCtrl ) {
UIControl * tChild = mParentCtrl->getFirstChild();
UINode * tChild = mParentCtrl->getFirstChild();
while ( NULL != tChild ) {
if ( tChild->isType( UI_TYPE_RADIOBUTTON ) ) {
@@ -156,7 +156,7 @@ void UIRadioButton::setActive( const bool& active ) {
bool UIRadioButton::checkActives() {
if ( NULL != mParentCtrl ) {
UIControl * tChild = mParentCtrl->getFirstChild();
UINode * tChild = mParentCtrl->getFirstChild();
while ( NULL != tChild ) {
if ( tChild->isType( UI_TYPE_RADIOBUTTON ) ) {
@@ -179,7 +179,7 @@ void UIRadioButton::autoActivate() {
eeASSERT( NULL != mParentCtrl );
if ( NULL != mParentCtrl ) {
UIControl * tChild = mParentCtrl->getFirstChild();
UINode * tChild = mParentCtrl->getFirstChild();
while ( NULL != tChild ) {
if ( tChild->isType( UI_TYPE_RADIOBUTTON ) ) {
@@ -210,11 +210,11 @@ void UIRadioButton::onPaddingChange() {
mRealPadding.Left = mActiveButton->getRealPosition().x + mActiveButton->getRealSize().getWidth() + PixelDensity::dpToPxI( mTextSeparation );
}
UIControlAnim * UIRadioButton::getActiveButton() const {
UINode * UIRadioButton::getActiveButton() const {
return mActiveButton;
}
UIControlAnim * UIRadioButton::getInactiveButton() const {
UINode * UIRadioButton::getInactiveButton() const {
return mInactiveButton;
}

View File

@@ -49,7 +49,7 @@ void UIRelativeLayout::fixChilds() {
setInternalHeight( getParent()->getSize().getHeight() - mLayoutMargin.Top - mLayoutMargin.Bottom );
}
UIControl * child = mChild;
UINode * child = mChild;
while ( NULL != child ) {
if ( child->isWidget() ) {

View File

@@ -18,8 +18,8 @@ UIScrollBar::UIScrollBar( const UI_ORIENTATION& orientation ) :
{
mFlags |= UI_AUTO_SIZE;
mBtnDown = UIControlAnim::New();
mBtnUp = UIControlAnim::New();
mBtnDown = UINode::New();
mBtnUp = UINode::New();
mBtnUp->setParent( this );
mBtnUp->setSize( 16, 16 );
mBtnDown->setParent( this );
@@ -53,14 +53,14 @@ void UIScrollBar::setTheme( UITheme * Theme ) {
UIWidget::setTheme( Theme );
if ( !isVertical() ) {
UIControl::setThemeSkin( Theme, "hscrollbar" );
UINode::setThemeSkin( Theme, "hscrollbar" );
mSlider->setThemeSkin( Theme, "hscrollbar_slider" );
mSlider->getBackSlider()->setThemeSkin( Theme, "hscrollbar_bg" );
mSlider->getSliderButton()->setThemeSkin( Theme, "hscrollbar_button" );
mBtnUp->setThemeSkin( Theme, "hscrollbar_btnup" );
mBtnDown->setThemeSkin( Theme, "hscrollbar_btndown" );
} else {
UIControl::setThemeSkin( Theme, "vscrollbar" );
UINode::setThemeSkin( Theme, "vscrollbar" );
mSlider->setThemeSkin( Theme, "vscrollbar_slider" );
mSlider->getBackSlider()->setThemeSkin( Theme, "vscrollbar_bg" );
mSlider->getSliderButton()->setThemeSkin( Theme, "vscrollbar_button" );
@@ -178,7 +178,7 @@ void UIScrollBar::adjustChilds() {
}
void UIScrollBar::update() {
UIControlAnim::update();
UINode::update();
if ( mBtnUp->isMouseOver() || mBtnDown->isMouseOver() ) {
manageClick( UIManager::instance()->getInput()->getClickTrigger() );
@@ -265,11 +265,11 @@ UISlider * UIScrollBar::getSlider() const {
return mSlider;
}
UIControlAnim * UIScrollBar::getButtonUp() const {
UINode * UIScrollBar::getButtonUp() const {
return mBtnUp;
}
UIControlAnim * UIScrollBar::getButtonDown() const {
UINode * UIScrollBar::getButtonDown() const {
return mBtnDown;
}
@@ -309,7 +309,7 @@ UI_ORIENTATION UIScrollBar::getOrientation() const {
return mSlider->getOrientation();
}
UIControl * UIScrollBar::setOrientation( const UI_ORIENTATION & orientation ) {
UINode * UIScrollBar::setOrientation( const UI_ORIENTATION & orientation ) {
mSlider->setOrientation( orientation );
applyDefaultTheme();
@@ -318,7 +318,7 @@ UIControl * UIScrollBar::setOrientation( const UI_ORIENTATION & orientation ) {
}
void UIScrollBar::onAlphaChange() {
UIControlAnim::onAlphaChange();
UINode::onAlphaChange();
mSlider->setAlpha( mAlpha );
mBtnUp->setAlpha( mAlpha );

View File

@@ -15,7 +15,7 @@ UIScrollView::UIScrollView() :
mHScrollMode( UI_SCROLLBAR_AUTO ),
mVScroll( UIScrollBar::New( UI_VERTICAL ) ),
mHScroll( UIScrollBar::New( UI_HORIZONTAL ) ),
mContainer( UIControlAnim::New() ),
mContainer( UINode::New() ),
mScrollView( NULL ),
mSizeChangeCb( 0 )
{
@@ -51,12 +51,12 @@ void UIScrollView::onAlphaChange() {
mHScroll->setAlpha( mAlpha );
mContainer->setAlpha( mAlpha );
if ( NULL != mScrollView && mScrollView->isAnimated() )
reinterpret_cast<UIControlAnim*>( mScrollView )->setAlpha( mAlpha );
if ( NULL != mScrollView )
mScrollView->setAlpha( mAlpha );
}
void UIScrollView::onChildCountChange() {
UIControl * child = mChild;
UINode * child = mChild;
bool found = false;
while ( NULL != child ) {
@@ -125,7 +125,7 @@ UIScrollBar * UIScrollView::getHorizontalScrollBar() const {
return mHScroll;
}
UIControlAnim * UIScrollView::getContainer() const {
UINode * UIScrollView::getContainer() const {
return mContainer;
}

View File

@@ -34,7 +34,7 @@ UISlider::UISlider( const UI_ORIENTATION& orientation ) :
else
bgSize = Sizei( 8, mSize.getHeight() - 16 );
mBackSlider = UIControlAnim::New();
mBackSlider = UINode::New();
mBackSlider->setParent( this );
mBackSlider->setVisible( true );
mBackSlider->setEnabled( true );
@@ -282,7 +282,7 @@ bool UISlider::isVertical() const {
}
void UISlider::update() {
UIControlAnim::update();
UINode::update();
if ( isMouseOver() || mBackSlider->isMouseOver() || mSlider->isMouseOver() ) {
manageClick( UIManager::instance()->getInput()->getClickTrigger() );
@@ -387,16 +387,16 @@ void UISlider::setPageStep(const Float & pageStep) {
setValue( mValue );
}
UIControl * UISlider::getBackSlider() const {
UINode * UISlider::getBackSlider() const {
return mBackSlider;
}
UIDragableControl * UISlider::getSliderButton() const {
UINode * UISlider::getSliderButton() const {
return mSlider;
}
void UISlider::onAlphaChange() {
UIControlAnim::onAlphaChange();
UINode::onAlphaChange();
mBackSlider->setAlpha( mAlpha );
mSlider->setAlpha( mAlpha );

View File

@@ -20,13 +20,13 @@ UISpinBox::UISpinBox() :
mInput->setEnabled( true );
mInput->setParent( this );
mPushUp = UIControlAnim::New();
mPushUp = UINode::New();
mPushUp->setVisible( true );
mPushUp->setEnabled( true );
mPushUp->setParent( this );
mPushUp->setSize( 16, 16 );
mPushDown = UIControlAnim::New();
mPushDown = UINode::New();
mPushDown->setVisible( true );
mPushDown->setEnabled( true );
mPushDown->setParent( this );
@@ -211,7 +211,7 @@ const Float& UISpinBox::getMaxValue() const {
void UISpinBox::update() {
bool Changed = mInput->getInputTextBuffer()->changedSinceLastUpdate();
UIControlAnim::update();
UINode::update();
if ( Changed ) {
if ( !mInput->getText().size() ) {
@@ -234,11 +234,11 @@ void UISpinBox::update() {
}
}
UIControlAnim * UISpinBox::getButtonPushUp() const {
UINode * UISpinBox::getButtonPushUp() const {
return mPushUp;
}
UIControlAnim * UISpinBox::getButtonPushDown() const {
UINode * UISpinBox::getButtonPushDown() const {
return mPushDown;
}
@@ -257,7 +257,7 @@ bool UISpinBox::dotsInNumbersAllowed() {
}
void UISpinBox::onAlphaChange() {
UIControlAnim::onAlphaChange();
UINode::onAlphaChange();
mInput->setAlpha( mAlpha );
mPushUp->setAlpha( mAlpha );

View File

@@ -59,7 +59,7 @@ void UISubTexture::onAutoSize() {
}
void UISubTexture::draw() {
UIControlAnim::draw();
UINode::draw();
if ( mVisible ) {
if ( NULL != mSubTexture && 0.f != mAlpha ) {

View File

@@ -57,7 +57,7 @@ void UITab::setTheme( UITheme * Theme ) {
}
}
UIControl::setThemeSkin( Theme, tabPos );
UINode::setThemeSkin( Theme, tabPos );
onThemeLoaded();
}
@@ -195,18 +195,18 @@ void UITab::loadFromXmlNode(const pugi::xml_node & node) {
}
void UITab::setOwnedControl() {
UIControl * ctrl = getParent()->getParent()->find( mOwnedName );
UINode * ctrl = getParent()->getParent()->find( mOwnedName );
if ( NULL != ctrl ) {
setControlOwned( ctrl );
}
}
UIControl * UITab::getControlOwned() const {
UINode * UITab::getControlOwned() const {
return mControlOwned;
}
void UITab::setControlOwned(UIControl * controlOwned) {
void UITab::setControlOwned(UINode * controlOwned) {
mControlOwned = controlOwned;
UITabWidget * tTabW = getTabWidget();

View File

@@ -483,7 +483,7 @@ void UITable::updateCollumnsPos() {
}
void UITable::onAlphaChange() {
UIControlAnim::onAlphaChange();
UINode::onAlphaChange();
mVScrollBar->setAlpha( mAlpha );
mHScrollBar->setAlpha( mAlpha );
@@ -561,7 +561,7 @@ Uint32 UITable::onMessage( const UIMessage * Msg ) {
switch ( Msg->getMsg() ) {
case UIMessage::FocusLoss:
{
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
UINode * FocusCtrl = UIManager::instance()->getFocusControl();
if ( this != FocusCtrl && !isParentOf( FocusCtrl ) ) {
onWidgetFocusLoss();

View File

@@ -32,7 +32,7 @@ UITable * UITableCell::gridParent() const {
return reinterpret_cast<UITable*> ( mParentCtrl->getParent() );
}
void UITableCell::setCell( const Uint32& CollumnIndex, UIControl * Ctrl ) {
void UITableCell::setCell( const Uint32& CollumnIndex, UINode * Ctrl ) {
eeASSERT( CollumnIndex < gridParent()->getCollumnsCount() );
UITable * P = gridParent();
@@ -52,7 +52,7 @@ void UITableCell::setCell( const Uint32& CollumnIndex, UIControl * Ctrl ) {
Ctrl->setEnabled( true );
}
UIControl * UITableCell::getCell( const Uint32& CollumnIndex ) const {
UINode * UITableCell::getCell( const Uint32& CollumnIndex ) const {
eeASSERT( CollumnIndex < gridParent()->getCollumnsCount() );
return mCells[ CollumnIndex ];
@@ -78,8 +78,8 @@ void UITableCell::update() {
setAlpha( MyParent->getAlpha() );
for ( Uint32 i = 0; i < mCells.size(); i++ ) {
if ( NULL != mCells[i] && mCells[i]->isAnimated() ) {
reinterpret_cast<UIControlAnim*>( mCells[i] )->setAlpha( MyParent->getAlpha() );
if ( NULL != mCells[i] ) {
mCells[i]->setAlpha( MyParent->getAlpha() );
}
}
}
@@ -127,7 +127,7 @@ bool UITableCell::isSelected() const {
}
Uint32 UITableCell::onMouseExit( const Vector2i& Pos, const Uint32 Flags ) {
UIControl::onMouseExit( Pos, Flags );
UINode::onMouseExit( Pos, Flags );
if ( mControlFlags & UI_CTRL_FLAG_SELECTED )
setSkinState( UISkinState::StateSelected );

View File

@@ -503,7 +503,7 @@ void UITabWidget::orderTabs() {
invalidateDraw();
}
UITab * UITabWidget::createTab( const String& Text, UIControl * CtrlOwned, Drawable * Icon ) {
UITab * UITabWidget::createTab( const String& Text, UINode * CtrlOwned, Drawable * Icon ) {
UITab * tCtrl = UITab::New();
tCtrl->setParent( mTabContainer );
tCtrl->setFlags( UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_AUTO_SIZE );
@@ -520,7 +520,7 @@ UITab * UITabWidget::createTab( const String& Text, UIControl * CtrlOwned, Drawa
return tCtrl;
}
UITabWidget * UITabWidget::add( const String& Text, UIControl * CtrlOwned, Drawable * Icon ) {
UITabWidget * UITabWidget::add( const String& Text, UINode * CtrlOwned, Drawable * Icon ) {
return add( createTab( Text, CtrlOwned, Icon ) );
}
@@ -619,7 +619,7 @@ void UITabWidget::removeAll() {
orderTabs();
}
void UITabWidget::insert( const String& Text, UIControl * CtrlOwned, Drawable * Icon, const Uint32& Index ) {
void UITabWidget::insert( const String& Text, UINode * CtrlOwned, Drawable * Icon, const Uint32& Index ) {
insert( createTab( Text, CtrlOwned, Icon ), Index );
}
@@ -711,7 +711,7 @@ void UITabWidget::onSizeChange() {
}
void UITabWidget::onChildCountChange() {
UIControl * child = mChild;
UINode * child = mChild;
bool found = false;
while ( NULL != child ) {

View File

@@ -128,7 +128,7 @@ void UITextInput::draw() {
}
Uint32 UITextInput::onFocus() {
UIControlAnim::onFocus();
UINode::onFocus();
if ( mAllowEditing ) {
mTextBuffer.setActive( true );
@@ -292,7 +292,7 @@ Uint32 UITextInput::onMouseDoubleClick( const Vector2i& Pos, const Uint32 Flags
}
Uint32 UITextInput::onMouseExit( const Vector2i& Pos, const Uint32 Flags ) {
UIControl::onMouseExit( Pos, Flags );
UINode::onMouseExit( Pos, Flags );
UIManager::instance()->setCursor( EE_CURSOR_ARROW );

View File

@@ -25,7 +25,7 @@ UITextInputPassword::~UITextInputPassword() {
void UITextInputPassword::draw() {
if ( mVisible && 0.f != mAlpha ) {
UIControlAnim::draw();
UINode::draw();
drawSelection( mPassCache );

View File

@@ -49,7 +49,7 @@ bool UITextView::isType( const Uint32& type ) const {
void UITextView::draw() {
if ( mVisible && 0.f != mAlpha ) {
UIControlAnim::draw();
UINode::draw();
drawSelection( mTextCache );
@@ -223,7 +223,7 @@ UITextView * UITextView::setSelectionBackColor( const Color& color ) {
void UITextView::setAlpha( const Float& alpha ) {
if ( mAlpha != alpha ) {
UIControlAnim::setAlpha( alpha );
UINode::setAlpha( alpha );
mFontStyleConfig.FontColor.a = (Uint8)alpha;
mFontStyleConfig.ShadowColor.a = (Uint8)alpha;
@@ -298,7 +298,7 @@ Uint32 UITextView::onFocusLoss() {
void UITextView::onSizeChange() {
recalculate();
UIControlAnim::onSizeChange();
UINode::onSizeChange();
}
void UITextView::onTextChanged() {

View File

@@ -1,5 +1,5 @@
#include <eepp/ui/uithememanager.hpp>
#include <eepp/ui/uicontrol.hpp>
#include <eepp/ui/uinode.hpp>
#include <eepp/ui/uimanager.hpp>
namespace EE { namespace UI {
@@ -45,7 +45,7 @@ void UIThemeManager::setTheme( const std::string& Theme ) {
}
void UIThemeManager::setTheme( UITheme * Theme ) {
UIControl * MainCtrl = UIManager::instance()->getMainControl();
UINode * MainCtrl = UIManager::instance()->getMainControl();
if ( NULL != MainCtrl ) {
MainCtrl->setThemeToChilds( Theme );
@@ -74,7 +74,7 @@ UITheme * UIThemeManager::getDefaultTheme() const {
return mThemeDefault;
}
void UIThemeManager::applyDefaultTheme( UIControl * Control ) {
void UIThemeManager::applyDefaultTheme( UINode * Control ) {
if ( mAutoApplyDefaultTheme && NULL != mThemeDefault && NULL != Control )
Control->setTheme( mThemeDefault );
}

View File

@@ -10,7 +10,7 @@ UITooltip *UITooltip::New() {
}
UITooltip::UITooltip() :
UIControlAnim(),
UINode(),
mAlignOffset( 0.f, 0.f ),
mTooltipTime( Time::Zero ),
mTooltipOf()
@@ -50,7 +50,7 @@ Uint32 UITooltip::getType() const {
}
bool UITooltip::isType( const Uint32& type ) const {
return UITooltip::getType() == type ? true : UIControlAnim::isType( type );
return UITooltip::getType() == type ? true : UINode::isType( type );
}
void UITooltip::setTheme( UITheme * Theme ) {
@@ -91,7 +91,7 @@ void UITooltip::hide() {
void UITooltip::draw() {
if ( mVisible && 0.f != mAlpha && mTextCache->getString().size() > 0 ) {
UIControlAnim::draw();
UINode::draw();
if ( mTextCache->getTextWidth() ) {
mTextCache->setAlign( getFlags() );
@@ -147,7 +147,7 @@ void UITooltip::setFontShadowColor( const Color& color ) {
}
void UITooltip::setAlpha( const Float& alpha ) {
UIControlAnim::setAlpha( alpha );
UINode::setAlpha( alpha );
mStyleConfig.FontColor.a = (Uint8)alpha;
mStyleConfig.ShadowColor.a = (Uint8)alpha;
@@ -197,7 +197,7 @@ void UITooltip::onSizeChange() {
onAutoSize();
autoAlign();
UIControlAnim::onSizeChange();
UINode::onSizeChange();
}
void UITooltip::onTextChanged() {
@@ -249,11 +249,11 @@ const Time& UITooltip::getTooltipTime() const {
return mTooltipTime;
}
UIControl * UITooltip::getTooltipOf() const {
UINode * UITooltip::getTooltipOf() const {
return mTooltipOf;
}
void UITooltip::setTooltipOf(UIControl * tooltipOf) {
void UITooltip::setTooltipOf(UINode * tooltipOf) {
mTooltipOf = tooltipOf;
}

View File

@@ -10,7 +10,7 @@ UIWidget * UIWidget::New() {
}
UIWidget::UIWidget() :
UIControlAnim(),
UINode(),
mTheme( NULL ),
mTooltip( NULL ),
mMinControlSize(),
@@ -36,7 +36,7 @@ Uint32 UIWidget::getType() const {
}
bool UIWidget::isType( const Uint32& type ) const {
return UIWidget::getType() == type ? true : UIControlAnim::isType( type );
return UIWidget::getType() == type ? true : UINode::isType( type );
}
void UIWidget::updateAnchorsDistances() {
@@ -190,7 +190,7 @@ void UIWidget::update() {
}
}
UIControlAnim::update();
UINode::update();
}
void UIWidget::createTooltip() {
@@ -227,7 +227,7 @@ void UIWidget::tooltipRemove() {
mTooltip = NULL;
}
UIControl * UIWidget::setSize( const Sizei& size ) {
UINode * UIWidget::setSize( const Sizei& size ) {
Sizei s( size );
if ( s.x < mMinControlSize.x )
@@ -236,10 +236,10 @@ UIControl * UIWidget::setSize( const Sizei& size ) {
if ( s.y < mMinControlSize.y )
s.y = mMinControlSize.y;
return UIControlAnim::setSize( s );
return UINode::setSize( s );
}
UIControl * UIWidget::setFlags(const Uint32 & flags) {
UINode * UIWidget::setFlags(const Uint32 & flags) {
if ( flags & ( UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ) ) {
updateAnchorsDistances();
}
@@ -248,15 +248,15 @@ UIControl * UIWidget::setFlags(const Uint32 & flags) {
onAutoSize();
}
return UIControlAnim::setFlags( flags );
return UINode::setFlags( flags );
}
UIControl * UIWidget::unsetFlags(const Uint32 & flags) {
UINode * UIWidget::unsetFlags(const Uint32 & flags) {
if ( flags & ( UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ) ) {
updateAnchorsDistances();
}
return UIControlAnim::unsetFlags( flags );
return UINode::unsetFlags( flags );
}
UIWidget * UIWidget::setAnchors(const Uint32 & flags) {
@@ -271,20 +271,20 @@ void UIWidget::setTheme( UITheme * Theme ) {
invalidateDraw();
}
UIControl * UIWidget::setThemeSkin( const std::string& skinName ) {
UINode * UIWidget::setThemeSkin( const std::string& skinName ) {
return setThemeSkin( NULL != mTheme ? mTheme : UIThemeManager::instance()->getDefaultTheme(), skinName );
}
UIControl * UIWidget::setThemeSkin( UITheme * Theme, const std::string& skinName ) {
return UIControl::setThemeSkin( Theme, skinName );
UINode * UIWidget::setThemeSkin( UITheme * Theme, const std::string& skinName ) {
return UINode::setThemeSkin( Theme, skinName );
}
UIControl * UIWidget::setSize( const Int32& Width, const Int32& Height ) {
return UIControlAnim::setSize( Width, Height );
UINode * UIWidget::setSize( const Int32& Width, const Int32& Height ) {
return UINode::setSize( Width, Height );
}
const Sizei& UIWidget::getSize() {
return UIControlAnim::getSize();
return UINode::getSize();
}
UITooltip * UIWidget::getTooltip() {
@@ -293,18 +293,18 @@ UITooltip * UIWidget::getTooltip() {
void UIWidget::onParentSizeChange( const Vector2i& SizeChange ) {
updateAnchors( SizeChange );
UIControlAnim::onParentSizeChange( SizeChange );
UINode::onParentSizeChange( SizeChange );
}
void UIWidget::onPositionChange() {
updateAnchorsDistances();
UIControlAnim::onPositionChange();
UINode::onPositionChange();
}
void UIWidget::onVisibilityChange() {
updateAnchorsDistances();
notifyLayoutAttrChange();
UIControlAnim::onVisibilityChange();
UINode::onVisibilityChange();
}
void UIWidget::onAutoSize() {
@@ -630,7 +630,7 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) {
std::string id = ait->as_string();
UIControl * control = getParent()->find( id );
UINode * control = getParent()->find( id );
if ( NULL != control && control->isWidget() ) {
UIWidget * widget = static_cast<UIWidget*>( control );

View File

@@ -107,7 +107,7 @@ void UIWindow::updateWinFlags() {
if ( !( mStyleConfig.WinFlags & UI_WIN_NO_BORDER ) ) {
if ( NULL == mWindowDecoration ) {
mWindowDecoration = UIControlAnim::New();
mWindowDecoration = UINode::New();
mWindowDecoration->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
}
@@ -116,7 +116,7 @@ void UIWindow::updateWinFlags() {
mWindowDecoration->setEnabled( false );
if ( NULL == mBorderLeft ) {
mBorderLeft = UIControlAnim::New();
mBorderLeft = UINode::New();
mBorderLeft->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
}
@@ -125,7 +125,7 @@ void UIWindow::updateWinFlags() {
mBorderLeft->setVisible( true );
if ( NULL == mBorderRight ) {
mBorderRight = UIControlAnim::New();
mBorderRight = UINode::New();
mBorderRight->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
}
@@ -134,7 +134,7 @@ void UIWindow::updateWinFlags() {
mBorderRight->setVisible( true );
if ( NULL == mBorderBottom ) {
mBorderBottom = UIControlAnim::New();
mBorderBottom = UINode::New();
mBorderBottom->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
}
@@ -144,7 +144,7 @@ void UIWindow::updateWinFlags() {
if ( mStyleConfig.WinFlags & UI_WIN_CLOSE_BUTTON ) {
if ( NULL == mButtonClose ) {
mButtonClose = UIControlAnim::New();
mButtonClose = UINode::New();
mButtonClose->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
needsUpdate = true;
}
@@ -163,7 +163,7 @@ void UIWindow::updateWinFlags() {
if ( isMaximizable() ) {
if ( NULL == mButtonMaximize ) {
mButtonMaximize = UIControlAnim::New();
mButtonMaximize = UINode::New();
mButtonMaximize->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
needsUpdate = true;
}
@@ -182,7 +182,7 @@ void UIWindow::updateWinFlags() {
if ( mStyleConfig.WinFlags & UI_WIN_MINIMIZE_BUTTON ) {
if ( NULL == mButtonMinimize ) {
mButtonMinimize = UIControlAnim::New();
mButtonMinimize = UINode::New();
mButtonMinimize->writeCtrlFlag( UI_CTRL_FLAG_OWNED_BY_WINDOW, 1 );
needsUpdate = true;
}
@@ -335,7 +335,7 @@ Sizei UIWindow::getFrameBufferSize() {
}
void UIWindow::createModalControl() {
UIControl * Ctrl = UIManager::instance()->getMainControl();
UINode * Ctrl = UIManager::instance()->getMainControl();
if ( NULL == mModalCtrl ) {
mModalCtrl = UIWidget::New();
@@ -356,7 +356,7 @@ void UIWindow::createModalControl() {
void UIWindow::enableByModal() {
if ( isModal() ) {
UIControl * CtrlChild = UIManager::instance()->getMainControl()->getFirstChild();
UINode * CtrlChild = UIManager::instance()->getMainControl()->getFirstChild();
while ( NULL != CtrlChild )
{
@@ -375,7 +375,7 @@ void UIWindow::enableByModal() {
void UIWindow::disableByModal() {
if ( isModal() ) {
UIControl * CtrlChild = UIManager::instance()->getMainControl()->getFirstChild();
UINode * CtrlChild = UIManager::instance()->getMainControl()->getFirstChild();
while ( NULL != CtrlChild )
{
@@ -551,7 +551,7 @@ void UIWindow::onSizeChange() {
}
}
UIControl * UIWindow::setSize( const Sizei& Size ) {
UINode * UIWindow::setSize( const Sizei& Size ) {
if ( NULL != mWindowDecoration ) {
Sizei size = Size;
@@ -566,7 +566,7 @@ UIControl * UIWindow::setSize( const Sizei& Size ) {
return this;
}
UIControl * UIWindow::setSize( const Int32& Width, const Int32& Height ) {
UINode * UIWindow::setSize( const Int32& Width, const Int32& Height ) {
setSize( Sizei( Width, Height ) );
return this;
}
@@ -718,7 +718,7 @@ void UIWindow::doResize ( const UIMessage * Msg ) {
decideResizeType( Msg->getSender() );
}
void UIWindow::decideResizeType( UIControl * Control ) {
void UIWindow::decideResizeType( UINode * Control ) {
Vector2i Pos = UIManager::instance()->getMousePos();
worldToControl( Pos );
@@ -860,14 +860,14 @@ void UIWindow::updateResize() {
case RESIZE_LEFT:
{
Pos.x -= mResizePos.x;
UIControl::setPixelsPosition( mRealPos.x + Pos.x, mRealPos.y );
UINode::setPixelsPosition( mRealPos.x + Pos.x, mRealPos.y );
internalSize( mRealSize.getWidth() - Pos.x, mRealSize.getHeight() );
break;
}
case RESIZE_TOP:
{
Pos.y -= mResizePos.y;
UIControl::setPixelsPosition( mRealPos.x, mRealPos.y + Pos.y );
UINode::setPixelsPosition( mRealPos.x, mRealPos.y + Pos.y );
internalSize( mRealSize.getWidth(), mRealSize.getHeight() - Pos.y );
break;
}
@@ -880,7 +880,7 @@ void UIWindow::updateResize() {
case RESIZE_TOPLEFT:
{
Pos -= mResizePos;
UIControl::setPixelsPosition( mRealPos.x + Pos.x, mRealPos.y + Pos.y );
UINode::setPixelsPosition( mRealPos.x + Pos.x, mRealPos.y + Pos.y );
internalSize( mRealSize.getWidth() - Pos.x, mRealSize.getHeight() - Pos.y );
break;
}
@@ -888,7 +888,7 @@ void UIWindow::updateResize() {
{
Pos.y -= mResizePos.y;
Pos.x += mResizePos.x;
UIControl::setPixelsPosition( mRealPos.x, mRealPos.y + Pos.y );
UINode::setPixelsPosition( mRealPos.x, mRealPos.y + Pos.y );
internalSize( Pos.x, mRealSize.getHeight() - Pos.y );
break;
}
@@ -896,7 +896,7 @@ void UIWindow::updateResize() {
{
Pos.x -= mResizePos.x;
Pos.y += mResizePos.y;
UIControl::setPixelsPosition( mRealPos.x + Pos.x, mRealPos.y );
UINode::setPixelsPosition( mRealPos.x + Pos.x, mRealPos.y );
internalSize( mRealSize.getWidth() - Pos.x, Pos.y );
break;
}
@@ -934,15 +934,15 @@ UIWidget * UIWindow::getContainer() const {
return mContainer;
}
UIControlAnim * UIWindow::getButtonClose() const {
UINode * UIWindow::getButtonClose() const {
return mButtonClose;
}
UIControlAnim * UIWindow::getButtonMaximize() const {
UINode * UIWindow::getButtonMaximize() const {
return mButtonMaximize;
}
UIControlAnim * UIWindow::getButtonMinimize() const {
UINode * UIWindow::getButtonMinimize() const {
return mButtonMinimize;
}
@@ -995,15 +995,10 @@ bool UIWindow::hide() {
void UIWindow::onAlphaChange() {
if ( mStyleConfig.WinFlags & UI_WIN_SHARE_ALPHA_WITH_CHILDS ) {
UIControlAnim * AnimChild;
UIControl * CurChild = mChild;
UINode * CurChild = mChild;
while ( NULL != CurChild ) {
if ( CurChild->isAnimated() ) {
AnimChild = reinterpret_cast<UIControlAnim*> ( CurChild );
AnimChild->setAlpha( mAlpha );
}
CurChild->setAlpha( mAlpha );
CurChild = CurChild->getNextControl();
}
}
@@ -1015,7 +1010,7 @@ void UIWindow::onChildCountChange() {
if ( NULL == mContainer || UIManager::instance()->getMainControl() == this )
return;
UIControl * child = mChild;
UINode * child = mChild;
bool found = false;
while ( NULL != child ) {
@@ -1034,7 +1029,7 @@ void UIWindow::onChildCountChange() {
void UIWindow::setBaseAlpha( const Uint8& Alpha ) {
if ( mAlpha == mStyleConfig.BaseAlpha ) {
UIControlAnim::setAlpha( Alpha );
UINode::setAlpha( Alpha );
}
mStyleConfig.BaseAlpha = Alpha;
@@ -1088,7 +1083,7 @@ UITextView * UIWindow::getTitleTextBox() const {
}
void UIWindow::maximize() {
UIControl * Ctrl = UIManager::instance()->getMainControl();
UINode * Ctrl = UIManager::instance()->getMainControl();
if ( Ctrl->getSize() == mSize ) {
setPixelsPosition( mNonMaxPos );
@@ -1329,7 +1324,7 @@ void UIWindow::resizeCursor() {
worldToControl( Pos );
const UIControl * Control = Man->getOverControl();
const UINode * Control = Man->getOverControl();
if ( Control == this ) {
if ( Pos.x <= mBorderLeft->getSize().getWidth() ) {

View File

@@ -219,7 +219,7 @@ Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) {
}
case UIMessage::FocusLoss:
{
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
UINode * FocusCtrl = UIManager::instance()->getFocusControl();
if ( !isParentOf( FocusCtrl ) && !isPopUpMenuChild( FocusCtrl ) ) {
onWidgetFocusLoss();
@@ -256,7 +256,7 @@ UIPopUpMenu * UIWinMenu::getMenuFromButton( UISelectButton * Button ) {
return NULL;
}
bool UIWinMenu::isPopUpMenuChild( UIControl * Ctrl ) {
bool UIWinMenu::isPopUpMenuChild( UINode * Ctrl ) {
for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); it++ ) {
if ( it->second == Ctrl || it->second->isParentOf( Ctrl ) ) {
return true;
@@ -267,7 +267,7 @@ bool UIWinMenu::isPopUpMenuChild( UIControl * Ctrl ) {
}
void UIWinMenu::onMenuFocusLoss( const UIEvent * Event ) {
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
UINode * FocusCtrl = UIManager::instance()->getFocusControl();
if ( !isParentOf( FocusCtrl ) && !isPopUpMenuChild( FocusCtrl ) ) {
onWidgetFocusLoss();

View File

@@ -99,11 +99,7 @@ void InputSDL::update() {
String txt = String::fromUtf8( SDLEvent.text.text );
EEEvent.Type = InputEvent::TextInput;
#if SDL_VERSION_ATLEAST(2,0,0)
EEEvent.text.timestamp = SDLEvent.text.timestamp;
#else
EEEvent.text.timestamp = Sys::getTicks();
#endif
EEEvent.text.text = txt[0];
processEvent( &EEEvent );

View File

@@ -164,13 +164,11 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
#endif
}
#else
#if SDL_VERSION_ATLEAST(2,0,0)
if ( GLv_3CP == Context.Version ) {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
}
#endif
#endif
#ifdef SDL2_THREADED_GLCONTEXT
@@ -390,9 +388,7 @@ void WindowSDL::setSize( Uint32 Width, Uint32 Height, bool Windowed ) {
if ( isWindowed() && !Windowed ) {
mWinPos = getPosition();
} else {
#if SDL_VERSION_ATLEAST(2,0,0)
SDL_SetWindowFullscreen( mSDLWindow, Windowed ? 0 : SDL_WINDOW_FULLSCREEN );
#endif
}
SDL_SetWindowSize( mSDLWindow, Width, Height );
@@ -402,9 +398,7 @@ void WindowSDL::setSize( Uint32 Width, Uint32 Height, bool Windowed ) {
setGLConfig();
#if SDL_VERSION_ATLEAST(2,0,0)
SDL_SetWindowFullscreen( mSDLWindow, Windowed ? 0 : SDL_WINDOW_FULLSCREEN );
#endif
}
if ( isWindowed() && Windowed ) {
@@ -576,12 +570,10 @@ Vector2i WindowSDL::getPosition() {
}
void WindowSDL::updateDesktopResolution() {
#if SDL_VERSION_ATLEAST(2,0,0)
SDL_DisplayMode dpm;
SDL_GetDesktopDisplayMode( SDL_GetWindowDisplayIndex( mSDLWindow ), &dpm );
mWindow.DesktopResolution = Sizei( dpm.w, dpm.h );
#endif
}
const Sizei& WindowSDL::getDesktopResolution() {
@@ -598,11 +590,7 @@ void WindowSDL::startTextInput() {
}
bool WindowSDL::isTextInputActive() {
#if SDL_VERSION_ATLEAST(2,0,0)
return SDL_TRUE == SDL_IsTextInputActive();
#else
return false;
#endif
}
void WindowSDL::stopTextInput() {
@@ -626,19 +614,11 @@ void WindowSDL::setTextInputRect( Rect& rect ) {
}
bool WindowSDL::hasScreenKeyboardSupport() {
#if SDL_VERSION_ATLEAST(2,0,0)
return SDL_TRUE == SDL_HasScreenKeyboardSupport();
#else
return false;
#endif
}
bool WindowSDL::isScreenKeyboardShown() {
#if SDL_VERSION_ATLEAST(2,0,0)
return SDL_TRUE == SDL_IsScreenKeyboardShown( mSDLWindow );
#else
return false;
#endif
}
}}}}

View File

@@ -312,12 +312,12 @@ void EETest::createShaders() {
void EETest::onWinMouseUp( const UIEvent * Event ) {
const UIEventMouse * MEvent = reinterpret_cast<const UIEventMouse*> ( Event );
UIControlAnim * CtrlAnim;
UINode * CtrlAnim;
if ( Event->getControl()->isType( UI_TYPE_WINDOW ) ) {
CtrlAnim = reinterpret_cast<UIControlAnim*>( Event->getControl() );
CtrlAnim = reinterpret_cast<UINode*>( Event->getControl() );
} else {
CtrlAnim = reinterpret_cast<UIControlAnim*>( Event->getControl()->getParent() );
CtrlAnim = reinterpret_cast<UINode*>( Event->getControl()->getParent() );
}
if ( MEvent->getFlags() & EE_BUTTON_WUMASK ) {
@@ -560,7 +560,7 @@ void EETest::createUI() {
genGrid->setCollumnWidth( 1, 24 );
genGrid->setCollumnWidth( 2, 100 );
C = reinterpret_cast<UIControlAnim*> ( C->getParent() );
C = reinterpret_cast<UINode*> ( C->getParent() );
//createNewUI();
@@ -598,7 +598,7 @@ void EETest::createNewUI() {
relLay = UIRelativeLayout::New();
relLay->setLayoutSizeRules( MATCH_PARENT, MATCH_PARENT );
UIControlAnim * container = UIControlAnim::New();
UINode * container = UINode::New();
container->setSize( relLay->getSize() - 32 );
UIScrollView * scrollView = UIScrollView::New();
@@ -910,13 +910,13 @@ void EETest::createCommonDialog() {
}
static void onWinDragStart( const UIEvent * event ) {
UIControl * ctrl = static_cast<UIControl*>( event->getControl() );
UINode * ctrl = static_cast<UINode*>( event->getControl() );
UIWindow * window = ctrl->isType(UI_TYPE_WINDOW) ? static_cast<UIWindow*>( ctrl ) : static_cast<UIWindow*>( ctrl->getWindowContainer()->getParent() );
window->startAlphaAnim( window->getAlpha(), 100, Seconds(0.2f) );
}
static void onWinDragStop( const UIEvent * event ) {
UIControl * ctrl = static_cast<UIControl*>( event->getControl() );
UINode * ctrl = static_cast<UINode*>( event->getControl() );
UIWindow * window = ctrl->isType(UI_TYPE_WINDOW) ? static_cast<UIWindow*>( ctrl ) : static_cast<UIWindow*>( ctrl->getWindowContainer()->getParent() );
window->startAlphaAnim( window->getAlpha(), 255, Seconds(0.2f) );
}

View File

@@ -159,7 +159,7 @@ class EETest : private Thread {
void createDecoratedWindow();
void createUIThemeTextureAtlas();
UIControlAnim * C;
UINode * C;
UIScrollBar * mScrollBar;
UITextView * mTextBoxValue;
UISlider * mSlider;