Add Ctrl+A (or Cmd+A) to select the whole text in ui::Entry

This commit is contained in:
David Capello 2015-05-06 18:11:29 -03:00
parent 24c3c3e3a3
commit f7465771b0
2 changed files with 6 additions and 0 deletions

View File

@ -277,6 +277,7 @@ bool Entry::onProcessMessage(Message* msg)
case kKeyX: cmd = EntryCmd::Cut; break;
case kKeyC: cmd = EntryCmd::Copy; break;
case kKeyV: cmd = EntryCmd::Paste; break;
case kKeyA: cmd = EntryCmd::SelectAll; break;
}
}
else if (getManager()->isFocusMovementKey(msg)) {
@ -653,6 +654,10 @@ void Entry::executeCmd(EntryCmd cmd, int unicodeChar, bool shift_pressed)
m_select = -1;
break;
case EntryCmd::SelectAll:
selectAllText();
break;
}
std::string newText = base::to_utf8(text);

View File

@ -70,6 +70,7 @@ namespace ui {
Cut,
Copy,
Paste,
SelectAll,
};
int getCaretFromMouse(MouseMessage* mousemsg);