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


Groups > comp.lang.clipper.visual-objects > #10095

Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Karl-Heinz" <invalid@invalid.invalid>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how?
Date Thu, 29 Dec 2016 18:01:49 +0100
Lines 70
Message-ID <ecktt6F1ht5U1@mid.individual.net> (permalink)
References <_PW8A.209120$Xi4.69838@fx19.fr7>
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 8bit
X-Trace individual.net +t6icgX/8HNy08eatxvTCgvuEEPfTm0SS3HdeWSYBTeYHLLFs=
Cancel-Lock sha1:p+cDRB5065zYCZWbMOAE6eg4ZpI=
In-Reply-To <_PW8A.209120$Xi4.69838@fx19.fr7>
X-Priority 3
X-MSMail-Priority Normal
Importance Normal
X-Newsreader Microsoft Windows Live Mail 16.4.3564.1216
X-MimeOLE Produced By Microsoft MimeOLE V16.4.3564.1216
Xref csiph.com comp.lang.clipper.visual-objects:10095

Show key headers only | View raw


Hi Speedy

> I have 34 push buttons I want to change background color on, and I found
> the iconpushbuttons LIB
> There I can use the following:
>
> oCCButton1:Usecolor :=  Brush{Color{COLORGREEN},HATCHSOLID}
>
> I would like to do this in a for-next loop, but only get errors.
>
> FOR i := 1 to 34
>     IVarGetSelf(self,String2Symbol('oCCButton'+AsString(i):Usecolor)) :=
> Brush{Color{COLORGREEN},HATCHSOLID}
>
> NEXT i


try calling the attached SymIVarPut() function below from one of your window
methods.

e.g.

    aSymControls := ArrayNew ( 34 )

    FOR i := 1 UPTO 34

        aSymControls [ i ] := String2Symbol ( "BUTTON" + NTrim ( i) )


    NEXT


    SymIVarPut ( SELF , aSymControls , #Usecolor ,
Brush{Color{COLORGREEN},HATCHSOLID  )


    BTW. There“s no need to switch the controls from protect to export in
the painter.

--------------

FUNCTION SymIVarPut ( oWin AS Window , aSymCtrlNames AS ARRAY ,
symAssignName AS SYMBOL , uValue AS USUAL ) AS VOID PASCAL
LOCAL aChildren AS ARRAY
LOCAL i , dwLen AS DWORD


    dwLen := ALen ( aChildren := oWin:GetAllChildren() )


    FOR i := 1 UPTO dwLen

        IF IsAccess ( aChildren [i], #Namesym ) .AND.  AScan ( aSymCtrlNames
, aChildren [i]:Namesym  )  > 0

            IVarPut ( aChildren [ i ] , symAssignName , uValue )


        ENDIF

    NEXT


    RETURN

-----------

regards
Karl-Heinz 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

I want to change Iconpushbuttons:usecolor in a for-next loop....how? "Raymond Steffensen" <raymond@up2ng.net> - 2016-12-28 23:15 +0100
  Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? "Karl-Heinz" <invalid@invalid.invalid> - 2016-12-29 18:01 +0100
  Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2016-12-29 14:38 +0100
    Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? speedygonzales502@gmail.com - 2016-12-29 06:01 -0800
  Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? "Jamal" <noooospam@example.com> - 2016-12-28 18:25 -0500

csiph-web