Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to locate the item After sorting
#20
I added a grid control to the code

Can achieve the same effect as combo box? 
Double click an element in the grid to open the corresponding entry in the autotext
The visual effect of the grid is very good

[Image: pic.png]




Macro Macro8-ok
Code:
Copy      Help
str pattern="(?:.*\:sub\..*)"
_s.getmacro("A1" 0)
str d
int i
ARRAY(str) a
findrx(_s pattern 0 4 a)
a.sort
for i 0 a.len
,d.formata("%s[]" a[0 i])
d.replacerx(":sub.Sub" "    ") ;;Delete useless characters
d.replacerx(";;" "    ") ;;Delete useless characters
d.trim


str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 154 "Dialog" "4"
;3 ComboBox 0x54230641 0x0 8 8 96 122 ""
;4 QM_Grid 0x56031041 0x200 108 8 110 120 "0x0,0,0,0x0,0x0[]Abbr,30%,,[]#,20%,,[]Comment,50%,,"
;1 Button 0x54030001 0x4 112 136 48 14 "OK"
;2 Button 0x54030000 0x4 168 136 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040B01 "*" "" "" ""

str controls = "3 4"
str cb3 qmg4x
cb3=d
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
TO_CBGetItem(cb3)
cb3.trim
mac+ "A1"
_s.getmacro("A1" 0)
cb3.replacerx("\s+" " :sub.Sub" 4)
cb3.replacerx("\s+(\w+)" " ;;${1}" 4)
int cp1=findrx(_s cb3 0 1)
int h=GetQmCodeEditor
act h
int ii=findrx(cb3 "sub." 0 1)
if ii!=-1
,cp1=cp1+ii+5
out cp1
act h
SendMessage(h SCI.SCI_GOTOPOS cp1 0)
int cp=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0) ;;currentpos
out cp

#sub DlgProc
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
ret 1


Messages In This Thread
how to locate the item After sorting - by macman - 01-17-2021, 12:21 AM
RE: how to locate the item After sorting - by macman - 01-17-2021, 06:38 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)