Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Browsing - Scrolling Alphabetically in a QM-Grid column
#1
I understand that one can limit the selection in the key column of a QM-Grid structure, by using the "timer" technique, ie statements :

case EN_CHANGE<<16|3
SetTimer hDlg 1 300 0

and

case WM_TIMER
sel wParam
case 1
KillTimer hDlg wParam
SendMessage hsys32 LVM_DELETEALLITEMS 0 0
......

I wonder whether there exists a routine to browse within the key column already sorted alphabetically, by keying the first - and possibly subsequent letters - accordingly. For example if the column is :

apple
cherry
fig
lemon
morello
orange
pear
tree

by typing letter 'l' it scrolls to lemon, etc.

Best regards.
#2
LVM_GETISEARCHSTRING reference says it is automatic. But with my tested listview controls it did not work, I guess because they are virtual. QM_Grid is virtual too. No functions or messages exist for it, and probably no QM examples.
#3
Many thanks for a very prompt reply. I will work on it and I will report findings, if any.
#4
This is my approach. It is tested and it works properly :

Function tempf15
Code:
Copy      Help
,str stf ;; String to find
,ARRAY(str) ak ;; IStringmap key array
;,...............................
,stf="Dial"
,for int'i 0 ak.len
,,str stc=F"(?m)^\Q{stf}\E"
,,if(findrx(ak[i] stc)<0); continue
,,out F"{ak[i]}"
,,int w=win("QM - SES Help Topics" "#32770")
,,int c=id(4 w) ;;list
,,SendMessage c LVM_ENSUREVISIBLE i 0
,,Acc a.Find(w "LISTITEM" ak[i] "class=SysListView32[]id=4" 0x1005)
,,err
,,,out "String cannot be accessed"
,,,end
,,act c
,,a.Select(SELFLAG_TAKEFOCUS|SELFLAG_TAKESELECTION)
,,break
,if i=ak.len
,,outt F"String not found : {stf}"
,,ret
,


Forum Jump:


Users browsing this thread: 5 Guest(s)