mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-05 23:09:04 +00:00
A little refactoring.
This commit is contained in:
parent
297d287f39
commit
89e86d2c7b
4 changed files with 18 additions and 7 deletions
|
@ -126,6 +126,7 @@ namespace NLGUI
|
|||
|
||||
void onRemoved();
|
||||
void onWidgetDeleted( CInterfaceElement *e );
|
||||
void moveBy( sint32 x, sint32 y );
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -510,6 +510,14 @@ namespace NLGUI
|
|||
/// so other widgets in the group can check if it belongs to them
|
||||
virtual void onWidgetDeleted( CInterfaceElement *e ){}
|
||||
|
||||
/// Move the element by x in the X direction and y in the Y direction
|
||||
// Uses real coordinates
|
||||
virtual void moveBy( sint32 x, sint32 y )
|
||||
{
|
||||
_XReal += x;
|
||||
_YReal += y;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
bool editorSelected;
|
||||
|
|
|
@ -863,10 +863,6 @@ namespace NLGUI
|
|||
if(getFrozen() && getFrozenHalfTone())
|
||||
_ViewText->setAlpha(_ViewText->getAlpha()>>2);
|
||||
|
||||
// When dragging the button, the text needs to move too
|
||||
if( CInterfaceElement::editorMode )
|
||||
_ViewText->updateCoords();
|
||||
|
||||
_ViewText->draw();
|
||||
}
|
||||
}
|
||||
|
@ -1017,5 +1013,13 @@ namespace NLGUI
|
|||
void CCtrlTextButton::onWidgetDeleted( CInterfaceElement *e )
|
||||
{
|
||||
}
|
||||
|
||||
void CCtrlTextButton::moveBy( sint32 x, sint32 y )
|
||||
{
|
||||
CInterfaceElement::moveBy( x, y );
|
||||
|
||||
if( _ViewText != NULL )
|
||||
_ViewText->updateCoords();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2633,9 +2633,7 @@ namespace NLGUI
|
|||
sint32 dx = newX - oldX;
|
||||
sint32 dy = newY - oldY;
|
||||
|
||||
draggedElement->setXReal( draggedElement->getXReal() + dx );
|
||||
draggedElement->setYReal( draggedElement->getYReal() + dy );
|
||||
draggedElement->invalidateCoords();
|
||||
draggedElement->moveBy( dx, dy );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue