PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Jump to the search field when typing a letter in a table
Jump to the search field when typing a letter in a table
Débuté par R. Kobes, 21 sep. 2004 16:54 - 2 réponses
Posté le 21 septembre 2004 - 16:54
Hello,
In Clarion for Windows we had a function that gives us the possebility to define a 'incremental locator'.
When i'am in a table and type a letter the incremental locator show's the typed letters and the table is jumped to the first value that is equal or greater than the locator.
How can i doe this in Windev?
Posté le 21 septembre 2004 - 18:16
Hi,
you can do this with the EVENT and some Table.. functions.
Look at the code below. The EVENT call should be place in the init of the window. You can build a class around this code and pass the name of the table to the constructor and then doing all the table related code inside this class.
HTH Raimund
Event("CharReq", "Table1", WM_KEYDOWN)
PROCEDURE CharReq(nMsg, wParam, lParam)
I is int
sCol is string
IF NOT TableInputInProgress(Table1) THEN
IF wParam = 32 TO 255 THEN
I = 1

WHILE I <= Table1..NumberColumn
sCol = TableEnumColumn(Table1, I)
IF {"Table1." + sCol}..Sortable THEN
TableInputSearch("Table1." + sCol)
SendKey(Charact(wParam))
BREAK
END

I++
END
END
END
Hello,
In Clarion for Windows we had a function that gives us the possebility to define a 'incremental locator'.
When i'am in a table and type a letter the incremental locator show's the typed letters and the table is jumped to the first value that is equal or greater than the locator.
How can i doe this in Windev?



http://www.invitec.com
Posté le 22 septembre 2004 - 11:36
Hello,
in the example below use WM_CHAR instead of WM_KEYDOWN and change the code then to:
IF wParam <> 27 AND NOT TableInputInProgress(Table1) THEN
I = 1
WHILE I <= Table1..NumberColumn
....
This sends only succesful filtered (TranslateMessage) keystrokes (no cursor, no page up/down etc.)
Hi,
you can do this with the EVENT and some Table.. functions.
Look at the code below. The EVENT call should be place in the init of the window. You can build a class around this code and pass the name of the table to the constructor and then doing all the table related code inside this class.
HTH Raimund
Event("CharReq", "Table1", WM_KEYDOWN)
PROCEDURE CharReq(nMsg, wParam, lParam)
I is int
sCol is string
IF NOT TableInputInProgress(Table1) THEN
IF wParam = 32 TO 255 THEN
I = 1

WHILE I <= Table1..NumberColumn
sCol = TableEnumColumn(Table1, I)
IF {"Table1." + sCol}..Sortable THEN
TableInputSearch("Table1." + sCol)
SendKey(Charact(wParam))
BREAK
END

I++
END
END
END
Hello,
In Clarion for Windows we had a function that gives us the possebility to define a 'incremental locator'.
When i'am in a table and type a letter the incremental locator show's the typed letters and the table is jumped to the first value that is equal or greater than the locator.
How can i doe this in Windev?



http://www.invitec.com