Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #10095
| 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 | 2016-12-29 18:01 +0100 |
| Message-ID | <ecktt6F1ht5U1@mid.individual.net> (permalink) |
| References | <_PW8A.209120$Xi4.69838@fx19.fr7> |
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
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