|
|
|
@ -347,17 +347,26 @@ void CGroupEditBox::paste()
|
|
|
|
|
}
|
|
|
|
|
cutSelection();
|
|
|
|
|
}
|
|
|
|
|
stopParentBlink();
|
|
|
|
|
makeTopWindow();
|
|
|
|
|
|
|
|
|
|
ucstring sString;
|
|
|
|
|
|
|
|
|
|
if (Driver->pasteTextFromClipboard(sString))
|
|
|
|
|
{
|
|
|
|
|
sint length = (sint)sString.length();
|
|
|
|
|
// append string now
|
|
|
|
|
appendString(sString);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
void CGroupEditBox::appendString(const ucstring &str)
|
|
|
|
|
{
|
|
|
|
|
stopParentBlink();
|
|
|
|
|
makeTopWindow();
|
|
|
|
|
|
|
|
|
|
sint length = (sint)str.length();
|
|
|
|
|
|
|
|
|
|
ucstring toAppend;
|
|
|
|
|
// filter character depending on the netry type
|
|
|
|
|
// filter character depending on the entry type
|
|
|
|
|
switch (_EntryType)
|
|
|
|
|
{
|
|
|
|
|
case Text:
|
|
|
|
@ -365,15 +374,15 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
if (_NegativeFilter.empty())
|
|
|
|
|
{
|
|
|
|
|
toAppend = sString;
|
|
|
|
|
toAppend = str;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -387,12 +396,12 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isdigit(sString[k]) || sString[k]== ' ' ||
|
|
|
|
|
(_EntryType==PositiveFloat && sString[k]=='.') )
|
|
|
|
|
if (isdigit(str[k]) || str[k]== ' ' ||
|
|
|
|
|
(_EntryType==PositiveFloat && str[k]=='.') )
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -403,12 +412,12 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isdigit(sString[k]) || sString[k]== ' ' || sString[k]== '-' ||
|
|
|
|
|
(_EntryType==Float && sString[k]=='.') )
|
|
|
|
|
if (isdigit(str[k]) || str[k]== ' ' || str[k]== '-' ||
|
|
|
|
|
(_EntryType==Float && str[k]=='.') )
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -418,11 +427,11 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isValidAlphaNumSpace(sString[k]))
|
|
|
|
|
if (isValidAlphaNumSpace(str[k]))
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -432,11 +441,11 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isValidAlphaNum(sString[k]))
|
|
|
|
|
if (isValidAlphaNum(str[k]))
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -446,11 +455,11 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isValidAlpha(sString[k]))
|
|
|
|
|
if (isValidAlpha(str[k]))
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -460,11 +469,11 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isValidFilenameChar(sString[k]))
|
|
|
|
|
if (isValidFilenameChar(str[k]))
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -474,11 +483,11 @@ void CGroupEditBox::paste()
|
|
|
|
|
{
|
|
|
|
|
for (sint k = 0; k < length; ++k)
|
|
|
|
|
{
|
|
|
|
|
if (isValidPlayerNameChar(sString[k]))
|
|
|
|
|
if (isValidPlayerNameChar(str[k]))
|
|
|
|
|
{
|
|
|
|
|
if (!isFiltered(sString[k]))
|
|
|
|
|
if (!isFiltered(str[k]))
|
|
|
|
|
{
|
|
|
|
|
toAppend += sString[k];
|
|
|
|
|
toAppend += str[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -495,7 +504,6 @@ void CGroupEditBox::paste()
|
|
|
|
|
nlinfo ("Chat input was pasted from the clipboard");
|
|
|
|
|
|
|
|
|
|
triggerOnChangeAH();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_CursorAtPreviousLineEnd = false;
|
|
|
|
|
}
|
|
|
|
@ -610,6 +618,8 @@ void CGroupEditBox::handleEventChar(const CEventDescriptorKey &rEDK)
|
|
|
|
|
if (!isValidPlayerNameChar(c))
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// verify integer bounds
|
|
|
|
|
if(_EntryType==Integer && (_IntegerMinValue!=INT_MIN || _IntegerMaxValue!=INT_MAX))
|
|
|
|
@ -658,6 +668,11 @@ void CGroupEditBox::handleEventChar(const CEventDescriptorKey &rEDK)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
void CGroupEditBox::handleEventString(const CEventDescriptorKey &rEDK)
|
|
|
|
|
{
|
|
|
|
|
appendString(rEDK.getString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
bool CGroupEditBox::undo()
|
|
|
|
@ -720,7 +735,7 @@ bool CGroupEditBox::expand()
|
|
|
|
|
if (_InputString[0] == '/')
|
|
|
|
|
{
|
|
|
|
|
makeTopWindow();
|
|
|
|
|
// for french or deutch, be aware of unicode
|
|
|
|
|
// for french, deutsch and russian, be aware of unicode
|
|
|
|
|
std::string command = ucstring(_InputString.substr(1)).toUtf8();
|
|
|
|
|
ICommand::expand(command);
|
|
|
|
|
// then back to ucstring
|
|
|
|
@ -788,12 +803,14 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event)
|
|
|
|
|
switch(rEDK.getKeyEventType())
|
|
|
|
|
{
|
|
|
|
|
case CEventDescriptorKey::keychar: handleEventChar(rEDK); break;
|
|
|
|
|
case CEventDescriptorKey::keystring: handleEventString(rEDK); break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
// update the text
|
|
|
|
|
setInputString(_InputString);
|
|
|
|
|
|
|
|
|
|
// if event of type char, consider handle all of them
|
|
|
|
|
if( rEDK.getKeyEventType()==CEventDescriptorKey::keychar )
|
|
|
|
|
// if event of type char or string, consider handle all of them
|
|
|
|
|
if( rEDK.getKeyEventType()==CEventDescriptorKey::keychar || rEDK.getKeyEventType()==CEventDescriptorKey::keystring )
|
|
|
|
|
return true;
|
|
|
|
|
// Else filter the EventKeyDown AND EventKeyUp.
|
|
|
|
|
else
|
|
|
|
@ -1090,7 +1107,7 @@ void CGroupEditBox::setInputStringAsInt(sint32 val)
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
sint64 CGroupEditBox::getInputStringAsInt64() const
|
|
|
|
|
{
|
|
|
|
|
sint32 value;
|
|
|
|
|
sint64 value;
|
|
|
|
|
fromString(_InputString.toString(), value);
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|