Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #10098
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? |
| Date | 2016-12-29 14:59 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <o434ru$fda$1@gioia.aioe.org> (permalink) |
| References | <_PW8A.209120$Xi4.69838@fx19.fr7> <o42gvi$1e3c$1@gioia.aioe.org> <Pa79A.326574$R32.218798@fx28.fr7> |
Hi Raymond,
you can filter these buttons e.g. through name
IF IsInstanceOfUsual( oC, #BUTTON ) .AND.;
Left(oC:Name,6) == "PSHBTN" // pshBtn01 thru pshBtn99
or you can mark buttons in field Description in Painter
IF IsInstanceOfUsual( oC, #BUTTON ) .AND.;
oC:HyperLabel:Description == "XYZ" // Buttons to be colored
Regards, Franz
Am 29.12.2016 um 13:18 schrieb Raymond Steffensen:
> Hi Franz, and thanks for that solution.
>
> May I ask how you would change color of only one or few buttons with use
> of a macro?
>
> I need to change color of one or more buttons depending programflow.
>
> Raymond
>
> "Franz Rachbauer" skrev i nyhetsmeldingen: o42gvi$1e3c$1@gioia.aioe.org
> ...
>
> Hi Raymond,
> i'm using the buttons directly to do this color change:
>
> METHOD PostInit() CLASS MyDataWindow
> LOCAL aC := SELF:GetControls() AS ARRAY
> LOCAL x AS DWORD
>
> FOR x := 1 TO ALen(aC)
> aC[x]:Background := Brush{Color{255, 100, 10}}
> NEXT
> RETURN SELF
>
> METHOD GetControls() CLASS MyDataWindow
> LOCAL aControls AS ARRAY
> LOCAL oC AS VObject
> LOCAL hWnd AS PTR
>
> hWnd := GetWindow( SELF:oSurface:Handle(), GW_CHILD )
> aControls := {}
> WHILE hWnd != NULL_PTR
> oC := GetObjectByHandle( hWnd )
> IF IsInstanceOfUsual( oC, #BUTTON )
> AAdd( aControls, oC )
> ENDIF
> hWnd := GetWindow( hWnd, GW_HWNDNEXT )
> ENDDO
> RETURN aControls
>
> Regards, Franz
>
> Am 28.12.2016 um 23:15 schrieb Raymond Steffensen:
>> Hi
>>
>> Vo has been in the drawer for quite a few years, and now I start to
>> scratch the surface again.
>>
>> 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
>>
>> What am I doing wrong?
>>
>> Regards
>> Speedy
>
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? Franz Rachbauer <office@rachbauer.org> - 2016-12-29 09:20 +0100
Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? "Raymond Steffensen" <raymond@up2ng.net> - 2016-12-29 13:18 +0100
Re: I want to change Iconpushbuttons:usecolor in a for-next loop....how? Franz Rachbauer <office@rachbauer.org> - 2016-12-29 14:59 +0100
csiph-web