Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #8253 > unrolled thread

Interrogating classes for members

Started byMartin <Martin@spam.spam>
First post2015-07-06 10:01 +0100
Last post2015-07-11 03:36 -0700
Articles 10 — 8 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Interrogating classes for members Martin <Martin@spam.spam> - 2015-07-06 10:01 +0100
    Re: Interrogating classes for members "Wolfgang Riedmann" <wriedmann@gmail.com> - 2015-07-06 15:01 +0200
    Re: Interrogating classes for members Frans Wauters <info@wautersit.com> - 2015-07-06 08:46 -0700
    Re: Interrogating classes for members sherlocksoftware@gmail.com - 2015-07-07 03:59 -0700
      Re: Interrogating classes for members Sherlock <sherlock@sherlock.com.au> - 2015-07-07 04:28 -0700
        Re: Interrogating classes for members James Martin <james@northwoodlumber.com> - 2015-07-07 12:07 -0400
          Re: Interrogating classes for members sherlocksoftware@gmail.com - 2015-07-11 05:43 -0700
      Re: Interrogating classes for members "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2015-07-07 14:48 +0200
        Re: Interrogating classes for members sherlocksoftware@gmail.com - 2015-07-07 06:58 -0700
    Re: Interrogating classes for members "richard.townsendrose" <richard.townsendrose@gmail.com> - 2015-07-11 03:36 -0700

#8253 — Interrogating classes for members

FromMartin <Martin@spam.spam>
Date2015-07-06 10:01 +0100
SubjectInterrogating classes for members
Message-ID<mndg31$dln$1@dont-email.me>
Hello

I want to ask a class what its members are, eg a screen, the fixed texts.

What do I look at in a clas to identify these please?


Thanks

Martin

[toc] | [next] | [standalone]


#8254

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2015-07-06 15:01 +0200
Message-ID<cvvcgpFuc19U1@mid.individual.net>
In reply to#8253
Hi Martin,

> I want to ask a class what its members are, eg a screen, the fixed
> texts.
> 
> What do I look at in a clas to identify these please?

a datawindow has its aControls array to look into, for a dialogwindow
you can accomplish this with the Windows API.

If you try to do this via the object model: this is harder, as
protected and hidden instance variables cannot be retrieved at runtime
as they are resolved at compile time. Export instance variables can be
retrieved with the IVarList() and IVarListClass() functions.

HTH

Wolfgang


-- 

[toc] | [prev] | [next] | [standalone]


#8255

FromFrans Wauters <info@wautersit.com>
Date2015-07-06 08:46 -0700
Message-ID<e22bfd19-5ee2-4e65-9327-ceb2962f00f8@googlegroups.com>
In reply to#8253
Hi Martin,

You can create a procedure or function than you call with the window object ( SELF ) as parameter and use the GetAllChildren() method and store that in an array:


   PROCEDURE GUI_Setup( oObject, nMode )

      aArray := oObject:GetAllChildren()


