Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some questions about drop-down lists with filter function
#1
Hi,
The drop-down list with the filter function is very powerful, and I encountered the following problems in using it

1. How to match letters according to the order in which they appear?
For example, when I type the following letter, it doesn't match what I want,(Items matched from the beginning do not appear at the top)
wi
we
pr
o

I've set the sort tag to 8
ShowDropdownList(x i 0 8 hEdit 0 0 0 ddl)
[Image: 1671143713]
2. How to set the color of the border line of the edit box control?
The current border line color is white(Red arrow), I want to change it to green
[Image: 1671143810]
3. How bold only the text in the edit box? After set bold parameters for the edit box, but the text in the drop-down list(Red arrow) is also bolded
[Image: 1671144055]

Thank you in advance for any advice and help
david


Function AT_D_2
Trigger Aq     Help - how to add the trigger to the macro
Code:
Copy      Help
_s=
;sw 1 Switch
;wi 2 b
;wi 1 a
;ps Powershell
;we howc
;we how
;fun c Process
;fun b Pro
;pr file
;co ac
;oc cc

ARRAY(str) aList=_s
IQmDropdown ddl; int inERS

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x8 0 0 184 16 "Autotext" "4"
;3 Edit 0x54030080 0x200 0 0 184 16 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""
str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam
__GdiHandle- t_hbrush
sel message
,case WM_INITDIALOG
,,int- backcolor=0x955100
,,int- textcolor=0xffffff
,,t_hbrush=CreateSolidBrush(backcolor)
,,__Font- f.Create("Consolas" 12 1)
,,f.SetDialogFont(hDlg "3")
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CTLCOLOREDIT
,,if(lParam=id(3 hDlg))
,,,SetTextColor wParam textcolor
,,,SetBkColor wParam backcolor
,,,ret t_hbrush
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case EN_CHANGE<<16|3 sub.OnTextChanged lParam
ret 1

#sub OnTextChanged v
function hEdit

if(inERS) ret
if(ddl) ddl.Close; ddl=0

str s.getwintext(hEdit)
if(!s.len) ret

ICsv x._create
x.AddRow1(0 "0")
int i
for i 0 aList.len
,if(find(aList[i] s 0 1)<0) continue
,x.AddRow1(-1 aList[i])
if(!x.RowCount) ret

if(ShowDropdownList(x i 0 8 hEdit 0 0 0 ddl)&QMDDRET_SELOK=0) ret
s=x.Cell(i+1 0)

inERS=1
EditReplaceSel hEdit 0 s 1|2|4
inERS=0


Messages In This Thread
Some questions about drop-down lists with filter function - by Davider - 12-12-2022, 10:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)