Fixed a couple of bugs in cMap.

Cleaned up some skin code on the ui.
This commit is contained in:
spartanj@gmail.com
2012-02-19 23:53:56 -03:00
parent a2f9967172
commit 8ed729cc8b
18 changed files with 110 additions and 96 deletions

View File

@@ -323,8 +323,6 @@ void cMap::CalcTilesClip() {
mStartTile.x = -foff.x / ( mTileSize.x * mScale ) - mExtraTiles.x;
mStartTile.y = -foff.y / ( mTileSize.y * mScale ) - mExtraTiles.y;
mEndTile.x = mStartTile.x + eeRoundUp( (eeFloat)mViewSize.x / ( (eeFloat)mTileSize.x * mScale ) ) + 1 + mExtraTiles.x;
mEndTile.y = mStartTile.y + eeRoundUp( (eeFloat)mViewSize.y / ( (eeFloat)mTileSize.y * mScale ) ) + 1 + mExtraTiles.y;
if ( mStartTile.x < 0 )
mStartTile.x = 0;
@@ -332,6 +330,9 @@ void cMap::CalcTilesClip() {
if ( mStartTile.y < 0 )
mStartTile.y = 0;
mEndTile.x = mStartTile.x + eeRoundUp( (eeFloat)mViewSize.x / ( (eeFloat)mTileSize.x * mScale ) ) + 1 + mExtraTiles.x;
mEndTile.y = mStartTile.y + eeRoundUp( (eeFloat)mViewSize.y / ( (eeFloat)mTileSize.y * mScale ) ) + 1 + mExtraTiles.y;
if ( mEndTile.x > mSize.x )
mEndTile.x = mSize.x;
@@ -393,7 +394,17 @@ void cMap::UpdateOffscale() {
eeVector2f totSizeT( mTileSize.x * mSize.x - mViewSize.x , mTileSize.y * mSize.y - mViewSize.y );
eeVector2f totSizeS( mTileSize.x * mSize.x * mScale - mViewSize.x , mTileSize.y * mSize.y * mScale - mViewSize.y );
mOffscale = eeVector2f( totSizeS.x / totSizeT.x, totSizeS.y / totSizeT.y );
if ( 0 == totSizeT.x ) {
mOffscale.x = 0;
} else {
mOffscale.x = totSizeS.x / totSizeT.x;
}
if ( 0 == totSizeT.y ) {
mOffscale.y = 0;
} else {
mOffscale.y = totSizeS.y / totSizeT.y;
}
}
const eeFloat& cMap::Scale() const {

View File

@@ -9,8 +9,8 @@ cTextCache::cTextCache() :
mNumLines(1),
mFontColor(255,255,255,255),
mFontShadowColor(0,0,0,255),
mCachedCoords(false),
mFlags(0)
mFlags(0),
mCachedCoords(false)
{
}

View File

@@ -58,7 +58,7 @@ class EE_API cTextCache {
protected:
friend class cFont;
String mText;
String mText;
cFont * mFont;
std::vector<eeFloat> mLinesWidth;
eeFloat mCachedWidth;
@@ -69,10 +69,12 @@ class EE_API cTextCache {
std::vector<eeVertexCoords> mRenderCoords;
std::vector<eeColorA> mColors;
bool mCachedCoords;
Uint32 mFlags;
Uint32 mVertexNumCached;
bool mCachedCoords;
void UpdateCoords();
const bool& CachedCoords() const;

View File

@@ -395,6 +395,7 @@ void cEETest::CreateUI() {
PBParams.PosSet( 20, 197 );
PBParams.Size = eeSize( 200, 16 );
PBParams.DisplayPercent = true;
PBParams.MovementSpeed = eeVector2f( -64, 0 );
mProgressBar = eeNew( cUIProgressBar, ( PBParams ) );
mProgressBar->Visible( true );
mProgressBar->Enabled( true );

View File

@@ -11,7 +11,7 @@ class EE_API cUIAquaTheme : public cUITheme {
virtual cUIPopUpMenu * CreatePopUpMenu( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE | UI_AUTO_PADDING, Uint32 RowHeight = 0, eeRecti PaddingContainer = eeRecti(), Uint32 MinWidth = 100, Uint32 MinSpaceForIcons = 16, Uint32 MinRightMargin = 8 );
virtual cUIProgressBar * CreateProgressBar( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, bool DisplayPercent = true, bool VerticalExpand = false, eeVector2f MovementSpeed = eeVector2f( 64, 0 ), eeRectf FillerMargin = eeRectf() );
virtual cUIProgressBar * CreateProgressBar( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, bool DisplayPercent = true, bool VerticalExpand = false, eeVector2f MovementSpeed = eeVector2f( -64, 0 ), eeRectf FillerMargin = eeRectf() );
virtual cUIWinMenu * CreateWinMenu( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, Uint32 MarginBetweenButtons = 0, Uint32 ButtonMargin = 12, Uint32 MenuHeight = 0, Uint32 FirstButtonMargin = 1 );

View File

@@ -40,8 +40,8 @@ bool cUICheckBox::IsType( const Uint32& type ) const {
void cUICheckBox::SetTheme( cUITheme * Theme ) {
cUIControl::SetTheme( Theme, "checkbox" );
mActiveButton->ForceThemeSkin ( Theme, "checkbox_active" );
mInactiveButton->ForceThemeSkin ( Theme, "checkbox_inactive" );
mActiveButton->SetSkin ( Theme, "checkbox_active" );
mInactiveButton->SetSkin ( Theme, "checkbox_inactive" );
DoAfterSetTheme();
}

View File

@@ -40,7 +40,7 @@ cUIControl::cUIControl( const CreateParams& Params ) :
}
cUIControl::~cUIControl() {
eeSAFE_DELETE( mSkinState );
SafeDeleteSkinState();
eeSAFE_DELETE( mBackground );
eeSAFE_DELETE( mBorder );
@@ -255,7 +255,7 @@ void cUIControl::Update() {
}
if ( mControlFlags & UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD )
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS, 0 );
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD, 0 );
}
void cUIControl::SendMouseEvent( const Uint32& Event, const eeVector2i& Pos, const Uint32& Flags ) {
@@ -305,11 +305,11 @@ Uint32 cUIControl::OnMouseClick( const eeVector2i& Pos, const Uint32 Flags ) {
}
bool cUIControl::IsMouseOver() {
return 0 != Read32BitKey( &mControlFlags, UI_CTRL_FLAG_MOUSEOVER_POS );
return mControlFlags & UI_CTRL_FLAG_MOUSEOVER;
}
bool cUIControl::IsMouseOverMeOrChilds() {
return 0 != Read32BitKey( &mControlFlags, UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS );
return mControlFlags & UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD;
}
Uint32 cUIControl::OnMouseDoubleClick( const eeVector2i& Pos, const Uint32 Flags ) {
@@ -318,7 +318,7 @@ Uint32 cUIControl::OnMouseDoubleClick( const eeVector2i& Pos, const Uint32 Flags
}
Uint32 cUIControl::OnMouseEnter( const eeVector2i& Pos, const Uint32 Flags ) {
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_POS, 1 );
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER, 1 );
SendMouseEvent( cUIEvent::EventMouseEnter, Pos, Flags );
@@ -328,7 +328,7 @@ Uint32 cUIControl::OnMouseEnter( const eeVector2i& Pos, const Uint32 Flags ) {
}
Uint32 cUIControl::OnMouseExit( const eeVector2i& Pos, const Uint32 Flags ) {
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_POS, 0 );
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER, 0 );
SendMouseEvent( cUIEvent::EventMouseExit, Pos, Flags );
@@ -386,7 +386,7 @@ void cUIControl::VAlign( Uint32 valign ) {
}
void cUIControl::FillBackground( bool enabled ) {
SetFlagValue( &mFlags, UI_FILL_BACKGROUND, enabled ? 1 : 0 );
WriteFlag( UI_FILL_BACKGROUND, enabled ? 1 : 0 );
if ( enabled && NULL == mBackground ) {
mBackground = eeNew( cUIBackground, () );
@@ -394,7 +394,7 @@ void cUIControl::FillBackground( bool enabled ) {
}
void cUIControl::Border( bool enabled ) {
SetFlagValue( &mFlags, UI_BORDER, enabled ? 1 : 0 );
WriteFlag( UI_BORDER, enabled ? 1 : 0 );
if ( enabled && NULL == mBorder ) {
mBorder = eeNew( cUIBorder, () );
@@ -764,7 +764,7 @@ cUIControl * cUIControl::OverFind( const eeVector2f& Point ) {
UpdateQuad();
if ( PointInsidePolygon2( mPoly, Point ) ) {
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS, 1 );
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD, 1 );
cUIControl * ChildLoop = mChildLast;
@@ -905,29 +905,42 @@ void cUIControl::SetTheme( cUITheme * Theme ) {
SetTheme( Theme, "control" );
}
void cUIControl::SafeDeleteSkinState() {
if ( NULL != mSkinState && ( mControlFlags & UI_CTRL_FLAG_SKIN_OWNER ) ) {
cUISkin * tSkin = mSkinState->GetSkin();
eeSAFE_DELETE( tSkin );
}
eeSAFE_DELETE( mSkinState );
}
void cUIControl::SetTheme( cUITheme * Theme, const std::string& ControlName ) {
if ( NULL != Theme ) {
cUISkin * tSkin = NULL;
if ( mSkinForcedName.size() )
tSkin = Theme->GetByName( Theme->Abbr() + "_" + mSkinForcedName );
else
tSkin = Theme->GetByName( Theme->Abbr() + "_" + ControlName );
cUISkin * tSkin = Theme->GetByName( Theme->Abbr() + "_" + ControlName );
if ( NULL != tSkin ) {
eeSAFE_DELETE( mSkinState );
SafeDeleteSkinState();
mSkinState = eeNew( cUISkinState, ( tSkin ) );
}
}
}
void cUIControl::ForceThemeSkin( cUITheme * Theme, const std::string& ControlName ) {
mSkinForcedName = ControlName;
void cUIControl::SetSkin( cUITheme * Theme, const std::string& ControlName ) {
SetTheme( Theme, ControlName );
}
void cUIControl::SetSkin( cUISkin * Skin ) {
if ( NULL != Skin ) {
SafeDeleteSkinState();
WriteCtrlFlag( UI_CTRL_FLAG_SKIN_OWNER, 1 );
mSkinState = eeNew( cUISkinState, ( Skin ) );
}
}
void cUIControl::OnStateChange() {
}
@@ -984,8 +997,8 @@ cUISkin * cUIControl::GetSkin() {
return NULL;
}
void cUIControl::WriteCtrlFlag( const Uint32& Pos, const Uint32& Val ) {
Write32BitKey( &mControlFlags, Pos, Val );
void cUIControl::WriteCtrlFlag( const Uint32& Flag, const Uint32& Val ) {
SetFlagValue( &mControlFlags, Flag, Val );
}
void cUIControl::WriteFlag( const Uint32& Flag, const Uint32& Val ) {

View File

@@ -197,7 +197,9 @@ class EE_API cUIControl {
cUISkin * GetSkin();
void ForceThemeSkin( cUITheme * Theme, const std::string& ControlName );
void SetSkin( cUITheme * Theme, const std::string& ControlName );
void SetSkin( cUISkin * Skin );
cUIControl * ChildGetFirst() const;
@@ -260,8 +262,6 @@ class EE_API cUIControl {
UIEventsMap mEvents;
std::string mSkinForcedName;
bool mVisible;
bool mEnabled;
@@ -355,7 +355,7 @@ class EE_API cUIControl {
void UpdateChildsScreenPos();
void WriteCtrlFlag( const Uint32& Pos, const Uint32& Val );
void WriteCtrlFlag( const Uint32& Flag, const Uint32& Val );
void WriteFlag( const Uint32& Flag, const Uint32& Val );
@@ -366,6 +366,8 @@ class EE_API cUIControl {
eeFloat Elapsed();
eeRecti MakePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false );
void SafeDeleteSkinState();
};
}}

View File

@@ -86,7 +86,7 @@ bool cUIDragable::Dragging() const {
}
void cUIDragable::Dragging( const bool& dragging ) {
WriteCtrlFlag( UI_CTRL_FLAG_DRAGGING_POS, true == dragging );
WriteCtrlFlag( UI_CTRL_FLAG_DRAGGING, true == dragging );
}
void cUIDragable::DragButton( const Uint32& Button ) {

View File

@@ -44,8 +44,8 @@ bool cUIRadioButton::IsType( const Uint32& type ) const {
void cUIRadioButton::SetTheme( cUITheme * Theme ) {
cUIControl::SetTheme( Theme, "radiobutton" );
mActiveButton->ForceThemeSkin ( Theme, "radiobutton_active" );
mInactiveButton->ForceThemeSkin ( Theme, "radiobutton_inactive" );
mActiveButton->SetSkin ( Theme, "radiobutton_active" );
mInactiveButton->SetSkin ( Theme, "radiobutton_inactive" );
cShape * tShape = NULL;
cUISkin * tSkin = mActiveButton->GetSkin();

View File

@@ -55,18 +55,18 @@ bool cUIScrollBar::IsType( const Uint32& type ) const {
void cUIScrollBar::SetTheme( cUITheme * Theme ) {
if ( !IsVertical() ) {
cUIControl::SetTheme( Theme, "hscrollbar" );
mSlider->ForceThemeSkin( Theme, "hscrollbar_slider" );
mSlider->GetBackSlider()->ForceThemeSkin( Theme, "hscrollbar_bg" );
mSlider->GetSliderButton()->ForceThemeSkin( Theme, "hscrollbar_button" );
mBtnUp->ForceThemeSkin( Theme, "hscrollbar_btnup" );
mBtnDown->ForceThemeSkin( Theme, "hscrollbar_btndown" );
mSlider->SetSkin( Theme, "hscrollbar_slider" );
mSlider->GetBackSlider()->SetSkin( Theme, "hscrollbar_bg" );
mSlider->GetSliderButton()->SetSkin( Theme, "hscrollbar_button" );
mBtnUp->SetSkin( Theme, "hscrollbar_btnup" );
mBtnDown->SetSkin( Theme, "hscrollbar_btndown" );
} else {
cUIControl::SetTheme( Theme, "vscrollbar" );
mSlider->ForceThemeSkin( Theme, "vscrollbar_slider" );
mSlider->GetBackSlider()->ForceThemeSkin( Theme, "vscrollbar_bg" );
mSlider->GetSliderButton()->ForceThemeSkin( Theme, "vscrollbar_button" );
mBtnUp->ForceThemeSkin( Theme, "vscrollbar_btnup" );
mBtnDown->ForceThemeSkin( Theme, "vscrollbar_btndown" );
mSlider->SetSkin( Theme, "vscrollbar_slider" );
mSlider->GetBackSlider()->SetSkin( Theme, "vscrollbar_bg" );
mSlider->GetSliderButton()->SetSkin( Theme, "vscrollbar_button" );
mBtnUp->SetSkin( Theme, "vscrollbar_btnup" );
mBtnDown->SetSkin( Theme, "vscrollbar_btndown" );
}
cShape * tShape = NULL;

View File

@@ -62,13 +62,13 @@ void cUISlider::SetTheme( cUITheme * Theme ) {
if ( !mVertical ) {
cUIControl::SetTheme( Theme, "hslider" );
mBackSlider->ForceThemeSkin( Theme, "hslider_bg" );
mSlider->ForceThemeSkin( Theme, "hslider_button" );
mBackSlider->SetSkin( Theme, "hslider_bg" );
mSlider->SetSkin( Theme, "hslider_button" );
} else {
cUIControl::SetTheme( Theme, "vslider" );
mBackSlider->ForceThemeSkin( Theme, "vslider_bg" );
mSlider->ForceThemeSkin( Theme, "vslider_button" );
mBackSlider->SetSkin( Theme, "vslider_bg" );
mSlider->SetSkin( Theme, "vslider_button" );
}
AdjustChilds();

View File

@@ -60,9 +60,9 @@ bool cUISpinBox::IsType( const Uint32& type ) const {
void cUISpinBox::SetTheme( cUITheme * Theme ) {
cUIControl::SetTheme ( Theme, "spinbox" );
mInput->ForceThemeSkin ( Theme, "spinbox_input" );
mPushUp->ForceThemeSkin ( Theme, "spinbox_btnup" );
mPushDown->ForceThemeSkin ( Theme, "spinbox_btndown" );
mInput->SetSkin ( Theme, "spinbox_input" );
mPushUp->SetSkin ( Theme, "spinbox_btnup" );
mPushDown->SetSkin ( Theme, "spinbox_btndown" );
cShape * tShape = NULL;
cUISkin * tSkin = NULL;

View File

@@ -87,7 +87,7 @@ bool cUITextEdit::IsType( const Uint32& type ) const {
void cUITextEdit::SetTheme( cUITheme * Theme ) {
cUIControl::SetTheme( Theme, "textedit" );
mTextInput->ForceThemeSkin( Theme, "textedit_box" );
mTextInput->SetSkin( Theme, "textedit_box" );
AutoPadding();

View File

@@ -171,24 +171,24 @@ void cUIWindow::SetTheme( cUITheme *Theme ) {
cUIComplexControl::SetTheme( Theme );
if ( !( mWinFlags & UI_WIN_NO_BORDER ) ) {
mContainer->ForceThemeSkin ( Theme, "winback" );
mWindowDecoration->ForceThemeSkin ( Theme, "windeco" );
mBorderLeft->ForceThemeSkin ( Theme, "winborderleft" );
mBorderRight->ForceThemeSkin ( Theme, "winborderright" );
mBorderBottom->ForceThemeSkin ( Theme, "winborderbottom" );
mContainer->SetSkin ( Theme, "winback" );
mWindowDecoration->SetSkin ( Theme, "windeco" );
mBorderLeft->SetSkin ( Theme, "winborderleft" );
mBorderRight->SetSkin ( Theme, "winborderright" );
mBorderBottom->SetSkin ( Theme, "winborderbottom" );
if ( NULL != mButtonClose ) {
mButtonClose->ForceThemeSkin( Theme, "winclose" );
mButtonClose->SetSkin( Theme, "winclose" );
mButtonClose->Size( mButtonClose->GetSkinShapeSize() );
}
if ( NULL != mButtonMaximize ) {
mButtonMaximize->ForceThemeSkin( Theme, "winmax" );
mButtonMaximize->SetSkin( Theme, "winmax" );
mButtonMaximize->Size( mButtonMaximize->GetSkinShapeSize() );
}
if ( NULL != mButtonMinimize ) {
mButtonMinimize->ForceThemeSkin( Theme, "winmin" );
mButtonMinimize->SetSkin( Theme, "winmin" );
mButtonMinimize->Size( mButtonMinimize->GetSkinShapeSize() );
}

View File

@@ -57,7 +57,7 @@ void cUIWinMenu::AddMenuButton( const String& ButtonText, cUIPopUpMenu * Menu )
Button->Text( ButtonText );
Button->Visible( true );
Button->Enabled( true );
Button->ForceThemeSkin( mSkinState->GetSkin()->Theme(), "winmenubutton" );
Button->SetSkin( mSkinState->GetSkin()->Theme(), "winmenubutton" );
Menu->Visible( false );
Menu->Enabled( false );
@@ -73,7 +73,7 @@ void cUIWinMenu::SetTheme( cUITheme * Theme ) {
cUIComplexControl::SetTheme( Theme, "winmenu" );
for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); it++ ) {
it->first->ForceThemeSkin( Theme, "winmenubutton" );
it->first->SetSkin( Theme, "winmenubutton" );
}
if ( 0 == mMenuHeight && NULL != GetSkin() && NULL != GetSkin()->GetShape( cUISkinState::StateNormal ) ) {

View File

@@ -64,7 +64,7 @@ cUIControl * tUIItemContainer<TContainer>::OverFind( const eeVector2f& Point ) {
UpdateQuad();
if ( PointInsidePolygon2( mPoly, Point ) ) {
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS, 1 );
WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD, 1 );
for ( Uint32 i = LBParent->mVisibleFirst; i <= LBParent->mVisibleLast; i++ ) {
if ( NULL != LBParent->mItems[i] ) {

View File

@@ -9,36 +9,21 @@ Uint32 EE_API HAlignGet( Uint32 Flags );
Uint32 EE_API VAlignGet( Uint32 Flags );
enum UI_CONTROL_FLAGS_POS {
UI_CTRL_FLAG_CLOSE_POS = 0,
UI_CTRL_FLAG_CLOSE_FO_POS,
UI_CTRL_FLAG_ANIM_POS,
UI_CTRL_FLAG_MOUSEOVER_POS,
UI_CTRL_FLAG_HAS_FOCUS_POS,
UI_CTRL_FLAG_SELECTED_POS,
UI_CTRL_FLAG_DISABLE_CHECK_CLOSE_CHILDS_POS,
UI_CTRL_FLAG_DISABLE_FADE_OUT_POS,
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS,
UI_CTRL_FLAG_DRAGGING_POS,
UI_CTRL_FLAG_DRAGABLE_POS,
UI_CTRL_FLAG_COMPLEX_POS,
UI_CTRL_FLAG_FREE_USE_POS = 31
};
enum UI_CONTROL_FLAGS_VALUES {
UI_CTRL_FLAG_CLOSE = (1<<UI_CTRL_FLAG_CLOSE_POS),
UI_CTRL_FLAG_CLOSE_FO = (1<<UI_CTRL_FLAG_CLOSE_FO_POS),
UI_CTRL_FLAG_ANIM = (1<<UI_CTRL_FLAG_ANIM_POS),
UI_CTRL_FLAG_MOUSEOVER = (1<<UI_CTRL_FLAG_MOUSEOVER_POS),
UI_CTRL_FLAG_HAS_FOCUS = (1<<UI_CTRL_FLAG_HAS_FOCUS_POS),
UI_CTRL_FLAG_SELECTED = (1<<UI_CTRL_FLAG_SELECTED_POS),
UI_CTRL_FLAG_DISABLE_CHECK_CLOSE_CHILDS = (1<<UI_CTRL_FLAG_DISABLE_CHECK_CLOSE_CHILDS_POS),
UI_CTRL_FLAG_DISABLE_FADE_OUT = (1<<UI_CTRL_FLAG_DISABLE_FADE_OUT_POS),
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD = (1<<UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS),
UI_CTRL_FLAG_DRAGGING = (1<<UI_CTRL_FLAG_DRAGGING_POS),
UI_CTRL_FLAG_DRAGABLE = (1<<UI_CTRL_FLAG_DRAGABLE_POS),
UI_CTRL_FLAG_COMPLEX = (1<<UI_CTRL_FLAG_COMPLEX_POS),
UI_CTRL_FLAG_FREE_USE = (1<<UI_CTRL_FLAG_FREE_USE_POS)
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_CHECK_CLOSE_CHILDS = (1<<6),
UI_CTRL_FLAG_DISABLE_FADE_OUT = (1<<7),
UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD = (1<<8),
UI_CTRL_FLAG_DRAGGING = (1<<9),
UI_CTRL_FLAG_DRAGABLE = (1<<10),
UI_CTRL_FLAG_COMPLEX = (1<<11),
UI_CTRL_FLAG_SKIN_OWNER = (1<<12),
UI_CTRL_FLAG_FREE_USE = (1<<31)
};
#define UI_HALIGN_LEFT FONT_DRAW_LEFT