pressing tab switches between textboxes in the deco editor
This commit is contained in:
parent
1266307070
commit
d38b7b9b11
2
.gitignore
vendored
2
.gitignore
vendored
@ -51,7 +51,7 @@ Makefile.me
|
||||
*.cbp
|
||||
*.layout
|
||||
*.config
|
||||
*.creator
|
||||
*.creator*
|
||||
*.files
|
||||
*.includes
|
||||
config.log
|
||||
|
@ -241,6 +241,20 @@ void ColourPickerActivity::OnMouseUp(int x, int y, unsigned button)
|
||||
}
|
||||
}
|
||||
|
||||
void ColourPickerActivity::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
|
||||
{
|
||||
if (key == KEY_TAB)
|
||||
{
|
||||
if (rValue->IsFocused())
|
||||
gValue->TabFocus();
|
||||
else if (gValue->IsFocused())
|
||||
bValue->TabFocus();
|
||||
else if (bValue->IsFocused())
|
||||
aValue->TabFocus();
|
||||
else if (aValue->IsFocused())
|
||||
rValue->TabFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void ColourPickerActivity::OnDraw()
|
||||
{
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
virtual void OnMouseMove(int x, int y, int dx, int dy);
|
||||
virtual void OnMouseDown(int x, int y, unsigned button);
|
||||
virtual void OnMouseUp(int x, int y, unsigned button);
|
||||
virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
|
||||
virtual void OnTryExit(ExitMethod method);
|
||||
ColourPickerActivity(ui::Colour initialColour, ColourPickedCallback * callback = NULL);
|
||||
virtual ~ColourPickerActivity();
|
||||
|
@ -127,6 +127,12 @@ void Textbox::resetCursorPosition()
|
||||
Graphics::PositionAtCharIndex(multiline?((char*)textLines.c_str()):((char*)text.c_str()), cursor, cursorPositionX, cursorPositionY);
|
||||
}
|
||||
|
||||
void Textbox::TabFocus()
|
||||
{
|
||||
GetParentWindow()->FocusComponent(this);
|
||||
selectAll();
|
||||
}
|
||||
|
||||
void Textbox::cutSelection()
|
||||
{
|
||||
char * clipboardText;
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
void SetInputType(ValidInput input);
|
||||
|
||||
void resetCursorPosition();
|
||||
void TabFocus();
|
||||
//Determines if the given character is valid given the input type
|
||||
bool CharacterValid(Uint16 character);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user