mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 09:16:18 +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
44d6404b03
commit
1291837873
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()))
|
if (!isIn(eventDesc.getX(), eventDesc.getY()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1329,6 +1339,7 @@ namespace NLGUI
|
||||||
_SelectingText = true;
|
_SelectingText = true;
|
||||||
stopParentBlink();
|
stopParentBlink();
|
||||||
CWidgetManager::getInstance()->setCaptureKeyboard (this);
|
CWidgetManager::getInstance()->setCaptureKeyboard (this);
|
||||||
|
CWidgetManager::getInstance()->setCapturePointerLeft (this);
|
||||||
// set the right cursor position
|
// set the right cursor position
|
||||||
uint newCurPos;
|
uint newCurPos;
|
||||||
bool cursorAtPreviousLineEnd;
|
bool cursorAtPreviousLineEnd;
|
||||||
|
@ -1356,16 +1367,6 @@ namespace NLGUI
|
||||||
return true;
|
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)
|
if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mouserightdown)
|
||||||
{
|
{
|
||||||
CWidgetManager::getInstance()->setCapturePointerRight(this);
|
CWidgetManager::getInstance()->setCapturePointerRight(this);
|
||||||
|
|
|
@ -2539,6 +2539,12 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if ( getCapturePointerLeft() != NULL)
|
if ( getCapturePointerLeft() != NULL)
|
||||||
{
|
{
|
||||||
|
if( !handled )
|
||||||
|
{
|
||||||
|
CCtrlBase *c = getCapturePointerLeft();
|
||||||
|
c->handleEvent( evnt );
|
||||||
|
}
|
||||||
|
|
||||||
setCapturePointerLeft(NULL);
|
setCapturePointerLeft(NULL);
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue