mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
whitespace
This commit is contained in:
parent
6164f36c47
commit
bcc5459818
50 changed files with 2111 additions and 2111 deletions
|
|
@ -46,17 +46,17 @@ ConsoleDocClass( GuiTextEditCtrl,
|
|||
|
||||
"@tsexample\n"
|
||||
" new GuiTextEditCtrl(MessageHud_Edit)\n"
|
||||
" {\n"
|
||||
" text = \"Hello World\";\n"
|
||||
" validate = \"validateCommand();\"\n"
|
||||
" escapeCommand = \"escapeCommand();\";\n"
|
||||
" historySize = \"5\";\n"
|
||||
" tabComplete = \"true\";\n"
|
||||
" deniedSound = \"DeniedSoundProfile\";\n"
|
||||
" sinkAllKeyEvents = \"true\";\n"
|
||||
" password = \"true\";\n"
|
||||
" passwordMask = \"*\";\n"
|
||||
" //Properties not specific to this control have been omitted from this example.\n"
|
||||
" {\n"
|
||||
" text = \"Hello World\";\n"
|
||||
" validate = \"validateCommand();\"\n"
|
||||
" escapeCommand = \"escapeCommand();\";\n"
|
||||
" historySize = \"5\";\n"
|
||||
" tabComplete = \"true\";\n"
|
||||
" deniedSound = \"DeniedSoundProfile\";\n"
|
||||
" sinkAllKeyEvents = \"true\";\n"
|
||||
" password = \"true\";\n"
|
||||
" passwordMask = \"*\";\n"
|
||||
" //Properties not specific to this control have been omitted from this example.\n"
|
||||
" };\n"
|
||||
"@endtsexample\n\n"
|
||||
|
||||
|
|
@ -72,9 +72,9 @@ IMPLEMENT_CALLBACK( GuiTextEditCtrl, onTabComplete, void, (const char* val),( va
|
|||
"@tsexample\n"
|
||||
"// Tab key has been pressed, causing the callback to occur.\n"
|
||||
"GuiTextEditCtrl::onTabComplete(%this,%val)\n"
|
||||
" {\n"
|
||||
" //Code to run when the onTabComplete callback occurs\n"
|
||||
" }\n"
|
||||
" {\n"
|
||||
" //Code to run when the onTabComplete callback occurs\n"
|
||||
" }\n"
|
||||
"@endtsexample\n\n"
|
||||
"@see GuiTextCtrl\n"
|
||||
"@see GuiControl\n\n"
|
||||
|
|
@ -85,9 +85,9 @@ IMPLEMENT_CALLBACK( GuiTextEditCtrl, onReturn, void, (),(),
|
|||
"@tsexample\n"
|
||||
"// Return or Enter key was pressed, causing the callback to occur.\n"
|
||||
"GuiTextEditCtrl::onReturn(%this)\n"
|
||||
" {\n"
|
||||
" // Code to run when the onReturn callback occurs\n"
|
||||
" }\n"
|
||||
" {\n"
|
||||
" // Code to run when the onReturn callback occurs\n"
|
||||
" }\n"
|
||||
"@endtsexample\n\n"
|
||||
"@see GuiTextCtrl\n"
|
||||
"@see GuiControl\n\n"
|
||||
|
|
@ -98,9 +98,9 @@ IMPLEMENT_CALLBACK( GuiTextEditCtrl, onValidate, void, (),(),
|
|||
"@tsexample\n"
|
||||
"// The control gets validated, causing the callback to occur\n"
|
||||
"GuiTextEditCtrl::onValidated(%this)\n"
|
||||
" {\n"
|
||||
" // Code to run when the control is validated\n"
|
||||
" }\n"
|
||||
" {\n"
|
||||
" // Code to run when the control is validated\n"
|
||||
" }\n"
|
||||
"@endtsexample\n\n"
|
||||
"@see GuiTextCtrl\n"
|
||||
"@see GuiControl\n\n"
|
||||
|
|
@ -139,7 +139,7 @@ GuiTextEditCtrl::GuiTextEditCtrl()
|
|||
mHistoryBuf = NULL;
|
||||
|
||||
#if defined(__MACOSX__)
|
||||
UTF8 bullet[4] = { 0xE2, 0x80, 0xA2, 0 };
|
||||
UTF8 bullet[4] = { 0xE2, 0x80, 0xA2, 0 };
|
||||
|
||||
mPasswordMask = StringTable->insert( bullet );
|
||||
#else
|
||||
|
|
@ -710,10 +710,10 @@ bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event)
|
|||
case KEY_TAB:
|
||||
if ( mTabComplete )
|
||||
{
|
||||
onTabComplete_callback("1");
|
||||
onTabComplete_callback("1");
|
||||
return true;
|
||||
}
|
||||
break; // We don't want to fall through if we don't handle the TAB here.
|
||||
break; // We don't want to fall through if we don't handle the TAB here.
|
||||
|
||||
case KEY_HOME:
|
||||
mBlockStart = 0;
|
||||
|
|
@ -779,10 +779,10 @@ bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event)
|
|||
}
|
||||
return true;
|
||||
|
||||
case KEY_RETURN:
|
||||
case KEY_NUMPADENTER:
|
||||
case KEY_RETURN:
|
||||
case KEY_NUMPADENTER:
|
||||
|
||||
return dealWithEnter(false);
|
||||
return dealWithEnter(false);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
@ -998,7 +998,7 @@ bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event)
|
|||
case KEY_RETURN:
|
||||
case KEY_NUMPADENTER:
|
||||
|
||||
return dealWithEnter(true);
|
||||
return dealWithEnter(true);
|
||||
|
||||
case KEY_UP:
|
||||
{
|
||||
|
|
@ -1155,7 +1155,7 @@ dealWithBackspace:
|
|||
case KEY_TAB:
|
||||
if ( mTabComplete )
|
||||
{
|
||||
onTabComplete_callback("0");
|
||||
onTabComplete_callback("0");
|
||||
return( true );
|
||||
}
|
||||
case KEY_UP:
|
||||
|
|
@ -1208,9 +1208,9 @@ bool GuiTextEditCtrl::dealWithEnter( bool clearResponder )
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if( clearResponder )
|
||||
clearFirstResponder();
|
||||
|
||||
if( clearResponder )
|
||||
clearFirstResponder();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1222,13 +1222,13 @@ void GuiTextEditCtrl::setFirstResponder()
|
|||
GuiCanvas *root = getRoot();
|
||||
if (root != NULL)
|
||||
{
|
||||
root->enableKeyboardTranslation();
|
||||
root->enableKeyboardTranslation();
|
||||
|
||||
|
||||
// If the native OS accelerator keys are not disabled
|
||||
// then some key events like Delete, ctrl+V, etc may
|
||||
// not make it down to us.
|
||||
root->setNativeAcceleratorsEnabled( false );
|
||||
// If the native OS accelerator keys are not disabled
|
||||
// then some key events like Delete, ctrl+V, etc may
|
||||
// not make it down to us.
|
||||
root->setNativeAcceleratorsEnabled( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1237,8 +1237,8 @@ void GuiTextEditCtrl::onLoseFirstResponder()
|
|||
GuiCanvas *root = getRoot();
|
||||
if( root )
|
||||
{
|
||||
root->setNativeAcceleratorsEnabled( true );
|
||||
root->disableKeyboardTranslation();
|
||||
root->setNativeAcceleratorsEnabled( true );
|
||||
root->disableKeyboardTranslation();
|
||||
}
|
||||
|
||||
//execute the validate command
|
||||
|
|
@ -1546,29 +1546,29 @@ void GuiTextEditCtrl::handleCharInput( U16 ascii )
|
|||
//see if it's a number field
|
||||
if ( mProfile->mNumbersOnly )
|
||||
{
|
||||
if (ascii == '-')
|
||||
{
|
||||
//a minus sign only exists at the beginning, and only a single minus sign
|
||||
if (mCursorPos != 0 && !isAllTextSelected())
|
||||
{
|
||||
invalidText();
|
||||
return;
|
||||
}
|
||||
if (ascii == '-')
|
||||
{
|
||||
//a minus sign only exists at the beginning, and only a single minus sign
|
||||
if (mCursorPos != 0 && !isAllTextSelected())
|
||||
{
|
||||
invalidText();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mInsertOn && (mTextBuffer.getChar(0) == '-'))
|
||||
{
|
||||
invalidText();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// BJTODO: This is probably not unicode safe.
|
||||
else if (ascii != '.' && (ascii < '0' || ascii > '9'))
|
||||
{
|
||||
invalidText();
|
||||
return;
|
||||
}
|
||||
else
|
||||
validText();
|
||||
if (mInsertOn && (mTextBuffer.getChar(0) == '-'))
|
||||
{
|
||||
invalidText();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// BJTODO: This is probably not unicode safe.
|
||||
else if (ascii != '.' && (ascii < '0' || ascii > '9'))
|
||||
{
|
||||
invalidText();
|
||||
return;
|
||||
}
|
||||
else
|
||||
validText();
|
||||
}
|
||||
|
||||
//save the current state
|
||||
|
|
@ -1778,22 +1778,22 @@ DefineEngineMethod( GuiTextEditCtrl, forceValidateText, void, (),,
|
|||
}
|
||||
|
||||
DefineEngineMethod(GuiTextEditCtrl, invalidText, void, (bool playSound), (true),
|
||||
"@brief Trigger the invalid sound and make the box red.nn"
|
||||
"@param playSound Play the invalid text sound or not.n")
|
||||
"@brief Trigger the invalid sound and make the box red.nn"
|
||||
"@param playSound Play the invalid text sound or not.n")
|
||||
{
|
||||
object->invalidText(playSound);
|
||||
object->invalidText(playSound);
|
||||
}
|
||||
|
||||
|
||||
DefineEngineMethod(GuiTextEditCtrl, validText, void, (), ,
|
||||
"@brief Restores the box to normal color.nn")
|
||||
"@brief Restores the box to normal color.nn")
|
||||
{
|
||||
object->validText();
|
||||
object->validText();
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiTextEditCtrl, isValidText, bool, (), ,
|
||||
"@brief Returns if the text is set to valid or not.n"
|
||||
"@Return true if text is set to valid, false if not.nn")
|
||||
"@brief Returns if the text is set to valid or not.n"
|
||||
"@Return true if text is set to valid, false if not.nn")
|
||||
{
|
||||
return object->isValidText();
|
||||
return object->isValidText();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue