mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-27 02:50:53 +00:00
Editbox selection should be stopped when the mouse button goes up, even if it happens outside of the box.
This commit is contained in:
parent
a943c939ef
commit
161c8e5edc
2 changed files with 17 additions and 10 deletions
|
@ -1320,6 +1320,16 @@ namespace NLGUI
|
|||
}
|
||||
}
|
||||
|
||||
// if click, and not frozen, then get the focus
|
||||
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !_Frozen)
|
||||
{
|
||||
_SelectingText = false;
|
||||
if (_SelectCursorPos == _CursorPos)
|
||||
_CurrSelection = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||
return false;
|
||||
|
||||
|
@ -1329,6 +1339,7 @@ namespace NLGUI
|
|||
_SelectingText = true;
|
||||
stopParentBlink();
|
||||
CWidgetManager::getInstance()->setCaptureKeyboard (this);
|
||||
CWidgetManager::getInstance()->setCapturePointerLeft (this);
|
||||
// set the right cursor position
|
||||
uint newCurPos;
|
||||
bool cursorAtPreviousLineEnd;
|
||||
|
@ -1356,16 +1367,6 @@ namespace NLGUI
|
|||
return true;
|
||||
}
|
||||
|
||||
// if click, and not frozen, then get the focus
|
||||
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouseleftup && !_Frozen)
|
||||
{
|
||||
_SelectingText = false;
|
||||
if (_SelectCursorPos == _CursorPos)
|
||||
_CurrSelection = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||
{
|
||||
CWidgetManager::getInstance()->setCapturePointerRight(this);
|
||||
|
|
|
@ -2539,6 +2539,12 @@ namespace NLGUI
|
|||
{
|
||||
if ( getCapturePointerLeft() != NULL)
|
||||
{
|
||||
if( !handled )
|
||||
{
|
||||
CCtrlBase *c = getCapturePointerLeft();
|
||||
c->handleEvent( evnt );
|
||||
}
|
||||
|
||||
setCapturePointerLeft(NULL);
|
||||
handled = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue