mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-04 20:46:29 +03:00
UI module more refactoring.
--HG-- branch : dev
This commit is contained in:
@@ -24,7 +24,7 @@ class EE_API UICheckBox : public UITextBox {
|
||||
|
||||
const bool& active() const;
|
||||
|
||||
virtual void padding( const Recti& padding );
|
||||
virtual void setPadding( const Recti& padding );
|
||||
|
||||
UIControlAnim * activeButton() const;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class EE_API UIComboBox : public UIDropDownList {
|
||||
|
||||
void onButtonExit( const UIEvent * Event );
|
||||
|
||||
Uint32 onMouseClick( const Vector2i& setPosition, const Uint32 flags );
|
||||
Uint32 onMouseClick( const Vector2i& position, const Uint32 flags );
|
||||
|
||||
void createButton();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class EE_API UIComplexControl : public UIControlAnim {
|
||||
|
||||
virtual void update();
|
||||
|
||||
virtual void setSize( const Sizei &getSize );
|
||||
virtual void setSize( const Sizei& size );
|
||||
|
||||
void setSize( const Int32& Width, const Int32& Height );
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ class EE_API UIControl {
|
||||
|
||||
~CreateParams() {}
|
||||
|
||||
void setPos( const Vector2i& pos ) { Pos.x = pos.x; Pos.y = pos.y; }
|
||||
void setPos( const Int32& X, const Int32& Y ) { Pos.x = X; Pos.y = Y; }
|
||||
void setPosition( const Vector2i& pos ) { Pos.x = pos.x; Pos.y = pos.y; }
|
||||
void setPosition( const Int32& X, const Int32& Y ) { Pos.x = X; Pos.y = Y; }
|
||||
void setParent( UIControl * Ctrl ) { ParentCtrl = Ctrl; }
|
||||
void setSize( const Sizei& size ) { Size.x = size.x; Size.y = size.y; }
|
||||
void setSize( const Int32& Width, const Int32& Height ) { Size.x = Width; Size.y = Height; }
|
||||
|
||||
@@ -24,7 +24,7 @@ class EE_API UIRadioButton : public UITextBox {
|
||||
|
||||
const bool& active() const;
|
||||
|
||||
virtual void padding( const Recti& padding );
|
||||
virtual void setPadding( const Recti& padding );
|
||||
|
||||
UIControlAnim * activeButton() const;
|
||||
|
||||
|
||||
@@ -48,33 +48,33 @@ class EE_API UITextBox : public UIComplexControl {
|
||||
|
||||
virtual void setAlpha( const Float& alpha );
|
||||
|
||||
Graphics::Font * font() const;
|
||||
Graphics::Font * getFont() const;
|
||||
|
||||
void font( Graphics::Font * font );
|
||||
void setFont( Graphics::Font * font );
|
||||
|
||||
virtual const String& text();
|
||||
virtual const String& getText();
|
||||
|
||||
virtual void text( const String& text );
|
||||
virtual void setText( const String& text );
|
||||
|
||||
const ColorA& color() const;
|
||||
const ColorA& getColor() const;
|
||||
|
||||
void color( const ColorA& color );
|
||||
void setColor( const ColorA& color );
|
||||
|
||||
const ColorA& shadowColor() const;
|
||||
const ColorA& getShadowColor() const;
|
||||
|
||||
void shadowColor( const ColorA& color );
|
||||
void setShadowColor( const ColorA& color );
|
||||
|
||||
const ColorA& selectionBackColor() const;
|
||||
const ColorA& getSelectionBackColor() const;
|
||||
|
||||
void selectionBackColor( const ColorA& color );
|
||||
void setSelectionBackColor( const ColorA& color );
|
||||
|
||||
virtual void onTextChanged();
|
||||
|
||||
virtual void onFontChanged();
|
||||
|
||||
virtual void padding( const Recti& padding );
|
||||
virtual void setPadding( const Recti& padding );
|
||||
|
||||
const Recti& padding() const;
|
||||
const Recti& getPadding() const;
|
||||
|
||||
virtual void setTheme( UITheme * Theme );
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ class EE_API UITextInput : public UITextBox {
|
||||
|
||||
const bool& allowEditing() const;
|
||||
|
||||
virtual const String& text();
|
||||
virtual const String& getText();
|
||||
|
||||
virtual void text( const String& text );
|
||||
virtual void setText( const String& text );
|
||||
|
||||
virtual void shrinkText( const Uint32& MaxWidth );
|
||||
protected:
|
||||
|
||||
@@ -12,9 +12,9 @@ class UITextInputPassword : public UITextInput
|
||||
|
||||
virtual void draw();
|
||||
|
||||
virtual const String& text();
|
||||
virtual const String& getText();
|
||||
|
||||
virtual void text( const String& text );
|
||||
virtual void setText( const String& text );
|
||||
|
||||
TextCache * getPassCache() const;
|
||||
protected:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.2.0, 2017-02-18T04:59:58. -->
|
||||
<!-- Written by QtCreator 4.2.0, 2017-02-18T05:18:35. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
@@ -161,7 +161,7 @@ void MapEditor::CreateWinMenu() {
|
||||
|
||||
UIComplexControl::CreateParams Params;
|
||||
Params.setParent( mUIContainer );
|
||||
Params.setPos( 0, WinMenu->getSize().getHeight() );
|
||||
Params.setPosition( 0, WinMenu->getSize().getHeight() );
|
||||
Params.setSize( mUIContainer->getSize().getWidth(), mUIContainer->getSize().getHeight() - WinMenu->getSize().getHeight() );
|
||||
Params.Flags = UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_REPORT_SIZE_CHANGE_TO_CHILDS;
|
||||
mWinContainer = eeNew( UIComplexControl, ( Params ) );
|
||||
@@ -264,42 +264,42 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) {
|
||||
Uint32 ChkFlags = UI_CONTROL_DEFAULT_ALIGN | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP;
|
||||
|
||||
mChkMirrored = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ), ChkFlags );
|
||||
mChkMirrored->text( "Mirrored" );
|
||||
mChkMirrored->setText( "Mirrored" );
|
||||
mChkMirrored->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickMirrored ) );
|
||||
|
||||
mChkFliped = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->getPosition().x + mChkMirrored->getSize().getWidth() + 32, mChkMirrored->getPosition().y ), ChkFlags );
|
||||
mChkFliped->text( "Fliped" );
|
||||
mChkFliped->setText( "Fliped" );
|
||||
mChkFliped->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickFliped ) );
|
||||
|
||||
mChkBlocked = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->getPosition().x, mChkMirrored->getPosition().y + mChkMirrored->getSize().getHeight() + 4 ), ChkFlags );
|
||||
mChkBlocked->text( "Blocked" );
|
||||
mChkBlocked->setText( "Blocked" );
|
||||
mChkBlocked->setTooltipText( "Blocks the tile occupied by the sprite." );
|
||||
mChkBlocked->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickBlocked ) );
|
||||
|
||||
mChkAnim = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkFliped->getPosition().x, mChkFliped->getPosition().y + mChkFliped->getSize().getHeight() + 4 ), ChkFlags );
|
||||
mChkAnim->text( "Animated" );
|
||||
mChkAnim->setText( "Animated" );
|
||||
mChkAnim->setTooltipText( "Indicates if the Sprite is animated." );
|
||||
mChkAnim->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAnimated ) );
|
||||
|
||||
mChkRot90 = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->getPosition().x, mChkBlocked->getPosition().y + mChkBlocked->getSize().getHeight() + 4 ), ChkFlags );
|
||||
mChkRot90->text( String::fromUtf8( "Rotate 90º" ) );
|
||||
mChkRot90->setText( String::fromUtf8( "Rotate 90º" ) );
|
||||
mChkRot90->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickRot90 ) );
|
||||
|
||||
mChkAutoFix = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->getPosition().x, mChkAnim->getPosition().y + mChkAnim->getSize().getHeight() + 4 ), ChkFlags );
|
||||
mChkAutoFix->text( "AutoFix TilePos" );
|
||||
mChkAutoFix->setText( "AutoFix TilePos" );
|
||||
mChkAutoFix->setTooltipText( "In a tiled layer if the sprite is moved,\nit will update the current tile position automatically." );
|
||||
mChkAutoFix->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAutoFix ) );
|
||||
|
||||
Txt = mTheme->createTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->getPosition().y + mChkRot90->getSize().getHeight() + 8 ), TxtFlags );
|
||||
|
||||
mChkDI = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ), ChkFlags );
|
||||
mChkDI->text( "Add as DataId" );
|
||||
mChkDI->setText( "Add as DataId" );
|
||||
mChkDI->setTooltipText( "If the resource it's not a sprite,\nyou can reference it with a data id" );
|
||||
mChkDI->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickDI ) );
|
||||
|
||||
UIComplexControl::CreateParams SGParams;
|
||||
SGParams.setParent( mSubTextureCont );
|
||||
SGParams.setPos( Vector2i( TAB_CONT_X_DIST, mChkDI->getPosition().y + mChkDI->getSize().getHeight() + 8 ) );
|
||||
SGParams.setPosition( Vector2i( TAB_CONT_X_DIST, mChkDI->getPosition().y + mChkDI->getSize().getHeight() + 8 ) );
|
||||
SGParams.setSize( Sizei( Width, 400 ) );
|
||||
SGParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP;
|
||||
mSGCont = eeNew( UIComplexControl, ( SGParams ) );
|
||||
@@ -321,7 +321,7 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) {
|
||||
|
||||
UIComplexControl::CreateParams DIParams;
|
||||
DIParams.setParent( mSubTextureCont );
|
||||
DIParams.setPos( SGParams.Pos );
|
||||
DIParams.setPosition( SGParams.Pos );
|
||||
DIParams.setSize( Sizei( Width, 400 ) );
|
||||
DIParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP;
|
||||
mDICont = eeNew( UIComplexControl, ( DIParams ) );
|
||||
@@ -344,7 +344,7 @@ void MapEditor::CreateLighContainer() {
|
||||
|
||||
UIComplexControl::CreateParams ComParams;
|
||||
ComParams.setParent( mLightCont );
|
||||
ComParams.setPos( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
ComParams.setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
ComParams.setSize( 58, 64 );
|
||||
ComParams.Background.setColor( ColorA(255,255,255,255) );
|
||||
ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) );
|
||||
@@ -384,7 +384,7 @@ void MapEditor::CreateLighContainer() {
|
||||
mLightRadius->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnLightRadiusChangeVal ) );
|
||||
|
||||
mLightTypeChk = mTheme->createCheckBox( mLightCont, Sizei(), Vector2i( mLightRadius->getPosition().x, mLightRadius->getPosition().y + mLightRadius->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE );
|
||||
mLightTypeChk->text( "Isometric Light" );
|
||||
mLightTypeChk->setText( "Isometric Light" );
|
||||
mLightTypeChk->active( false );
|
||||
mLightTypeChk->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnLightTypeChange ) );
|
||||
}
|
||||
@@ -416,7 +416,7 @@ void MapEditor::CreateObjectsContainer() {
|
||||
Uint32 ChkFlags = UI_CONTROL_DEFAULT_ALIGN | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP;
|
||||
|
||||
mChkClampToTile = mTheme->createCheckBox( mObjectCont, Sizei(), Vector2i( 12, nextY ), ChkFlags );
|
||||
mChkClampToTile->text( "Clamp Position to Tile" );
|
||||
mChkClampToTile->setText( "Clamp Position to Tile" );
|
||||
mChkClampToTile->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickClampToTile ) );
|
||||
mChkClampToTile->active( true );
|
||||
}
|
||||
@@ -461,7 +461,7 @@ void MapEditor::CreateUIMap() {
|
||||
|
||||
UIComplexControl::CreateParams Params;
|
||||
Params.setParent( mWinContainer );
|
||||
Params.setPos( 0, 0 );
|
||||
Params.setPosition( 0, 0 );
|
||||
Params.setSize( mWinContainer->getSize().getWidth() - 225 - ScrollV, mWinContainer->getSize().getHeight() - ScrollH );
|
||||
|
||||
Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT;
|
||||
@@ -553,7 +553,7 @@ void MapEditor::OnRedChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Red = (Uint8)mUIRedSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIRedTxt->text( String::toStr( (Int32)mUIRedSlider->value() ) );
|
||||
mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->value() ) );
|
||||
|
||||
if ( NULL != mUIMap->GetSelectedLight() ) {
|
||||
RGB lCol( mUIMap->GetSelectedLight()->Color() );
|
||||
@@ -566,7 +566,7 @@ void MapEditor::OnGreenChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Green = (Uint8)mUIGreenSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIGreenTxt->text( String::toStr( (Uint32)mUIGreenSlider->value() ) );
|
||||
mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->value() ) );
|
||||
|
||||
if ( NULL != mUIMap->GetSelectedLight() ) {
|
||||
RGB lCol( mUIMap->GetSelectedLight()->Color() );
|
||||
@@ -579,7 +579,7 @@ void MapEditor::OnBlueChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Blue = (Uint8)mUIBlueSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIBlueTxt->text( String::toStr( (Uint32)mUIBlueSlider->value() ) );
|
||||
mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->value() ) );
|
||||
|
||||
if ( NULL != mUIMap->GetSelectedLight() ) {
|
||||
RGB lCol( mUIMap->GetSelectedLight()->Color() );
|
||||
@@ -645,17 +645,17 @@ void MapEditor::UpdateFlags() {
|
||||
}
|
||||
|
||||
void MapEditor::OnTypeChange( const UIEvent * Event ) {
|
||||
if ( mGOTypeList->text() == "SubTexture" )
|
||||
if ( mGOTypeList->getText() == "SubTexture" )
|
||||
mCurGOType = GAMEOBJECT_TYPE_SUBTEXTURE;
|
||||
else if ( mGOTypeList->text() == "SubTextureEx" )
|
||||
else if ( mGOTypeList->getText() == "SubTextureEx" )
|
||||
mCurGOType = GAMEOBJECT_TYPE_SUBTEXTUREEX;
|
||||
else if ( mGOTypeList->text() == "Sprite" )
|
||||
else if ( mGOTypeList->getText() == "Sprite" )
|
||||
mCurGOType = GAMEOBJECT_TYPE_SPRITE;
|
||||
else
|
||||
mCurGOType = String::hash( mGOTypeList->text().toUtf8() );
|
||||
mCurGOType = String::hash( mGOTypeList->getText().toUtf8() );
|
||||
|
||||
if ( NULL != mChkAnim && NULL != mGOTypeList && mChkAnim->active() && mGOTypeList->text() != "Sprite" ) {
|
||||
if ( mGOTypeList->text() == "SubTexture" || mGOTypeList->text() == "SubTextureEx" ) {
|
||||
if ( NULL != mChkAnim && NULL != mGOTypeList && mChkAnim->active() && mGOTypeList->getText() != "Sprite" ) {
|
||||
if ( mGOTypeList->getText() == "SubTexture" || mGOTypeList->getText() == "SubTextureEx" ) {
|
||||
mChkAnim->active( false );
|
||||
}
|
||||
}
|
||||
@@ -687,7 +687,7 @@ void MapEditor::ChkClickAutoFix( const UIEvent * Event ) {
|
||||
void MapEditor::ChkClickAnimated( const UIEvent * Event ) {
|
||||
UpdateFlags();
|
||||
|
||||
if ( mChkAnim->active() && ( mGOTypeList->text() == "SubTexture" || mGOTypeList->text() == "SubTextureEx" ) ) {
|
||||
if ( mChkAnim->active() && ( mGOTypeList->getText() == "SubTexture" || mGOTypeList->getText() == "SubTextureEx" ) ) {
|
||||
mGOTypeList->getListBox()->setSelected( "Sprite" );
|
||||
}
|
||||
}
|
||||
@@ -701,7 +701,7 @@ void MapEditor::OnNewGOTypeAdded( std::string name, Uint32 hash ) {
|
||||
for ( Uint32 i = 0; i < mGOTypeList->getListBox()->count(); i++ ) {
|
||||
UIListBoxItem * Item = mGOTypeList->getListBox()->getItem(i);
|
||||
|
||||
if ( Item->text() == name )
|
||||
if ( Item->getText() == name )
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -737,7 +737,7 @@ void MapEditor::FillSGCombo() {
|
||||
|
||||
void MapEditor::FillSubTextureList() {
|
||||
TextureAtlasManager * SGM = TextureAtlasManager::instance();
|
||||
mCurSG = SGM->getByName( mTextureAtlasesList->text() );
|
||||
mCurSG = SGM->getByName( mTextureAtlasesList->getText() );
|
||||
std::list<SubTexture*>& Res = mCurSG->getResources();
|
||||
|
||||
mSubTextureList->clear();
|
||||
@@ -1160,7 +1160,7 @@ void MapEditor::OnLayerAdd( UIMapLayerNew * UILayer ) {
|
||||
}
|
||||
|
||||
void MapEditor::OnLayerSelect( const UIEvent * Event ) {
|
||||
MapLayer * tLayer = mUIMap->Map()->GetLayer( mLayerList->text() );
|
||||
MapLayer * tLayer = mUIMap->Map()->GetLayer( mLayerList->getText() );
|
||||
|
||||
if ( NULL != tLayer ) {
|
||||
mCurLayer = tLayer;
|
||||
@@ -1208,7 +1208,7 @@ GameObject * MapEditor::CreateGameObject() {
|
||||
//! Creates an empty game object. The client will interpret the GameObject Type, and instanciate the corresponding class.
|
||||
|
||||
if ( mChkDI->active() )
|
||||
tObj = eeNew( GameObjectVirtual, ( String::hash( mDataIdInput->text().toUtf8() ), mCurLayer, mCurGOFlags, mCurGOType ) );
|
||||
tObj = eeNew( GameObjectVirtual, ( String::hash( mDataIdInput->getText().toUtf8() ), mCurLayer, mCurGOFlags, mCurGOType ) );
|
||||
else
|
||||
tObj = eeNew( GameObjectVirtual, ( mGfxPreview->subTexture(), mCurLayer, mCurGOFlags, mCurGOType ) );
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
|
||||
UITextBox * Txt = mUITheme->createTextBox( "Layer name:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE );
|
||||
mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 );
|
||||
mUIInput->text( mLayer->Name() );
|
||||
mUIInput->setText( mLayer->Name() );
|
||||
mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapLayerProperties::OKClick ) );
|
||||
|
||||
Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER;
|
||||
@@ -48,7 +48,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
|
||||
UIGenericGrid::CreateParams GridParams;
|
||||
GridParams.setParent( mUIWindow->getContainer() );
|
||||
GridParams.setPos( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() );
|
||||
GridParams.setPosition( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() );
|
||||
GridParams.setSize( 400, 350 );
|
||||
GridParams.Flags = UI_AUTO_PADDING;
|
||||
GridParams.RowHeight = 24;
|
||||
@@ -96,8 +96,8 @@ void MapLayerProperties::SaveProperties() {
|
||||
UITextInput * Input = reinterpret_cast<UITextInput*>( Cell->cell( 1 ) );
|
||||
UITextInput * Input2 = reinterpret_cast<UITextInput*>( Cell->cell( 3 ) );
|
||||
|
||||
if ( NULL != Cell && Input->text().size() && Input2->text().size() ) {
|
||||
mLayer->AddProperty( Input->text(), Input2->text() );
|
||||
if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) {
|
||||
mLayer->AddProperty( Input->getText(), Input2->getText() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,8 +111,8 @@ void MapLayerProperties::LoadProperties() {
|
||||
UITextInput * Input = reinterpret_cast<UITextInput*>( Cell->cell( 1 ) );
|
||||
UITextInput * Input2 = reinterpret_cast<UITextInput*>( Cell->cell( 3 ) );
|
||||
|
||||
Input->text( it->first );
|
||||
Input2->text( it->second );
|
||||
Input->setText( it->first );
|
||||
Input2->setText( it->second );
|
||||
|
||||
mGenGrid->add( Cell );
|
||||
}
|
||||
@@ -121,7 +121,7 @@ void MapLayerProperties::LoadProperties() {
|
||||
void MapLayerProperties::OKClick( const UIEvent * Event ) {
|
||||
SaveProperties();
|
||||
|
||||
mLayer->Name( mUIInput->text().toUtf8() );
|
||||
mLayer->Name( mUIInput->getText().toUtf8() );
|
||||
|
||||
if ( mRefreshCb.IsSet() ) {
|
||||
mRefreshCb();
|
||||
|
||||
@@ -28,12 +28,12 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
|
||||
UITextBox * Txt = mUITheme->createTextBox( "Object name:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE );
|
||||
mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 );
|
||||
mUIInput->text( mObj->Name() );
|
||||
mUIInput->setText( mObj->Name() );
|
||||
mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) );
|
||||
|
||||
UITextBox * Txt2 = mUITheme->createTextBox( "Object type:", mUIWindow->getContainer(), Sizei(), Vector2i( 50+192, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE );
|
||||
mUIInput2 = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt2->getPosition().x + DistFromTitle, Txt2->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 );
|
||||
mUIInput2->text( mObj->TypeName() );
|
||||
mUIInput2->setText( mObj->TypeName() );
|
||||
mUIInput2->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) );
|
||||
|
||||
Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER;
|
||||
@@ -52,7 +52,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
|
||||
UIGenericGrid::CreateParams GridParams;
|
||||
GridParams.setParent( mUIWindow->getContainer() );
|
||||
GridParams.setPos( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() );
|
||||
GridParams.setPosition( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() );
|
||||
GridParams.setSize( 400, 350 );
|
||||
GridParams.Flags = UI_AUTO_PADDING;
|
||||
GridParams.RowHeight = 24;
|
||||
@@ -100,8 +100,8 @@ void MapObjectProperties::SaveProperties() {
|
||||
UITextInput * Input = reinterpret_cast<UITextInput*>( Cell->cell( 1 ) );
|
||||
UITextInput * Input2 = reinterpret_cast<UITextInput*>( Cell->cell( 3 ) );
|
||||
|
||||
if ( NULL != Cell && Input->text().size() && Input2->text().size() ) {
|
||||
mObj->AddProperty( Input->text(), Input2->text() );
|
||||
if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) {
|
||||
mObj->AddProperty( Input->getText(), Input2->getText() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,8 +115,8 @@ void MapObjectProperties::LoadProperties() {
|
||||
UITextInput * Input = reinterpret_cast<UITextInput*>( Cell->cell( 1 ) );
|
||||
UITextInput * Input2 = reinterpret_cast<UITextInput*>( Cell->cell( 3 ) );
|
||||
|
||||
Input->text( it->first );
|
||||
Input2->text( it->second );
|
||||
Input->setText( it->first );
|
||||
Input2->setText( it->second );
|
||||
|
||||
mGenGrid->add( Cell );
|
||||
}
|
||||
@@ -125,8 +125,8 @@ void MapObjectProperties::LoadProperties() {
|
||||
void MapObjectProperties::OKClick( const UIEvent * Event ) {
|
||||
SaveProperties();
|
||||
|
||||
mObj->Name( mUIInput->text().toUtf8() );
|
||||
mObj->TypeName( mUIInput2->text().toUtf8() );
|
||||
mObj->Name( mUIInput->getText().toUtf8() );
|
||||
mObj->TypeName( mUIInput2->getText().toUtf8() );
|
||||
|
||||
mUIWindow->CloseWindow();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
|
||||
UIComplexControl::CreateParams ComParams;
|
||||
ComParams.setParent( mUIWindow->getContainer() );
|
||||
ComParams.setPos( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
ComParams.setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
ComParams.setSize( 64, 64 );
|
||||
ComParams.Background.setColor( mMap->BaseColor() );
|
||||
ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) );
|
||||
@@ -82,7 +82,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
|
||||
UIGenericGrid::CreateParams GridParams;
|
||||
GridParams.setParent( mUIWindow->getContainer() );
|
||||
GridParams.setPos( 50, TxtBox->getPosition().y + 20 );
|
||||
GridParams.setPosition( 50, TxtBox->getPosition().y + 20 );
|
||||
GridParams.setSize( 400, 400 - DiffIfLights );
|
||||
GridParams.Flags = UI_AUTO_PADDING;
|
||||
GridParams.RowHeight = 24;
|
||||
@@ -125,7 +125,7 @@ void TileMapProperties::OnRedChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Red = (Uint8)mUIRedSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIRedTxt->text( String::toStr( (Int32)mUIRedSlider->value() ) );
|
||||
mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->value() ) );
|
||||
|
||||
ColorA MapCol = mMap->BaseColor();
|
||||
MapCol.Red = Col.Red;
|
||||
@@ -136,7 +136,7 @@ void TileMapProperties::OnGreenChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Green = (Uint8)mUIGreenSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIGreenTxt->text( String::toStr( (Uint32)mUIGreenSlider->value() ) );
|
||||
mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->value() ) );
|
||||
|
||||
ColorA MapCol = mMap->BaseColor();
|
||||
MapCol.Green = Col.Green;
|
||||
@@ -147,7 +147,7 @@ void TileMapProperties::OnBlueChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Blue = (Uint8)mUIBlueSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIBlueTxt->text( String::toStr( (Uint32)mUIBlueSlider->value() ) );
|
||||
mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->value() ) );
|
||||
|
||||
ColorA MapCol = mMap->BaseColor();
|
||||
MapCol.Blue = Col.Blue;
|
||||
@@ -164,8 +164,8 @@ void TileMapProperties::SaveProperties() {
|
||||
UITextInput * Input = reinterpret_cast<UITextInput*>( Cell->cell( 1 ) );
|
||||
UITextInput * Input2 = reinterpret_cast<UITextInput*>( Cell->cell( 3 ) );
|
||||
|
||||
if ( NULL != Cell && Input->text().size() && Input2->text().size() ) {
|
||||
mMap->AddProperty( Input->text(), Input2->text() );
|
||||
if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) {
|
||||
mMap->AddProperty( Input->getText(), Input2->getText() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,8 +179,8 @@ void TileMapProperties::LoadProperties() {
|
||||
UITextInput * Input = reinterpret_cast<UITextInput*>( Cell->cell( 1 ) );
|
||||
UITextInput * Input2 = reinterpret_cast<UITextInput*>( Cell->cell( 3 ) );
|
||||
|
||||
Input->text( it->first );
|
||||
Input2->text( it->second );
|
||||
Input->setText( it->first );
|
||||
Input2->setText( it->second );
|
||||
|
||||
mGenGrid->add( Cell );
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ UIGOTypeNew::~UIGOTypeNew() {
|
||||
}
|
||||
|
||||
void UIGOTypeNew::OKClick( const UIEvent * Event ) {
|
||||
if ( mUIInput->text().size() ) {
|
||||
if ( mUIInput->getText().size() ) {
|
||||
if ( mCb.IsSet() )
|
||||
mCb( mUIInput->text().toUtf8(), String::hash( mUIInput->text().toUtf8() ) );
|
||||
mCb( mUIInput->getText().toUtf8(), String::hash( mUIInput->getText().toUtf8() ) );
|
||||
}
|
||||
|
||||
mUIWindow->CloseWindow();
|
||||
|
||||
@@ -337,7 +337,7 @@ Uint32 UIMap::onMouseMove( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
|
||||
if ( mLastMouseTilePos != mp ) {
|
||||
mLastMouseTilePos = mp;
|
||||
mTileBox->text( String::toStr( mp.x ) + "," + String::toStr( mp.y ) );
|
||||
mTileBox->setText( String::toStr( mp.x ) + "," + String::toStr( mp.y ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay
|
||||
UITextBox * Txt = mTheme->createTextBox( "Layer Name", mUIWindow->getContainer(), Sizei(), Vector2i( 16, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE );
|
||||
|
||||
mUILayerName = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 );
|
||||
mUILayerName->text( "Layer " + String::toStr( mUIMap->Map()->LayerCount() + 1 ) );
|
||||
mUILayerName->setText( "Layer " + String::toStr( mUIMap->Map()->LayerCount() + 1 ) );
|
||||
|
||||
UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "add" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
@@ -64,8 +64,8 @@ void UIMapLayerNew::OnKeyUp( const UIEvent * Event ) {
|
||||
}
|
||||
|
||||
void UIMapLayerNew::OKClick( const UIEvent * Event ) {
|
||||
if ( mUILayerName->text().size() ) {
|
||||
mLayer = mUIMap->Map()->AddLayer( mType, LAYER_FLAG_VISIBLE | LAYER_FLAG_LIGHTS_ENABLED, mUILayerName->text() );
|
||||
if ( mUILayerName->getText().size() ) {
|
||||
mLayer = mUIMap->Map()->AddLayer( mType, LAYER_FLAG_VISIBLE | LAYER_FLAG_LIGHTS_ENABLED, mUILayerName->getText() );
|
||||
|
||||
if ( mNewLayerCb.IsSet() )
|
||||
mNewLayerCb( this );
|
||||
@@ -91,7 +91,7 @@ UITextInput * UIMapLayerNew::UILayerName() const {
|
||||
}
|
||||
|
||||
const String& UIMapLayerNew::Name() const {
|
||||
return mUILayerName->text();
|
||||
return mUILayerName->getText();
|
||||
}
|
||||
|
||||
MapLayer * UIMapLayerNew::Layer() const {
|
||||
|
||||
@@ -77,7 +77,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
Txt = mTheme->createTextBox( "Map Flags:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x, mUIMapMaxLayers->getPosition().y + mUIMapMaxLayers->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE );
|
||||
|
||||
mUILightsEnabled = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + Txt->getSize().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE );
|
||||
mUILightsEnabled->text( "Lights Enabled" );
|
||||
mUILightsEnabled->setText( "Lights Enabled" );
|
||||
mUILightsEnabled->active( true );
|
||||
|
||||
if ( ResizeMap ) {
|
||||
@@ -85,7 +85,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
}
|
||||
|
||||
mUILightsByVertex = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, mUILightsEnabled->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE );
|
||||
mUILightsByVertex->text( "Lights By Vertex" );
|
||||
mUILightsByVertex->setText( "Lights By Vertex" );
|
||||
mUILightsByVertex->active( true );
|
||||
|
||||
if ( ResizeMap ) {
|
||||
@@ -93,7 +93,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
}
|
||||
|
||||
mUIClampBorders = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x + DistFromTitle, mUILightsEnabled->getPosition().y + mUILightsEnabled->getSize().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE );
|
||||
mUIClampBorders->text( "Clamp Borders" );
|
||||
mUIClampBorders->setText( "Clamp Borders" );
|
||||
mUIClampBorders->active( true );
|
||||
|
||||
if ( ResizeMap ) {
|
||||
@@ -101,7 +101,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
}
|
||||
|
||||
mUIClipArea = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, mUIClampBorders->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE );
|
||||
mUIClipArea->text( "Clip View Area" );
|
||||
mUIClipArea->setText( "Clip View Area" );
|
||||
mUIClipArea->active( true );
|
||||
|
||||
if ( ResizeMap ) {
|
||||
@@ -112,7 +112,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
|
||||
UIComplexControl::CreateParams ComParams;
|
||||
ComParams.setParent( mUIWindow->getContainer() );
|
||||
ComParams.setPos( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
ComParams.setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
ComParams.setSize( 64, 64 );
|
||||
ComParams.Background.setColor( ColorA( 255, 255, 255, 255 ) );
|
||||
|
||||
@@ -186,21 +186,21 @@ void UIMapNew::OnRedChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Red = (Uint8)mUIRedSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIRedTxt->text( String::toStr( (Int32)mUIRedSlider->value() ) );
|
||||
mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->value() ) );
|
||||
}
|
||||
|
||||
void UIMapNew::OnGreenChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Green = (Uint8)mUIGreenSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIGreenTxt->text( String::toStr( (Uint32)mUIGreenSlider->value() ) );
|
||||
mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->value() ) );
|
||||
}
|
||||
|
||||
void UIMapNew::OnBlueChange( const UIEvent * Event ) {
|
||||
ColorA Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.Blue = (Uint8)mUIBlueSlider->value();
|
||||
mUIBaseColor->getBackground()->setColor( Col );
|
||||
mUIBlueTxt->text( String::toStr( (Uint32)mUIBlueSlider->value() ) );
|
||||
mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->value() ) );
|
||||
}
|
||||
|
||||
void UIMapNew::OKClick( const UIEvent * Event ) {
|
||||
|
||||
@@ -111,7 +111,7 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos
|
||||
|
||||
UIComplexControl::CreateParams Params;
|
||||
Params.setParent( mUIContainer );
|
||||
Params.setPos( 0, mWinMenu->getSize().getHeight() );
|
||||
Params.setPosition( 0, mWinMenu->getSize().getHeight() );
|
||||
Params.setSize( 800, 600 );
|
||||
Params.Background.setColor( ColorA( 0, 0, 0, 50 ) );
|
||||
Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT | UI_CLIP_ENABLE | UI_BORDER | UI_FILL_BACKGROUND;
|
||||
|
||||
@@ -88,7 +88,7 @@ void TextureAtlasNew::okClick( const UIEvent * Event ) {
|
||||
const UIEventMouse * MouseEvent = reinterpret_cast<const UIEventMouse*>( Event );
|
||||
|
||||
if ( MouseEvent->getFlags() & EE_BUTTON_LMASK ) {
|
||||
std::string ext( mSaveFileType->text() );
|
||||
std::string ext( mSaveFileType->getText() );
|
||||
String::toLowerInPlace( ext );
|
||||
|
||||
UICommonDialog * TGDialog = mTheme->createCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*." + ext );
|
||||
@@ -122,14 +122,14 @@ void TextureAtlasNew::textureAtlasSave( const UIEvent * Event ) {
|
||||
|
||||
if ( !FileSystem::isDirectory( FPath ) ) {
|
||||
Int32 w = 0, h = 0, b;
|
||||
bool Res1 = String::fromString<Int32>( w, mComboWidth->text() );
|
||||
bool Res2 = String::fromString<Int32>( h, mComboHeight->text() );
|
||||
bool Res1 = String::fromString<Int32>( w, mComboWidth->getText() );
|
||||
bool Res2 = String::fromString<Int32>( h, mComboHeight->getText() );
|
||||
b = static_cast<Int32>( mPixelSpace->value() );
|
||||
|
||||
if ( Res1 && Res2 ) {
|
||||
Graphics::TexturePacker * TexturePacker = eeNew( Graphics::TexturePacker, ( w, h, false, b ) );
|
||||
|
||||
TexturePacker->addTexturesPath( mTGPath->text() );
|
||||
TexturePacker->addTexturesPath( mTGPath->getText() );
|
||||
|
||||
TexturePacker->packTextures();
|
||||
|
||||
@@ -138,7 +138,7 @@ void TextureAtlasNew::textureAtlasSave( const UIEvent * Event ) {
|
||||
if ( !IsValidExtension( ext ) ) {
|
||||
FPath = FileSystem::fileRemoveExtension( FPath );
|
||||
|
||||
ext = mSaveFileType->text();
|
||||
ext = mSaveFileType->getText();
|
||||
|
||||
String::toLowerInPlace( ext );
|
||||
|
||||
@@ -198,7 +198,7 @@ void TextureAtlasNew::onSelectFolder( const UIEvent * Event ) {
|
||||
|
||||
//! All OK
|
||||
if ( count ) {
|
||||
mTGPath->text( FPath );
|
||||
mTGPath->setText( FPath );
|
||||
} else {
|
||||
MsgBox = mTheme->createMessageBox( MSGBOX_OK, "The folder must contain at least one image!" );
|
||||
MsgBox->setTitle( "Error" );
|
||||
|
||||
@@ -12,7 +12,7 @@ UICheckBox::UICheckBox( const UITextBox::CreateParams& Params ) :
|
||||
UIControlAnim::CreateParams ButtonParams( Params );
|
||||
|
||||
ButtonParams.setParent( this );
|
||||
ButtonParams.setPos( Vector2i( 0, 0 ) );
|
||||
ButtonParams.setPosition( Vector2i( 0, 0 ) );
|
||||
ButtonParams.Size = Sizei( 16, 16 );
|
||||
|
||||
mActiveButton = eeNew( UIControlAnim, ( ButtonParams ) );
|
||||
@@ -23,7 +23,7 @@ UICheckBox::UICheckBox( const UITextBox::CreateParams& Params ) :
|
||||
mInactiveButton->setVisible( true );
|
||||
mInactiveButton->setEnabled( true );
|
||||
|
||||
padding( Recti(0,0,0,0) );
|
||||
setPadding( Recti(0,0,0,0) );
|
||||
|
||||
applyDefaultTheme();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void UICheckBox::doAftersetTheme() {
|
||||
}
|
||||
}
|
||||
|
||||
padding( Recti(0,0,0,0) );
|
||||
setPadding( Recti(0,0,0,0) );
|
||||
}
|
||||
|
||||
void UICheckBox::autoSize() {
|
||||
@@ -139,7 +139,7 @@ const bool& UICheckBox::isActive() const {
|
||||
return active();
|
||||
}
|
||||
|
||||
void UICheckBox::padding( const Recti& padding ) {
|
||||
void UICheckBox::setPadding( const Recti& padding ) {
|
||||
mPadding = padding;
|
||||
mPadding.Left = mPadding.Left + mActiveButton->getSize().getWidth();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ void UIComboBox::createButton() {
|
||||
UIControl::CreateParams Params;
|
||||
Params.setParent( this ),
|
||||
Params.Size = Sizei( btnWidth, mSize.getHeight() );
|
||||
Params.setPos( mSize.getWidth() - btnWidth, 0 );
|
||||
Params.setPosition( mSize.getWidth() - btnWidth, 0 );
|
||||
mButton = eeNew( UIControl, ( Params ) );
|
||||
mButton->setVisible( true );
|
||||
mButton->setEnabled( true );
|
||||
@@ -79,9 +79,9 @@ void UIComboBox::onButtonExit( const UIEvent * Event ) {
|
||||
setSkinState( UISkinState::StateMouseExit );
|
||||
}
|
||||
|
||||
Uint32 UIComboBox::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
Uint32 UIComboBox::onMouseClick( const Vector2i& position, const Uint32 Flags ) {
|
||||
if ( Flags & EE_BUTTON_LMASK ) {
|
||||
UITextInput::onMouseClick( Pos, Flags );
|
||||
UITextInput::onMouseClick( position, Flags );
|
||||
|
||||
if ( mListBox->isVisible() ) {
|
||||
hide();
|
||||
|
||||
@@ -35,17 +35,17 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) :
|
||||
|
||||
UITextBox::CreateParams TxtBoxParams;
|
||||
TxtBoxParams.setParent( getContainer() );
|
||||
TxtBoxParams.setPos( 6, 13 );
|
||||
TxtBoxParams.setPosition( 6, 13 );
|
||||
TxtBoxParams.Flags |= UI_AUTO_SIZE;
|
||||
UITextBox * TBox = eeNew( UITextBox, ( TxtBoxParams ) );
|
||||
TBox->setVisible( true );
|
||||
TBox->setEnabled( false );
|
||||
TBox->text( "Look in:" );
|
||||
TBox->setText( "Look in:" );
|
||||
|
||||
UIPushButton::CreateParams ButtonParams;
|
||||
ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE;
|
||||
ButtonParams.setParent( getContainer() );
|
||||
ButtonParams.setPos( getContainer()->getSize().getWidth() - 86, getContainer()->getSize().getHeight() - 24 );
|
||||
ButtonParams.setPosition( getContainer()->getSize().getWidth() - 86, getContainer()->getSize().getHeight() - 24 );
|
||||
ButtonParams.setSize( 80, 22 );
|
||||
mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) );
|
||||
mButtonCancel->setVisible( true );
|
||||
@@ -54,7 +54,7 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) :
|
||||
mButtonCancel->setPosition( Vector2i( mButtonCancel->getPosition().x, getContainer()->getSize().getHeight() - mButtonCancel->getSize().getHeight() - 2 ) );
|
||||
mButtonCancel->updateAnchorsDistances();
|
||||
|
||||
ButtonParams.setPos( mButtonCancel->getPosition().x, mButtonCancel->getPosition().y - mButtonCancel->getSize().getHeight() );
|
||||
ButtonParams.setPosition( mButtonCancel->getPosition().x, mButtonCancel->getPosition().y - mButtonCancel->getSize().getHeight() );
|
||||
mButtonOpen = eeNew( UIPushButton, ( ButtonParams ) );
|
||||
mButtonOpen->setVisible( true );
|
||||
mButtonOpen->setEnabled( true );
|
||||
@@ -67,15 +67,15 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) :
|
||||
UITextInput::CreateParams TInputParams;
|
||||
TInputParams.setParent( getContainer() );
|
||||
TInputParams.Flags = UI_AUTO_PADDING | UI_CLIP_ENABLE | UI_ANCHOR_RIGHT | UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_VALIGN_CENTER | UI_TEXT_SELECTION_ENABLED;
|
||||
TInputParams.setPos( 70, 6 );
|
||||
TInputParams.setPosition( 70, 6 );
|
||||
TInputParams.setSize( getContainer()->getSize().getWidth() - TInputParams.Pos.x - 42, 22 );
|
||||
mPath = eeNew( UITextInput, ( TInputParams ) );
|
||||
mPath->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressEnter ) );
|
||||
mPath->setVisible( true );
|
||||
mPath->setEnabled( true );
|
||||
mPath->text( mCurPath );
|
||||
mPath->setText( mCurPath );
|
||||
|
||||
ButtonParams.setPos( TInputParams.Pos.x + TInputParams.Size.getWidth() + 6, TInputParams.Pos.y );
|
||||
ButtonParams.setPosition( TInputParams.Pos.x + TInputParams.Size.getWidth() + 6, TInputParams.Pos.y );
|
||||
ButtonParams.setSize( 24, 22 );
|
||||
ButtonParams.Flags |= UI_ANCHOR_TOP;
|
||||
mButtonUp = eeNew( UIPushButton, ( ButtonParams ) );
|
||||
@@ -85,7 +85,7 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) :
|
||||
|
||||
UIListBox::CreateParams LBParams;
|
||||
LBParams.setParent( getContainer() );
|
||||
LBParams.setPos( 6, mButtonUp->getPosition().y + mButtonUp->getSize().getHeight() + 4 );
|
||||
LBParams.setPosition( 6, mButtonUp->getPosition().y + mButtonUp->getSize().getHeight() + 4 );
|
||||
LBParams.Size = Sizei( getContainer()->getSize().getWidth() - 12,
|
||||
getContainer()->getSize().getHeight() -
|
||||
mButtonUp->getSize().getHeight() -
|
||||
@@ -108,22 +108,22 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) :
|
||||
mList->setVisible( true );
|
||||
mList->setEnabled( true );
|
||||
|
||||
TxtBoxParams.setPos( 6, getContainer()->getSize().getHeight() - 54 );
|
||||
TxtBoxParams.setPosition( 6, getContainer()->getSize().getHeight() - 54 );
|
||||
TxtBoxParams.setSize( 74, 19 );
|
||||
TxtBoxParams.Flags = UI_ANCHOR_LEFT | UI_VALIGN_CENTER;
|
||||
TBox = eeNew( UITextBox, ( TxtBoxParams ) );
|
||||
TBox->setVisible( true );
|
||||
TBox->setEnabled( false );
|
||||
TBox->text( "File Name:" );
|
||||
TBox->setText( "File Name:" );
|
||||
|
||||
TxtBoxParams.setPos( TBox->getPosition().x, TBox->getPosition().y + TBox->getSize().getHeight()+ 6 );
|
||||
TxtBoxParams.setPosition( TBox->getPosition().x, TBox->getPosition().y + TBox->getSize().getHeight()+ 6 );
|
||||
UITextBox * TBox2 = eeNew( UITextBox, ( TxtBoxParams ) );
|
||||
TBox2->setVisible( true );
|
||||
TBox2->setEnabled( false );
|
||||
TBox2->text( "Files of type:" );
|
||||
TBox2->setText( "Files of type:" );
|
||||
|
||||
TInputParams.Flags &= ~UI_ANCHOR_TOP;
|
||||
TInputParams.setPos( TBox->getPosition().x + TBox->getSize().getWidth(), TBox->getPosition().y );
|
||||
TInputParams.setPosition( TBox->getPosition().x + TBox->getSize().getWidth(), TBox->getPosition().y );
|
||||
TInputParams.setSize( getContainer()->getSize().getWidth() - mButtonOpen->getSize().getWidth() - TInputParams.Pos.x - 20, TInputParams.Size.getHeight() );
|
||||
mFile = eeNew( UITextInput, ( TInputParams ) );
|
||||
mFile->setVisible( true );
|
||||
@@ -132,7 +132,7 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) :
|
||||
|
||||
UIDropDownList::CreateParams DDLParams;
|
||||
DDLParams.setParent( getContainer() );
|
||||
DDLParams.setPos( TBox2->getPosition().x + TBox2->getSize().getWidth(), TBox2->getPosition().y );
|
||||
DDLParams.setPosition( TBox2->getPosition().x + TBox2->getSize().getWidth(), TBox2->getPosition().y );
|
||||
DDLParams.setSize( getContainer()->getSize().getWidth() - mButtonCancel->getSize().getWidth() - DDLParams.Pos.x - 20, 22 );
|
||||
DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_AUTO_SIZE;
|
||||
DDLParams.PopUpToMainControl = true;
|
||||
@@ -177,8 +177,8 @@ void UICommonDialog::refreshFolder() {
|
||||
bool accepted;
|
||||
Uint32 i, z;
|
||||
|
||||
if ( "*" != mFiletype->text() ) {
|
||||
patterns = String::split( mFiletype->text().toUtf8(), ';' );
|
||||
if ( "*" != mFiletype->getText() ) {
|
||||
patterns = String::split( mFiletype->getText().toUtf8(), ';' );
|
||||
|
||||
for ( i = 0; i < patterns.size(); i++ )
|
||||
patterns[i] = FileSystem::fileExtension( patterns[i] );
|
||||
@@ -264,7 +264,7 @@ Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
CloseWindow();
|
||||
} else if ( Msg->getSender() == mButtonUp ) {
|
||||
mCurPath = FileSystem::removeLastFolderFromPath( mCurPath );
|
||||
mPath->text( mCurPath );
|
||||
mPath->setText( mCurPath );
|
||||
refreshFolder();
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
|
||||
if ( FileSystem::isDirectory( newPath ) ) {
|
||||
mCurPath = newPath + FileSystem::getOSlash();
|
||||
mPath->text( mCurPath );
|
||||
mPath->setText( mCurPath );
|
||||
refreshFolder();
|
||||
} else {
|
||||
open();
|
||||
@@ -294,15 +294,15 @@ Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
if ( Msg->getSender() == mList ) {
|
||||
if ( !isSaveDialog() ) {
|
||||
if ( allowFolderSelect() ) {
|
||||
mFile->text( mList->getItemSelectedText() );
|
||||
mFile->setText( mList->getItemSelectedText() );
|
||||
} else {
|
||||
if ( !FileSystem::isDirectory( getTempFullPath() ) ) {
|
||||
mFile->text( mList->getItemSelectedText() );
|
||||
mFile->setText( mList->getItemSelectedText() );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( !FileSystem::isDirectory( getTempFullPath() ) ) {
|
||||
mFile->text( mList->getItemSelectedText() );
|
||||
mFile->setText( mList->getItemSelectedText() );
|
||||
}
|
||||
}
|
||||
} else if ( Msg->getSender() == mFiletype ) {
|
||||
@@ -343,11 +343,11 @@ void UICommonDialog::open() {
|
||||
}
|
||||
|
||||
void UICommonDialog::onPressEnter( const UIEvent * Event ) {
|
||||
if ( FileSystem::isDirectory( mPath->text() ) ) {
|
||||
std::string tpath = mPath->text();
|
||||
if ( FileSystem::isDirectory( mPath->getText() ) ) {
|
||||
std::string tpath = mPath->getText();
|
||||
FileSystem::dirPathAddSlashAtEnd( tpath );
|
||||
mPath->text( tpath );
|
||||
mCurPath = mPath->text();
|
||||
mPath->setText( tpath );
|
||||
mCurPath = mPath->getText();
|
||||
refreshFolder();
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ std::string UICommonDialog::getCurPath() const {
|
||||
|
||||
std::string UICommonDialog::getCurFile() const {
|
||||
if ( mCDLFlags & CDL_FLAG_SAVE_DIALOG )
|
||||
return mFile->text();
|
||||
return mFile->getText();
|
||||
|
||||
return mList->getItemSelectedText().toUtf8();
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ void UIComplexControl::tooltipRemove() {
|
||||
mTooltip = NULL;
|
||||
}
|
||||
|
||||
void UIComplexControl::setSize( const Sizei &Size ) {
|
||||
Sizei s( Size );
|
||||
void UIComplexControl::setSize( const Sizei& size ) {
|
||||
Sizei s( size );
|
||||
|
||||
if ( s.x < mMinControlSize.x )
|
||||
s.x = mMinControlSize.x;
|
||||
|
||||
@@ -21,7 +21,7 @@ UIdefaultTheme::UIdefaultTheme( const std::string& Name, const std::string& Abbr
|
||||
UIPopUpMenu * UIdefaultTheme::createPopUpMenu( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 RowHeight, Recti PaddingContainer, Uint32 MinWidth, Uint32 MinSpaceForIcons, Uint32 MinRightMargin ) {
|
||||
UIPopUpMenu::CreateParams MenuParams;
|
||||
MenuParams.setParent( Parent );
|
||||
MenuParams.setPos( Pos );
|
||||
MenuParams.setPosition( Pos );
|
||||
MenuParams.setSize( Size );
|
||||
MenuParams.Flags = Flags;
|
||||
MenuParams.RowHeight = RowHeight;
|
||||
@@ -43,7 +43,7 @@ UIPopUpMenu * UIdefaultTheme::createPopUpMenu( UIControl * Parent, const Sizei&
|
||||
UIProgressBar * UIdefaultTheme::createProgressBar( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool DisplayPercent, bool VerticalExpand, Vector2f MovementSpeed, Rectf FillerMargin ) {
|
||||
UIProgressBar::CreateParams PBParams;
|
||||
PBParams.setParent( Parent );
|
||||
PBParams.setPos( Pos );
|
||||
PBParams.setPosition( Pos );
|
||||
PBParams.setSize( Size );
|
||||
PBParams.Flags = Flags;
|
||||
PBParams.DisplayPercent = DisplayPercent;
|
||||
@@ -68,7 +68,7 @@ UIProgressBar * UIdefaultTheme::createProgressBar( UIControl * Parent, const Siz
|
||||
UIWinMenu * UIdefaultTheme::createWinMenu( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 MarginBetweenButtons, Uint32 ButtonMargin, Uint32 MenuHeight, Uint32 FirstButtonMargin ) {
|
||||
UIWinMenu::CreateParams WinMenuParams;
|
||||
WinMenuParams.setParent( Parent );
|
||||
WinMenuParams.setPos( Pos );
|
||||
WinMenuParams.setPosition( Pos );
|
||||
WinMenuParams.setSize( Size );
|
||||
WinMenuParams.Flags = Flags;
|
||||
WinMenuParams.MarginBetweenButtons = MarginBetweenButtons;
|
||||
@@ -89,7 +89,7 @@ UIWinMenu * UIdefaultTheme::createWinMenu( UIControl * Parent, const Sizei& Size
|
||||
UIWindow * UIdefaultTheme::createWindow( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 WinFlags, Sizei MinWindowSize, Uint8 BaseAlpha ) {
|
||||
UIWindow::CreateParams WinParams;
|
||||
WinParams.setParent( Parent );
|
||||
WinParams.setPos( Pos );
|
||||
WinParams.setPosition( Pos );
|
||||
WinParams.setSize( Size );
|
||||
WinParams.Flags = Flags;
|
||||
WinParams.WinFlags = WinFlags;
|
||||
@@ -109,7 +109,7 @@ UIWindow * UIdefaultTheme::createWindow( UIControl * Parent, const Sizei& Size,
|
||||
UICommonDialog * UIdefaultTheme::createCommonDialog( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 WinFlags, Sizei MinWindowSize, Uint8 BaseAlpha, Uint32 CDLFlags, std::string DefaultFilePattern, std::string DefaultDirectory ) {
|
||||
UICommonDialog::CreateParams DLGParams;
|
||||
DLGParams.setParent( Parent );
|
||||
DLGParams.setPos( Pos );
|
||||
DLGParams.setPosition( Pos );
|
||||
DLGParams.setSize( Size );
|
||||
DLGParams.Flags = Flags;
|
||||
DLGParams.WinFlags = WinFlags;
|
||||
@@ -132,7 +132,7 @@ UICommonDialog * UIdefaultTheme::createCommonDialog( UIControl * Parent, const S
|
||||
UIMessageBox * UIdefaultTheme::createMessageBox( UI_MSGBOX_TYPE Type, const String& Message, Uint32 WinFlags, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Sizei MinWindowSize, Uint8 BaseAlpha ) {
|
||||
UIMessageBox::CreateParams MsgBoxParams;
|
||||
MsgBoxParams.setParent( Parent );
|
||||
MsgBoxParams.setPos( Pos );
|
||||
MsgBoxParams.setPosition( Pos );
|
||||
MsgBoxParams.setSize( Size );
|
||||
MsgBoxParams.Flags = Flags;
|
||||
MsgBoxParams.WinFlags = WinFlags;
|
||||
@@ -154,7 +154,7 @@ UIMessageBox * UIdefaultTheme::createMessageBox( UI_MSGBOX_TYPE Type, const Stri
|
||||
UIComboBox * UIdefaultTheme::createComboBox( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, UIListBox * ListBox ) {
|
||||
UIComboBox::CreateParams ComboParams;
|
||||
ComboParams.setParent( Parent );
|
||||
ComboParams.setPos( Pos );
|
||||
ComboParams.setPosition( Pos );
|
||||
ComboParams.setSize( Size );
|
||||
ComboParams.Flags = Flags;
|
||||
ComboParams.MinNumVisibleItems = MinNumVisibleItems;
|
||||
@@ -174,7 +174,7 @@ UIComboBox * UIdefaultTheme::createComboBox( UIControl * Parent, const Sizei& Si
|
||||
UIDropDownList * UIdefaultTheme::createDropDownList( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, UIListBox * ListBox ) {
|
||||
UIDropDownList::CreateParams DDLParams;
|
||||
DDLParams.setParent( Parent );
|
||||
DDLParams.setPos( Pos );
|
||||
DDLParams.setPosition( Pos );
|
||||
DDLParams.setSize( Size );
|
||||
DDLParams.Flags = Flags;
|
||||
DDLParams.MinNumVisibleItems = MinNumVisibleItems;
|
||||
@@ -194,7 +194,7 @@ UIDropDownList * UIdefaultTheme::createDropDownList( UIControl * Parent, const S
|
||||
UITabWidget * UIdefaultTheme::createTabWidget( UIControl *Parent, const Sizei &Size, const Vector2i &Pos, const Uint32 &Flags, const bool &TabsClosable, const bool &SpecialBorderTabs, const Int32 &TabSeparation, const Uint32 &MaxTextLength, const Uint32 &TabWidgetHeight, const Uint32 &TabTextAlign, const Uint32 &MinTabWidth, const Uint32 &MaxTabWidth ) {
|
||||
UITabWidget::CreateParams TabWidgetParams;
|
||||
TabWidgetParams.setParent( Parent );
|
||||
TabWidgetParams.setPos( Pos );
|
||||
TabWidgetParams.setPosition( Pos );
|
||||
TabWidgetParams.setSize( Size );
|
||||
TabWidgetParams.Flags = Flags;
|
||||
TabWidgetParams.TabsClosable = TabsClosable;
|
||||
@@ -223,7 +223,7 @@ UITabWidget * UIdefaultTheme::createTabWidget( UIControl *Parent, const Sizei &S
|
||||
UITooltip * UIdefaultTheme::createTooltip( UIControl * TooltipOf, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags ) {
|
||||
UITooltip::CreateParams TooltipParams;
|
||||
TooltipParams.setParent( Parent );
|
||||
TooltipParams.setPos( Pos );
|
||||
TooltipParams.setPosition( Pos );
|
||||
TooltipParams.setSize( Size );
|
||||
TooltipParams.Flags = Flags;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void UIDropDownList::showListBox() {
|
||||
}
|
||||
|
||||
void UIDropDownList::onControlClear( const UIEvent * Event ) {
|
||||
text( "" );
|
||||
setText( "" );
|
||||
}
|
||||
|
||||
void UIDropDownList::onItemKeyDown( const UIEvent * Event ) {
|
||||
@@ -171,7 +171,7 @@ void UIDropDownList::onItemClicked( const UIEvent * Event ) {
|
||||
}
|
||||
|
||||
void UIDropDownList::onItemSelected( const UIEvent * Event ) {
|
||||
text( mListBox->getItemSelectedText() );
|
||||
setText( mListBox->getItemSelectedText() );
|
||||
|
||||
UIMessage Msg( this, UIMessage::MsgSelected, mListBox->getItemSelectedIndex() );
|
||||
messagePost( &Msg );
|
||||
|
||||
@@ -30,7 +30,7 @@ UIGenericGrid::UIGenericGrid( const UIGenericGrid::CreateParams& Params ) :
|
||||
|
||||
UIComplexControl::CreateParams CParams;
|
||||
CParams.setParent( this );
|
||||
CParams.setPos( mPadding.Left, mPadding.Top );
|
||||
CParams.setPosition( mPadding.Left, mPadding.Top );
|
||||
CParams.Size = Sizei( mSize.getWidth() - mPadding.Right - mPadding.Left, mSize.getHeight() - mPadding.Top - mPadding.Bottom );
|
||||
CParams.Flags = Params.Flags;
|
||||
mContainer = eeNew( UIItemContainer<UIGenericGrid> , ( CParams ) );
|
||||
@@ -42,13 +42,13 @@ UIGenericGrid::UIGenericGrid( const UIGenericGrid::CreateParams& Params ) :
|
||||
|
||||
UIScrollBar::CreateParams ScrollBarP;
|
||||
ScrollBarP.setParent ( this );
|
||||
ScrollBarP.setPos ( mSize.getWidth() - 15, 0 );
|
||||
ScrollBarP.setPosition ( mSize.getWidth() - 15, 0 );
|
||||
ScrollBarP.Flags = UI_AUTO_SIZE;
|
||||
ScrollBarP.VerticalScrollBar = true;
|
||||
ScrollBarP.Size = Sizei( 15, mSize.getHeight() );
|
||||
mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) );
|
||||
|
||||
ScrollBarP.setPos ( 0, mSize.getHeight() - 15 );
|
||||
ScrollBarP.setPosition ( 0, mSize.getHeight() - 15 );
|
||||
ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 15 );
|
||||
ScrollBarP.VerticalScrollBar = false;
|
||||
mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) );
|
||||
|
||||
@@ -37,7 +37,7 @@ UIListBox::UIListBox( UIListBox::CreateParams& Params ) :
|
||||
|
||||
UIControl::CreateParams CParams;
|
||||
CParams.setParent( this );
|
||||
CParams.setPos( mPaddingContainer.Left, mPaddingContainer.Top );
|
||||
CParams.setPosition( mPaddingContainer.Left, mPaddingContainer.Top );
|
||||
CParams.Size = Sizei( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Top - mPaddingContainer.Bottom );
|
||||
CParams.Flags = Params.Flags;
|
||||
mContainer = eeNew( UIItemContainer<UIListBox>, ( CParams ) );
|
||||
@@ -50,13 +50,13 @@ UIListBox::UIListBox( UIListBox::CreateParams& Params ) :
|
||||
UIScrollBar::CreateParams ScrollBarP;
|
||||
ScrollBarP.setParent( this );
|
||||
ScrollBarP.Size = Sizei( 15, mSize.getHeight() );
|
||||
ScrollBarP.setPos( mSize.getWidth() - 15, 0 );
|
||||
ScrollBarP.setPosition( mSize.getWidth() - 15, 0 );
|
||||
ScrollBarP.Flags = UI_AUTO_SIZE;
|
||||
ScrollBarP.VerticalScrollBar = true;
|
||||
mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) );
|
||||
|
||||
ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 15 );
|
||||
ScrollBarP.setPos( 0, mSize.getHeight() - 15 );
|
||||
ScrollBarP.setPosition( 0, mSize.getHeight() - 15 );
|
||||
ScrollBarP.VerticalScrollBar = false;
|
||||
mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) );
|
||||
|
||||
@@ -127,7 +127,7 @@ void UIListBox::addListBoxItems( std::vector<String> Texts ) {
|
||||
|
||||
Uint32 UIListBox::addListBoxItem( UIListBoxItem * Item ) {
|
||||
mItems.push_back( Item );
|
||||
mTexts.push_back( Item->text() );
|
||||
mTexts.push_back( Item->getText() );
|
||||
|
||||
if ( Item->getParent() != mContainer )
|
||||
Item->setParent( mContainer );
|
||||
@@ -173,7 +173,7 @@ UIListBoxItem * UIListBox::createListBoxItem( const String& Name ) {
|
||||
TextParams.Font = mFont;
|
||||
TextParams.FontColor = mFontColor;
|
||||
UIListBoxItem * tItem = eeNew( UIListBoxItem, ( TextParams ) );
|
||||
tItem->text( Name );
|
||||
tItem->setText( Name );
|
||||
|
||||
return tItem;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ void UIListBox::removeListBoxItems( std::vector<Uint32> ItemsIndex ) {
|
||||
|
||||
if ( !erase ) {
|
||||
ItemsCpy.push_back( mItems[i] );
|
||||
mTexts.push_back( mItems[i]->text() );
|
||||
mTexts.push_back( mItems[i]->getText() );
|
||||
} else {
|
||||
eeSAFE_DELETE( mItems[i] ); // doesn't call to mItems[i]->Close(); because is not checking for close.
|
||||
}
|
||||
@@ -252,7 +252,7 @@ Uint32 UIListBox::getListBoxItemIndex( const String& Name ) {
|
||||
Uint32 size = (Uint32)mItems.size();
|
||||
|
||||
for ( Uint32 i = 0; i < size; i++ ) {
|
||||
if ( Name == mItems[i]->text() )
|
||||
if ( Name == mItems[i]->getText() )
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ void UIListBox::fontColor( const ColorA& Color ) {
|
||||
mFontColor = Color;
|
||||
|
||||
for ( Uint32 i = 0; i < mItems.size(); i++ )
|
||||
mItems[i]->color( mFontColor );
|
||||
mItems[i]->setColor( mFontColor );
|
||||
}
|
||||
|
||||
const ColorA& UIListBox::fontColor() const {
|
||||
@@ -700,7 +700,7 @@ void UIListBox::font( Graphics::Font * Font ) {
|
||||
mFont = Font;
|
||||
|
||||
for ( Uint32 i = 0; i < mItems.size(); i++ )
|
||||
mItems[i]->font( mFont );
|
||||
mItems[i]->setFont( mFont );
|
||||
|
||||
findMaxWidth();
|
||||
updateListBoxItemsSize();
|
||||
|
||||
@@ -116,11 +116,11 @@ void UIListBoxItem::onStateChange() {
|
||||
}
|
||||
|
||||
if ( mSkinState->getState() == UISkinState::StateSelected ) {
|
||||
color( LBParent->fontSelectedColor() );
|
||||
setColor( LBParent->fontSelectedColor() );
|
||||
} else if ( mSkinState->getState() == UISkinState::StateMouseEnter ) {
|
||||
color( LBParent->fontOverColor() );
|
||||
setColor( LBParent->fontOverColor() );
|
||||
} else {
|
||||
color( LBParent->fontColor() );
|
||||
setColor( LBParent->fontColor() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ void UIManager::init( Uint32 Flags, EE::Window::Window * window ) {
|
||||
|
||||
UIWindow::CreateParams Params;
|
||||
Params.setParent( NULL );
|
||||
Params.setPos( 0, 0 );
|
||||
Params.setPosition( 0, 0 );
|
||||
Params.setSize( Engine::instance()->getWidth(), Engine::instance()->getHeight() );
|
||||
Params.Flags = UI_CONTROL_DEFAULT_FLAGS | UI_REPORT_SIZE_CHANGE_TO_CHILDS;
|
||||
Params.WinFlags = UI_WIN_NO_BORDER | UI_WIN_RESIZEABLE;
|
||||
|
||||
@@ -223,7 +223,7 @@ void UIMenu::SetControlSize( UIControl * Control, const Uint32& Pos ) {
|
||||
Uint32 UIMenu::AddSeparator() {
|
||||
UISeparator::CreateParams Params;
|
||||
Params.setParent( this );
|
||||
Params.setPos( mPadding.Left, mPadding.Top + mNextPosY );
|
||||
Params.setPosition( mPadding.Left, mPadding.Top + mNextPosY );
|
||||
Params.Size = Sizei( mSize.getWidth() - mPadding.Left - mPadding.Right, 3 );
|
||||
|
||||
UISeparator * Control = eeNew( UISeparator, ( Params ) );
|
||||
|
||||
@@ -37,11 +37,11 @@ void UIMenuItem::onStateChange() {
|
||||
UIMenu * tMenu = reinterpret_cast<UIMenu*> ( getParent() );
|
||||
|
||||
if ( mSkinState->getState() == UISkinState::StateSelected ) {
|
||||
mTextBox->color( tMenu->mFontSelectedColor );
|
||||
mTextBox->setColor( tMenu->mFontSelectedColor );
|
||||
} else if ( mSkinState->getState() == UISkinState::StateMouseEnter ) {
|
||||
mTextBox->color( tMenu->mFontOverColor );
|
||||
mTextBox->setColor( tMenu->mFontOverColor );
|
||||
} else {
|
||||
mTextBox->color( tMenu->mFontColor );
|
||||
mTextBox->setColor( tMenu->mFontColor );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) :
|
||||
UIPushButton::CreateParams ButtonParams;
|
||||
ButtonParams.setParent( getContainer() );
|
||||
ButtonParams.setSize( 90, 22 );
|
||||
ButtonParams.setPos( getContainer()->getSize().getWidth() - 96, getContainer()->getSize().getHeight() - ButtonParams.Size.getHeight() - 8 );
|
||||
ButtonParams.setPosition( getContainer()->getSize().getWidth() - 96, getContainer()->getSize().getHeight() - ButtonParams.Size.getHeight() - 8 );
|
||||
ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE;
|
||||
mButtonOK = eeNew( UIPushButton, ( ButtonParams ) );
|
||||
mButtonOK->setVisible( true );
|
||||
@@ -47,7 +47,7 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) :
|
||||
mTextBox = eeNew( UITextBox, ( TxtParams ) );
|
||||
mTextBox->setVisible( true );
|
||||
mTextBox->setEnabled( true );
|
||||
mTextBox->text( Params.Message );
|
||||
mTextBox->setText( Params.Message );
|
||||
|
||||
switch ( mMsgBoxType ) {
|
||||
case MSGBOX_OKCANCEL:
|
||||
|
||||
@@ -16,7 +16,7 @@ UIProgressBar::UIProgressBar( const UIProgressBar::CreateParams& Params ) :
|
||||
|
||||
TxtBoxParams.setParent( this );
|
||||
TxtBoxParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER;
|
||||
TxtBoxParams.setPos( 0, 0 );
|
||||
TxtBoxParams.setPosition( 0, 0 );
|
||||
|
||||
mTextBox = eeNew( UITextBox, ( TxtBoxParams ) );
|
||||
mTextBox->setEnabled( false );
|
||||
@@ -172,7 +172,7 @@ const bool& UIProgressBar::displayPercent() const {
|
||||
void UIProgressBar::updateTextBox() {
|
||||
mTextBox->setVisible( mDisplayPercent );
|
||||
mTextBox->setSize( mSize );
|
||||
mTextBox->text( String::toStr( (Int32)( ( mProgress / mTotalSteps ) * 100.f ) ) + "%" );
|
||||
mTextBox->setText( String::toStr( (Int32)( ( mProgress / mTotalSteps ) * 100.f ) ) + "%" );
|
||||
}
|
||||
|
||||
UITextBox * UIProgressBar::getTextBox() const {
|
||||
|
||||
@@ -90,7 +90,7 @@ void UIPushButton::onSizeChange() {
|
||||
}
|
||||
}
|
||||
|
||||
if ( NULL != mTextBox && 0 == mTextBox->text().size() ) {
|
||||
if ( NULL != mTextBox && 0 == mTextBox->getText().size() ) {
|
||||
mIcon->center();
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ void UIPushButton::setTheme( UITheme * Theme ) {
|
||||
}
|
||||
|
||||
void UIPushButton::doAftersetTheme() {
|
||||
if ( NULL != mTextBox && NULL == mTextBox->font() && NULL != mSkinState && NULL != mSkinState->getSkin() && NULL != mSkinState->getSkin()->theme() && NULL != mSkinState->getSkin()->theme()->font() )
|
||||
mTextBox->font( mSkinState->getSkin()->theme()->font() );
|
||||
if ( NULL != mTextBox && NULL == mTextBox->getFont() && NULL != mSkinState && NULL != mSkinState->getSkin() && NULL != mSkinState->getSkin()->theme() && NULL != mSkinState->getSkin()->theme()->font() )
|
||||
mTextBox->setFont( mSkinState->getSkin()->theme()->font() );
|
||||
|
||||
if ( mControlFlags & UI_CTRL_FLAG_FREE_USE ) {
|
||||
Recti RMargin = makePadding( true, false, false, false, true );
|
||||
@@ -161,20 +161,20 @@ UIGfx * UIPushButton::icon() const {
|
||||
}
|
||||
|
||||
void UIPushButton::text( const String& text ) {
|
||||
mTextBox->text( text );
|
||||
mTextBox->setText( text );
|
||||
onSizeChange();
|
||||
}
|
||||
|
||||
const String& UIPushButton::text() {
|
||||
return mTextBox->text();
|
||||
return mTextBox->getText();
|
||||
}
|
||||
|
||||
void UIPushButton::padding( const Recti& padding ) {
|
||||
mTextBox->padding( padding );
|
||||
mTextBox->setPadding( padding );
|
||||
}
|
||||
|
||||
const Recti& UIPushButton::padding() const {
|
||||
return mTextBox->padding();
|
||||
return mTextBox->getPadding();
|
||||
}
|
||||
|
||||
void UIPushButton::iconHorizontalMargin( Int32 margin ) {
|
||||
@@ -199,9 +199,9 @@ void UIPushButton::onAlphaChange() {
|
||||
|
||||
void UIPushButton::onStateChange() {
|
||||
if ( mSkinState->getState() == UISkinState::StateMouseEnter ) {
|
||||
mTextBox->color( mFontOverColor );
|
||||
mTextBox->setColor( mFontOverColor );
|
||||
} else {
|
||||
mTextBox->color( mFontColor );
|
||||
mTextBox->setColor( mFontColor );
|
||||
}
|
||||
|
||||
mTextBox->setAlpha( mAlpha );
|
||||
|
||||
@@ -14,7 +14,7 @@ UIRadioButton::UIRadioButton( const UITextBox::CreateParams& Params ) :
|
||||
UIControlAnim::CreateParams ButtonParams( Params );
|
||||
|
||||
ButtonParams.setParent( this );
|
||||
ButtonParams.setPos( Vector2i( 0, 0 ) );
|
||||
ButtonParams.setPosition( Vector2i( 0, 0 ) );
|
||||
ButtonParams.Size = Sizei( 16, 16 );
|
||||
|
||||
mActiveButton = eeNew( UIControlAnim, ( ButtonParams ) );
|
||||
@@ -25,7 +25,7 @@ UIRadioButton::UIRadioButton( const UITextBox::CreateParams& Params ) :
|
||||
mInactiveButton->setVisible( true );
|
||||
mInactiveButton->setEnabled( true );
|
||||
|
||||
padding( Recti(0,0,0,0) );
|
||||
setPadding( Recti(0,0,0,0) );
|
||||
|
||||
autoActivate();
|
||||
|
||||
@@ -72,7 +72,7 @@ void UIRadioButton::setTheme( UITheme * Theme ) {
|
||||
}
|
||||
}
|
||||
|
||||
padding( Recti(0,0,0,0) );
|
||||
setPadding( Recti(0,0,0,0) );
|
||||
}
|
||||
|
||||
void UIRadioButton::autoSize() {
|
||||
@@ -205,7 +205,7 @@ const bool& UIRadioButton::isActive() const {
|
||||
return active();
|
||||
}
|
||||
|
||||
void UIRadioButton::padding( const Recti& padding ) {
|
||||
void UIRadioButton::setPadding( const Recti& padding ) {
|
||||
mPadding = padding;
|
||||
mPadding.Left = mPadding.Left + mActiveButton->getSize().getWidth();
|
||||
}
|
||||
|
||||
@@ -54,11 +54,11 @@ void UISelectButton::onStateChange() {
|
||||
UIWinMenu * Menu = reinterpret_cast<UIWinMenu*> ( getParent() );
|
||||
|
||||
if ( mSkinState->getState() == UISkinState::StateSelected ) {
|
||||
getTextBox()->color( Menu->fontSelectedColor() );
|
||||
getTextBox()->setColor( Menu->fontSelectedColor() );
|
||||
} else if ( mSkinState->getState() == UISkinState::StateMouseEnter ) {
|
||||
getTextBox()->color( Menu->fontOverColor() );
|
||||
getTextBox()->setColor( Menu->fontOverColor() );
|
||||
} else {
|
||||
getTextBox()->color( Menu->fontColor() );
|
||||
getTextBox()->setColor( Menu->fontColor() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ UISlider::UISlider( const UISlider::CreateParams& Params ) :
|
||||
UIDragable::CreateParams SlideParams;
|
||||
SlideParams.setParent( this );
|
||||
SlideParams.Size = Sizei( 16, 16 );
|
||||
SlideParams.setPos( Vector2i( 0, 0 ) );
|
||||
SlideParams.setPosition( Vector2i( 0, 0 ) );
|
||||
|
||||
mSlider = eeNew( Private::UISliderButton, ( SlideParams ) );
|
||||
mSlider->setEnabled( true );
|
||||
|
||||
@@ -11,7 +11,7 @@ UISpinBox::UISpinBox( const UISpinBox::CreateParams& Params ) :
|
||||
mClickStep( 1.f )
|
||||
{
|
||||
UITextInput::CreateParams InputParams( Params );
|
||||
InputParams.setPos( 0, 0 );
|
||||
InputParams.setPosition( 0, 0 );
|
||||
InputParams.setParent( this );
|
||||
|
||||
if ( InputParams.Flags & UI_AUTO_SIZE )
|
||||
@@ -105,11 +105,11 @@ void UISpinBox::adjustChilds() {
|
||||
}
|
||||
|
||||
void UISpinBox::padding( const Recti& padding ) {
|
||||
mInput->padding( padding );
|
||||
mInput->setPadding( padding );
|
||||
}
|
||||
|
||||
const Recti& UISpinBox::padding() const {
|
||||
return mInput->padding();
|
||||
return mInput->getPadding();
|
||||
}
|
||||
|
||||
void UISpinBox::clickStep( const Float& step ) {
|
||||
@@ -145,8 +145,8 @@ Uint32 UISpinBox::onMessage( const UIMessage * Msg ) {
|
||||
}
|
||||
|
||||
void UISpinBox::addValue( const Float& value ) {
|
||||
if ( !mInput->text().size() )
|
||||
mInput->text( String::toStr( static_cast<Int32>( mMinValue ) ) );
|
||||
if ( !mInput->getText().size() )
|
||||
mInput->setText( String::toStr( static_cast<Int32>( mMinValue ) ) );
|
||||
|
||||
this->value( mValue + value );
|
||||
}
|
||||
@@ -158,9 +158,9 @@ void UISpinBox::internalValue( const Float& Val, const bool& Force ) {
|
||||
Float fValN = (Float)iValN;
|
||||
|
||||
if ( fValN == Val ) {
|
||||
mInput->text( String::toStr( iValN ) );
|
||||
mInput->setText( String::toStr( iValN ) );
|
||||
} else {
|
||||
mInput->text( String::toStr( Val ) );
|
||||
mInput->setText( String::toStr( Val ) );
|
||||
}
|
||||
|
||||
mValue = Val;
|
||||
@@ -206,18 +206,18 @@ void UISpinBox::update() {
|
||||
UIControlAnim::update();
|
||||
|
||||
if ( Changed ) {
|
||||
if ( !mInput->text().size() ) {
|
||||
if ( !mInput->getText().size() ) {
|
||||
value( 0 );
|
||||
} else {
|
||||
Float Val = mValue;
|
||||
|
||||
if ( '.' == mInput->text()[ mInput->text().size() - 1 ] ) {
|
||||
Uint32 pos = (Uint32)mInput->text().find_first_of( "." );
|
||||
if ( '.' == mInput->getText()[ mInput->getText().size() - 1 ] ) {
|
||||
Uint32 pos = (Uint32)mInput->getText().find_first_of( "." );
|
||||
|
||||
if ( pos != mInput->text().size() - 1 )
|
||||
mInput->text( mInput->text().substr( 0, mInput->text().size() - 1 ) );
|
||||
if ( pos != mInput->getText().size() - 1 )
|
||||
mInput->setText( mInput->getText().substr( 0, mInput->getText().size() - 1 ) );
|
||||
} else {
|
||||
bool Res = String::fromString<Float>( Val, mInput->text() );
|
||||
bool Res = String::fromString<Float>( Val, mInput->getText() );
|
||||
|
||||
if ( Res )
|
||||
value( Val );
|
||||
|
||||
@@ -73,11 +73,11 @@ void UITab::onStateChange() {
|
||||
setSize( mSize.getWidth(), getSkinSize( getSkin(), mSkinState->getState() ).getHeight() );
|
||||
|
||||
if ( mSkinState->getState() == UISkinState::StateSelected ) {
|
||||
mTextBox->color( tTabW->mFontSelectedColor );
|
||||
mTextBox->setColor( tTabW->mFontSelectedColor );
|
||||
} else if ( mSkinState->getState() == UISkinState::StateMouseEnter ) {
|
||||
mTextBox->color( tTabW->mFontOverColor );
|
||||
mTextBox->setColor( tTabW->mFontOverColor );
|
||||
} else {
|
||||
mTextBox->color( tTabW->mFontColor );
|
||||
mTextBox->setColor( tTabW->mFontColor );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) :
|
||||
{
|
||||
UIComplexControl::CreateParams TabParams;
|
||||
TabParams.setParent( this );
|
||||
TabParams.setPos( 0, 0 );
|
||||
TabParams.setPosition( 0, 0 );
|
||||
TabParams.Flags |= UI_CLIP_ENABLE | UI_ANCHOR_RIGHT;
|
||||
TabParams.setSize( mSize.getWidth(), mTabWidgetHeight );
|
||||
|
||||
@@ -37,7 +37,7 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) :
|
||||
|
||||
UIComplexControl::CreateParams CtrlParams;
|
||||
CtrlParams.setParent( this );
|
||||
CtrlParams.setPos( 0, mTabWidgetHeight );
|
||||
CtrlParams.setPosition( 0, mTabWidgetHeight );
|
||||
CtrlParams.setSize( mSize.getWidth(), mSize.getHeight() - mTabWidgetHeight );
|
||||
CtrlParams.Flags |= UI_CLIP_ENABLE | UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT;
|
||||
|
||||
|
||||
@@ -70,11 +70,11 @@ void UITextBox::draw() {
|
||||
}
|
||||
}
|
||||
|
||||
Graphics::Font * UITextBox::font() const {
|
||||
Graphics::Font * UITextBox::getFont() const {
|
||||
return mTextCache->getFont();
|
||||
}
|
||||
|
||||
void UITextBox::font( Graphics::Font * font ) {
|
||||
void UITextBox::setFont( Graphics::Font * font ) {
|
||||
if ( mTextCache->getFont() != font ) {
|
||||
mTextCache->setFont( font );
|
||||
autoShrink();
|
||||
@@ -84,14 +84,14 @@ void UITextBox::font( Graphics::Font * font ) {
|
||||
}
|
||||
}
|
||||
|
||||
const String& UITextBox::text() {
|
||||
const String& UITextBox::getText() {
|
||||
if ( mFlags & UI_AUTO_SHRINK_TEXT )
|
||||
return mString;
|
||||
|
||||
return mTextCache->getText();
|
||||
}
|
||||
|
||||
void UITextBox::text( const String& text ) {
|
||||
void UITextBox::setText( const String& text ) {
|
||||
if ( mFlags & UI_AUTO_SHRINK_TEXT ) {
|
||||
mString = text;
|
||||
mTextCache->setText( mString );
|
||||
@@ -105,31 +105,31 @@ void UITextBox::text( const String& text ) {
|
||||
onTextChanged();
|
||||
}
|
||||
|
||||
const ColorA& UITextBox::color() const {
|
||||
const ColorA& UITextBox::getColor() const {
|
||||
return mFontColor;
|
||||
}
|
||||
|
||||
void UITextBox::color( const ColorA& color ) {
|
||||
void UITextBox::setColor( const ColorA& color ) {
|
||||
mFontColor = color;
|
||||
mTextCache->setColor( color );
|
||||
|
||||
setAlpha( color.a() );
|
||||
}
|
||||
|
||||
const ColorA& UITextBox::shadowColor() const {
|
||||
const ColorA& UITextBox::getShadowColor() const {
|
||||
return mFontShadowColor;
|
||||
}
|
||||
|
||||
void UITextBox::shadowColor( const ColorA& color ) {
|
||||
void UITextBox::setShadowColor( const ColorA& color ) {
|
||||
mFontShadowColor = color;
|
||||
mTextCache->setShadowColor( mFontColor );
|
||||
}
|
||||
|
||||
const ColorA& UITextBox::selectionBackColor() const {
|
||||
const ColorA& UITextBox::getSelectionBackColor() const {
|
||||
return mFontSelectionBackColor;
|
||||
}
|
||||
|
||||
void UITextBox::selectionBackColor( const ColorA& color ) {
|
||||
void UITextBox::setSelectionBackColor( const ColorA& color ) {
|
||||
mFontSelectionBackColor = color;
|
||||
}
|
||||
|
||||
@@ -213,11 +213,11 @@ void UITextBox::onFontChanged() {
|
||||
sendCommonEvent( UIEvent::EventOnFontChanged );
|
||||
}
|
||||
|
||||
void UITextBox::padding( const Recti& padding ) {
|
||||
void UITextBox::setPadding( const Recti& padding ) {
|
||||
mPadding = padding;
|
||||
}
|
||||
|
||||
const Recti& UITextBox::padding() const {
|
||||
const Recti& UITextBox::getPadding() const {
|
||||
return mPadding;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,14 +51,14 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) :
|
||||
|
||||
UIScrollBar::CreateParams ScrollBarP;
|
||||
ScrollBarP.setParent( this );
|
||||
ScrollBarP.setPos( mSize.getWidth() - 15, 0 );
|
||||
ScrollBarP.setPosition( mSize.getWidth() - 15, 0 );
|
||||
ScrollBarP.Size = Sizei( 15, mSize.getHeight() );
|
||||
ScrollBarP.Flags = UI_AUTO_SIZE;
|
||||
ScrollBarP.VerticalScrollBar = true;
|
||||
mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) );
|
||||
mVScrollBar->value( 1 );
|
||||
|
||||
ScrollBarP.setPos( 0, mSize.getHeight() - 15 );
|
||||
ScrollBarP.setPosition( 0, mSize.getHeight() - 15 );
|
||||
ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 15 );
|
||||
ScrollBarP.VerticalScrollBar = false;
|
||||
mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) );
|
||||
@@ -257,11 +257,11 @@ UIScrollBar * UITextEdit::getVScrollBar() const {
|
||||
}
|
||||
|
||||
const String& UITextEdit::text() const {
|
||||
return mTextInput->text();
|
||||
return mTextInput->getText();
|
||||
}
|
||||
|
||||
void UITextEdit::text( const String& Txt ) {
|
||||
mTextInput->text( Txt );
|
||||
mTextInput->setText( Txt );
|
||||
|
||||
onInputSizeChange();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void UITextInput::update() {
|
||||
if ( mTextBuffer.changedSinceLastUpdate() ) {
|
||||
Vector2f offSet = mAlignOffset;
|
||||
|
||||
UITextBox::text( mTextBuffer.getBuffer() );
|
||||
UITextBox::setText( mTextBuffer.getBuffer() );
|
||||
|
||||
updateText();
|
||||
|
||||
@@ -202,16 +202,16 @@ const bool& UITextInput::allowEditing() const {
|
||||
return mAllowEditing;
|
||||
}
|
||||
|
||||
void UITextInput::text( const String& text ) {
|
||||
UITextBox::text( text );
|
||||
void UITextInput::setText( const String& text ) {
|
||||
UITextBox::setText( text );
|
||||
|
||||
mTextBuffer.setBuffer( text );
|
||||
|
||||
mTextBuffer.cursorToEnd();
|
||||
}
|
||||
|
||||
const String& UITextInput::text() {
|
||||
return UITextBox::text();
|
||||
const String& UITextInput::getText() {
|
||||
return UITextBox::getText();
|
||||
}
|
||||
|
||||
void UITextInput::shrinkText( const Uint32& MaxWidth ) {
|
||||
|
||||
@@ -120,8 +120,8 @@ void UITextInputPassword::updatePass( const String& pass ) {
|
||||
mPassCache->setText( newTxt );
|
||||
}
|
||||
|
||||
void UITextInputPassword::text( const String& text ) {
|
||||
UITextInput::text( text );
|
||||
void UITextInputPassword::setText( const String& text ) {
|
||||
UITextInput::setText( text );
|
||||
|
||||
updatePass( text );
|
||||
}
|
||||
@@ -130,8 +130,8 @@ TextCache *UITextInputPassword::getPassCache() const {
|
||||
return mPassCache;
|
||||
}
|
||||
|
||||
const String& UITextInputPassword::text() {
|
||||
return UITextBox::text();
|
||||
const String& UITextInputPassword::getText() {
|
||||
return UITextBox::getText();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ SubTexture * UITheme::getIconByName( const std::string& name ) {
|
||||
UIGfx * UITheme::createGfx( SubTexture * SubTexture, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, ColorA SubTextureColor, EE_RENDER_MODE SubTextureRender ) {
|
||||
UIGfx::CreateParams GfxParams;
|
||||
GfxParams.setParent( Parent );
|
||||
GfxParams.setPos( Pos );
|
||||
GfxParams.setPosition( Pos );
|
||||
GfxParams.setSize( Size );
|
||||
GfxParams.Flags = Flags;
|
||||
GfxParams.SubTexture = SubTexture;
|
||||
@@ -442,7 +442,7 @@ UIGfx * UITheme::createGfx( SubTexture * SubTexture, UIControl * Parent, const S
|
||||
UISprite * UITheme::createSprite( Sprite * Sprite, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool DealloSprite, EE_RENDER_MODE SpriteRender ) {
|
||||
UISprite::CreateParams SpriteParams;
|
||||
SpriteParams.setParent( Parent );
|
||||
SpriteParams.setPos( Pos );
|
||||
SpriteParams.setPosition( Pos );
|
||||
SpriteParams.setSize( Size );
|
||||
SpriteParams.Flags = Flags;
|
||||
SpriteParams.Sprite = Sprite;
|
||||
@@ -457,7 +457,7 @@ UISprite * UITheme::createSprite( Sprite * Sprite, UIControl * Parent, const Siz
|
||||
UICheckBox * UITheme::createCheckBox( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags ) {
|
||||
UICheckBox::CreateParams CheckBoxParams;
|
||||
CheckBoxParams.setParent( Parent );
|
||||
CheckBoxParams.setPos( Pos );
|
||||
CheckBoxParams.setPosition( Pos );
|
||||
CheckBoxParams.setSize( Size );
|
||||
CheckBoxParams.Flags = Flags;
|
||||
UICheckBox * Ctrl = eeNew( UICheckBox, ( CheckBoxParams ) );
|
||||
@@ -469,7 +469,7 @@ UICheckBox * UITheme::createCheckBox( UIControl * Parent, const Sizei& Size, con
|
||||
UIRadioButton * UITheme::createRadioButton( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags ) {
|
||||
UIRadioButton::CreateParams RadioButtonParams;
|
||||
RadioButtonParams.setParent( Parent );
|
||||
RadioButtonParams.setPos( Pos );
|
||||
RadioButtonParams.setPosition( Pos );
|
||||
RadioButtonParams.setSize( Size );
|
||||
RadioButtonParams.Flags = Flags;
|
||||
UIRadioButton * Ctrl = eeNew( UIRadioButton, ( RadioButtonParams ) );
|
||||
@@ -481,20 +481,20 @@ UIRadioButton * UITheme::createRadioButton( UIControl * Parent, const Sizei& Siz
|
||||
UITextBox * UITheme::createTextBox( const String& Text, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags ) {
|
||||
UITextBox::CreateParams TextBoxParams;
|
||||
TextBoxParams.setParent( Parent );
|
||||
TextBoxParams.setPos( Pos );
|
||||
TextBoxParams.setPosition( Pos );
|
||||
TextBoxParams.setSize( Size );
|
||||
TextBoxParams.Flags = Flags;
|
||||
UITextBox * Ctrl = eeNew( UITextBox, ( TextBoxParams ) );
|
||||
Ctrl->setVisible( true );
|
||||
Ctrl->setEnabled( false );
|
||||
Ctrl->text( Text );
|
||||
Ctrl->setText( Text );
|
||||
return Ctrl;
|
||||
}
|
||||
|
||||
UITooltip * UITheme::createTooltip( UIControl * TooltipOf, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags ) {
|
||||
UITooltip::CreateParams TooltipParams;
|
||||
TooltipParams.setParent( Parent );
|
||||
TooltipParams.setPos( Pos );
|
||||
TooltipParams.setPosition( Pos );
|
||||
TooltipParams.setSize( Size );
|
||||
TooltipParams.Flags = Flags;
|
||||
UITooltip * Ctrl = eeNew( UITooltip, ( TooltipParams, TooltipOf ) );
|
||||
@@ -506,7 +506,7 @@ UITooltip * UITheme::createTooltip( UIControl * TooltipOf, UIControl * Parent, c
|
||||
UITextEdit * UITheme::createTextEdit( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, UI_SCROLLBAR_MODE HScrollBar, UI_SCROLLBAR_MODE VScrollBar, bool WordWrap ) {
|
||||
UITextEdit::CreateParams TextEditParams;
|
||||
TextEditParams.setParent( Parent );
|
||||
TextEditParams.setPos( Pos );
|
||||
TextEditParams.setPosition( Pos );
|
||||
TextEditParams.setSize( Size );
|
||||
TextEditParams.Flags = Flags;
|
||||
TextEditParams.HScrollBar = HScrollBar;
|
||||
@@ -521,7 +521,7 @@ UITextEdit * UITheme::createTextEdit( UIControl * Parent, const Sizei& Size, con
|
||||
UITextInput * UITheme::createTextInput( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool SupportFreeEditing, Uint32 MaxLength ) {
|
||||
UITextInput::CreateParams TextInputParams;
|
||||
TextInputParams.setParent( Parent );
|
||||
TextInputParams.setPos( Pos );
|
||||
TextInputParams.setPosition( Pos );
|
||||
TextInputParams.setSize( Size );
|
||||
TextInputParams.Flags = Flags;
|
||||
TextInputParams.SupportFreeEditing = SupportFreeEditing;
|
||||
@@ -535,7 +535,7 @@ UITextInput * UITheme::createTextInput( UIControl * Parent, const Sizei& Size, c
|
||||
UITextInputPassword * UITheme::createTextInputPassword( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool SupportFreeEditing, Uint32 MaxLength ) {
|
||||
UITextInput::CreateParams TextInputParams;
|
||||
TextInputParams.setParent( Parent );
|
||||
TextInputParams.setPos( Pos );
|
||||
TextInputParams.setPosition( Pos );
|
||||
TextInputParams.setSize( Size );
|
||||
TextInputParams.Flags = Flags;
|
||||
TextInputParams.SupportFreeEditing = SupportFreeEditing;
|
||||
@@ -549,7 +549,7 @@ UITextInputPassword * UITheme::createTextInputPassword( UIControl * Parent, cons
|
||||
UISpinBox * UITheme::createSpinBox( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Float DefaultValue, bool AllowDotsInNumbers ) {
|
||||
UISpinBox::CreateParams SpinBoxParams;
|
||||
SpinBoxParams.setParent( Parent );
|
||||
SpinBoxParams.setPos( Pos );
|
||||
SpinBoxParams.setPosition( Pos );
|
||||
SpinBoxParams.setSize( Size );
|
||||
SpinBoxParams.Flags = Flags;
|
||||
SpinBoxParams.DefaultValue = DefaultValue;
|
||||
@@ -563,7 +563,7 @@ UISpinBox * UITheme::createSpinBox( UIControl * Parent, const Sizei& Size, const
|
||||
UIScrollBar * UITheme::createScrollBar( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool VerticalScrollBar ) {
|
||||
UIScrollBar::CreateParams ScrollBarParams;
|
||||
ScrollBarParams.setParent( Parent );
|
||||
ScrollBarParams.setPos( Pos );
|
||||
ScrollBarParams.setPosition( Pos );
|
||||
ScrollBarParams.setSize( Size );
|
||||
ScrollBarParams.Flags = Flags;
|
||||
ScrollBarParams.VerticalScrollBar = VerticalScrollBar;
|
||||
@@ -576,7 +576,7 @@ UIScrollBar * UITheme::createScrollBar( UIControl * Parent, const Sizei& Size, c
|
||||
UISlider * UITheme::createSlider( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool VerticalSlider, bool AllowHalfSliderOut, bool ExpandBackground ) {
|
||||
UISlider::CreateParams SliderParams;
|
||||
SliderParams.setParent( Parent );
|
||||
SliderParams.setPos( Pos );
|
||||
SliderParams.setPosition( Pos );
|
||||
SliderParams.setSize( Size );
|
||||
SliderParams.Flags = Flags;
|
||||
SliderParams.VerticalSlider = VerticalSlider;
|
||||
@@ -591,7 +591,7 @@ UISlider * UITheme::createSlider( UIControl * Parent, const Sizei& Size, const V
|
||||
UIComboBox * UITheme::createComboBox( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, UIListBox * ListBox ) {
|
||||
UIComboBox::CreateParams ComboParams;
|
||||
ComboParams.setParent( Parent );
|
||||
ComboParams.setPos( Pos );
|
||||
ComboParams.setPosition( Pos );
|
||||
ComboParams.setSize( Size );
|
||||
ComboParams.Flags = Flags;
|
||||
ComboParams.MinNumVisibleItems = MinNumVisibleItems;
|
||||
@@ -606,7 +606,7 @@ UIComboBox * UITheme::createComboBox( UIControl * Parent, const Sizei& Size, con
|
||||
UIDropDownList * UITheme::createDropDownList( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, UIListBox * ListBox ) {
|
||||
UIDropDownList::CreateParams DDLParams;
|
||||
DDLParams.setParent( Parent );
|
||||
DDLParams.setPos( Pos );
|
||||
DDLParams.setPosition( Pos );
|
||||
DDLParams.setSize( Size );
|
||||
DDLParams.Flags = Flags;
|
||||
DDLParams.MinNumVisibleItems = MinNumVisibleItems;
|
||||
@@ -621,7 +621,7 @@ UIDropDownList * UITheme::createDropDownList( UIControl * Parent, const Sizei& S
|
||||
UIListBox * UITheme::createListBox( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool SmoothScroll, Uint32 RowHeight, UI_SCROLLBAR_MODE VScrollMode, UI_SCROLLBAR_MODE HScrollMode, Recti PaddingContainer ) {
|
||||
UIListBox::CreateParams LBParams;
|
||||
LBParams.setParent( Parent );
|
||||
LBParams.setPos( Pos );
|
||||
LBParams.setPosition( Pos );
|
||||
LBParams.setSize( Size );
|
||||
LBParams.Flags = Flags;
|
||||
LBParams.SmoothScroll = SmoothScroll;
|
||||
@@ -638,7 +638,7 @@ UIListBox * UITheme::createListBox( UIControl * Parent, const Sizei& Size, const
|
||||
UIMenu * UITheme::createMenu( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 RowHeight, Recti PaddingContainer, Uint32 MinWidth, Uint32 MinSpaceForIcons, Uint32 MinRightMargin ) {
|
||||
UIMenu::CreateParams MenuParams;
|
||||
MenuParams.setParent( Parent );
|
||||
MenuParams.setPos( Pos );
|
||||
MenuParams.setPosition( Pos );
|
||||
MenuParams.setSize( Size );
|
||||
MenuParams.Flags = Flags;
|
||||
MenuParams.RowHeight = RowHeight;
|
||||
@@ -656,7 +656,7 @@ UIMenu * UITheme::createMenu( UIControl * Parent, const Sizei& Size, const Vecto
|
||||
UIPopUpMenu * UITheme::createPopUpMenu( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 RowHeight, Recti PaddingContainer, Uint32 MinWidth, Uint32 MinSpaceForIcons, Uint32 MinRightMargin ) {
|
||||
UIPopUpMenu::CreateParams MenuParams;
|
||||
MenuParams.setParent( Parent );
|
||||
MenuParams.setPos( Pos );
|
||||
MenuParams.setPosition( Pos );
|
||||
MenuParams.setSize( Size );
|
||||
MenuParams.Flags = Flags;
|
||||
MenuParams.RowHeight = RowHeight;
|
||||
@@ -670,7 +670,7 @@ UIPopUpMenu * UITheme::createPopUpMenu( UIControl * Parent, const Sizei& Size, c
|
||||
UIProgressBar * UITheme::createProgressBar( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool DisplayPercent, bool VerticalExpand, Vector2f MovementSpeed, Rectf FillerMargin ) {
|
||||
UIProgressBar::CreateParams PBParams;
|
||||
PBParams.setParent( Parent );
|
||||
PBParams.setPos( Pos );
|
||||
PBParams.setPosition( Pos );
|
||||
PBParams.setSize( Size );
|
||||
PBParams.Flags = Flags;
|
||||
PBParams.DisplayPercent = DisplayPercent;
|
||||
@@ -687,7 +687,7 @@ UIProgressBar * UITheme::createProgressBar( UIControl * Parent, const Sizei& Siz
|
||||
UIPushButton * UITheme::createPushButton( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, SubTexture * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) {
|
||||
UIPushButton::CreateParams ButtonParams;
|
||||
ButtonParams.setParent( Parent );
|
||||
ButtonParams.setPos( Pos );
|
||||
ButtonParams.setPosition( Pos );
|
||||
ButtonParams.setSize( Size );
|
||||
ButtonParams.Flags = Flags;
|
||||
ButtonParams.Icon = Icon;
|
||||
@@ -706,7 +706,7 @@ UIPushButton * UITheme::createPushButton( UIControl * Parent, const Sizei& Size,
|
||||
UISelectButton * UITheme::createSelectButton( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, SubTexture * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) {
|
||||
UIPushButton::CreateParams ButtonParams;
|
||||
ButtonParams.setParent( Parent );
|
||||
ButtonParams.setPos( Pos );
|
||||
ButtonParams.setPosition( Pos );
|
||||
ButtonParams.setSize( Size );
|
||||
ButtonParams.Flags = Flags;
|
||||
ButtonParams.Icon = Icon;
|
||||
@@ -725,7 +725,7 @@ UISelectButton * UITheme::createSelectButton( UIControl * Parent, const Sizei& S
|
||||
UIWinMenu * UITheme::createWinMenu( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 MarginBetweenButtons, Uint32 ButtonMargin, Uint32 MenuHeight, Uint32 FirstButtonMargin ) {
|
||||
UIWinMenu::CreateParams WinMenuParams;
|
||||
WinMenuParams.setParent( Parent );
|
||||
WinMenuParams.setPos( Pos );
|
||||
WinMenuParams.setPosition( Pos );
|
||||
WinMenuParams.setSize( Size );
|
||||
WinMenuParams.Flags = Flags;
|
||||
WinMenuParams.MarginBetweenButtons = MarginBetweenButtons;
|
||||
@@ -742,7 +742,7 @@ UIWinMenu * UITheme::createWinMenu( UIControl * Parent, const Sizei& Size, const
|
||||
UIWindow * UITheme::createWindow( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 WinFlags, Sizei MinWindowSize, Uint8 BaseAlpha ) {
|
||||
UIWindow::CreateParams WinParams;
|
||||
WinParams.setParent( Parent );
|
||||
WinParams.setPos( Pos );
|
||||
WinParams.setPosition( Pos );
|
||||
WinParams.setSize( Size );
|
||||
WinParams.Flags = Flags;
|
||||
WinParams.WinFlags = WinFlags;
|
||||
@@ -754,7 +754,7 @@ UIWindow * UITheme::createWindow( UIControl * Parent, const Sizei& Size, const V
|
||||
UICommonDialog * UITheme::createCommonDialog( UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Uint32 WinFlags, Sizei MinWindowSize, Uint8 BaseAlpha, Uint32 CDLFlags, std::string DefaultFilePattern, std::string DefaultDirectory ) {
|
||||
UICommonDialog::CreateParams DLGParams;
|
||||
DLGParams.setParent( Parent );
|
||||
DLGParams.setPos( Pos );
|
||||
DLGParams.setPosition( Pos );
|
||||
DLGParams.setSize( Size );
|
||||
DLGParams.Flags = Flags;
|
||||
DLGParams.WinFlags = WinFlags;
|
||||
@@ -769,7 +769,7 @@ UICommonDialog * UITheme::createCommonDialog( UIControl * Parent, const Sizei& S
|
||||
UIMessageBox * UITheme::createMessageBox( UI_MSGBOX_TYPE Type, const String& Message, Uint32 WinFlags, UIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, Sizei MinWindowSize, Uint8 BaseAlpha ) {
|
||||
UIMessageBox::CreateParams MsgBoxParams;
|
||||
MsgBoxParams.setParent( Parent );
|
||||
MsgBoxParams.setPos( Pos );
|
||||
MsgBoxParams.setPosition( Pos );
|
||||
MsgBoxParams.setSize( Size );
|
||||
MsgBoxParams.Flags = Flags;
|
||||
MsgBoxParams.WinFlags = WinFlags;
|
||||
@@ -783,7 +783,7 @@ UIMessageBox * UITheme::createMessageBox( UI_MSGBOX_TYPE Type, const String& Mes
|
||||
UITabWidget * UITheme::createTabWidget( UIControl *Parent, const Sizei &Size, const Vector2i &Pos, const Uint32 &Flags, const bool &TabsClosable, const bool &SpecialBorderTabs, const Int32 &TabSeparation, const Uint32 &MaxTextLength, const Uint32 &TabWidgetHeight, const Uint32 &TabTextAlign, const Uint32 &MinTabWidth, const Uint32 &MaxTabWidth ) {
|
||||
UITabWidget::CreateParams TabWidgetParams;
|
||||
TabWidgetParams.setParent( Parent );
|
||||
TabWidgetParams.setPos( Pos );
|
||||
TabWidgetParams.setPosition( Pos );
|
||||
TabWidgetParams.setSize( Size );
|
||||
TabWidgetParams.Flags = Flags;
|
||||
TabWidgetParams.TabsClosable = TabsClosable;
|
||||
|
||||
@@ -803,7 +803,7 @@ void UIWindow::setTitle( const String& Text ) {
|
||||
mTitle->setVisible( true );
|
||||
}
|
||||
|
||||
mTitle->text( Text );
|
||||
mTitle->setText( Text );
|
||||
|
||||
fixTitleSize();
|
||||
}
|
||||
@@ -817,7 +817,7 @@ void UIWindow::fixTitleSize() {
|
||||
|
||||
String UIWindow::getTitle() const {
|
||||
if ( NULL != mTitle )
|
||||
return mTitle->text();
|
||||
return mTitle->getText();
|
||||
|
||||
return String();
|
||||
}
|
||||
|
||||
@@ -307,17 +307,17 @@ void EETest::CreateUI() {
|
||||
|
||||
UITextBox::CreateParams TextParams;
|
||||
TextParams.setParent( C );
|
||||
TextParams.setPos( 0, 0 );
|
||||
TextParams.setPosition( 0, 0 );
|
||||
TextParams.Size = Sizei( 320, 240 );
|
||||
TextParams.Flags = UI_VALIGN_TOP | UI_HALIGN_RIGHT;
|
||||
UITextBox * Text = eeNew( UITextBox, ( TextParams ) );
|
||||
Text->setVisible( true );
|
||||
Text->setEnabled( false );
|
||||
Text->text( "Turn around\nJust Turn Around\nAround!" );
|
||||
Text->setText( "Turn around\nJust Turn Around\nAround!" );
|
||||
|
||||
UITextInput::CreateParams InputParams;
|
||||
InputParams.setParent( C );
|
||||
InputParams.setPos( 20, 216 );
|
||||
InputParams.setPosition( 20, 216 );
|
||||
InputParams.Size = Sizei( 200, 22 );
|
||||
InputParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_TEXT_SELECTION_ENABLED;
|
||||
UITextInput * Input = eeNew( UITextInput, ( InputParams ) );
|
||||
@@ -327,7 +327,7 @@ void EETest::CreateUI() {
|
||||
UIPushButton::CreateParams ButtonParams;
|
||||
ButtonParams.setParent( C );
|
||||
ButtonParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_AUTO_SIZE;
|
||||
ButtonParams.setPos( 225, 216 );
|
||||
ButtonParams.setPosition( 225, 216 );
|
||||
ButtonParams.Size = Sizei( 90, 0 );
|
||||
ButtonParams.SetIcon( mTheme->getIconByName( "ok" ) );
|
||||
UIPushButton * Button = eeNew( UIPushButton, ( ButtonParams ) );
|
||||
@@ -337,50 +337,50 @@ void EETest::CreateUI() {
|
||||
Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::ButtonClick ) );
|
||||
Button->setTooltipText( "Click and see what happens..." );
|
||||
|
||||
TextParams.setPos( 130, 20 );
|
||||
TextParams.setPosition( 130, 20 );
|
||||
TextParams.Size = Sizei( 80, 22 );
|
||||
TextParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT;
|
||||
UICheckBox * Checkbox = eeNew( UICheckBox, ( TextParams ) );
|
||||
Checkbox->setVisible( true );
|
||||
Checkbox->text( "Check Me" );
|
||||
Checkbox->setText( "Check Me" );
|
||||
Checkbox->setEnabled( true );
|
||||
|
||||
TextParams.setPos( 130, 40 );
|
||||
TextParams.setPosition( 130, 40 );
|
||||
UIRadioButton * RadioButton = eeNew( UIRadioButton, ( TextParams ) );
|
||||
RadioButton->setVisible( true );
|
||||
RadioButton->text( "Check Me" );
|
||||
RadioButton->setText( "Check Me" );
|
||||
RadioButton->setEnabled( true );
|
||||
|
||||
TextParams.setPos( 130, 60 );
|
||||
TextParams.setPosition( 130, 60 );
|
||||
RadioButton = eeNew( UIRadioButton, ( TextParams ) );
|
||||
RadioButton->setVisible( true );
|
||||
RadioButton->text( "Check Me 2" );
|
||||
RadioButton->setText( "Check Me 2" );
|
||||
RadioButton->setEnabled( true );
|
||||
|
||||
UISlider::CreateParams SliderParams;
|
||||
SliderParams.setParent( C );
|
||||
SliderParams.setPos( 220, 80 );
|
||||
SliderParams.setPosition( 220, 80 );
|
||||
SliderParams.Size = Sizei( 80, 24 );
|
||||
mSlider = eeNew( UISlider, ( SliderParams ) );
|
||||
mSlider->setVisible( true );
|
||||
mSlider->setEnabled( true );
|
||||
mSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &EETest::OnSliderValueChange ) );
|
||||
|
||||
SliderParams.setPos( 40, 110 );
|
||||
SliderParams.setPosition( 40, 110 );
|
||||
SliderParams.Size = Sizei( 24, 80 );
|
||||
SliderParams.VerticalSlider = true;
|
||||
mSlider = eeNew( UISlider, ( SliderParams ) );
|
||||
mSlider->setVisible( true );
|
||||
mSlider->setEnabled( true );
|
||||
|
||||
SliderParams.setPos( 60, 110 );
|
||||
SliderParams.setPosition( 60, 110 );
|
||||
mSlider = eeNew( UISlider, ( SliderParams ) );
|
||||
mSlider->setVisible( true );
|
||||
mSlider->setEnabled( true );
|
||||
|
||||
UISpinBox::CreateParams SpinBoxParams;
|
||||
SpinBoxParams.setParent( C );
|
||||
SpinBoxParams.setPos( 80, 150 );
|
||||
SpinBoxParams.setPosition( 80, 150 );
|
||||
SpinBoxParams.Size = Sizei( 80, 24 );
|
||||
SpinBoxParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_CLIP_ENABLE;
|
||||
SpinBoxParams.AllowDotsInNumbers = true;
|
||||
@@ -390,7 +390,7 @@ void EETest::CreateUI() {
|
||||
|
||||
UIScrollBar::CreateParams ScrollBarP;
|
||||
ScrollBarP.setParent( C );
|
||||
ScrollBarP.setPos( 0, 0 );
|
||||
ScrollBarP.setPosition( 0, 0 );
|
||||
ScrollBarP.Size = Sizei( 15, 240 );
|
||||
ScrollBarP.Flags = UI_AUTO_SIZE;
|
||||
ScrollBarP.VerticalScrollBar = true;
|
||||
@@ -401,14 +401,14 @@ void EETest::CreateUI() {
|
||||
|
||||
mProgressBar = mTheme->createProgressBar( C, Sizei( 200, 20 ), Vector2i( 20, 190 ) );
|
||||
|
||||
TextParams.setPos( 20, 5 );
|
||||
TextParams.setPosition( 20, 5 );
|
||||
mTextBoxValue = eeNew( UITextBox, ( TextParams ) );
|
||||
mTextBoxValue->setVisible( true );
|
||||
OnValueChange( NULL );
|
||||
|
||||
UIListBox::CreateParams LBParams;
|
||||
LBParams.setParent( C );
|
||||
LBParams.setPos( 325, 8 );
|
||||
LBParams.setPosition( 325, 8 );
|
||||
LBParams.Size = Sizei( 200, 240-16 );
|
||||
LBParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_TOUCH_DRAG_ENABLED; // | UI_MULTI_SELECT
|
||||
mListBox = eeNew( UIListBox, ( LBParams ) );
|
||||
@@ -428,7 +428,7 @@ void EETest::CreateUI() {
|
||||
|
||||
UIDropDownList::CreateParams DDLParams;
|
||||
DDLParams.setParent( C );
|
||||
DDLParams.setPos( 20, 55 );
|
||||
DDLParams.setPosition( 20, 55 );
|
||||
DDLParams.Size = Sizei( 100, 21 );
|
||||
DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_TOUCH_DRAG_ENABLED;
|
||||
UIDropDownList * mDropDownList = eeNew( UIDropDownList, ( DDLParams ) );
|
||||
@@ -450,7 +450,7 @@ void EETest::CreateUI() {
|
||||
|
||||
UIComboBox::CreateParams ComboParams;
|
||||
ComboParams.setParent( C );
|
||||
ComboParams.setPos( 20, 80 );
|
||||
ComboParams.setPosition( 20, 80 );
|
||||
ComboParams.Size = Sizei( 100, 1 );
|
||||
ComboParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_AUTO_SIZE | UI_TOUCH_DRAG_ENABLED | UI_TEXT_SELECTION_ENABLED;
|
||||
UIComboBox * mComboBox = eeNew( UIComboBox, ( ComboParams ) );
|
||||
@@ -506,7 +506,7 @@ void EETest::CreateUI() {
|
||||
|
||||
UITextEdit::CreateParams TEParams;
|
||||
TEParams.setParent( C );
|
||||
TEParams.setPos( 5, 245 );
|
||||
TEParams.setPosition( 5, 245 );
|
||||
TEParams.Size = Sizei( 315, 130 );
|
||||
TEParams.Flags = UI_AUTO_PADDING | UI_CLIP_ENABLE | UI_TEXT_SELECTION_ENABLED;
|
||||
UITextEdit * TextEdit = eeNew( UITextEdit, ( TEParams ) );
|
||||
@@ -516,7 +516,7 @@ void EETest::CreateUI() {
|
||||
|
||||
UIGenericGrid::CreateParams GridParams;
|
||||
GridParams.setParent( C );
|
||||
GridParams.setPos( 325, 245 );
|
||||
GridParams.setPosition( 325, 245 );
|
||||
GridParams.setSize( 200, 130 );
|
||||
GridParams.Flags = UI_AUTO_PADDING | UI_TOUCH_DRAG_ENABLED;
|
||||
GridParams.RowHeight = 24;
|
||||
@@ -542,7 +542,7 @@ void EETest::CreateUI() {
|
||||
UITextInput * TxtInput = eeNew( UITextInput, ( TxtInputParams ) );
|
||||
UIGfx * TxtGfx = eeNew( UIGfx, ( TxtGfxParams ) );
|
||||
|
||||
TxtBox->text( "Test " + String::toStr( i+1 ) );
|
||||
TxtBox->setText( "Test " + String::toStr( i+1 ) );
|
||||
|
||||
Cell->cell( 0, TxtBox );
|
||||
Cell->cell( 1, TxtGfx );
|
||||
@@ -647,7 +647,7 @@ void EETest::CreateDecoratedWindow() {
|
||||
TabWidget->add( "TextEdit", TEdit );
|
||||
|
||||
UITextInput * Txt = mTheme->createTextInput( TabWidget, Sizei(), Vector2i(), UI_AUTO_PADDING | UI_AUTO_SHRINK_TEXT | UI_TEXT_SELECTION_ENABLED );
|
||||
Txt->text( mBuda );
|
||||
Txt->setText( mBuda );
|
||||
TabWidget->add( "TextInput", Txt );
|
||||
|
||||
TabWidget->add( "TextBox", mTheme->createTextBox( mBuda, TabWidget, Sizei(), Vector2i(), UI_AUTO_PADDING | UI_AUTO_SHRINK_TEXT | UI_TEXT_SELECTION_ENABLED ) );
|
||||
@@ -724,7 +724,7 @@ void EETest::ItemClick( const UIEvent * Event ) {
|
||||
}
|
||||
|
||||
void EETest::OnValueChange( const UIEvent * Event ) {
|
||||
mTextBoxValue->text( "Scroll Value:\n" + String::toStr( mScrollBar->value() ) );
|
||||
mTextBoxValue->setText( "Scroll Value:\n" + String::toStr( mScrollBar->value() ) );
|
||||
|
||||
mProgressBar->progress( mScrollBar->value() * 100.f );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user