MODIFIED: Draw the highlight of the currently selected widget in editor mode.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2013-03-07 06:01:33 +01:00
parent 532a3ef7d3
commit aa2affa158
5 changed files with 19 additions and 3 deletions

View file

@ -424,6 +424,8 @@ namespace NLGUI
void drawHotSpot(THotSpot hs, NLMISC::CRGBA col);
void drawHighlight();
// Returns 'true' if that element can be downcasted to a view
virtual bool isView() const { return false; }

View file

@ -357,7 +357,7 @@ namespace NLGUI
if ( ( _Over && !editorMode ) || editorSelected )
if ( ( _Over && !editorMode ) )
{
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL))

View file

@ -774,8 +774,7 @@ namespace NLGUI
CCtrlBase *capturePointerLeft = CWidgetManager::getInstance()->getCapturePointerLeft();
// *** Draw Over
if( editorSelected ||
( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || capturePointerLeft == this ) ) )
if( ( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || capturePointerLeft == this ) ) )
)
{
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL) )

View file

@ -1300,6 +1300,11 @@ namespace NLGUI
}
void CInterfaceElement::drawHighlight()
{
CViewRenderer::getInstance()->drawWiredQuad( _XReal, _YReal, _WReal, _HReal );
}
// ***************************************************************************
void CInterfaceElement::invalidateContent()
{

View file

@ -2056,6 +2056,16 @@ namespace NLGUI
getPointer()->draw ();
}
if( CInterfaceElement::getEditorMode() )
{
if( !currentEditorSelection.empty() )
{
CInterfaceElement *e = getElementFromId( currentEditorSelection );
if( e != NULL )
e->drawHighlight();
}
}
// flush layers
CViewRenderer::getInstance()->flush();