Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Edit box displays a list of identical letters
#3
@kevin
Thanks for your reminder, this feature is very good, it will be better to use it in the Add AutoText function.  Smile

http://www.quickmacros.com/forum/showthr...p?tid=6709

@kevin

I added a combo box, but the effect in the combo box is not the same as the effect in the edit box. For example, enter the letter r. See the image below.

In addition, I need to achieve an effect, when I enter a letter, if the word I need is in the first place, after I press the Enter key, the word, all appear in the edit box, for example, enter the letter a, enter After that, Autotext1 will appear in the edit box, please see the picture below.

This features can meet the needs of the link below  Smile

http://www.quickmacros.com/forum/showthr...3#pid33173


Macro Macro2
Code:
Copy      Help
;Run this macro. Type something from the list, eg o or r.
;Need QM 2.4.3.

str sList
;sList=
;;one
;;two
;;three
;;four

QMITEM q; int i
ARRAY(str) atn
ARRAY(int) htvi
rep
,i=qmitem(-i 1|16 &q 1|2|4|8)
,if(i=0) break
,if q.itype=4
,,atn[]=q.name
,,htvi[]=q.htvi
sList=atn

ARRAY(str) aList=sList
IQmDropdown ddl
int inERS

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Edit 0x54030080 0x200 8 8 96 12 ""
;4 ComboBox 0x54230641 0x0 113 8 102 92 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040801 "*" "" "" ""

str controls = "3 4"
str e3 cb4
cb4=atn
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

out e3
out cb4

#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case EN_CHANGE<<16|3 sub.OnTextChanged lParam
,case EN_CHANGE<<16|4 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 "")
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 1 hEdit 0 0 0 ddl)&QMDDRET_SELOK=0) ret
s=x.Cell(i+1 0)

inERS=1
EditReplaceSel hEdit 0 s 1
inERS=0


Attached Files Image(s)
   


Messages In This Thread
RE: Edit box displays a list of identical letters - by win - 04-14-2019, 12:59 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)