Make group selection optional.
This commit is contained in:
parent
01cdcaa480
commit
e9f5fef158
5 changed files with 21 additions and 1 deletions
|
@ -516,6 +516,8 @@ namespace NLGUI
|
|||
void unregisterWidgetWatcher( IWidgetWatcher *watcher );
|
||||
|
||||
CInterfaceElement* addWidgetToGroup( std::string &group, std::string &widgetClass, std::string &widgetName );
|
||||
|
||||
void setGroupSelection( bool b ){ groupSelection = b; }
|
||||
|
||||
private:
|
||||
CWidgetManager();
|
||||
|
@ -610,6 +612,7 @@ namespace NLGUI
|
|||
|
||||
|
||||
std::string currentEditorSelection;
|
||||
bool groupSelection;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -2408,7 +2408,7 @@ namespace NLGUI
|
|||
// This may happen when alt-tab has been used => the sheet is dragged but the left button is up
|
||||
if (!CCtrlDraggable::getDraggedSheet())
|
||||
{
|
||||
if( CInterfaceElement::getEditorMode() )
|
||||
if( CInterfaceElement::getEditorMode() && groupSelection )
|
||||
{
|
||||
for( sint32 i = _GroupsUnderPointer.size() - 1; i >= 0; i-- )
|
||||
{
|
||||
|
@ -3516,6 +3516,7 @@ namespace NLGUI
|
|||
setScreenWH( 0, 0 );
|
||||
|
||||
currentEditorSelection = "";
|
||||
groupSelection = false;
|
||||
}
|
||||
|
||||
CWidgetManager::~CWidgetManager()
|
||||
|
|
|
@ -130,5 +130,10 @@ namespace GUIEditor
|
|||
e->setActive( false );
|
||||
e->setActive( true );
|
||||
}
|
||||
|
||||
void CEditorMessageProcessor::onSetGroupSelection( bool b )
|
||||
{
|
||||
CWidgetManager::getInstance()->setGroupSelection( b );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace GUIEditor
|
|||
public Q_SLOTS:
|
||||
void onDelete();
|
||||
void onAdd( const QString &parentGroup, const QString &widgetType, const QString &name );
|
||||
void onSetGroupSelection( bool b );
|
||||
|
||||
private:
|
||||
CWidgetInfoTree *tree;
|
||||
|
|
|
@ -399,6 +399,16 @@ namespace GUIEditor
|
|||
connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onAddWidgetClicked() ) );
|
||||
m->addAction( a );
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
m->addSeparator();
|
||||
|
||||
a = new QAction( "Select groups", this );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( false );
|
||||
connect( a, SIGNAL( triggered( bool ) ), messageProcessor, SLOT( onSetGroupSelection( bool ) ) );
|
||||
m->addAction( a );
|
||||
|
||||
menu = m;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue