Get the object type of a window control?

I know somewhere in the help text we can determine the current object that has scope. Something similar to:

IF ?{PROP:OBJECT} = ENTRY
  ?{PROP:MSG} = ‘Help text!’
END

I can’t remember the parameters now and looked at all the SYSTEM and PROP calls.

Thanks!

Hi,

AFAIK, it’s PROP:Type what you’re looking for…

Best regards

2 Likes

Perfect! I’ll take it from there. Thanks, Flavio!

1 Like

That could be coded as:

IF ?{PROP:Type} = Create:ENTRY
   ?{PROP:MSG} = ‘Status Bar - Help text!’
   ?{PROP:Tip} = ‘Tool Tip - Help text!’
END

There are Create:xxxx Equates for each Type number in Equates.CLW e.g.

CREATE:sstring          EQUATE (1)
CREATE:string           EQUATE (2)
...
CREATE:entry            EQUATE (8)
CREATE:button           EQUATE (9)
CREATE:prompt           EQUATE (10)
CREATE:option           EQUATE (11)
CREATE:check            EQUATE (12)
...
CREATE:singleline       EQUATE (41)
CREATE:state3           EQUATE (42)

Here’s a function I had to turn that Type number into a Description that could go in debug or a list.

TypeName STRING(24) 
CtrlType LONG 

 CtrlType = FEQ{PROP:Type}  
 TypeName=CHOOSE(BAND(CtrlType,0FFh)+1,'Window', |
          'SString','String','Image','Region','Line','Box','Ellipse','Entry','Button','Prompt',|          !1-10
          'Option', 'Check', 'Group','List',  'Combo','Spin','Text','Custom','Menu','Item',|              !11-20
          'Radio',  'MenuBar','Type23','Application','Window','Report','Header','Footer','Break','Form',| !21-30
          'Detail', 'Ole','Droplist','Dropcombo','Progress','Slider','Sheet','Tab','Panel','TextRtf',|    !31-40
          'Text_SingleLine','Check3','Type?' & CtrlType)
4 Likes

Thanks, Carl!

Once I knew to look for PROP:TYPE it was easy sailing. I just couldn’t remember it was “TYPE”. I went right by it as I looked through each “PROP:”.

In the help text they have a CREATE:ENTRY example that you can search for all of the object types by.