mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-27 02:50:53 +00:00
Dragged elements will no longer disappear.
This commit is contained in:
parent
17dcb2acf9
commit
574d24e5e3
2 changed files with 20 additions and 2 deletions
|
@ -532,7 +532,8 @@ namespace NLGUI
|
|||
|
||||
NLMISC::CRefPtr< CViewBase > _CapturedView;
|
||||
|
||||
NLMISC::CRefPtr< CInterfaceElement > draggedElement;
|
||||
NLMISC::CRefPtr< CInterfaceElement > draggedElement; // the element that we're currently dragging
|
||||
std::vector< NLMISC::CRefPtr< CInterfaceElement > > _OrphanElements; // elements that were dragged out of their parents
|
||||
|
||||
bool startDragging();
|
||||
void stopDragging();
|
||||
|
|
|
@ -1037,6 +1037,8 @@ namespace NLGUI
|
|||
setCapturePointerRight(NULL);
|
||||
_CapturedView = NULL;
|
||||
|
||||
_OrphanElements.clear();
|
||||
|
||||
resetColorProps();
|
||||
resetAlphaRolloverSpeedProps();
|
||||
resetGlobalAlphasProps();
|
||||
|
@ -2039,6 +2041,15 @@ namespace NLGUI
|
|||
}
|
||||
}
|
||||
|
||||
std::vector< NLMISC::CRefPtr< CInterfaceElement > >::iterator oeitr = _OrphanElements.begin();
|
||||
while( oeitr != _OrphanElements.end() )
|
||||
{
|
||||
CInterfaceElement *e = *oeitr;
|
||||
CViewBase *v = dynamic_cast< CViewBase* >( e );
|
||||
v->draw();
|
||||
++oeitr;
|
||||
}
|
||||
|
||||
if( draggedElement != NULL )
|
||||
{
|
||||
CInterfaceElement *e = draggedElement;
|
||||
|
@ -2657,8 +2668,12 @@ namespace NLGUI
|
|||
|
||||
void CWidgetManager::stopDragging()
|
||||
{
|
||||
if( draggedElement != NULL )
|
||||
{
|
||||
_OrphanElements.push_back( draggedElement );
|
||||
draggedElement = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CWidgetManager::movePointer (sint32 dx, sint32 dy)
|
||||
|
@ -3454,6 +3469,8 @@ namespace NLGUI
|
|||
|
||||
CWidgetManager::~CWidgetManager()
|
||||
{
|
||||
_OrphanElements.clear();
|
||||
|
||||
for (uint32 i = 0; i < _MasterGroups.size(); ++i)
|
||||
{
|
||||
delete _MasterGroups[i].Group;
|
||||
|
|
Loading…
Reference in a new issue