mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-20 01:32:51 +03:00
Refactored UIMessage and UIEvent.
--HG-- branch : dev
This commit is contained in:
@@ -10,53 +10,53 @@ class UIControl;
|
||||
class EE_API UIEvent {
|
||||
public:
|
||||
enum Event {
|
||||
EventKeyDown = 0,
|
||||
EventKeyUp,
|
||||
EventMouseMove,
|
||||
EventMouseDown,
|
||||
EventMouseClick,
|
||||
EventMouseDoubleClick,
|
||||
EventMouseUp,
|
||||
EventMouseEnter,
|
||||
EventMouseExit,
|
||||
EventOnFocus,
|
||||
EventOnFocusLoss,
|
||||
EventOnVisibleChange,
|
||||
EventOnEnabledChange,
|
||||
EventOnPosChange,
|
||||
EventOnSizeChange,
|
||||
EventOnAngleChange,
|
||||
EventOnScaleChange,
|
||||
EventOnAlphaChange,
|
||||
EventOnTextChanged,
|
||||
EventOnFontChanged,
|
||||
EventOnPressEnter,
|
||||
EventOnValueChange,
|
||||
EventOnWidgetFocusLoss,
|
||||
EventOnItemClicked,
|
||||
EventOnHideByClick,
|
||||
EventOnItemKeyDown,
|
||||
EventOnItemKeyUp,
|
||||
EventOnItemSelected,
|
||||
EventOnCursorPosChange,
|
||||
EventOnParentSizeChange,
|
||||
EventOnWindowClose,
|
||||
EventOnWindowCloseClick,
|
||||
EventOnWindowMaximizeClick,
|
||||
EventOnWindowMinimizeClick,
|
||||
EventOpenFile,
|
||||
EventSaveFile,
|
||||
EventOnControlClear,
|
||||
EventMsgBoxConfirmClick,
|
||||
EventOnTabSelected,
|
||||
EventOnClose, // Warning: Only some controls will report this event.
|
||||
EventOnDragStart,
|
||||
EventOnDragStop,
|
||||
EventUser,
|
||||
EventForceDWord = eeINDEX_NOT_FOUND
|
||||
KeyDown = 0,
|
||||
KeyUp,
|
||||
MouseMove,
|
||||
MouseDown,
|
||||
MouseClick,
|
||||
MouseDoubleClick,
|
||||
MouseUp,
|
||||
MouseEnter,
|
||||
MouseExit,
|
||||
OnFocus,
|
||||
OnFocusLoss,
|
||||
OnVisibleChange,
|
||||
OnEnabledChange,
|
||||
OnPosChange,
|
||||
OnSizeChange,
|
||||
OnAngleChange,
|
||||
OnScaleChange,
|
||||
OnAlphaChange,
|
||||
OnTextChanged,
|
||||
OnFontChanged,
|
||||
OnPressEnter,
|
||||
OnValueChange,
|
||||
OnWidgetFocusLoss,
|
||||
OnItemClicked,
|
||||
OnHideByClick,
|
||||
OnItemKeyDown,
|
||||
OnItemKeyUp,
|
||||
OnItemSelected,
|
||||
OnCursorPosChange,
|
||||
OnParentSizeChange,
|
||||
OnWindowClose,
|
||||
OnWindowCloseClick,
|
||||
OnWindowMaximizeClick,
|
||||
OnWindowMinimizeClick,
|
||||
OpenFile,
|
||||
SaveFile,
|
||||
OnControlClear,
|
||||
MsgBoxConfirmClick,
|
||||
OnTabSelected,
|
||||
OnClose, // Warning: Only some controls will report this event.
|
||||
OnDragStart,
|
||||
OnDragStop,
|
||||
UserEvent,
|
||||
NoEvent = eeINDEX_NOT_FOUND
|
||||
};
|
||||
|
||||
UIEvent( UIControl * control, const Uint32& eventType = EventForceDWord );
|
||||
UIEvent( UIControl * control, const Uint32& eventType = NoEvent );
|
||||
|
||||
~UIEvent();
|
||||
|
||||
|
||||
@@ -11,25 +11,25 @@ class EE_API UIMessage {
|
||||
public:
|
||||
enum Message
|
||||
{
|
||||
MsgClick = 0,
|
||||
MsgDoubleClick,
|
||||
MsgMouseEnter,
|
||||
MsgMouseExit,
|
||||
MsgMouseDown,
|
||||
MsgMouseUp,
|
||||
MsgWindowResize,
|
||||
MsgFocus,
|
||||
MsgFocusLoss,
|
||||
MsgCellClicked,
|
||||
MsgSelected,
|
||||
MsgDragStart,
|
||||
MsgDragStop,
|
||||
MsgLayoutAttributeChange,
|
||||
MsgUser,
|
||||
MsgForceDWord = eeINDEX_NOT_FOUND
|
||||
Click = 0,
|
||||
DoubleClick,
|
||||
MouseEnter,
|
||||
MouseExit,
|
||||
MouseDown,
|
||||
MouseUp,
|
||||
WindowResize,
|
||||
Focus,
|
||||
FocusLoss,
|
||||
CellClicked,
|
||||
Selected,
|
||||
DragStart,
|
||||
DragStop,
|
||||
LayoutAttributeChange,
|
||||
UserMessage,
|
||||
NoMessage = eeINDEX_NOT_FOUND
|
||||
};
|
||||
|
||||
UIMessage( UIControl * Ctrl, const Uint32& getMsg, const Uint32& getFlags = MsgForceDWord );
|
||||
UIMessage( UIControl * Ctrl, const Uint32& getMsg, const Uint32& getFlags = NoMessage );
|
||||
|
||||
~UIMessage();
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ MapEditor::MapEditor( UIWindow * AttatchTo, const MapEditorCloseCb& callback ) :
|
||||
}
|
||||
|
||||
mUIWindow->setTitle( "Map Editor" );
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapEditor::windowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &MapEditor::windowClose ) );
|
||||
|
||||
createME();
|
||||
}
|
||||
@@ -102,7 +102,7 @@ void MapEditor::createWinMenu() {
|
||||
PU1->addSeparator();
|
||||
PU1->add( "Quit", mTheme->getIconByName( "quit" ) );
|
||||
|
||||
PU1->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &MapEditor::fileMenuClick ) );
|
||||
PU1->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &MapEditor::fileMenuClick ) );
|
||||
WinMenu->addMenuButton( "File", PU1 );
|
||||
|
||||
UIPopUpMenu * PU3 = UIPopUpMenu::New();
|
||||
@@ -121,7 +121,7 @@ void MapEditor::createWinMenu() {
|
||||
mUIWindow->addShortcut( KEY_KP0 , KEYMOD_CTRL, reinterpret_cast<UIPushButton*> ( PU3->getItem( PU3->add( "Normal Size", mTheme->getIconByName( "zoom-original" ) ) ) ) );
|
||||
PU3->addSeparator();
|
||||
|
||||
PU3->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &MapEditor::viewMenuClick ) );
|
||||
PU3->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &MapEditor::viewMenuClick ) );
|
||||
WinMenu->addMenuButton( "View", PU3 );
|
||||
|
||||
UIPopUpMenu * PU4 = UIPopUpMenu::New();
|
||||
@@ -129,7 +129,7 @@ void MapEditor::createWinMenu() {
|
||||
PU4->add( "Properties..." );
|
||||
PU4->add( "Resize..." );
|
||||
|
||||
PU4->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &MapEditor::mapMenuClick ) );
|
||||
PU4->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &MapEditor::mapMenuClick ) );
|
||||
WinMenu->addMenuButton( "Map", PU4 );
|
||||
|
||||
UIPopUpMenu * PU5 = UIPopUpMenu::New();
|
||||
@@ -153,7 +153,7 @@ void MapEditor::createWinMenu() {
|
||||
LayerChkBoxIndex = PU5->addCheckBox( "Visible" );
|
||||
mLayerChkVisible = reinterpret_cast<UIMenuCheckBox*> ( PU5->getItem( LayerChkBoxIndex ) );
|
||||
|
||||
PU5->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &MapEditor::layerMenuClick ) );
|
||||
PU5->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &MapEditor::layerMenuClick ) );
|
||||
WinMenu->addMenuButton( "Layer", PU5 );
|
||||
|
||||
UIPopUpMenu * PU6 = UIPopUpMenu::New();
|
||||
@@ -161,7 +161,7 @@ void MapEditor::createWinMenu() {
|
||||
PU6->add( "New Texture Atlas..." );
|
||||
PU6->add( "Add External Texture Atlas..." );
|
||||
WinMenu->addMenuButton( "Atlases", PU6 );
|
||||
PU6->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &MapEditor::mapMenuClick ) );
|
||||
PU6->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &MapEditor::mapMenuClick ) );
|
||||
|
||||
mWinContainer = UIWidget::New();
|
||||
mWinContainer->setFlags( UI_REPORT_SIZE_CHANGE_TO_CHILDS );
|
||||
@@ -199,7 +199,7 @@ void MapEditor::createETGMenu() {
|
||||
setPosition( ContPosX, DistFromTopMenu )->resetFlags()->
|
||||
setFlags( UI_HALIGN_CENTER | UI_VALIGN_BOTTOM | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM );
|
||||
|
||||
mTabWidget->addEventListener( UIEvent::EventOnTabSelected, cb::Make1( this, &MapEditor::onTabSelected ) );
|
||||
mTabWidget->addEventListener( UIEvent::OnTabSelected, cb::Make1( this, &MapEditor::onTabSelected ) );
|
||||
|
||||
createTabs();
|
||||
|
||||
@@ -258,7 +258,7 @@ void MapEditor::createSubTextureContainer( Int32 Width ) {
|
||||
mGOTypeList = UIDropDownList::New();
|
||||
mGOTypeList->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setSize( Width - 26, 0 )->setPosition( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
|
||||
mGOTypeList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::onTypeChange ) );
|
||||
mGOTypeList->addEventListener( UIEvent::OnItemSelected, cb::Make1( this, &MapEditor::onTypeChange ) );
|
||||
fillGotyList();
|
||||
|
||||
mBtnGOTypeAdd = UIPushButton::New();
|
||||
@@ -266,7 +266,7 @@ void MapEditor::createSubTextureContainer( Int32 Width ) {
|
||||
->setPosition( mGOTypeList->getPosition().x + mGOTypeList->getSize().getWidth() + 2, mGOTypeList->getPosition().y );
|
||||
mBtnGOTypeAdd->setIcon( mTheme->getIconByName( "add" ) )->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
mBtnGOTypeAdd->setTooltipText( "Adds a new game object type\nunknown by the map editor." );
|
||||
mBtnGOTypeAdd->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::addNewGOType ) );
|
||||
mBtnGOTypeAdd->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapEditor::addNewGOType ) );
|
||||
|
||||
if ( NULL == mBtnGOTypeAdd->getIcon()->getDrawable() )
|
||||
mBtnGOTypeAdd->setText( "..." );
|
||||
@@ -276,7 +276,7 @@ void MapEditor::createSubTextureContainer( Int32 Width ) {
|
||||
mLayerList = UIDropDownList::New();
|
||||
mLayerList->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setSize( Width, 0 )->setPosition( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 );
|
||||
|
||||
mLayerList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::onLayerSelect ) );
|
||||
mLayerList->addEventListener( UIEvent::OnItemSelected, cb::Make1( this, &MapEditor::onLayerSelect ) );
|
||||
|
||||
Txt = createTextBox( "Game Object Flags:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mLayerList->getPosition().y + mLayerList->getSize().getHeight() + 4 ), TxtFlags, Text::Shadow );
|
||||
|
||||
@@ -285,35 +285,35 @@ void MapEditor::createSubTextureContainer( Int32 Width ) {
|
||||
mChkMirrored = UICheckBox::New();
|
||||
mChkMirrored->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 )->resetFlags( ChkFlags );
|
||||
mChkMirrored->setText( "Mirrored" );
|
||||
mChkMirrored->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickMirrored ) );
|
||||
mChkMirrored->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickMirrored ) );
|
||||
|
||||
mChkFliped = UICheckBox::New();
|
||||
mChkFliped->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( mChkMirrored->getPosition().x + mChkMirrored->getSize().getWidth() + 32, mChkMirrored->getPosition().y )->resetFlags( ChkFlags );
|
||||
mChkFliped->setText( "Fliped" );
|
||||
mChkFliped->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickFlipped ) );
|
||||
mChkFliped->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickFlipped ) );
|
||||
|
||||
mChkBlocked = UICheckBox::New();
|
||||
mChkBlocked->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( mChkMirrored->getPosition().x, mChkMirrored->getPosition().y + mChkMirrored->getSize().getHeight() + 4 )->resetFlags( ChkFlags );
|
||||
mChkBlocked->setText( "Blocked" );
|
||||
mChkBlocked->setTooltipText( "Blocks the tile occupied by the sprite." );
|
||||
mChkBlocked->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickBlocked ) );
|
||||
mChkBlocked->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickBlocked ) );
|
||||
|
||||
mChkAnim = UICheckBox::New();
|
||||
mChkAnim->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( mChkFliped->getPosition().x, mChkFliped->getPosition().y + mChkFliped->getSize().getHeight() + 4 )->resetFlags( ChkFlags );
|
||||
mChkAnim->setText( "Animated" );
|
||||
mChkAnim->setTooltipText( "Indicates if the Sprite is animated." );
|
||||
mChkAnim->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickAnimated ) );
|
||||
mChkAnim->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickAnimated ) );
|
||||
|
||||
mChkRot90 = UICheckBox::New();
|
||||
mChkRot90->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( mChkBlocked->getPosition().x, mChkBlocked->getPosition().y + mChkBlocked->getSize().getHeight() + 4 )->resetFlags( ChkFlags );
|
||||
mChkRot90->setText( String::fromUtf8( "Rotate 90º" ) );
|
||||
mChkRot90->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickRot90 ) );
|
||||
mChkRot90->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickRot90 ) );
|
||||
|
||||
mChkAutoFix = UICheckBox::New();
|
||||
mChkAutoFix->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( mChkAnim->getPosition().x, mChkAnim->getPosition().y + mChkAnim->getSize().getHeight() + 4 )->resetFlags( ChkFlags );
|
||||
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::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickAutoFix ) );
|
||||
mChkAutoFix->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickAutoFix ) );
|
||||
|
||||
Txt = createTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->getPosition().y + mChkRot90->getSize().getHeight() + 8 ), TxtFlags, Text::Shadow );
|
||||
|
||||
@@ -321,7 +321,7 @@ void MapEditor::createSubTextureContainer( Int32 Width ) {
|
||||
mChkDI->setFontStyle( Text::Shadow )->setParent( mSubTextureCont )->setPosition( TAB_CONT_X_DIST, Txt->getPosition().y + Txt->getSize().getHeight() + 4 )->resetFlags( ChkFlags );
|
||||
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::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickDI ) );
|
||||
mChkDI->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickDI ) );
|
||||
|
||||
mSGCont = UIWidget::New();
|
||||
mSGCont->setParent( mSubTextureCont )->setPosition( TAB_CONT_X_DIST, mChkDI->getPosition().y + mChkDI->getSize().getHeight() + 8 )->setSize( Width, 400 );
|
||||
@@ -333,14 +333,14 @@ void MapEditor::createSubTextureContainer( Int32 Width ) {
|
||||
|
||||
mTextureAtlasesList = UIDropDownList::New();
|
||||
mTextureAtlasesList->setFontStyle( Text::Shadow )->setParent( mSGCont )->setSize( Width, 0 )->setPosition( 0, Txt->getPosition().y +Txt->getSize().getHeight() + 4 );
|
||||
mTextureAtlasesList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::onTextureAtlasChange ) );
|
||||
mTextureAtlasesList->addEventListener( UIEvent::OnItemSelected, cb::Make1( this, &MapEditor::onTextureAtlasChange ) );
|
||||
|
||||
mSubTextureList = UIListBox::New();
|
||||
mSubTextureList->setParent( mSGCont )
|
||||
->setPosition( 0, mTextureAtlasesList->getPosition().y + mTextureAtlasesList->getSize().getHeight() + 4 )
|
||||
->setSize( Width, mSubTextureList->getRowHeight() * 9 + mSubTextureList->getContainerPadding().Top + mSubTextureList->getContainerPadding().Bottom );
|
||||
mSubTextureList->setAnchors(UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
mSubTextureList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::onSubTextureChange ) );
|
||||
mSubTextureList->addEventListener( UIEvent::OnItemSelected, cb::Make1( this, &MapEditor::onSubTextureChange ) );
|
||||
|
||||
mGfxPreview = UISubTexture::New();
|
||||
mGfxPreview->setScaleType( UIScaleType::FitInside )
|
||||
@@ -369,7 +369,7 @@ void MapEditor::createLighContainer() {
|
||||
UIPushButton * NewLightBut = UIPushButton::New();
|
||||
NewLightBut->setParent( mLightCont )->setSize( mLightCont->getSize().getWidth() - TAB_CONT_X_DIST * 2, 0 )->setPosition( TAB_CONT_X_DIST, 0 );
|
||||
NewLightBut->setText( "New Light" );
|
||||
NewLightBut->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::onNewLight ) );
|
||||
NewLightBut->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapEditor::onNewLight ) );
|
||||
|
||||
UITextView * Txt = createTextBox( "Light Color:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, 32 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE );
|
||||
Txt->setFontStyle( Text::Shadow );
|
||||
@@ -388,7 +388,7 @@ void MapEditor::createLighContainer() {
|
||||
mUIRedSlider->setParent( mLightCont )->setSize( 100, 20 )->setPosition( Txt->getPosition().x + Txt->getSize().getWidth(), Txt->getPosition().y );
|
||||
mUIRedSlider->setMaxValue( 255 );
|
||||
mUIRedSlider->setValue( 255 );
|
||||
mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onRedChange ) );
|
||||
mUIRedSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onRedChange ) );
|
||||
|
||||
mUIRedTxt = createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -397,7 +397,7 @@ void MapEditor::createLighContainer() {
|
||||
mUIGreenSlider->setParent( mLightCont )->setSize( 100, 20 )->setPosition( mUIRedSlider->getPosition().x, Txt->getPosition().y );
|
||||
mUIGreenSlider->setMaxValue( 255 );
|
||||
mUIGreenSlider->setValue( 255 );
|
||||
mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onGreenChange ) );
|
||||
mUIGreenSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onGreenChange ) );
|
||||
|
||||
mUIGreenTxt = createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -406,7 +406,7 @@ void MapEditor::createLighContainer() {
|
||||
mUIBlueSlider->setParent( mLightCont )->setSize( 100, 20 )->setPosition( mUIRedSlider->getPosition().x, Txt->getPosition().y );
|
||||
mUIBlueSlider->setMaxValue( 255 );
|
||||
mUIBlueSlider->setValue( 255 );
|
||||
mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onBlueChange ) );
|
||||
mUIBlueSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onBlueChange ) );
|
||||
|
||||
mUIBlueTxt = createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -415,13 +415,13 @@ void MapEditor::createLighContainer() {
|
||||
mLightRadius = UISpinBox::New()->setAllowOnlyNumbers( false )->setValue( 100 );
|
||||
mLightRadius->setParent( mLightCont )->setSize( 100, 0 )->setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 8 );
|
||||
mLightRadius->setMaxValue( 2000 );
|
||||
mLightRadius->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onLightRadiusChangeVal ) );
|
||||
mLightRadius->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onLightRadiusChangeVal ) );
|
||||
|
||||
mLightTypeChk = UICheckBox::New();
|
||||
mLightTypeChk->setParent( mLightCont )->setPosition( mLightRadius->getPosition().x, mLightRadius->getPosition().y + mLightRadius->getSize().getHeight() + 8 )->setFlags( UI_AUTO_SIZE );
|
||||
mLightTypeChk->setText( "Isometric Light" );
|
||||
mLightTypeChk->setActive( false );
|
||||
mLightTypeChk->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onLightTypeChange ) );
|
||||
mLightTypeChk->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onLightTypeChange ) );
|
||||
}
|
||||
|
||||
UISelectButton * MapEditor::addObjContButton( String text, Uint32 mode ) {
|
||||
@@ -431,7 +431,7 @@ UISelectButton * MapEditor::addObjContButton( String text, Uint32 mode ) {
|
||||
Button->setText( text );
|
||||
Button->setData( mode );
|
||||
|
||||
Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::onObjectModeSel ) );
|
||||
Button->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapEditor::onObjectModeSel ) );
|
||||
|
||||
mLastSelButtonY += Button->getSize().getHeight() + 4;
|
||||
|
||||
@@ -454,7 +454,7 @@ void MapEditor::createObjectsContainer() {
|
||||
mChkClampToTile = UICheckBox::New();
|
||||
mChkClampToTile->setParent( mObjectCont )->setPosition( 12, nextY )->resetFlags( ChkFlags );
|
||||
mChkClampToTile->setText( "Clamp Position to Tile" );
|
||||
mChkClampToTile->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::chkClickClampToTile ) );
|
||||
mChkClampToTile->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::chkClickClampToTile ) );
|
||||
mChkClampToTile->setActive( true );
|
||||
}
|
||||
|
||||
@@ -496,9 +496,9 @@ void MapEditor::createUIMap() {
|
||||
mUIMap->setVisible( true );
|
||||
mUIMap->setEnabled( true );
|
||||
createNewEmptyMap();
|
||||
mUIMap->addEventListener( UIEvent::EventOnSizeChange, cb::Make1( this, &MapEditor::onMapSizeChange ) );
|
||||
mUIMap->addEventListener( UIEvent::EventMouseDown, cb::Make1( this, &MapEditor::onMapMouseDown ) );
|
||||
mUIMap->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::onMapMouseClick ) );
|
||||
mUIMap->addEventListener( UIEvent::OnSizeChange, cb::Make1( this, &MapEditor::onMapSizeChange ) );
|
||||
mUIMap->addEventListener( UIEvent::MouseDown, cb::Make1( this, &MapEditor::onMapMouseDown ) );
|
||||
mUIMap->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapEditor::onMapMouseClick ) );
|
||||
mUIMap->setLightSelectCb( cb::Make1( this, &MapEditor::onLightSelect ) );
|
||||
mUIMap->setLightRadiusChangeCb( cb::Make1( this, &MapEditor::onLightRadiusChange ) );
|
||||
mUIMap->setAddObjectCallback( cb::Make2( this, &MapEditor::onAddObject ) );
|
||||
@@ -512,13 +512,13 @@ void MapEditor::createUIMap() {
|
||||
->setSize( mWinContainer->getSize().getWidth() - 225 - ScrollV, ScrollH )
|
||||
->setPosition( 0, mWinContainer->getSize().getHeight() - ScrollH );
|
||||
mMapHScroll->setAnchors( UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
mMapHScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onScrollMapH ) );
|
||||
mMapHScroll->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onScrollMapH ) );
|
||||
|
||||
mMapVScroll = UIScrollBar::New();
|
||||
mMapVScroll->setParent( mWinContainer )->setSize( ScrollV, mWinContainer->getSize().getHeight() - ScrollH )
|
||||
->setPosition( mWinContainer->getSize().getWidth() - 225 - ScrollV, 0 );
|
||||
mMapVScroll->setAnchors( UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM );
|
||||
mMapVScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::onScrollMapV ) );
|
||||
mMapVScroll->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &MapEditor::onScrollMapV ) );
|
||||
|
||||
mapCreated();
|
||||
}
|
||||
@@ -920,14 +920,14 @@ void MapEditor::fileMenuClick( const UIEvent * Event ) {
|
||||
UICommonDialog * TGDialog = UICommonDialog::New( UI_CDL_DEFAULT_FLAGS, "*.eem" );
|
||||
TGDialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
|
||||
TGDialog->setTitle( "Open Map" );
|
||||
TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &MapEditor::mapOpen ) );
|
||||
TGDialog->addEventListener( UIEvent::OpenFile, cb::Make1( this, &MapEditor::mapOpen ) );
|
||||
TGDialog->center();
|
||||
TGDialog->show();
|
||||
} else if ( "Save As..." == txt ) {
|
||||
UICommonDialog * TGDialog = UICommonDialog::New( UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*.eem" );
|
||||
TGDialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
|
||||
TGDialog->setTitle( "Save Map" );
|
||||
TGDialog->addEventListener( UIEvent::EventSaveFile, cb::Make1( this, &MapEditor::mapSave ) );
|
||||
TGDialog->addEventListener( UIEvent::SaveFile, cb::Make1( this, &MapEditor::mapSave ) );
|
||||
TGDialog->center();
|
||||
TGDialog->show();
|
||||
} else if ( "Save" == txt ) {
|
||||
@@ -936,7 +936,7 @@ void MapEditor::fileMenuClick( const UIEvent * Event ) {
|
||||
}
|
||||
} else if ( "Close" == txt ) {
|
||||
UIMessageBox * MsgBox = UIMessageBox::New( MSGBOX_OKCANCEL, "Do you really want to close the current map?\nAll changes will be lost." );
|
||||
MsgBox->addEventListener( UIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &MapEditor::onMapClose ) );
|
||||
MsgBox->addEventListener( UIEvent::MsgBoxConfirmClick, cb::Make1( this, &MapEditor::onMapClose ) );
|
||||
MsgBox->setTitle( "Close Map?" );
|
||||
MsgBox->center();
|
||||
MsgBox->show();
|
||||
@@ -1057,7 +1057,7 @@ void MapEditor::mapMenuClick( const UIEvent * Event ) {
|
||||
UICommonDialog * TGDialog = UICommonDialog::New( UI_CDL_DEFAULT_FLAGS, std::string( "*" ) + EE_TEXTURE_ATLAS_EXTENSION );
|
||||
TGDialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
|
||||
TGDialog->setTitle( "Load Texture Atlas..." );
|
||||
TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &MapEditor::cextureAtlasOpen ) );
|
||||
TGDialog->addEventListener( UIEvent::OpenFile, cb::Make1( this, &MapEditor::cextureAtlasOpen ) );
|
||||
TGDialog->center();
|
||||
TGDialog->show();
|
||||
} else if ( "Properties..." == txt ) {
|
||||
|
||||
@@ -23,7 +23,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
mUIWindow = UIWindow::New();
|
||||
mUIWindow->setSizeWithDecoration( 500, 500 )->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL )->setMinWindowSize( 500, 500 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapLayerProperties::onWindowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &MapLayerProperties::onWindowClose ) );
|
||||
mUIWindow->setTitle( "Layer Properties" );
|
||||
|
||||
Int32 InitialY = 16;
|
||||
@@ -36,7 +36,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
mUIInput = UITextInput::New()->setMaxLength( 64 );
|
||||
mUIInput->setParent( mUIWindow->getContainer() )->setSize( 120, 0 )->setPosition( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle );
|
||||
mUIInput->setText( mLayer->getName() );
|
||||
mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapLayerProperties::onOKClick ) );
|
||||
mUIInput->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &MapLayerProperties::onOKClick ) );
|
||||
|
||||
UITextView * TxtBox = UITextView::New();
|
||||
TxtBox->setFontStyle( Text::Shadow )->setParent( mUIWindow->getContainer() )->setSize( 192, 24 )->setHorizontalAlign( UI_HALIGN_CENTER )
|
||||
@@ -52,14 +52,14 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
OKButton->setParent( mUIWindow->getContainer() )->setSize( 80, 0 );
|
||||
OKButton->setIcon( mUITheme->getIconByName( "ok" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onOKClick ) );
|
||||
OKButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapLayerProperties::onOKClick ) );
|
||||
OKButton->setText( "OK" );
|
||||
OKButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
|
||||
UIPushButton * CancelButton = UIPushButton::New();
|
||||
CancelButton->setParent( mUIWindow->getContainer() )->setSize( OKButton->getSize() )->setPosition( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y );
|
||||
CancelButton->setIcon( mUITheme->getIconByName( "cancel" ) );
|
||||
CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onCancelClick ) );
|
||||
CancelButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapLayerProperties::onCancelClick ) );
|
||||
CancelButton->setText( "Cancel" );
|
||||
CancelButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
|
||||
@@ -80,7 +80,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
AddButton->setParent( mUIWindow->getContainer() )->setSize( 24, 0 )->setPosition( Pos );
|
||||
AddButton->setIcon( mUITheme->getIconByName( "add" ) );
|
||||
AddButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onAddCellClick ) );
|
||||
AddButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapLayerProperties::onAddCellClick ) );
|
||||
|
||||
if ( NULL == AddButton->getIcon()->getDrawable() )
|
||||
AddButton->setText( "+" );
|
||||
@@ -91,7 +91,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb )
|
||||
RemoveButton->setParent( mUIWindow->getContainer() )->setSize( 24, 0 )->setPosition( Pos );
|
||||
RemoveButton->setIcon( mUITheme->getIconByName( "remove" ) );
|
||||
RemoveButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onRemoveCellClick ) );
|
||||
RemoveButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapLayerProperties::onRemoveCellClick ) );
|
||||
|
||||
if ( NULL == RemoveButton->getIcon()->getDrawable() )
|
||||
RemoveButton->setText( "-" );
|
||||
|
||||
@@ -30,7 +30,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
mUIWindow = UIWindow::New();
|
||||
mUIWindow->setSizeWithDecoration( 500, 500 )->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL )->setMinWindowSize( 500, 500 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapObjectProperties::onWindowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &MapObjectProperties::onWindowClose ) );
|
||||
mUIWindow->setTitle( "Object Properties" );
|
||||
|
||||
Int32 InitialY = 16;
|
||||
@@ -41,14 +41,14 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
mUIInput->setParent( mUIWindow->getContainer() )->setSize( 120, 0 )->setPosition( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle );
|
||||
mUIInput->setMaxLength( 64 );
|
||||
mUIInput->setText( mObj->getName() );
|
||||
mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::onOKClick ) );
|
||||
mUIInput->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &MapObjectProperties::onOKClick ) );
|
||||
|
||||
UITextView * Txt2 = createTextBox( "Object type:", mUIWindow->getContainer(), Sizei(), Vector2i( 50+192, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
mUIInput2 = UITextInput::New();
|
||||
mUIInput2->setParent( mUIWindow->getContainer() )->setSize( 120, 0 )->setPosition( Txt2->getPosition().x + DistFromTitle, Txt2->getPosition().y + DistFromTitle );
|
||||
mUIInput2->setMaxLength( 64 );
|
||||
mUIInput2->setText( mObj->getTypeName() );
|
||||
mUIInput2->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::onOKClick ) );
|
||||
mUIInput2->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &MapObjectProperties::onOKClick ) );
|
||||
|
||||
Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_HALIGN_CENTER | UI_VALIGN_CENTER;
|
||||
createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags, Text::Shadow );
|
||||
@@ -58,14 +58,14 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
OKButton->setParent( mUIWindow->getContainer() )->setSize( 80, 0 );
|
||||
OKButton->setIcon( mUITheme->getIconByName( "ok" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onOKClick ) );
|
||||
OKButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapObjectProperties::onOKClick ) );
|
||||
OKButton->setText( "OK" );
|
||||
OKButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
|
||||
UIPushButton * CancelButton = UIPushButton::New();
|
||||
CancelButton->setParent( mUIWindow->getContainer() )->setSize( OKButton->getSize() )->setPosition( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y );
|
||||
CancelButton->setIcon( mUITheme->getIconByName( "cancel" ) );
|
||||
CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onCancelClick ) );
|
||||
CancelButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapObjectProperties::onCancelClick ) );
|
||||
CancelButton->setText( "Cancel" );
|
||||
CancelButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
|
||||
@@ -86,7 +86,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
AddButton->setParent( mUIWindow->getContainer() )->setSize( 24, 0 )->setPosition( Pos );
|
||||
AddButton->setIcon( mUITheme->getIconByName( "add" ) );
|
||||
AddButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onAddCellClick ) );
|
||||
AddButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapObjectProperties::onAddCellClick ) );
|
||||
|
||||
if ( NULL == AddButton->getIcon()->getDrawable() )
|
||||
AddButton->setText( "+" );
|
||||
@@ -97,7 +97,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) :
|
||||
RemoveButton->setParent( mUIWindow->getContainer() )->setSize( 24, 0 )->setPosition( Pos );
|
||||
RemoveButton->setIcon( mUITheme->getIconByName( "remove" ) );
|
||||
RemoveButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onRemoveCellClick ) );
|
||||
RemoveButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &MapObjectProperties::onRemoveCellClick ) );
|
||||
|
||||
if ( NULL == RemoveButton->getIcon()->getDrawable() )
|
||||
RemoveButton->setText( "-" );
|
||||
|
||||
@@ -29,7 +29,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
mUIWindow = UIWindow::New();
|
||||
mUIWindow->setSizeWithDecoration( 500, 500 )->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL )->setMinWindowSize( 500, 500 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TileMapProperties::onWindowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &TileMapProperties::onWindowClose ) );
|
||||
mUIWindow->setTitle( "Map Properties" );
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
mUIRedSlider->setParent( mUIWindow->getContainer() )->setSize( 255, 20 )->setPosition( Txt->getPosition().x + Txt->getSize().getWidth() + 16, Txt->getPosition().y );
|
||||
mUIRedSlider->setMaxValue( 255 );
|
||||
mUIRedSlider->setValue( mMap->getBaseColor().r );
|
||||
mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::onRedChange ) );
|
||||
mUIRedSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TileMapProperties::onRedChange ) );
|
||||
|
||||
mUIRedTxt = createTextBox( String::toStr( (Uint32)mMap->getBaseColor().r ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -63,7 +63,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
mUIGreenSlider->setParent( mUIWindow->getContainer() )->setSize( 255, 20 )->setPosition( mUIRedSlider->getPosition().x, Txt->getPosition().y );
|
||||
mUIGreenSlider->setMaxValue( 255 );
|
||||
mUIGreenSlider->setValue( mMap->getBaseColor().g );
|
||||
mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::onGreenChange ) );
|
||||
mUIGreenSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TileMapProperties::onGreenChange ) );
|
||||
|
||||
mUIGreenTxt = createTextBox( String::toStr( (Uint32)mMap->getBaseColor().g ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -72,7 +72,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
mUIBlueSlider->setParent( mUIWindow->getContainer() )->setSize( 255, 20 )->setPosition( mUIRedSlider->getPosition().x, Txt->getPosition().y );
|
||||
mUIBlueSlider->setMaxValue( 255 );
|
||||
mUIBlueSlider->setValue( mMap->getBaseColor().b );
|
||||
mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::onBlueChange ) );
|
||||
mUIBlueSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TileMapProperties::onBlueChange ) );
|
||||
|
||||
mUIBlueTxt = createTextBox( String::toStr( (Uint32)mMap->getBaseColor().b ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
}
|
||||
@@ -85,14 +85,14 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
OKButton->setParent( mUIWindow->getContainer() )->setSize( 80, 0 );
|
||||
OKButton->setIcon( mUITheme->getIconByName( "ok" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onOKClick ) );
|
||||
OKButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TileMapProperties::onOKClick ) );
|
||||
OKButton->setText( "OK" );
|
||||
OKButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
|
||||
UIPushButton * CancelButton = UIPushButton::New();
|
||||
CancelButton->setParent( mUIWindow->getContainer() )->setSize( OKButton->getSize() )->setPosition( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y );
|
||||
CancelButton->setIcon( mUITheme->getIconByName( "cancel" ) );
|
||||
CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onCancelClick ) );
|
||||
CancelButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TileMapProperties::onCancelClick ) );
|
||||
CancelButton->setText( "Cancel" );
|
||||
CancelButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
|
||||
@@ -113,7 +113,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
AddButton->setParent( mUIWindow->getContainer() )->setSize( 24, 0 )->setPosition( Pos );
|
||||
AddButton->setIcon( mUITheme->getIconByName( "add" ) );
|
||||
AddButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onAddCellClick ) );
|
||||
AddButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TileMapProperties::onAddCellClick ) );
|
||||
|
||||
if ( NULL == AddButton->getIcon()->getDrawable() )
|
||||
AddButton->setText( "+" );
|
||||
@@ -124,7 +124,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
RemoveButton->setParent( mUIWindow->getContainer() )->setSize( 24, 0 )->setPosition( Pos );
|
||||
RemoveButton->setIcon( mUITheme->getIconByName( "remove" ) );
|
||||
RemoveButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_TOP );
|
||||
RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onRemoveCellClick ) );
|
||||
RemoveButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TileMapProperties::onRemoveCellClick ) );
|
||||
|
||||
if ( NULL == RemoveButton->getIcon()->getDrawable() )
|
||||
RemoveButton->setText( "-" );
|
||||
|
||||
@@ -16,7 +16,7 @@ UIGOTypeNew::UIGOTypeNew( cb::Callback2<void, std::string, Uint32> Cb ) :
|
||||
mUIWindow = UIWindow::New();
|
||||
mUIWindow->setSizeWithDecoration( 278, 114 )->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL )->setMinWindowSize( 278, 114 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIGOTypeNew::onWindowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &UIGOTypeNew::onWindowClose ) );
|
||||
mUIWindow->setTitle( "Add GameObject Type" );
|
||||
|
||||
Int32 InitialY = 16;
|
||||
@@ -33,15 +33,15 @@ UIGOTypeNew::UIGOTypeNew( cb::Callback2<void, std::string, Uint32> Cb ) :
|
||||
OKButton->setParent( mUIWindow->getContainer() )->setSize( 80, 0 );
|
||||
OKButton->setIcon( mUITheme->getIconByName( "add" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::onOKClick ) );
|
||||
mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIGOTypeNew::onOKClick ) );
|
||||
OKButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIGOTypeNew::onOKClick ) );
|
||||
mUIInput->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &UIGOTypeNew::onOKClick ) );
|
||||
|
||||
OKButton->setText( "Add" );
|
||||
|
||||
UIPushButton * CancelButton = UIPushButton::New();
|
||||
CancelButton->setParent( mUIWindow->getContainer() )->setSize( OKButton->getSize() )->setPosition( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y );
|
||||
CancelButton->setIcon( mUITheme->getIconByName( "cancel" ) );
|
||||
CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::onCancelClick ) );
|
||||
CancelButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIGOTypeNew::onCancelClick ) );
|
||||
CancelButton->setText( "Cancel" );
|
||||
|
||||
mUIWindow->center();
|
||||
|
||||
@@ -537,7 +537,7 @@ void UIMap::setUpdateScrollCb( UpdateScrollCb Cb ) {
|
||||
}
|
||||
|
||||
Uint32 UIMap::onMessage( const UIMessage * Msg ) {
|
||||
if ( Msg->getMsg() == UIMessage::MsgClick && Msg->getSender() == this && ( Msg->getFlags() & EE_BUTTON_RMASK ) ) {
|
||||
if ( Msg->getMsg() == UIMessage::Click && Msg->getSender() == this && ( Msg->getFlags() & EE_BUTTON_RMASK ) ) {
|
||||
if ( SELECT_OBJECTS == mEditingObjMode && NULL != mSelObj && mSelObj->pointInside( mMap->getMouseMapPosf() ) ) {
|
||||
createObjPopUpMenu();
|
||||
}
|
||||
@@ -575,7 +575,7 @@ void UIMap::createObjPopUpMenu() {
|
||||
Menu->add( "Remove Object" );
|
||||
Menu->addSeparator();
|
||||
Menu->add( "Object Properties..." );
|
||||
Menu->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &UIMap::objItemClick ) );
|
||||
Menu->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &UIMap::objItemClick ) );
|
||||
|
||||
if ( Menu->show() ) {
|
||||
Vector2i Pos = UIManager::instance()->getInput()->getMousePos();
|
||||
|
||||
@@ -18,7 +18,7 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay
|
||||
mUIWindow = UIWindow::New();
|
||||
mUIWindow->setSizeWithDecoration( 278, 114 )->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL )->setMinWindowSize( 278, 114 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapLayerNew::onWindowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &UIMapLayerNew::onWindowClose ) );
|
||||
|
||||
if ( MAP_LAYER_TILED == mType )
|
||||
mUIWindow->setTitle( "New Tile Layer" );
|
||||
@@ -40,18 +40,18 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay
|
||||
OKButton->setParent( mUIWindow->getContainer() )->setSize( 80, 0 );
|
||||
OKButton->setIcon( mTheme->getIconByName( "add" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::onOKClick ) );
|
||||
mUILayerName->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIMapLayerNew::onOKClick ) );
|
||||
OKButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIMapLayerNew::onOKClick ) );
|
||||
mUILayerName->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &UIMapLayerNew::onOKClick ) );
|
||||
|
||||
OKButton->setText( "Add" );
|
||||
|
||||
UIPushButton * CancelButton = UIPushButton::New();
|
||||
CancelButton->setParent( mUIWindow->getContainer() )->setSize( OKButton->getSize() )->setPosition( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y );
|
||||
CancelButton->setIcon( mTheme->getIconByName( "cancel" ) );
|
||||
CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::onCancelClick ) );
|
||||
CancelButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIMapLayerNew::onCancelClick ) );
|
||||
CancelButton->setText( "Cancel" );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventKeyUp, cb::Make1( this, &UIMapLayerNew::onOnKeyUp ) );
|
||||
mUIWindow->addEventListener( UIEvent::KeyUp, cb::Make1( this, &UIMapLayerNew::onOnKeyUp ) );
|
||||
|
||||
mUIWindow->center();
|
||||
mUIWindow->show();
|
||||
|
||||
@@ -27,7 +27,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
->setWinFlags( UI_WIN_CLOSE_BUTTON | UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS | UI_WIN_SHARE_ALPHA_WITH_CHILDS | UI_WIN_MODAL )
|
||||
->setMinWindowSize( 320, 380 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapNew::onWindowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &UIMapNew::onWindowClose ) );
|
||||
|
||||
if ( !mResizeMap ) {
|
||||
mUIWindow->setTitle( "New Map" );
|
||||
@@ -148,7 +148,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
mUIRedSlider->setParent( mUIWindow->getContainer() )->setSize( 128, 20 )->setPosition( Txt->getPosition().x + Txt->getSize().getWidth() + 16, Txt->getPosition().y );
|
||||
mUIRedSlider->setMaxValue( 255 );
|
||||
mUIRedSlider->setValue( 255 );
|
||||
mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::onRedChange ) );
|
||||
mUIRedSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIMapNew::onRedChange ) );
|
||||
|
||||
mUIRedTxt = createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -162,7 +162,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
mUIGreenSlider->setParent( mUIWindow->getContainer() )->setSize( 128, 20 )->setPosition( mUIRedSlider->getPosition().x, Txt->getPosition().y );
|
||||
mUIGreenSlider->setMaxValue( 255 );
|
||||
mUIGreenSlider->setValue( 255 );
|
||||
mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::onGreenChange ) );
|
||||
mUIGreenSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIMapNew::onGreenChange ) );
|
||||
|
||||
mUIGreenTxt = createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -176,7 +176,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
mUIBlueSlider->setParent( mUIWindow->getContainer() )->setSize( 128, 20 )->setPosition( mUIRedSlider->getPosition().x, Txt->getPosition().y );
|
||||
mUIBlueSlider->setMaxValue( 255 );
|
||||
mUIBlueSlider->setValue( 255 );
|
||||
mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::onBlueChange ) );
|
||||
mUIBlueSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIMapNew::onBlueChange ) );
|
||||
|
||||
mUIBlueTxt = createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow );
|
||||
|
||||
@@ -188,13 +188,13 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap )
|
||||
OKButton->setParent( mUIWindow->getContainer() )->setSize( 80, 0 );
|
||||
OKButton->setIcon( mTheme->getIconByName( "ok" ) );
|
||||
OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 );
|
||||
OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::onOKClick ) );
|
||||
OKButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIMapNew::onOKClick ) );
|
||||
OKButton->setText( "OK" );
|
||||
|
||||
UIPushButton * CancelButton = UIPushButton::New();
|
||||
CancelButton->setParent( mUIWindow->getContainer() )->setSize( OKButton->getSize() )->setPosition( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y );
|
||||
CancelButton->setIcon( mTheme->getIconByName( "cancel" ) );
|
||||
CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::onCancelClick ) );
|
||||
CancelButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIMapNew::onCancelClick ) );
|
||||
CancelButton->setText( "Cancel" );
|
||||
|
||||
mUIWindow->center();
|
||||
|
||||
@@ -97,32 +97,32 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos
|
||||
UIWidgetCreator::removeCustomWidgetCallback( "TextureAtlasSubTextureEditor" );
|
||||
|
||||
mUIContainer->bind( "SubTextureList", mSubTextureList );
|
||||
mSubTextureList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &TextureAtlasEditor::onSubTextureChange ) );
|
||||
mSubTextureList->addEventListener( UIEvent::OnItemSelected, cb::Make1( this, &TextureAtlasEditor::onSubTextureChange ) );
|
||||
|
||||
mUIContainer->bind( "offX", mSpinOffX );
|
||||
mSpinOffX->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffXChange ) );
|
||||
mSpinOffX->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffXChange ) );
|
||||
|
||||
mUIContainer->bind( "offY", mSpinOffY );
|
||||
mSpinOffY->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffYChange ) );
|
||||
mSpinOffY->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffYChange ) );
|
||||
|
||||
mUIContainer->bind( "destW", mSpinDestW );
|
||||
mSpinDestW->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestWChange ) );
|
||||
mSpinDestW->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestWChange ) );
|
||||
|
||||
mUIContainer->bind( "destH", mSpinDestH );
|
||||
mSpinDestH->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestHChange ) );
|
||||
mSpinDestH->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestHChange ) );
|
||||
|
||||
mUIContainer->find<UIPushButton>( "resetDest" )->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onResetDestSize ) );
|
||||
mUIContainer->find<UIPushButton>( "resetDest" )->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasEditor::onResetDestSize ) );
|
||||
|
||||
mUIContainer->find<UIPushButton>( "resetOff" )->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onResetOffset ) );
|
||||
mUIContainer->find<UIPushButton>( "resetOff" )->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasEditor::onResetOffset ) );
|
||||
|
||||
mUIContainer->find<UIPushButton>( "centerOff" )->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onCenterOffset ) );
|
||||
mUIContainer->find<UIPushButton>( "centerOff" )->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasEditor::onCenterOffset ) );
|
||||
|
||||
mUIContainer->find<UIPushButton>( "hbotOff" )->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onHBOffset ) );
|
||||
mUIContainer->find<UIPushButton>( "hbotOff" )->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasEditor::onHBOffset ) );
|
||||
|
||||
mUIContainer->find<UIPopUpMenu>("fileMenu")->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &TextureAtlasEditor::fileMenuClick ) );
|
||||
mUIContainer->find<UIPopUpMenu>("fileMenu")->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &TextureAtlasEditor::fileMenuClick ) );
|
||||
|
||||
mUIWindow->setTitle( "Texture Atlas Editor" );
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasEditor::windowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &TextureAtlasEditor::windowClose ) );
|
||||
|
||||
mTGEU = eeNew( UITGEUpdater, ( this ) );
|
||||
}
|
||||
@@ -225,7 +225,7 @@ void TextureAtlasEditor::fileMenuClick( const UIEvent * Event ) {
|
||||
UICommonDialog * TGDialog = UICommonDialog::New( UI_CDL_DEFAULT_FLAGS, std::string( "*" ) + EE_TEXTURE_ATLAS_EXTENSION );
|
||||
TGDialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
|
||||
TGDialog->setTitle( "Open Texture Atlas" );
|
||||
TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &TextureAtlasEditor::openTextureAtlas ) );
|
||||
TGDialog->addEventListener( UIEvent::OpenFile, cb::Make1( this, &TextureAtlasEditor::openTextureAtlas ) );
|
||||
TGDialog->center();
|
||||
TGDialog->show();
|
||||
} else if ( "Save" == txt ) {
|
||||
@@ -235,7 +235,7 @@ void TextureAtlasEditor::fileMenuClick( const UIEvent * Event ) {
|
||||
} else if ( "Close" == txt ) {
|
||||
if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) {
|
||||
UIMessageBox * MsgBox = UIMessageBox::New( MSGBOX_OKCANCEL, "Do you really want to close the current texture atlas?\nAll changes will be lost." );
|
||||
MsgBox->addEventListener( UIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &TextureAtlasEditor::onTextureAtlasClose ) );
|
||||
MsgBox->addEventListener( UIEvent::MsgBoxConfirmClick, cb::Make1( this, &TextureAtlasEditor::onTextureAtlasClose ) );
|
||||
MsgBox->setTitle( "Close Texture Atlas?" );
|
||||
MsgBox->center();
|
||||
MsgBox->show();
|
||||
|
||||
@@ -22,7 +22,7 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) :
|
||||
->setMinWindowSize( 378, 263 )
|
||||
->setWinFlags( UI_WIN_CLOSE_BUTTON | UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS | UI_WIN_SHARE_ALPHA_WITH_CHILDS | UI_WIN_MODAL );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasNew::windowClose ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowClose, cb::Make1( this, &TextureAtlasNew::windowClose ) );
|
||||
mUIWindow->setTitle( "New Texture Atlas" );
|
||||
|
||||
std::string layout =
|
||||
@@ -91,9 +91,9 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) :
|
||||
mComboWidth->getListBox()->setSelected( "2048" );
|
||||
mComboHeight->getListBox()->setSelected( "2048" );
|
||||
|
||||
mSetPathButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::onDialogFolderSelect ) );
|
||||
mUIWindow->find<UIPushButton>( "okButton" )->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::okClick ) );
|
||||
mUIWindow->find<UIPushButton>( "cancelButton" )->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::cancelClick ) );
|
||||
mSetPathButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasNew::onDialogFolderSelect ) );
|
||||
mUIWindow->find<UIPushButton>( "okButton" )->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasNew::okClick ) );
|
||||
mUIWindow->find<UIPushButton>( "cancelButton" )->addEventListener( UIEvent::MouseClick, cb::Make1( this, &TextureAtlasNew::cancelClick ) );
|
||||
|
||||
mUIWindow->setSizeWithDecoration( mUIWindow->getContainer()->find( "container" )->getSize() );
|
||||
mUIWindow->center();
|
||||
@@ -113,7 +113,7 @@ void TextureAtlasNew::okClick( const UIEvent * Event ) {
|
||||
UICommonDialog * TGDialog = UICommonDialog::New( UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*." + ext );
|
||||
TGDialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
|
||||
TGDialog->setTitle( "Save Texture Atlas" );
|
||||
TGDialog->addEventListener( UIEvent::EventSaveFile, cb::Make1( this, &TextureAtlasNew::textureAtlasSave ) );
|
||||
TGDialog->addEventListener( UIEvent::SaveFile, cb::Make1( this, &TextureAtlasNew::textureAtlasSave ) );
|
||||
TGDialog->center();
|
||||
TGDialog->show();
|
||||
}
|
||||
@@ -181,7 +181,7 @@ void TextureAtlasNew::onDialogFolderSelect( const UIEvent * Event ) {
|
||||
UICommonDialog * TGDialog = UICommonDialog::New( UI_CDL_DEFAULT_FLAGS | CDL_FLAG_ALLOW_FOLDER_SELECT, "*" );
|
||||
TGDialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL );
|
||||
TGDialog->setTitle( "Create Texture Atlas ( Select Folder Containing Textures )" );
|
||||
TGDialog->addEventListener( UIEvent::EventOpenFile, cb::Make1( this, &TextureAtlasNew::onSelectFolder ) );
|
||||
TGDialog->addEventListener( UIEvent::OpenFile, cb::Make1( this, &TextureAtlasNew::onSelectFolder ) );
|
||||
TGDialog->center();
|
||||
TGDialog->show();
|
||||
}
|
||||
|
||||
@@ -101,13 +101,13 @@ void UICheckBox::onSizeChange() {
|
||||
|
||||
Uint32 UICheckBox::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgClick: {
|
||||
case UIMessage::Click: {
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
switchState();
|
||||
}
|
||||
|
||||
if ( Msg->getSender() == mActiveButton || Msg->getSender() == mInactiveButton ) {
|
||||
sendMouseEvent( UIEvent::EventMouseClick, UIManager::instance()->getMousePos(), UIManager::instance()->getPressTrigger() );
|
||||
sendMouseEvent( UIEvent::MouseClick, UIManager::instance()->getMousePos(), UIManager::instance()->getPressTrigger() );
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -43,7 +43,7 @@ void UIComboBox::setTheme( UITheme * Theme ) {
|
||||
mButton->setParent( this );
|
||||
mButton->setVisible( true );
|
||||
mButton->setEnabled( true );
|
||||
mButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIComboBox::onButtonClick ) );
|
||||
mButton->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIComboBox::onButtonClick ) );
|
||||
}
|
||||
|
||||
mDropDownList->setThemeSkin( Theme, "combobox" );
|
||||
|
||||
@@ -55,7 +55,7 @@ UICommonDialog::UICommonDialog( Uint32 CDLFlags , std::string DefaultFilePattern
|
||||
|
||||
mPath = UITextInput::New();
|
||||
mPath->setText( mCurPath )->setLayoutSizeRules( WRAP_CONTENT, MATCH_PARENT )->setLayoutWeight( 1 )->setParent( hLayout );
|
||||
mPath->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressEnter ) );
|
||||
mPath->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &UICommonDialog::onPressEnter ) );
|
||||
|
||||
mButtonUp = UIPushButton::New();
|
||||
mButtonUp->setText( "Up" )->setLayoutSizeRules( WRAP_CONTENT, MATCH_PARENT )->setParent( hLayout );
|
||||
@@ -72,7 +72,7 @@ UICommonDialog::UICommonDialog( Uint32 CDLFlags , std::string DefaultFilePattern
|
||||
mFile = UITextInput::New();
|
||||
mFile->setLayoutSizeRules( WRAP_CONTENT, MATCH_PARENT )->setLayoutWeight( 1 )->setParent( hLayout );
|
||||
mFile->setLayoutMargin( Rect( 0, 0, 4, 0 ) );
|
||||
mFile->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressFileEnter ) );
|
||||
mFile->addEventListener( UIEvent::OnPressEnter, cb::Make1( this, &UICommonDialog::onPressFileEnter ) );
|
||||
|
||||
mButtonOpen = UIPushButton::New();
|
||||
mButtonOpen->setText( isSaveDialog() ? "Save" : "Open" )->setLayoutSizeRules( FIXED, WRAP_CONTENT )->setSize(80,0)->setParent( hLayout );
|
||||
@@ -203,7 +203,7 @@ void UICommonDialog::disableButtons() {
|
||||
|
||||
Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgClick:
|
||||
case UIMessage::Click:
|
||||
{
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
if ( Msg->getSender() == mButtonOpen ) {
|
||||
@@ -221,7 +221,7 @@ Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgDoubleClick:
|
||||
case UIMessage::DoubleClick:
|
||||
{
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
if ( Msg->getSender()->isType( UI_TYPE_LISTBOXITEM ) ) {
|
||||
@@ -239,7 +239,7 @@ Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgSelected:
|
||||
case UIMessage::Selected:
|
||||
{
|
||||
if ( Msg->getSender() == mList ) {
|
||||
if ( !isSaveDialog() ) {
|
||||
@@ -267,7 +267,7 @@ Uint32 UICommonDialog::onMessage( const UIMessage * Msg ) {
|
||||
}
|
||||
|
||||
void UICommonDialog::save() {
|
||||
sendCommonEvent( UIEvent::EventSaveFile );
|
||||
sendCommonEvent( UIEvent::SaveFile );
|
||||
|
||||
disableButtons();
|
||||
|
||||
@@ -284,7 +284,7 @@ void UICommonDialog::open() {
|
||||
return;
|
||||
}
|
||||
|
||||
sendCommonEvent( UIEvent::EventOpenFile );
|
||||
sendCommonEvent( UIEvent::OpenFile );
|
||||
|
||||
disableButtons();
|
||||
|
||||
|
||||
@@ -159,14 +159,14 @@ void UIControl::setInternalSize( const Sizei& size ) {
|
||||
mSize = size;
|
||||
mRealSize = Sizei( size.x * PixelDensity::getPixelDensity(), size.y * PixelDensity::getPixelDensity() );
|
||||
updateCenter();
|
||||
sendCommonEvent( UIEvent::EventOnSizeChange );
|
||||
sendCommonEvent( UIEvent::OnSizeChange );
|
||||
}
|
||||
|
||||
void UIControl::setInternalPixelsSize( const Sizei& size ) {
|
||||
mSize = PixelDensity::pxToDpI( size );
|
||||
mRealSize = size;
|
||||
updateCenter();
|
||||
sendCommonEvent( UIEvent::EventOnSizeChange );
|
||||
sendCommonEvent( UIEvent::OnSizeChange );
|
||||
}
|
||||
|
||||
UIControl * UIControl::setSize( const Sizei& Size ) {
|
||||
@@ -452,12 +452,12 @@ Uint32 UIControl::onKeyUp( const UIEventKey& Event ) {
|
||||
}
|
||||
|
||||
Uint32 UIControl::onMouseMove( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMouseEvent( UIEvent::EventMouseMove, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseMove, Pos, Flags );
|
||||
return 1;
|
||||
}
|
||||
|
||||
Uint32 UIControl::onMouseDown( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMouseEvent( UIEvent::EventMouseDown, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseDown, Pos, Flags );
|
||||
|
||||
setSkinState( UISkinState::StateMouseDown );
|
||||
|
||||
@@ -465,7 +465,7 @@ Uint32 UIControl::onMouseDown( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
}
|
||||
|
||||
Uint32 UIControl::onMouseUp( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMouseEvent( UIEvent::EventMouseUp, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseUp, Pos, Flags );
|
||||
|
||||
setPrevSkinState();
|
||||
|
||||
@@ -473,7 +473,7 @@ Uint32 UIControl::onMouseUp( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
}
|
||||
|
||||
Uint32 UIControl::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMouseEvent( UIEvent::EventMouseClick, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseClick, Pos, Flags );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -486,14 +486,14 @@ bool UIControl::isMouseOverMeOrChilds() {
|
||||
}
|
||||
|
||||
Uint32 UIControl::onMouseDoubleClick( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMouseEvent( UIEvent::EventMouseDoubleClick, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseDoubleClick, Pos, Flags );
|
||||
return 1;
|
||||
}
|
||||
|
||||
Uint32 UIControl::onMouseEnter( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
writeCtrlFlag( UI_CTRL_FLAG_MOUSEOVER, 1 );
|
||||
|
||||
sendMouseEvent( UIEvent::EventMouseEnter, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseEnter, Pos, Flags );
|
||||
|
||||
setSkinState( UISkinState::StateMouseEnter );
|
||||
|
||||
@@ -503,7 +503,7 @@ Uint32 UIControl::onMouseEnter( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
Uint32 UIControl::onMouseExit( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
writeCtrlFlag( UI_CTRL_FLAG_MOUSEOVER, 0 );
|
||||
|
||||
sendMouseEvent( UIEvent::EventMouseExit, Pos, Flags );
|
||||
sendMouseEvent( UIEvent::MouseExit, Pos, Flags );
|
||||
|
||||
setSkinState( UISkinState::StateMouseExit );
|
||||
|
||||
@@ -513,7 +513,7 @@ Uint32 UIControl::onMouseExit( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
Uint32 UIControl::onFocus() {
|
||||
mControlFlags |= UI_CTRL_FLAG_HAS_FOCUS;
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnFocus );
|
||||
sendCommonEvent( UIEvent::OnFocus );
|
||||
|
||||
setSkinState( UISkinState::StateFocus );
|
||||
|
||||
@@ -523,13 +523,13 @@ Uint32 UIControl::onFocus() {
|
||||
Uint32 UIControl::onFocusLoss() {
|
||||
mControlFlags &= ~UI_CTRL_FLAG_HAS_FOCUS;
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnFocusLoss );
|
||||
sendCommonEvent( UIEvent::OnFocusLoss );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void UIControl::onWidgetFocusLoss() {
|
||||
sendCommonEvent( UIEvent::EventOnWidgetFocusLoss );
|
||||
sendCommonEvent( UIEvent::OnWidgetFocusLoss );
|
||||
}
|
||||
|
||||
bool UIControl::hasFocus() const {
|
||||
@@ -537,13 +537,13 @@ bool UIControl::hasFocus() const {
|
||||
}
|
||||
|
||||
Uint32 UIControl::onValueChange() {
|
||||
sendCommonEvent( UIEvent::EventOnValueChange );
|
||||
sendCommonEvent( UIEvent::OnValueChange );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void UIControl::onClose() {
|
||||
sendCommonEvent( UIEvent::EventOnClose );
|
||||
sendCommonEvent( UIEvent::OnClose );
|
||||
}
|
||||
|
||||
Uint32 UIControl::getHorizontalAlign() const {
|
||||
@@ -691,7 +691,7 @@ void UIControl::toPosition( const Uint32& Pos ) {
|
||||
}
|
||||
|
||||
void UIControl::onVisibilityChange() {
|
||||
sendCommonEvent( UIEvent::EventOnVisibleChange );
|
||||
sendCommonEvent( UIEvent::OnVisibleChange );
|
||||
}
|
||||
|
||||
void UIControl::onEnabledChange() {
|
||||
@@ -701,11 +701,11 @@ void UIControl::onEnabledChange() {
|
||||
}
|
||||
}
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnEnabledChange );
|
||||
sendCommonEvent( UIEvent::OnEnabledChange );
|
||||
}
|
||||
|
||||
void UIControl::onPositionChange() {
|
||||
sendCommonEvent( UIEvent::EventOnPosChange );
|
||||
sendCommonEvent( UIEvent::OnPosChange );
|
||||
}
|
||||
|
||||
void UIControl::onSizeChange() {
|
||||
@@ -1432,7 +1432,7 @@ void UIControl::sendParentSizeChange( const Vector2i& SizeChange ) {
|
||||
}
|
||||
|
||||
void UIControl::onParentSizeChange( const Vector2i& SizeChange ) {
|
||||
sendCommonEvent( UIEvent::EventOnParentSizeChange );
|
||||
sendCommonEvent( UIEvent::OnParentSizeChange );
|
||||
}
|
||||
|
||||
Sizei UIControl::getSkinSize( UISkin * Skin, const Uint32& State ) {
|
||||
|
||||
@@ -462,15 +462,15 @@ Interpolation2d * UIControlAnim::getTranslationInterpolation() {
|
||||
}
|
||||
|
||||
void UIControlAnim::onAngleChange() {
|
||||
sendCommonEvent( UIEvent::EventOnAngleChange );
|
||||
sendCommonEvent( UIEvent::OnAngleChange );
|
||||
}
|
||||
|
||||
void UIControlAnim::onScaleChange() {
|
||||
sendCommonEvent( UIEvent::EventOnScaleChange );
|
||||
sendCommonEvent( UIEvent::OnScaleChange );
|
||||
}
|
||||
|
||||
void UIControlAnim::onAlphaChange() {
|
||||
sendCommonEvent( UIEvent::EventOnAlphaChange );
|
||||
sendCommonEvent( UIEvent::OnAlphaChange );
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -92,12 +92,12 @@ Uint32 UIDragableControl::onDrag( const Vector2i& Pos ) {
|
||||
}
|
||||
|
||||
Uint32 UIDragableControl::onDragStart( const Vector2i& Pos ) {
|
||||
sendCommonEvent( UIEvent::EventOnDragStart );
|
||||
sendCommonEvent( UIEvent::OnDragStart );
|
||||
return 1;
|
||||
}
|
||||
|
||||
Uint32 UIDragableControl::onDragStop( const Vector2i& Pos ) {
|
||||
sendCommonEvent( UIEvent::EventOnDragStop );
|
||||
sendCommonEvent( UIEvent::OnDragStop );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -117,12 +117,12 @@ void UIDragableControl::setDragging( const bool& dragging ) {
|
||||
writeCtrlFlag( UI_CTRL_FLAG_DRAGGING, dragging );
|
||||
|
||||
if ( dragging ) {
|
||||
UIMessage tMsg( this, UIMessage::MsgDragStart, 0 );
|
||||
UIMessage tMsg( this, UIMessage::DragStart, 0 );
|
||||
messagePost( &tMsg );
|
||||
|
||||
onDragStart( UIManager::instance()->getMousePos() );
|
||||
} else {
|
||||
UIMessage tMsg( this, UIMessage::MsgDragStop, 0 );
|
||||
UIMessage tMsg( this, UIMessage::DragStop, 0 );
|
||||
messagePost( &tMsg );
|
||||
|
||||
onDragStop( UIManager::instance()->getMousePos() );
|
||||
|
||||
@@ -31,12 +31,12 @@ UIDropDownList::UIDropDownList() :
|
||||
mListBox->setEnabled( false );
|
||||
mListBox->setVisible( false );
|
||||
|
||||
mListBox->addEventListener( UIEvent::EventOnWidgetFocusLoss, cb::Make1( this, &UIDropDownList::onListBoxFocusLoss ) );
|
||||
mListBox->addEventListener( UIEvent::EventOnItemSelected , cb::Make1( this, &UIDropDownList::onItemSelected ) );
|
||||
mListBox->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &UIDropDownList::onItemClicked ) );
|
||||
mListBox->addEventListener( UIEvent::EventOnItemKeyDown, cb::Make1( this, &UIDropDownList::onItemKeyDown ) );
|
||||
mListBox->addEventListener( UIEvent::EventKeyDown , cb::Make1( this, &UIDropDownList::onItemKeyDown ) );
|
||||
mListBox->addEventListener( UIEvent::EventOnControlClear, cb::Make1( this, &UIDropDownList::onControlClear ) );
|
||||
mListBox->addEventListener( UIEvent::OnWidgetFocusLoss, cb::Make1( this, &UIDropDownList::onListBoxFocusLoss ) );
|
||||
mListBox->addEventListener( UIEvent::OnItemSelected , cb::Make1( this, &UIDropDownList::onItemSelected ) );
|
||||
mListBox->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &UIDropDownList::onItemClicked ) );
|
||||
mListBox->addEventListener( UIEvent::OnItemKeyDown, cb::Make1( this, &UIDropDownList::onItemKeyDown ) );
|
||||
mListBox->addEventListener( UIEvent::KeyDown , cb::Make1( this, &UIDropDownList::onItemKeyDown ) );
|
||||
mListBox->addEventListener( UIEvent::OnControlClear, cb::Make1( this, &UIDropDownList::onControlClear ) );
|
||||
}
|
||||
|
||||
UIDropDownList::~UIDropDownList() {
|
||||
@@ -232,10 +232,10 @@ void UIDropDownList::onItemClicked( const UIEvent * Event ) {
|
||||
void UIDropDownList::onItemSelected( const UIEvent * Event ) {
|
||||
setText( mListBox->getItemSelectedText() );
|
||||
|
||||
UIMessage Msg( this, UIMessage::MsgSelected, mListBox->getItemSelectedIndex() );
|
||||
UIMessage Msg( this, UIMessage::Selected, mListBox->getItemSelectedIndex() );
|
||||
messagePost( &Msg );
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnItemSelected );
|
||||
sendCommonEvent( UIEvent::OnItemSelected );
|
||||
}
|
||||
|
||||
void UIDropDownList::show() {
|
||||
|
||||
@@ -182,7 +182,7 @@ void UIGridLayout::pack() {
|
||||
|
||||
Uint32 UIGridLayout::onMessage(const UIMessage * Msg) {
|
||||
switch( Msg->getMsg() ) {
|
||||
case UIMessage::MsgLayoutAttributeChange:
|
||||
case UIMessage::LayoutAttributeChange:
|
||||
{
|
||||
pack();
|
||||
break;
|
||||
|
||||
@@ -350,7 +350,7 @@ void UILinearLayout::loadFromXmlNode(const pugi::xml_node & node) {
|
||||
|
||||
Uint32 UILinearLayout::onMessage(const UIMessage * Msg) {
|
||||
switch( Msg->getMsg() ) {
|
||||
case UIMessage::MsgLayoutAttributeChange:
|
||||
case UIMessage::LayoutAttributeChange:
|
||||
{
|
||||
pack();
|
||||
break;
|
||||
|
||||
@@ -59,8 +59,8 @@ UIListBox::UIListBox() :
|
||||
mHScrollBar->setPosition( 0, mSize.getHeight() - 16 );
|
||||
mHScrollBar->setEnabled( false )->setVisible( false );
|
||||
|
||||
mVScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIListBox::onScrollValueChange ) );
|
||||
mHScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIListBox::onHScrollValueChange ) );
|
||||
mVScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIListBox::onScrollValueChange ) );
|
||||
mHScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIListBox::onHScrollValueChange ) );
|
||||
|
||||
setSmoothScroll( true );
|
||||
|
||||
@@ -232,7 +232,7 @@ void UIListBox::clear() {
|
||||
updateScroll();
|
||||
updateListBoxItemsSize();
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnControlClear );
|
||||
sendCommonEvent( UIEvent::OnControlClear );
|
||||
}
|
||||
|
||||
Uint32 UIListBox::removeListBoxItem( Uint32 ItemIndex ) {
|
||||
@@ -591,12 +591,12 @@ void UIListBox::updateScroll( bool FromScrollChange ) {
|
||||
}
|
||||
|
||||
void UIListBox::itemKeyEvent( const UIEventKey &Event ) {
|
||||
UIEventKey ItemEvent( Event.getControl(), UIEvent::EventOnItemKeyDown, Event.getKeyCode(), Event.getChar(), Event.getMod() );
|
||||
UIEventKey ItemEvent( Event.getControl(), UIEvent::OnItemKeyDown, Event.getKeyCode(), Event.getChar(), Event.getMod() );
|
||||
sendEvent( &ItemEvent );
|
||||
}
|
||||
|
||||
void UIListBox::itemClicked( UIListBoxItem * Item ) {
|
||||
UIEvent ItemEvent( Item, UIEvent::EventOnItemClicked );
|
||||
UIEvent ItemEvent( Item, UIEvent::OnItemClicked );
|
||||
sendEvent( &ItemEvent );
|
||||
|
||||
if ( !( isMultiSelect() && UIManager::instance()->getInput()->isKeyDown( KEY_LCTRL ) ) )
|
||||
@@ -604,10 +604,10 @@ void UIListBox::itemClicked( UIListBoxItem * Item ) {
|
||||
}
|
||||
|
||||
Uint32 UIListBox::onSelected() {
|
||||
UIMessage tMsg( this, UIMessage::MsgSelected, 0 );
|
||||
UIMessage tMsg( this, UIMessage::Selected, 0 );
|
||||
messagePost( &tMsg );
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnItemSelected );
|
||||
sendCommonEvent( UIEvent::OnItemSelected );
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -896,7 +896,7 @@ Uint32 UIListBox::onKeyDown( const UIEventKey &Event ) {
|
||||
|
||||
Uint32 UIListBox::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgFocusLoss:
|
||||
case UIMessage::FocusLoss:
|
||||
{
|
||||
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
|
||||
|
||||
|
||||
@@ -118,17 +118,17 @@ void UIManager::inputCallback( InputEvent * Event ) {
|
||||
|
||||
void UIManager::resizeControl( EE::Window::Window * win ) {
|
||||
mControl->setSize( (Float)mWindow->getWidth() / PixelDensity::getPixelDensity(), (Float)mWindow->getHeight() / PixelDensity::getPixelDensity() );
|
||||
sendMsg( mControl, UIMessage::MsgWindowResize );
|
||||
sendMsg( mControl, UIMessage::WindowResize );
|
||||
|
||||
std::list<UIWindow*>::iterator it;
|
||||
|
||||
for ( it = mWindowsList.begin(); it != mWindowsList.end(); it++ ) {
|
||||
sendMsg( *it, UIMessage::MsgWindowResize );
|
||||
sendMsg( *it, UIMessage::WindowResize );
|
||||
}
|
||||
}
|
||||
|
||||
void UIManager::sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod ) {
|
||||
UIEventKey KeyEvent = UIEventKey( mFocusControl, UIEvent::EventKeyUp, KeyCode, Char, Mod );
|
||||
UIEventKey KeyEvent = UIEventKey( mFocusControl, UIEvent::KeyUp, KeyCode, Char, Mod );
|
||||
UIControl * CtrlLoop = mFocusControl;
|
||||
|
||||
while( NULL != CtrlLoop ) {
|
||||
@@ -140,7 +140,7 @@ void UIManager::sendKeyUp( const Uint32& KeyCode, const Uint16& Char, const Uint
|
||||
}
|
||||
|
||||
void UIManager::sendKeyDown( const Uint32& KeyCode, const Uint16& Char, const Uint32& Mod ) {
|
||||
UIEventKey KeyEvent = UIEventKey( mFocusControl, UIEvent::EventKeyDown, KeyCode, Char, Mod );
|
||||
UIEventKey KeyEvent = UIEventKey( mFocusControl, UIEvent::KeyDown, KeyCode, Char, Mod );
|
||||
UIControl * CtrlLoop = mFocusControl;
|
||||
|
||||
while( NULL != CtrlLoop ) {
|
||||
@@ -166,10 +166,10 @@ void UIManager::setFocusControl( UIControl * Ctrl ) {
|
||||
mFocusControl = Ctrl;
|
||||
|
||||
mLossFocusControl->onFocusLoss();
|
||||
sendMsg( mLossFocusControl, UIMessage::MsgFocusLoss );
|
||||
sendMsg( mLossFocusControl, UIMessage::FocusLoss );
|
||||
|
||||
mFocusControl->onFocus();
|
||||
sendMsg( mFocusControl, UIMessage::MsgFocus );
|
||||
sendMsg( mFocusControl, UIMessage::Focus );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,14 +198,14 @@ void UIManager::update() {
|
||||
|
||||
if ( pOver != mOverControl ) {
|
||||
if ( NULL != mOverControl ) {
|
||||
sendMsg( mOverControl, UIMessage::MsgMouseExit );
|
||||
sendMsg( mOverControl, UIMessage::MouseExit );
|
||||
mOverControl->onMouseExit( mKM->getMousePos(), 0 );
|
||||
}
|
||||
|
||||
mOverControl = pOver;
|
||||
|
||||
if ( NULL != mOverControl ) {
|
||||
sendMsg( mOverControl, UIMessage::MsgMouseEnter );
|
||||
sendMsg( mOverControl, UIMessage::MouseEnter );
|
||||
mOverControl->onMouseEnter( mKM->getMousePos(), 0 );
|
||||
}
|
||||
} else {
|
||||
@@ -219,7 +219,7 @@ void UIManager::update() {
|
||||
|
||||
if ( NULL != mOverControl ) {
|
||||
mOverControl->onMouseDown( mKM->getMousePos(), mKM->getPressTrigger() );
|
||||
sendMsg( mOverControl, UIMessage::MsgMouseDown, mKM->getPressTrigger() );
|
||||
sendMsg( mOverControl, UIMessage::MouseDown, mKM->getPressTrigger() );
|
||||
}
|
||||
|
||||
if ( !mFirstPress ) {
|
||||
@@ -237,14 +237,14 @@ void UIManager::update() {
|
||||
setFocusControl( mOverControl );
|
||||
|
||||
mFocusControl->onMouseUp( mKM->getMousePos(), mKM->getReleaseTrigger() );
|
||||
sendMsg( mFocusControl, UIMessage::MsgMouseUp, mKM->getReleaseTrigger() );
|
||||
sendMsg( mFocusControl, UIMessage::MouseUp, mKM->getReleaseTrigger() );
|
||||
|
||||
if ( mKM->getClickTrigger() ) { // mDownControl == mOverControl &&
|
||||
sendMsg( mFocusControl, UIMessage::MsgClick, mKM->getClickTrigger() );
|
||||
sendMsg( mFocusControl, UIMessage::Click, mKM->getClickTrigger() );
|
||||
mFocusControl->onMouseClick( mKM->getMousePos(), mKM->getClickTrigger() );
|
||||
|
||||
if ( mKM->getDoubleClickTrigger() ) {
|
||||
sendMsg( mFocusControl, UIMessage::MsgDoubleClick, mKM->getDoubleClickTrigger() );
|
||||
sendMsg( mFocusControl, UIMessage::DoubleClick, mKM->getDoubleClickTrigger() );
|
||||
mFocusControl->onMouseDoubleClick( mKM->getMousePos(), mKM->getDoubleClickTrigger() );
|
||||
}
|
||||
}
|
||||
@@ -379,17 +379,17 @@ void UIManager::checkTabPress( const Uint32& KeyCode ) {
|
||||
}
|
||||
|
||||
void UIManager::sendMouseClick( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMsg( ToCtrl, UIMessage::MsgClick, Flags );
|
||||
sendMsg( ToCtrl, UIMessage::Click, Flags );
|
||||
ToCtrl->onMouseClick( Pos, Flags );
|
||||
}
|
||||
|
||||
void UIManager::sendMouseUp( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMsg( ToCtrl, UIMessage::MsgMouseUp, Flags );
|
||||
sendMsg( ToCtrl, UIMessage::MouseUp, Flags );
|
||||
ToCtrl->onMouseUp( Pos, Flags );
|
||||
}
|
||||
|
||||
void UIManager::sendMouseDown( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ) {
|
||||
sendMsg( ToCtrl, UIMessage::MsgMouseDown, Flags );
|
||||
sendMsg( ToCtrl, UIMessage::MouseDown, Flags );
|
||||
ToCtrl->onMouseDown( Pos, Flags );
|
||||
}
|
||||
|
||||
|
||||
@@ -288,16 +288,16 @@ bool UIMenu::isSubMenu( UIControl * Ctrl ) {
|
||||
|
||||
Uint32 UIMenu::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgMouseUp:
|
||||
case UIMessage::MouseUp:
|
||||
{
|
||||
if ( Msg->getSender()->getParent() == this && ( Msg->getFlags() & EE_BUTTONS_LRM ) ) {
|
||||
UIEvent ItemEvent( Msg->getSender(), UIEvent::EventOnItemClicked );
|
||||
UIEvent ItemEvent( Msg->getSender(), UIEvent::OnItemClicked );
|
||||
sendEvent( &ItemEvent );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
case UIMessage::MsgFocusLoss:
|
||||
case UIMessage::FocusLoss:
|
||||
{
|
||||
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
|
||||
|
||||
@@ -497,9 +497,9 @@ Uint32 UIMenu::onKeyDown( const UIEventKey& Event ) {
|
||||
break;
|
||||
case KEY_RETURN:
|
||||
if ( NULL != mItemSelected ) {
|
||||
mItemSelected->sendMouseEvent(UIEvent::EventMouseClick, UIManager::instance()->getMousePos(), EE_BUTTONS_ALL );
|
||||
mItemSelected->sendMouseEvent(UIEvent::MouseClick, UIManager::instance()->getMousePos(), EE_BUTTONS_ALL );
|
||||
|
||||
UIMessage Msg( mItemSelected, UIMessage::MsgMouseUp, EE_BUTTONS_ALL );
|
||||
UIMessage Msg( mItemSelected, UIMessage::MouseUp, EE_BUTTONS_ALL );
|
||||
mItemSelected->messagePost( &Msg );
|
||||
}
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ void UIMenuSubMenu::setSubMenu( UIMenu * SubMenu ) {
|
||||
mSubMenu = SubMenu;
|
||||
|
||||
if ( NULL != mSubMenu ) {
|
||||
mCbId = mSubMenu->addEventListener( UIEvent::EventOnEnabledChange, cb::Make1( this, &UIMenuSubMenu::onSubMenuFocusLoss ) );
|
||||
mCbId2 = mSubMenu->addEventListener( UIEvent::EventOnHideByClick, cb::Make1( this, &UIMenuSubMenu::onHideByClick ) );
|
||||
mCbId = mSubMenu->addEventListener( UIEvent::OnEnabledChange, cb::Make1( this, &UIMenuSubMenu::onSubMenuFocusLoss ) );
|
||||
mCbId2 = mSubMenu->addEventListener( UIEvent::OnHideByClick, cb::Make1( this, &UIMenuSubMenu::onHideByClick ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,14 +96,14 @@ void UIMessageBox::setTheme( UITheme * Theme ) {
|
||||
|
||||
Uint32 UIMessageBox::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgClick:
|
||||
case UIMessage::Click:
|
||||
{
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
Vector2i mousei( UIManager::instance()->getMousePos() );
|
||||
Vector2f mouse( mousei.x, mousei.y );
|
||||
|
||||
if ( Msg->getSender() == mButtonOK && mButtonOK->getPolygon().pointInside( mouse ) ) {
|
||||
sendCommonEvent( UIEvent::EventMsgBoxConfirmClick );
|
||||
sendCommonEvent( UIEvent::MsgBoxConfirmClick );
|
||||
|
||||
closeWindow();
|
||||
} else if ( Msg->getSender() == mButtonCancel ) {
|
||||
|
||||
@@ -87,13 +87,13 @@ void UIPopUpMenu::onWidgetFocusLoss() {
|
||||
|
||||
Uint32 UIPopUpMenu::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgMouseUp:
|
||||
case UIMessage::MouseUp:
|
||||
{
|
||||
#ifdef EE_PLATFORM_TOUCH
|
||||
if ( mTE.getElapsed().asMilliseconds() > 250.f ) {
|
||||
#endif
|
||||
if ( !Msg->getSender()->isType( UI_TYPE_MENUSUBMENU ) && ( Msg->getFlags() & EE_BUTTONS_LRM ) ) {
|
||||
sendCommonEvent( UIEvent::EventOnHideByClick );
|
||||
sendCommonEvent( UIEvent::OnHideByClick );
|
||||
|
||||
if ( isVisible() )
|
||||
UIManager::instance()->getMainControl()->setFocus();
|
||||
|
||||
@@ -226,7 +226,7 @@ void UIPushButton::onAlignChange() {
|
||||
|
||||
Uint32 UIPushButton::onKeyDown( const UIEventKey& Event ) {
|
||||
if ( Event.getKeyCode() == KEY_RETURN ) {
|
||||
UIMessage Msg( this, UIMessage::MsgClick, EE_BUTTON_LMASK );
|
||||
UIMessage Msg( this, UIMessage::Click, EE_BUTTON_LMASK );
|
||||
messagePost( &Msg );
|
||||
onMouseClick( Vector2i(0,0), EE_BUTTON_LMASK );
|
||||
|
||||
|
||||
@@ -95,13 +95,13 @@ void UIRadioButton::onSizeChange() {
|
||||
|
||||
Uint32 UIRadioButton::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgClick: {
|
||||
case UIMessage::Click: {
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
switchState();
|
||||
}
|
||||
|
||||
if ( Msg->getSender() == mActiveButton || Msg->getSender() == mInactiveButton ) {
|
||||
sendMouseEvent( UIEvent::EventMouseClick, UIManager::instance()->getMousePos(), UIManager::instance()->getPressTrigger() );
|
||||
sendMouseEvent( UIEvent::MouseClick, UIManager::instance()->getMousePos(), UIManager::instance()->getPressTrigger() );
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -157,7 +157,7 @@ void UIRelativeLayout::fixChildSize( UIWidget * widget ) {
|
||||
|
||||
Uint32 UIRelativeLayout::onMessage(const UIMessage * Msg) {
|
||||
switch( Msg->getMsg() ) {
|
||||
case UIMessage::MsgLayoutAttributeChange:
|
||||
case UIMessage::LayoutAttributeChange:
|
||||
{
|
||||
fixChilds();
|
||||
break;
|
||||
|
||||
@@ -31,7 +31,7 @@ UIScrollBar::UIScrollBar( const UI_ORIENTATION& orientation ) :
|
||||
mSlider->setAllowHalfSliderOut( false );
|
||||
mSlider->setExpandBackground( false );
|
||||
|
||||
mSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIScrollBar::onValueChangeCb ) );
|
||||
mSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIScrollBar::onValueChangeCb ) );
|
||||
|
||||
adjustChilds();
|
||||
|
||||
@@ -182,7 +182,7 @@ void UIScrollBar::manageClick( const Uint32& Flags ) {
|
||||
|
||||
Uint32 UIScrollBar::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgClick:
|
||||
case UIMessage::Click:
|
||||
{
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
if ( Msg->getSender() == mBtnUp ) {
|
||||
|
||||
@@ -26,8 +26,8 @@ UIScrollView::UIScrollView() :
|
||||
mContainer->setParent( this );
|
||||
mContainer->setFlags( UI_CLIP_ENABLE | UI_REPORT_SIZE_CHANGE_TO_CHILDS );
|
||||
|
||||
mVScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIScrollView::onValueChangeCb ) );
|
||||
mHScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIScrollView::onValueChangeCb ) );
|
||||
mVScroll->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIScrollView::onValueChangeCb ) );
|
||||
mHScroll->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UIScrollView::onValueChangeCb ) );
|
||||
|
||||
applyDefaultTheme();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ void UIScrollView::onChildCountChange() {
|
||||
|
||||
child->setParent( mContainer );
|
||||
mScrollView = child;
|
||||
mSizeChangeCb = mScrollView->addEventListener( UIEvent::EventOnSizeChange, cb::Make1( this, &UIScrollView::onScrollViewSizeChange ) );
|
||||
mSizeChangeCb = mScrollView->addEventListener( UIEvent::OnSizeChange, cb::Make1( this, &UIScrollView::onScrollViewSizeChange ) );
|
||||
|
||||
containerUpdate();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ void UISelectButton::select() {
|
||||
mControlFlags |= UI_CTRL_FLAG_SELECTED;
|
||||
|
||||
if ( !wasSelected ) {
|
||||
UIMessage tMsg( this, UIMessage::MsgSelected, 0 );
|
||||
UIMessage tMsg( this, UIMessage::Selected, 0 );
|
||||
messagePost( &tMsg );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ const Float& UISpinBox::getClickStep() const {
|
||||
|
||||
Uint32 UISpinBox::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgClick:
|
||||
case UIMessage::Click:
|
||||
{
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
if ( Msg->getSender() == mPushUp ) {
|
||||
|
||||
@@ -54,8 +54,8 @@ UITable::UITable() :
|
||||
mVScrollBar->setVisible( UI_SCROLLBAR_ALWAYS_ON == mVScrollMode );
|
||||
mVScrollBar->setEnabled( UI_SCROLLBAR_ALWAYS_ON == mVScrollMode );
|
||||
|
||||
mVScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UITable::onScrollValueChange ) );
|
||||
mHScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UITable::onScrollValueChange ) );
|
||||
mVScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UITable::onScrollValueChange ) );
|
||||
mHScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UITable::onScrollValueChange ) );
|
||||
|
||||
applyDefaultTheme();
|
||||
}
|
||||
@@ -541,7 +541,7 @@ Uint32 UITable::getItemIndex( UITableCell * Item ) {
|
||||
}
|
||||
|
||||
Uint32 UITable::onSelected() {
|
||||
sendCommonEvent( UIEvent::EventOnItemSelected );
|
||||
sendCommonEvent( UIEvent::OnItemSelected );
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -559,7 +559,7 @@ Uint32 UITable::getItemSelectedIndex() const {
|
||||
|
||||
Uint32 UITable::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgFocusLoss:
|
||||
case UIMessage::FocusLoss:
|
||||
{
|
||||
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
|
||||
|
||||
|
||||
@@ -137,22 +137,22 @@ Uint32 UITableCell::onMouseExit( const Vector2i& Pos, const Uint32 Flags ) {
|
||||
|
||||
Uint32 UITableCell::onMessage( const UIMessage * Msg ) {
|
||||
switch( Msg->getMsg() ) {
|
||||
case UIMessage::MsgMouseEnter:
|
||||
case UIMessage::MouseEnter:
|
||||
{
|
||||
onMouseEnter( Vector2i(), Msg->getFlags() );
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgMouseExit:
|
||||
case UIMessage::MouseExit:
|
||||
{
|
||||
onMouseExit( Vector2i(), Msg->getFlags() );
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgClick:
|
||||
case UIMessage::Click:
|
||||
{
|
||||
if ( Msg->getFlags() & EE_BUTTONS_LRM ) {
|
||||
select();
|
||||
|
||||
UIMessage tMsg( this, UIMessage::MsgCellClicked, Msg->getFlags() );
|
||||
UIMessage tMsg( this, UIMessage::CellClicked, Msg->getFlags() );
|
||||
|
||||
messagePost( &tMsg );
|
||||
|
||||
|
||||
@@ -652,7 +652,7 @@ void UITabWidget::setTabSelected( UITab * Tab ) {
|
||||
|
||||
orderTabs();
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnTabSelected );
|
||||
sendCommonEvent( UIEvent::OnTabSelected );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ UITextEdit::UITextEdit() :
|
||||
mTextInput->setEnabled( true );
|
||||
mTextInput->setSize( mSize );
|
||||
|
||||
mTextInput->addEventListener( UIEvent::EventOnSizeChange , cb::Make1( this, &UITextEdit::onInputSizeChange ) );
|
||||
mTextInput->addEventListener( UIEvent::EventOnTextChanged , cb::Make1( this, &UITextEdit::onInputSizeChange ) );
|
||||
mTextInput->addEventListener( UIEvent::EventOnPressEnter , cb::Make1( this, &UITextEdit::onInputSizeChange ) );
|
||||
mTextInput->addEventListener( UIEvent::EventOnCursorPosChange , cb::Make1( this, &UITextEdit::onCursorPosChange ) );
|
||||
mTextInput->addEventListener( UIEvent::OnSizeChange , cb::Make1( this, &UITextEdit::onInputSizeChange ) );
|
||||
mTextInput->addEventListener( UIEvent::OnTextChanged , cb::Make1( this, &UITextEdit::onInputSizeChange ) );
|
||||
mTextInput->addEventListener( UIEvent::OnPressEnter , cb::Make1( this, &UITextEdit::onInputSizeChange ) );
|
||||
mTextInput->addEventListener( UIEvent::OnCursorPosChange , cb::Make1( this, &UITextEdit::onCursorPosChange ) );
|
||||
|
||||
mVScrollBar = UIScrollBar::New();
|
||||
mVScrollBar->setOrientation( UI_VERTICAL );
|
||||
@@ -48,8 +48,8 @@ UITextEdit::UITextEdit() :
|
||||
mHScrollBar->setSize( mSize.getWidth() - mVScrollBar->getSize().getWidth(), 16 );
|
||||
mHScrollBar->setPosition( 0, mSize.getHeight() - 16 );
|
||||
|
||||
mVScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UITextEdit::onVScrollValueChange ) );
|
||||
mHScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UITextEdit::onHScrollValueChange ) );
|
||||
mVScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UITextEdit::onVScrollValueChange ) );
|
||||
mHScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &UITextEdit::onHScrollValueChange ) );
|
||||
|
||||
autoPadding();
|
||||
|
||||
@@ -278,7 +278,7 @@ void UITextEdit::onInputSizeChange( const UIEvent * Event ) {
|
||||
int Height = mRealSize.getHeight() - mContainerPadding.Top - mContainerPadding.Bottom;
|
||||
|
||||
if ( NULL != Event ) {
|
||||
if ( Event->getEventType() == UIEvent::EventOnPressEnter ) {
|
||||
if ( Event->getEventType() == UIEvent::OnPressEnter ) {
|
||||
mHScrollBar->setValue( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ void UITextInput::update() {
|
||||
}
|
||||
|
||||
void UITextInput::onCursorPosChange() {
|
||||
sendCommonEvent( UIEvent::EventOnCursorPosChange );
|
||||
sendCommonEvent( UIEvent::OnCursorPosChange );
|
||||
}
|
||||
|
||||
void UITextInput::drawWaitingCursor() {
|
||||
@@ -137,7 +137,7 @@ Uint32 UITextInput::onFocusLoss() {
|
||||
}
|
||||
|
||||
Uint32 UITextInput::onPressEnter() {
|
||||
sendCommonEvent( UIEvent::EventOnPressEnter );
|
||||
sendCommonEvent( UIEvent::OnPressEnter );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -280,11 +280,11 @@ void UITextView::onSizeChange() {
|
||||
}
|
||||
|
||||
void UITextView::onTextChanged() {
|
||||
sendCommonEvent( UIEvent::EventOnTextChanged );
|
||||
sendCommonEvent( UIEvent::OnTextChanged );
|
||||
}
|
||||
|
||||
void UITextView::onFontChanged() {
|
||||
sendCommonEvent( UIEvent::EventOnFontChanged );
|
||||
sendCommonEvent( UIEvent::OnFontChanged );
|
||||
}
|
||||
|
||||
void UITextView::setTheme( UITheme * Theme ) {
|
||||
|
||||
@@ -201,11 +201,11 @@ void UITooltip::onSizeChange() {
|
||||
}
|
||||
|
||||
void UITooltip::onTextChanged() {
|
||||
sendCommonEvent( UIEvent::EventOnTextChanged );
|
||||
sendCommonEvent( UIEvent::OnTextChanged );
|
||||
}
|
||||
|
||||
void UITooltip::onFontChanged() {
|
||||
sendCommonEvent( UIEvent::EventOnFontChanged );
|
||||
sendCommonEvent( UIEvent::OnFontChanged );
|
||||
}
|
||||
|
||||
void UITooltip::setPadding( const Rect& padding ) {
|
||||
|
||||
@@ -288,14 +288,14 @@ void UIWidget::onWidgetCreated() {
|
||||
|
||||
void UIWidget::notifyLayoutAttrChange() {
|
||||
if ( 0 == mPropertiesTransactionCount ) {
|
||||
UIMessage msg( this, UIMessage::MsgLayoutAttributeChange );
|
||||
UIMessage msg( this, UIMessage::LayoutAttributeChange );
|
||||
messagePost( &msg );
|
||||
}
|
||||
}
|
||||
|
||||
void UIWidget::notifyLayoutAttrChangeParent() {
|
||||
if ( 0 == mPropertiesTransactionCount && NULL != mParentCtrl ) {
|
||||
UIMessage msg( this, UIMessage::MsgLayoutAttributeChange );
|
||||
UIMessage msg( this, UIMessage::LayoutAttributeChange );
|
||||
mParentCtrl->messagePost( &msg );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ UIWindow::UIWindow( UIWindow::WindowBaseContainerType type ) :
|
||||
mContainer->setParent( this );
|
||||
mContainer->setFlags( UI_REPORT_SIZE_CHANGE_TO_CHILDS | UI_CLIP_ENABLE );
|
||||
mContainer->setSize( mSize );
|
||||
mContainer->addEventListener( UIEvent::EventOnPosChange, cb::Make1( this, &UIWindow::onContainerPosChange ) );
|
||||
mContainer->addEventListener( UIEvent::OnPosChange, cb::Make1( this, &UIWindow::onContainerPosChange ) );
|
||||
|
||||
updateWinFlags();
|
||||
|
||||
@@ -74,7 +74,7 @@ UIWindow::~UIWindow() {
|
||||
|
||||
UIManager::instance()->setFocusLastWindow( this );
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnWindowClose );
|
||||
sendCommonEvent( UIEvent::OnWindowClose );
|
||||
|
||||
eeSAFE_DELETE( mFrameBuffer );
|
||||
}
|
||||
@@ -142,7 +142,7 @@ void UIWindow::updateWinFlags() {
|
||||
mButtonClose->setEnabled( true );
|
||||
|
||||
if ( mStyleConfig.WinFlags & UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS && 0 == mCloseListener ) {
|
||||
mCloseListener = mButtonClose->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIWindow::onButtonCloseClick ) );
|
||||
mCloseListener = mButtonClose->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIWindow::onButtonCloseClick ) );
|
||||
}
|
||||
} else if ( NULL != mButtonClose ) {
|
||||
mButtonClose->setVisible( false )->setEnabled( false )->close();
|
||||
@@ -161,7 +161,7 @@ void UIWindow::updateWinFlags() {
|
||||
mButtonMaximize->setEnabled( true );
|
||||
|
||||
if ( mStyleConfig.WinFlags & UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS && 0 == mMaximizeListener ) {
|
||||
mMaximizeListener = mButtonMaximize->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIWindow::onButtonMaximizeClick ) );
|
||||
mMaximizeListener = mButtonMaximize->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIWindow::onButtonMaximizeClick ) );
|
||||
}
|
||||
} else if ( NULL != mButtonMaximize ) {
|
||||
mButtonMaximize->setVisible( false )->setEnabled( false )->close();
|
||||
@@ -180,7 +180,7 @@ void UIWindow::updateWinFlags() {
|
||||
mButtonMinimize->setEnabled( true );
|
||||
|
||||
if ( mStyleConfig.WinFlags & UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS && 0 == mMinimizeListener ) {
|
||||
mMinimizeListener = mButtonMinimize->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIWindow::onButtonMinimizeClick ) );
|
||||
mMinimizeListener = mButtonMinimize->addEventListener( UIEvent::MouseClick, cb::Make1( this, &UIWindow::onButtonMinimizeClick ) );
|
||||
}
|
||||
} else if ( NULL != mButtonMinimize ) {
|
||||
mButtonMinimize->setVisible( false )->setEnabled( false )->close();
|
||||
@@ -290,7 +290,7 @@ void UIWindow::onContainerPosChange( const UIEvent * Event ) {
|
||||
void UIWindow::onButtonCloseClick( const UIEvent * Event ) {
|
||||
closeWindow();
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnWindowCloseClick );
|
||||
sendCommonEvent( UIEvent::OnWindowCloseClick );
|
||||
}
|
||||
|
||||
void UIWindow::closeWindow() {
|
||||
@@ -323,13 +323,13 @@ void UIWindow::close() {
|
||||
void UIWindow::onButtonMaximizeClick( const UIEvent * Event ) {
|
||||
maximize();
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnWindowMaximizeClick );
|
||||
sendCommonEvent( UIEvent::OnWindowMaximizeClick );
|
||||
}
|
||||
|
||||
void UIWindow::onButtonMinimizeClick( const UIEvent * Event ) {
|
||||
hide();
|
||||
|
||||
sendCommonEvent( UIEvent::EventOnWindowMinimizeClick );
|
||||
sendCommonEvent( UIEvent::OnWindowMinimizeClick );
|
||||
}
|
||||
|
||||
void UIWindow::setTheme( UITheme * Theme ) {
|
||||
@@ -536,17 +536,17 @@ void UIWindow::fixChildsSize() {
|
||||
|
||||
Uint32 UIWindow::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgFocus:
|
||||
case UIMessage::Focus:
|
||||
{
|
||||
toFront();
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgMouseDown:
|
||||
case UIMessage::MouseDown:
|
||||
{
|
||||
doResize( Msg );
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgWindowResize:
|
||||
case UIMessage::WindowResize:
|
||||
{
|
||||
if ( isModal() && NULL != mModalCtrl ) {
|
||||
mModalCtrl->setSize( UIManager::instance()->getMainControl()->getSize() );
|
||||
@@ -554,18 +554,18 @@ Uint32 UIWindow::onMessage( const UIMessage * Msg ) {
|
||||
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgMouseExit:
|
||||
case UIMessage::MouseExit:
|
||||
{
|
||||
UIManager::instance()->setCursor( EE_CURSOR_ARROW );
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgDragStart:
|
||||
case UIMessage::DragStart:
|
||||
{
|
||||
UIManager::instance()->setCursor( EE_CURSOR_HAND );
|
||||
toFront();
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgDragStop:
|
||||
case UIMessage::DragStop:
|
||||
{
|
||||
UIManager::instance()->setCursor( EE_CURSOR_ARROW );
|
||||
break;
|
||||
|
||||
@@ -55,7 +55,7 @@ void UIWinMenu::addMenuButton( const String& ButtonText, UIPopUpMenu * Menu ) {
|
||||
Menu->setVisible( false );
|
||||
Menu->setEnabled( false );
|
||||
Menu->setParent( getWindowContainer() );
|
||||
Menu->addEventListener( UIEvent::EventOnWidgetFocusLoss, cb::Make1( this, &UIWinMenu::onMenuFocusLoss ) );
|
||||
Menu->addEventListener( UIEvent::OnWidgetFocusLoss, cb::Make1( this, &UIWinMenu::onMenuFocusLoss ) );
|
||||
|
||||
mButtons.push_back( std::make_pair( Button, Menu ) );
|
||||
|
||||
@@ -176,8 +176,8 @@ void UIWinMenu::refreshButtons() {
|
||||
|
||||
Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case UIMessage::MsgMouseUp:
|
||||
case UIMessage::MsgMouseEnter:
|
||||
case UIMessage::MouseUp:
|
||||
case UIMessage::MouseEnter:
|
||||
{
|
||||
if ( Msg->getSender()->isType( UI_TYPE_SELECTBUTTON ) ) {
|
||||
UISelectButton * tbut = reinterpret_cast<UISelectButton*> ( Msg->getSender() );
|
||||
@@ -186,7 +186,7 @@ Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) {
|
||||
Vector2i pos( tbut->getPosition().x, tbut->getPosition().y + tbut->getSize().getHeight() );
|
||||
tpop->setPosition( pos );
|
||||
|
||||
if ( Msg->getMsg() == UIMessage::MsgMouseEnter ) {
|
||||
if ( Msg->getMsg() == UIMessage::MouseEnter ) {
|
||||
if ( NULL != mCurrentMenu ) {
|
||||
mCurrentMenu = tpop;
|
||||
|
||||
@@ -207,7 +207,7 @@ Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) {
|
||||
|
||||
break;
|
||||
}
|
||||
case UIMessage::MsgSelected:
|
||||
case UIMessage::Selected:
|
||||
{
|
||||
for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); it++ ) {
|
||||
if ( it->first != Msg->getSender() ) {
|
||||
@@ -217,7 +217,7 @@ Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
case UIMessage::MsgFocusLoss:
|
||||
case UIMessage::FocusLoss:
|
||||
{
|
||||
UIControl * FocusCtrl = UIManager::instance()->getFocusControl();
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ void EETest::createUI() {
|
||||
UIWindow * tWin = UIWindow::New();
|
||||
tWin->setSize( 530, 405 )->setPosition( 320, 240 );
|
||||
UIWindowStyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
windowStyleConfig.WinFlags = UI_WIN_DRAGABLE_CONTAINER | UI_WIN_SHADOW;
|
||||
windowStyleConfig.WinFlags = UI_WIN_DRAGABLE_CONTAINER | UI_WIN_SHADOW | UI_WIN_FRAME_BUFFER;
|
||||
windowStyleConfig.MinWindowSize = Sizei( 530, 405 );
|
||||
windowStyleConfig.BaseAlpha = 200;
|
||||
tWin->setStyleConfig( windowStyleConfig );
|
||||
@@ -325,8 +325,8 @@ void EETest::createUI() {
|
||||
|
||||
tWin->setTitle( "Controls Test" );
|
||||
|
||||
tWin->addEventListener( UIEvent::EventMouseUp, cb::Make1( this, &EETest::onWinMouseUp ) );
|
||||
C->addEventListener( UIEvent::EventMouseUp, cb::Make1( this, &EETest::onWinMouseUp ) );
|
||||
tWin->addEventListener( UIEvent::MouseUp, cb::Make1( this, &EETest::onWinMouseUp ) );
|
||||
C->addEventListener( UIEvent::MouseUp, cb::Make1( this, &EETest::onWinMouseUp ) );
|
||||
|
||||
UISprite * sprite = UISprite::New();
|
||||
sprite->setFlags( UI_AUTO_SIZE );
|
||||
@@ -345,7 +345,7 @@ void EETest::createUI() {
|
||||
Button->setParent( C )->setPosition( 225, 215 )->setSize( 90, 0 );
|
||||
Button->setIcon( mTheme->getIconByName( "ok" ) );
|
||||
Button->setText( "Click Me" );
|
||||
Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onButtonClick ) );
|
||||
Button->addEventListener( UIEvent::MouseClick, cb::Make1( this, &EETest::onButtonClick ) );
|
||||
Button->setTooltipText( "Click and see what happens..." );
|
||||
|
||||
UICheckBox * Checkbox = UICheckBox::New();
|
||||
@@ -362,7 +362,7 @@ void EETest::createUI() {
|
||||
|
||||
mSlider = UISlider::New();
|
||||
mSlider->setOrientation( UI_HORIZONTAL )->setParent( C )->setPosition( 220, 80 )->setSize( 80, 24 );
|
||||
mSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &EETest::onSliderValueChange ) );
|
||||
mSlider->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &EETest::onSliderValueChange ) );
|
||||
|
||||
UISlider::New()->setOrientation( UI_VERTICAL )->setParent( C )->setPosition( 40, 110 )->setSize( 24, 80 );
|
||||
|
||||
@@ -372,7 +372,7 @@ void EETest::createUI() {
|
||||
|
||||
mScrollBar = UIScrollBar::New();
|
||||
mScrollBar->setParent( C )->setSize( 0, 240 );
|
||||
mScrollBar->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &EETest::onValueChange ) );
|
||||
mScrollBar->addEventListener( UIEvent::OnValueChange, cb::Make1( this, &EETest::onValueChange ) );
|
||||
|
||||
mProgressBar = UIProgressBar::New();
|
||||
mProgressBar->setParent( C )->setSize( 200, 24 )->setPosition( 20, 190 );
|
||||
@@ -449,9 +449,9 @@ void EETest::createUI() {
|
||||
Menu->addSeparator();
|
||||
Menu->add( "Quit" );
|
||||
|
||||
Menu->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &EETest::onItemClick ) );
|
||||
Menu->getItem( "Quit" )->addEventListener( UIEvent::EventMouseUp, cb::Make1( this, &EETest::onQuitClick ) );
|
||||
UIManager::instance()->getMainControl()->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
Menu->addEventListener( UIEvent::OnItemClicked, cb::Make1( this, &EETest::onItemClick ) );
|
||||
Menu->getItem( "Quit" )->addEventListener( UIEvent::MouseUp, cb::Make1( this, &EETest::onQuitClick ) );
|
||||
UIManager::instance()->getMainControl()->addEventListener( UIEvent::MouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
|
||||
UITextEdit * TextEdit = UITextEdit::New();
|
||||
TextEdit->setParent( C )->setPosition( 5, 245 )->setSize( 315, 130 );
|
||||
@@ -511,7 +511,7 @@ void EETest::createUI() {
|
||||
|
||||
mShowMenu->setText( "Show Menu" );
|
||||
mShowMenu->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
mShowMenu->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onShowMenu ) );
|
||||
mShowMenu->addEventListener( UIEvent::MouseClick, cb::Make1( this, &EETest::onShowMenu ) );
|
||||
#endif
|
||||
|
||||
eePRINTL( "CreateUI time: %4.3f ms.", TE.getElapsed().asMilliseconds() );
|
||||
@@ -529,9 +529,9 @@ void EETest::createNewUI() {
|
||||
UIScrollView * scrollView = UIScrollView::New();
|
||||
scrollView->setTouchDragEnabled( true );
|
||||
scrollView->setLayoutSizeRules( MATCH_PARENT, MATCH_PARENT )->setParent( relLay );
|
||||
scrollView->getContainer()->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
scrollView->getContainer()->addEventListener( UIEvent::MouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
container->setParent( scrollView );
|
||||
container->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
container->addEventListener( UIEvent::MouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
|
||||
UILoader * loader = UILoader::New();
|
||||
loader->setOutlineThickness( 4 )
|
||||
@@ -851,10 +851,10 @@ void EETest::createDecoratedWindow() {
|
||||
mUIWindow->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_SHADOW | UI_WIN_FRAME_BUFFER )
|
||||
->setMinWindowSize( 530, 350 )->setPosition( 200, 50 );
|
||||
|
||||
mUIWindow->addEventListener( UIEvent::EventOnWindowCloseClick, cb::Make1( this, &EETest::onCloseClick ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnWindowCloseClick, cb::Make1( this, &EETest::onCloseClick ) );
|
||||
mUIWindow->setTitle( "Test Window" );
|
||||
mUIWindow->addEventListener( UIEvent::EventOnDragStart, cb::Make1( &onWinDragStart ) );
|
||||
mUIWindow->addEventListener( UIEvent::EventOnDragStop, cb::Make1( &onWinDragStop ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnDragStart, cb::Make1( &onWinDragStart ) );
|
||||
mUIWindow->addEventListener( UIEvent::OnDragStop, cb::Make1( &onWinDragStop ) );
|
||||
|
||||
UILinearLayout * lay = UILinearLayout::NewVertical();
|
||||
lay->setLayoutSizeRules( MATCH_PARENT, MATCH_PARENT );
|
||||
@@ -882,7 +882,7 @@ void EETest::createDecoratedWindow() {
|
||||
Button->setLayoutMargin( Rect( 5, 5, 5, 5 ) );
|
||||
Button->setText( "Click Me" );
|
||||
Button->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay );
|
||||
Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onButtonClick ) );
|
||||
Button->addEventListener( UIEvent::MouseClick, cb::Make1( this, &EETest::onButtonClick ) );
|
||||
|
||||
mUIWindow->addShortcut( KEY_C, KEYMOD_ALT, Button );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user