Here is a small program that shows two COMBO controls on a screen.
I wrote a small procedure that enumerates the controls and finds the Combo:CreateButton control for a given combo
From there, I alter the ICON on the Combo Control
Note: this program also shows multiple columns in the drop lists
PROGRAM
MAP
END
Q QUEUE
Descr STRING(20)
Row LONG
END
ComboValue STRING(20)
ComboValue2 STRING(20)
QuickWindow WINDOW('Combo Suggest'),AT(,,417,130),CENTER,GRAY,IMM,SYSTEM,|
FONT('Segoe UI',8,,FONT:regular,CHARSET:ANSI),TIMER(1),RESIZE
COMBO(@s20),AT(31,28,314),USE(ComboValue),DROP(4),FROM(Q), |
FORMAT('155L(2)|M~Description~@S20' & |
'@20L(2)|M~Row~@N2@')
BUTTON('Button1'),AT(30,100),USE(?BUTTON1)
COMBO(@s20),AT(31,58,313,15),USE(ComboValue2),DROP(4),FROM(Q),|
FORMAT('155L(2)|M~Description~@S20' & |
'@20L(2)|M~Row~@N2@')
END
INCLUDE('debuger.inc'),ONCE
DBG Debuger
FEQ EQUATE(SIGNED)
MAP
ComboButtonFEQ PROCEDURE(FEQ xComboFEQ),FEQ
SetComboIcon PROCEDURE(FEQ xComboFEQ, STRING xNewIcon)
END
CODE
dbg.mg_init('ComboSuggest')
DO FillQ
GET(Q, 5); ComboValue = Q.Descr
GET(Q, 3); ComboValue2= Q.Descr
OPEN(QuickWindow)
dbg.DumpControls() ! see DebugViewPP for OutputDebugString output
! SetComboIcon( ?ComboValue, ICON:Exclamation)
SetComboIcon( ?ComboValue2, ICON:Ellipsis) !<<<<<<<<<<<
ACCEPT
END
FillQ ROUTINE
LOOP 20 TIMES
Q.Descr = ALL(CHR(65 + RECORDS(Q)))
Q.Row = RECORDS(Q)+1
ADD(Q)
END
SetComboIcon PROCEDURE(FEQ xComboFEQ, STRING xNewIcon)
CODE
ComboButtonFEQ(xComboFEQ){PROP:Icon} = xNewIcon
ComboButtonFEQ PROCEDURE(FEQ xComboFEQ)
CurrFEQ FEQ(0)
ComboFieldName ANY
CREATE:_ComboButton EQUATE(CREATE:combo + 0100H) !see NG: Softvelocity.clarion.documentation Thread:"What is {prop:type}=271" Sept-18-2006
CODE
ComboFieldName = DBG.GetFEQDescr(xComboFEQ)
LOOP
CurrFEQ = 0{PROP:NextField, CurrFEQ}
IF CurrFEQ{PROP:Type} = CREATE:_ComboButton |
AND DBG.GetFEQDescr(CurrFEQ) = ComboFieldName |
THEN
RETURN CurrFEQ
END
WHILE CurrFEQ <> 0
RETURN 0
Here is the output of DBG.DumpControls, that I used to write the ComboButtonFEQ(FEQ) procedure.
Make sure you scroll horizontally to notice that the xDescr of the CREATE:ComboButton shows the same information as itâs parent control, the xDescr value is set by DBG.GetFEQDescr(FEQ) which is just a wrapper for the undocumented RTL command Cla$FIELDNAME
debugerGetFieldName(SIGNED FEQ),*CSTRING,RAW,NAME(âCla$FIELDNAMEâ)
DumpControls ===[start]==========================================
DumpControls for Window[Combo Suggest] FEQ Range[-2147483647 to 2147483647]
FEQ[1] Hide[] Disable[] AT(31,28,314,12) Type[15]=[create:COMBO] Text[s20] xDescr[?COMBOVALUE] Parent[0] Use [EEEEEEEEEEEEEEEEEEEE] UseAddress [134238016] Skip[] Trn[] IMM[]
FEQ[2] Hide[] Disable[] AT(30,100,40,14) Type[9]=[create:BUTTON] Text[Button1] xDescr[?BUTTON1] Parent[0] Use [] UseAddress [0] Skip[] Trn[] IMM[]
FEQ[3] Hide[] Disable[] AT(31,58,313,15) Type[15]=[create:COMBO] Text[s20] xDescr[?COMBOVALUE2] Parent[0] Use [CCCCCCCCCCCCCCCCCCCC] UseAddress [134237776] Skip[] Trn[] IMM[]
FEQ[32768] Hide[] Disable[] AT(301,0,12,11) Type[271]=[create:COMBOBUTTON] Text[ ] xDescr[?COMBOVALUE] Parent[0] Use [] UseAddress [0] Skip[] Trn[] IMM[]
FEQ[32769] Hide[] Disable[] AT(-791,-545,303,43) Type[270]=[create:SUBLIST] Text[] xDescr[?COMBOVALUE] Parent[0] Use [] UseAddress [0] Skip[1] Trn[] IMM[]
FEQ[32770] Hide[] Disable[] AT(297,0,15,14) Type[271]=[create:COMBOBUTTON] Text[ ] xDescr[?COMBOVALUE2] Parent[0] Use [] UseAddress [0] Skip[] Trn[] IMM[]
FEQ[32771] Hide[] Disable[] AT(-791,-545,303,43) Type[270]=[create:SUBLIST] Text[] xDescr[?COMBOVALUE2] Parent[0] Use [] UseAddress [0] Skip[1] Trn[] IMM[]
DumpControls ===[end]==========================================