|
|
@ -776,7 +776,7 @@ void KviInputEditor::mousePressEvent(TQMouseEvent *e)
|
|
|
|
m_iSelectionAnchorChar = m_iCursorPosition;
|
|
|
|
m_iSelectionAnchorChar = m_iCursorPosition;
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
//grabMouse(TQCursor(crossCursor));
|
|
|
|
//grabMouse(TQCursor(crossCursor));
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
killDragTimer();
|
|
|
|
killDragTimer();
|
|
|
|
m_iDragTimer = startTimer(KVI_INPUT_DRAG_TIMEOUT);
|
|
|
|
m_iDragTimer = startTimer(KVI_INPUT_DRAG_TIMEOUT);
|
|
|
|
|
|
|
|
|
|
|
@ -922,7 +922,7 @@ void KviInputEditor::copyToClipboard()
|
|
|
|
if(!c)return;
|
|
|
|
if(!c)return;
|
|
|
|
TQString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
|
|
|
|
TQString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
|
|
|
|
c->setText(szTxt,TQClipboard::Clipboard);
|
|
|
|
c->setText(szTxt,TQClipboard::Clipboard);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::copyToSelection(bool bDonNotCopyToClipboard)
|
|
|
|
void KviInputEditor::copyToSelection(bool bDonNotCopyToClipboard)
|
|
|
@ -935,7 +935,7 @@ void KviInputEditor::copyToSelection(bool bDonNotCopyToClipboard)
|
|
|
|
c->setText(szTxt,TQClipboard::Selection);
|
|
|
|
c->setText(szTxt,TQClipboard::Selection);
|
|
|
|
else if(!bDonNotCopyToClipboard)
|
|
|
|
else if(!bDonNotCopyToClipboard)
|
|
|
|
c->setText(szTxt,TQClipboard::Clipboard);
|
|
|
|
c->setText(szTxt,TQClipboard::Clipboard);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -954,7 +954,7 @@ void KviInputEditor::moveCursorTo(int idx,bool bRepaint)
|
|
|
|
m_iCursorPosition = idx;
|
|
|
|
m_iCursorPosition = idx;
|
|
|
|
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar = m_iCursorPosition;
|
|
|
|
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar = m_iCursorPosition;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(bRepaint)tqrepaintWithCursorOn();
|
|
|
|
if(bRepaint)repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::removeSelected()
|
|
|
|
void KviInputEditor::removeSelected()
|
|
|
@ -963,7 +963,7 @@ void KviInputEditor::removeSelected()
|
|
|
|
m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
|
|
|
|
m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
|
|
|
|
moveCursorTo(m_iSelectionBegin,false);
|
|
|
|
moveCursorTo(m_iSelectionBegin,false);
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::cut()
|
|
|
|
void KviInputEditor::cut()
|
|
|
@ -975,7 +975,7 @@ void KviInputEditor::cut()
|
|
|
|
m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
|
|
|
|
m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1);
|
|
|
|
moveCursorTo(m_iSelectionBegin,false);
|
|
|
|
moveCursorTo(m_iSelectionBegin,false);
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::insertText(const TQString &text)
|
|
|
|
void KviInputEditor::insertText(const TQString &text)
|
|
|
@ -1032,7 +1032,7 @@ int KviInputEditor::replaceSegment(int start, int length, const TQString &text)
|
|
|
|
m_szTextBuffer.remove(start, length);
|
|
|
|
m_szTextBuffer.remove(start, length);
|
|
|
|
m_szTextBuffer.insert(start, text);
|
|
|
|
m_szTextBuffer.insert(start, text);
|
|
|
|
m_szTextBuffer.truncate(m_iMaxBufferSize);
|
|
|
|
m_szTextBuffer.truncate(m_iMaxBufferSize);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
|
|
|
|
|
|
|
|
int iInsertedLength = text.length();
|
|
|
|
int iInsertedLength = text.length();
|
|
|
|
int iMaxInsertedLength = m_iMaxBufferSize - start;
|
|
|
|
int iMaxInsertedLength = m_iMaxBufferSize - start;
|
|
|
@ -1191,7 +1191,7 @@ void KviInputEditor::handleDragSelection()
|
|
|
|
m_iSelectionEnd = m_iSelectionAnchorChar-1;
|
|
|
|
m_iSelectionEnd = m_iSelectionAnchorChar-1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::returnPressed(bool bRepaint)
|
|
|
|
void KviInputEditor::returnPressed(bool bRepaint)
|
|
|
@ -1218,7 +1218,7 @@ void KviInputEditor::returnPressed(bool bRepaint)
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
m_iCursorPosition = 0;
|
|
|
|
m_iCursorPosition = 0;
|
|
|
|
m_iFirstVisibleChar = 0;
|
|
|
|
m_iFirstVisibleChar = 0;
|
|
|
|
if(bRepaint)tqrepaintWithCursorOn();
|
|
|
|
if(bRepaint)repaintWithCursorOn();
|
|
|
|
KviUserInput::parse(szBuffer,m_pKviWindow);
|
|
|
|
KviUserInput::parse(szBuffer,m_pKviWindow);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1327,7 +1327,7 @@ void KviInputEditor::imComposeEvent(TQIMEvent *e)
|
|
|
|
|
|
|
|
|
|
|
|
// tqrepaint
|
|
|
|
// tqrepaint
|
|
|
|
m_bUpdatesEnabled = true;
|
|
|
|
m_bUpdatesEnabled = true;
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
e->accept();
|
|
|
|
e->accept();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1349,7 +1349,7 @@ void KviInputEditor::imEndEvent(TQIMEvent *e)
|
|
|
|
|
|
|
|
|
|
|
|
// tqrepaint
|
|
|
|
// tqrepaint
|
|
|
|
m_bUpdatesEnabled = true;
|
|
|
|
m_bUpdatesEnabled = true;
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
|
|
|
|
|
|
|
|
// reset data
|
|
|
|
// reset data
|
|
|
|
m_bIMComposing = false;
|
|
|
|
m_bIMComposing = false;
|
|
|
@ -1427,7 +1427,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
if(m_szTextBuffer.at(m_iCursorPosition).isSpace())break;
|
|
|
|
if(m_szTextBuffer.at(m_iCursorPosition).isSpace())break;
|
|
|
|
internalCursorRight(e->state() & TQt::ShiftButton);
|
|
|
|
internalCursorRight(e->state() & TQt::ShiftButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_Left:
|
|
|
|
case TQt::Key_Left:
|
|
|
@ -1445,7 +1445,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
if(m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break;
|
|
|
|
if(m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break;
|
|
|
|
internalCursorLeft(e->state() & TQt::ShiftButton);
|
|
|
|
internalCursorLeft(e->state() & TQt::ShiftButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_K:
|
|
|
|
case TQt::Key_K:
|
|
|
@ -1520,7 +1520,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
m_iCursorPosition--;
|
|
|
|
m_iCursorPosition--;
|
|
|
|
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--;
|
|
|
|
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_PageUp:
|
|
|
|
case TQt::Key_PageUp:
|
|
|
@ -1536,7 +1536,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
m_iSelectionBegin=0;
|
|
|
|
m_iSelectionBegin=0;
|
|
|
|
m_iSelectionEnd=m_szTextBuffer.length()-1;
|
|
|
|
m_iSelectionEnd=m_szTextBuffer.length()-1;
|
|
|
|
m_iCursorPosition=m_szTextBuffer.length();
|
|
|
|
m_iCursorPosition=m_szTextBuffer.length();
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_Return:
|
|
|
|
case TQt::Key_Return:
|
|
|
|
case TQt::Key_Enter:
|
|
|
|
case TQt::Key_Enter:
|
|
|
@ -1547,7 +1547,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
m_iCursorPosition = 0;
|
|
|
|
m_iCursorPosition = 0;
|
|
|
|
m_iFirstVisibleChar = 0;
|
|
|
|
m_iFirstVisibleChar = 0;
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
KviUserInput::parseNonCommand(szBuffer,m_pKviWindow);
|
|
|
|
KviUserInput::parseNonCommand(szBuffer,m_pKviWindow);
|
|
|
|
if (!szBuffer.isEmpty())
|
|
|
|
if (!szBuffer.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1615,14 +1615,14 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
if(m_iCursorPosition < ((int)(m_szTextBuffer.length())))
|
|
|
|
if(m_iCursorPosition < ((int)(m_szTextBuffer.length())))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
internalCursorRight(e->state() & TQt::ShiftButton);
|
|
|
|
internalCursorRight(e->state() & TQt::ShiftButton);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_Left:
|
|
|
|
case TQt::Key_Left:
|
|
|
|
if(m_iCursorPosition > 0)
|
|
|
|
if(m_iCursorPosition > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
internalCursorLeft(e->state() & TQt::ShiftButton);
|
|
|
|
internalCursorLeft(e->state() & TQt::ShiftButton);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_Backspace:
|
|
|
|
case TQt::Key_Backspace:
|
|
|
@ -1640,7 +1640,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--;
|
|
|
|
if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQt::Key_Delete:
|
|
|
|
case TQt::Key_Delete:
|
|
|
@ -1651,7 +1651,7 @@ void KviInputEditor::keyPressEvent(TQKeyEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_szTextBuffer.remove(m_iCursorPosition,1);
|
|
|
|
m_szTextBuffer.remove(m_iCursorPosition,1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
selectOneChar(-1);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1808,7 +1808,7 @@ void KviInputEditor::completion(bool bShift)
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// this is standard nick completion continued
|
|
|
|
// this is standard nick completion continued
|
|
|
|
standardNickCompletion(bShift,word,bFirstWordInLine);
|
|
|
|
standardNickCompletion(bShift,word,bFirstWordInLine);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1850,7 +1850,7 @@ void KviInputEditor::completion(bool bShift)
|
|
|
|
match=m_pKviWindow->windowName();
|
|
|
|
match=m_pKviWindow->windowName();
|
|
|
|
match.append(" ");
|
|
|
|
match.append(" ");
|
|
|
|
replaceWordBeforeCursor(word,match,false);
|
|
|
|
replaceWordBeforeCursor(word,match,false);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if(m_pKviWindow->console())
|
|
|
|
if(m_pKviWindow->console())
|
|
|
@ -1875,7 +1875,7 @@ void KviInputEditor::completion(bool bShift)
|
|
|
|
bIsNick = true;
|
|
|
|
bIsNick = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
standardNickCompletion(bShift,word,bFirstWordInLine);
|
|
|
|
standardNickCompletion(bShift,word,bFirstWordInLine);
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1933,7 +1933,7 @@ void KviInputEditor::completion(bool bShift)
|
|
|
|
replaceWordBeforeCursor(word,match,false);
|
|
|
|
replaceWordBeforeCursor(word,match,false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::replaceWordBeforeCursor(const TQString &word,const TQString &replacement,bool bRepaint)
|
|
|
|
void KviInputEditor::replaceWordBeforeCursor(const TQString &word,const TQString &replacement,bool bRepaint)
|
|
|
@ -1944,7 +1944,7 @@ void KviInputEditor::replaceWordBeforeCursor(const TQString &word,const TQString
|
|
|
|
m_szTextBuffer.insert(m_iCursorPosition,replacement);
|
|
|
|
m_szTextBuffer.insert(m_iCursorPosition,replacement);
|
|
|
|
m_szTextBuffer.truncate(m_iMaxBufferSize);
|
|
|
|
m_szTextBuffer.truncate(m_iMaxBufferSize);
|
|
|
|
moveCursorTo(m_iCursorPosition + replacement.length());
|
|
|
|
moveCursorTo(m_iCursorPosition + replacement.length());
|
|
|
|
if(bRepaint)tqrepaintWithCursorOn();
|
|
|
|
if(bRepaint)repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::standardNickCompletion(bool bAddMask,TQString &word,bool bFirstWordInLine)
|
|
|
|
void KviInputEditor::standardNickCompletion(bool bAddMask,TQString &word,bool bFirstWordInLine)
|
|
|
@ -2045,14 +2045,14 @@ void KviInputEditor::end()
|
|
|
|
moveRightFirstVisibleCharToShowCursor();
|
|
|
|
moveRightFirstVisibleCharToShowCursor();
|
|
|
|
m_iCursorPosition++;
|
|
|
|
m_iCursorPosition++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::home()
|
|
|
|
void KviInputEditor::home()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_iFirstVisibleChar = 0;
|
|
|
|
m_iFirstVisibleChar = 0;
|
|
|
|
m_iCursorPosition = 0;
|
|
|
|
m_iCursorPosition = 0;
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::insertChar(TQChar c)
|
|
|
|
void KviInputEditor::insertChar(TQChar c)
|
|
|
@ -2073,7 +2073,7 @@ void KviInputEditor::insertChar(TQChar c)
|
|
|
|
m_szTextBuffer.insert(m_iCursorPosition,c);
|
|
|
|
m_szTextBuffer.insert(m_iCursorPosition,c);
|
|
|
|
moveRightFirstVisibleCharToShowCursor();
|
|
|
|
moveRightFirstVisibleCharToShowCursor();
|
|
|
|
m_iCursorPosition++;
|
|
|
|
m_iCursorPosition++;
|
|
|
|
tqrepaintWithCursorOn();
|
|
|
|
repaintWithCursorOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::moveRightFirstVisibleCharToShowCursor()
|
|
|
|
void KviInputEditor::moveRightFirstVisibleCharToShowCursor()
|
|
|
@ -2100,7 +2100,7 @@ void KviInputEditor::moveRightFirstVisibleCharToShowCursor()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KviInputEditor::tqrepaintWithCursorOn()
|
|
|
|
void KviInputEditor::repaintWithCursorOn()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// :)
|
|
|
|
// :)
|
|
|
|
if(m_bUpdatesEnabled)
|
|
|
|
if(m_bUpdatesEnabled)
|
|
|
|