mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Fix up radio buttons, more editbox functionality.
All blocking issues with UI should now be fixed.
This commit is contained in:
@@ -166,6 +166,9 @@ namespace PortabilityLayer
|
||||
{
|
||||
if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
{
|
||||
if (!m_hasFocus)
|
||||
return WidgetHandleStates::kIgnored;
|
||||
|
||||
const GpKeyboardInputEvent &keyEvent = evt.m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
|
||||
if (keyEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar || keyEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar)
|
||||
@@ -191,8 +194,6 @@ namespace PortabilityLayer
|
||||
{
|
||||
if (ch >= 0x20 && ch <= 0x7e)
|
||||
HandleCharacter(ch, keyEvent.m_repeatCount);
|
||||
else if (ch == '\b')
|
||||
HandleBackspace(keyEvent.m_repeatCount);
|
||||
|
||||
return WidgetHandleStates::kDigested;
|
||||
}
|
||||
@@ -206,7 +207,7 @@ namespace PortabilityLayer
|
||||
{
|
||||
if (keyEvent.m_key.m_specialKey == GpKeySpecials::kBackspace)
|
||||
{
|
||||
|
||||
HandleBackspace(keyEvent.m_repeatCount);
|
||||
return WidgetHandleStates::kDigested;
|
||||
}
|
||||
else if (keyEvent.m_key.m_specialKey == GpKeySpecials::kDelete)
|
||||
@@ -234,6 +235,24 @@ namespace PortabilityLayer
|
||||
return true;
|
||||
}
|
||||
|
||||
void EditboxWidget::SetSelection(size_t startChar, size_t endChar)
|
||||
{
|
||||
if (startChar > m_length)
|
||||
startChar = m_length;
|
||||
|
||||
if (endChar < startChar)
|
||||
endChar = startChar;
|
||||
|
||||
if (endChar > m_length)
|
||||
endChar = m_length;
|
||||
|
||||
m_selStartChar = startChar;
|
||||
m_selEndChar = endChar;
|
||||
|
||||
m_caratTimer = 0;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void EditboxWidget::OnTick()
|
||||
{
|
||||
if (m_hasFocus)
|
||||
|
||||
Reference in New Issue
Block a user