Page 1 of 1

Child OF oWnd

Posted: Wed Nov 09, 2022 4:23 am
by Jimmy
hi,

how can i find out which Control are Child OF oWnd :?:

Re: Child OF oWnd

Posted: Wed Nov 09, 2022 7:17 am
by Antonio Linares
Dear Jimmy,

oWnd:aControls

Re: Child OF oWnd

Posted: Wed Nov 09, 2022 8:18 am
by Jimmy
hi Antonio,
Antonio Linares wrote: oWnd:aControls
ah,thx

Re: Child OF oWnd

Posted: Wed Nov 09, 2022 10:25 am
by Jimmy
hi Antonio,

when use FWLOG i got
oMain:aControls = {TSAY,TCOMBOBOX,TFOLDER,TCOMBOBOX,TFOLDER,TSPLITTER, ...}
Question :
how to "identify" Control "Type" :?:
are Array Element a Object :?:

Code: Select all | Expand

   FOR ii := 1 TO LEN(oMain:aControls)
      Object := oMain:aControls[ii]
      DO CASE
         CASE Object:isDerivedFrom("TSAY")  // Xbase++ Syntax
            Object:SetPos()
            Object:SetSize()      
---

if i know "Type" of Object and Element "is" a Object : can i write this Way :?:

Code: Select all | Expand

   // TSAY
   oMain:aControls[1]:SETTEXT("hello world")

   // TCOMBOBOX
   oMain:aControls[2]:Select(3)   // 3rd Item

Re: Child OF oWnd

Posted: Wed Nov 09, 2022 1:11 pm
by cnavarro
Yes, that's right

Re: Child OF oWnd

Posted: Wed Nov 09, 2022 2:14 pm
by Antonio Linares
Dear Jimmy,

Harbour supports isDerivedFrom also:

Code: Select all | Expand

MsgInfo( oControl:isDerivedFrom( "TWINDOW" ) )

Re: Child OF oWnd

Posted: Thu Nov 10, 2022 5:44 am
by Jimmy
hi Antonio,
Antonio Linares wrote:Harbour supports isDerivedFrom also:

Code: Select all | Expand

MsgInfo( oControl:isDerivedFrom( "TWINDOW" ) )
that help me very much :D

---

when using FWLOG i "just" got 1-DIM Array which Controls
oMain:aControls = {TSAY,TCOMBOBOX,TFOLDER,TCOMBOBOX,TFOLDER,TSPLITTER,TBUTTON, ... }
but when look at each Control there are "more" (Array)

Code: Select all | Expand

   x :=  hb_valToExp(oMain:aControls[ii])
__itemSetObj( __itemSetRef( {{HWND, 394868}, {NOLDPROC, 4294903408}, {CCAPTION, }, {CVARNAME, oSayActive}, {NID, 102}, {TWINDOW:NTOP, 864}, {TWINDOW:NLEFT, 10}, {NBOTTOM, 893}, {NRIGHT, 649.00}, {NSTYLE, 1342177280}, {NCLRPANE, 16777215}, {NCLRTEXT, 0}, {ACONTROLS, {}}, {OBRUSH, {{HBRUSH, 9437200}, {HBITMAP, 0}, {HBMPORGL, 0}, {NCOUNT, 6}, {NRGBCOLOR, 16777215}, {LSYSTEM, .T.}, {USOURCE, CLR_WHITE}}}, {OFONT, {{CFACENAME, TAHOMA}, {HFONT, 1242174205}, {HFONTOLD, 0}, {LBOLD, .F.}, {LITALIC, .F.}, {LUNDERLINE, .F.}, {LSTRIKEOUT, .F.}, {NINPHEIGHT, -20}, {NINPWIDTH, 0}, {NESCAPEMENT, 0}, {NORIENTATION, 0}, {NWEIGHT, 0}, {NCHARSET, 0}, {NOUTPRECISION, 0}, {NCLIPPRECISION, 0}, {NQUALITY, 0}, {NPITCHFAMILY, 0}, {NCOUNT, 27}, {LDESTROY, .T.}, {LNEW, .F.}}} , ...
the 1st Sub-Array seems to be Control itself and have all Information of it include "Name" (CVARNAME)
but also "all other" Control (not show in Sample) include "Main" are in "Log" of "x" :shock:

Question : are these "Original" Value in Array or will they change :?:

Re: Child OF oWnd

Posted: Thu Nov 10, 2022 6:49 am
by Antonio Linares
Dear Jimmy,

Keep in mind that each control keeps a DATA oWnd that holds its parent object