I use this in an application to change colors dynamicaly. Calling it trough the PostInit(). Note: I prefix my controls using SLE, MLE, RTF, see sample:


   PROCEDURE GUI_Setup( oObject, nMode )

      LOCAL aArray            AS ARRAY
      LOCAL nControl          AS DWORD
      LOCAL cControl          AS STRING
      LOCAL DIM aBrushes[2]   AS OBJECT
      LOCAL xControl          AS USUAL

      oObject:Icon := APP_ICON{}
      oObject:IconSm := APP_ICON{}

      IF ValType( nMode ) == 'N'

         IF nMode == FORM_EDIT .OR. nMode == FORM_APPEND
            aBrushes[1] := Brush{ Color{ COLORWHITE } }  // input edit/add background
            aBrushes[2] := RF_CanvasBackgroundEx() 
         ELSE
            aBrushes[2] := RF_CanvasBackground()
         ENDIF

         IF IsAccess( oObject, #BackGround ) // Window background
            oObject:BackGround := aBrushes[ 2 ]
         ENDIF

         aArray := oObject:GetAllChildren()
         FOR nControl := 1 TO Len( aArray )

            IF IsAccess( aArray[ nControl ], #BackGround )
               xControl := aArray[ nControl ]
               cControl := Upper( Left( Symbol2String( aArray[ nControl ]:HyperLabel:NameSym ), 3 ) ) 
               DO CASE
               CASE Empty( cControl )
               CASE cControl $ BACKGROUNDCONTOLS // 'SLE MLE RTF CBX BBR'
                  aArray[ nControl ]:BackGround := aBrushes[ 1 ]
               CASE cControl $ 'CLR'
               OTHERWISE
                  aArray[ nControl ]:BackGround := aBrushes[ 2 ]
               ENDCASE
            ENDIF

         NEXT

         oObject:Repaint()

      ENDIF

      RETURN


Works fine. Check aArray after executing the oObject:GetAllChildren() code in debug.

Kind regards,
Frans

[toc] | [prev] | [next] | [standalone]


#8256

Fromsherlocksoftware@gmail.com
Date2015-07-07 03:59 -0700
Message-ID<98b6ccf0-c861-4acf-b47b-2ce0363c3279@googlegroups.com>
In reply to#8253
www.sherlock.com.au\vo2code\Sherlock_m_infoclass.MEF

This should do what you want and more..  I linked to a menu item when developing and remove menu in delivered version. Lets you know class structures

   ow_info := w_Info{SELF}
   ow_info:Show()

or
    w_Info{SELF}:Show()

I did not write it.. been using so long now sure who did and how I expanded it.
For new VO-ers good way to find stuff you did not know existed.

Phil McGuinness

[toc] | [prev] | [next] | [standalone]


#8257

FromSherlock <sherlock@sherlock.com.au>
Date2015-07-07 04:28 -0700
Message-ID<bc2b5d7e-11de-4d33-b19f-3ecbbfec5920@googlegroups.com>
In reply to#8256
 www.sherlock.com.au\vo2code\Sherlock_m_infoclass.txt

Changed MEF extension to TXT... else the download will not work.
Change TXT back to MEF to import to application.

Phil McGuinness
 

[toc] | [prev] | [next] | [standalone]


#8260

FromJames Martin <james@northwoodlumber.com>
Date2015-07-07 12:07 -0400
Message-ID<mngsv9$65k$1@dont-email.me>
In reply to#8257
I can't download the file. I sent you a screen print of the message that 
comes on my browser.

James

On 15-07-07 07:28 AM, Sherlock wrote:
>
>   www.sherlock.com.au\vo2code\Sherlock_m_infoclass.txt
>
> Changed MEF extension to TXT... else the download will not work.
> Change TXT back to MEF to import to application.
>
> Phil McGuinness
>
>

[toc] | [prev] | [next] | [standalone]


#8272

Fromsherlocksoftware@gmail.com
Date2015-07-11 05:43 -0700
Message-ID<f88b5e68-6428-4046-b0dc-d5d11f354392@googlegroups.com>
In reply to#8260
www.sherlock.com.au\vo2code\Sherlock_m_infoclass.txt

This URL works fine for me..

Phil

[toc] | [prev] | [next] | [standalone]


#8258

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2015-07-07 14:48 +0200
Message-ID<d0205eFka2tU1@mid.individual.net>
In reply to#8256
Hi Phil,

Nice module, thanks for sharing it with us!
regards
Urs

[toc] | [prev] | [next] | [standalone]


#8259

Fromsherlocksoftware@gmail.com
Date2015-07-07 06:58 -0700
Message-ID<525f1084-e9aa-47cf-b3b3-517fba4ce216@googlegroups.com>
In reply to#8258
Urs

snip[ Nice module, thanks for sharing it with us! regards  Urs \

Just familiarised myself and I remember why I added certain debugging and developers tools. It has memory dumps to look for leaks, objects not closed.
It also looks for and shows DBServers make have thought were closed and were not. I shows the inheritance tree and depth.
Shows the methods and variables required.
You have work on a program and run it live.

It taught me a lot, when I used it a lot and a must for beginners.

Phil McGuinness

[toc] | [prev] | [next] | [standalone]


#8271

From"richard.townsendrose" <richard.townsendrose@gmail.com>
Date2015-07-11 03:36 -0700
Message-ID<8fd35e92-9a0f-4859-8af1-cd1d32c412ed@googlegroups.com>
In reply to#8253
Martin

you have the AF set of libraries in lib 40. they will give you the answer you need.

richard

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web