mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-23 08:22:55 +02:00
Ctrl+A select all
This commit is contained in:
@@ -174,6 +174,13 @@ void Textbox::cutSelection()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Textbox::selectAll()
|
||||||
|
{
|
||||||
|
selectionIndex0 = 0;
|
||||||
|
selectionIndex1 = text.length();
|
||||||
|
updateSelection();
|
||||||
|
}
|
||||||
|
|
||||||
void Textbox::pasteIntoSelection()
|
void Textbox::pasteIntoSelection()
|
||||||
{
|
{
|
||||||
char * clipboardText;
|
char * clipboardText;
|
||||||
@@ -275,6 +282,11 @@ void Textbox::OnVKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
cutSelection();
|
cutSelection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(ctrl && key == 'a')
|
||||||
|
{
|
||||||
|
selectAll();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@@ -67,6 +67,7 @@ protected:
|
|||||||
std::string backingText;
|
std::string backingText;
|
||||||
std::string placeHolder;
|
std::string placeHolder;
|
||||||
|
|
||||||
|
virtual void selectAll();
|
||||||
virtual void cutSelection();
|
virtual void cutSelection();
|
||||||
virtual void pasteIntoSelection();
|
virtual void pasteIntoSelection();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user