1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Syncing the code for discussing it.

This commit is contained in:
dan
1999-10-22 23:39:39 +00:00
parent 652caa1f93
commit 6dd37d5972
2 changed files with 31 additions and 23 deletions

View File

@@ -157,7 +157,7 @@ textChangedObserver(void *observerData, WMNotification *notification)
WMInsertTextFieldText(panel->fileField, &item->text[textLen],
textLen);
WMSetTextFieldCursorPosition(panel->fileField, itemTextLen);
/*WMSetTextFieldCursorPosition(panel->fileField, itemTextLen);*/
range.position = textLen;
range.count = itemTextLen - textLen;
WMSelectTextFieldRange(panel->fileField, range);

View File

@@ -550,6 +550,8 @@ WMSelectTextFieldRange(WMTextField *tPtr, WMRange range)
tPtr->selection = range;
tPtr->cursorPosition = range.position + range.count;
if (tPtr->view->flags.realized) {
paintTextField(tPtr);
}
@@ -1176,9 +1178,15 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
normal_key:
default:
if (count > 0 && !iscntrl(buffer[0])) {
if (tPtr->selection.count)
if (tPtr->selection.count) {
WMDeleteTextFieldRange(tPtr, tPtr->selection);
tPtr->selection.count = 0;
refresh = 1;
}
/* TODO: check if this is correct. */
cancelSelection = 0;
WMInsertTextFieldText(tPtr, buffer, tPtr->cursorPosition);
tPtr->selection.position = tPtr->cursorPosition;
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
(void*)WMInsertTextEvent);
} else