[futurebasic] Re: [FB] change pen color

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2010 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Thu, 21 Jan 2010 21:10:53 -0500
Not sure if it's your problem either, but in FB5 and FBtoC due to the  
different runtime, in some cases it seems the DoDialog fn is no  
longer synchronous and linear (waiting around until some other  
function call it calls is done)...so  it's possible your Long Color  
is being bypassed entirely. Maybe not.

rc

On Jan 21, 2010, at 9:04 PM, Brian Heibert wrote:

> I know how to  display a color picker dialog but I do not know how  
> to change the color the paint/draw area uses
>
> local fn ColorPickerX
> dim as RGBColor   inRGB, outRGB
> dim as Point      pt
> dim as long       ev, id
> dim as Boolean    ok
>
> BlockZero( @outRGB, sizeof(RGBColor) )
>
> inRGB.red = 65535
> inRGB.green = 10000
> inRGB.blue = 23456
>
> ok = fn GetColor( pt, "Select a color...", @inRGB, @outRGB )
> //if ( ok ) then //print outRGB.red,outRGB.green,outRGB.blue
>
> end fn
>
> For example.... the CASE  "ColorName" : COLOR=_zColorName works
> but if I try to use LONG COLOR it doesn't seem to work
>
>
> local fn DoPopup( menuID as long )
> '~'1
> dim as Long     mItem
> dim as Str255   txtStr
> dim as MenuRef  mRef
> dim as Long     outWnd
> dim as RGBColor   inRGB, outRGB
>
> mItem = button( menuID )
> mRef  = button( menuID, _FBgetControlMenuHandle )
> call GetMenuItemText( mRef, mItem, @txtStr )
>
> outWnd = window( _mainWnd )
> window output _mainWnd
> select case ( txtStr )
> case "White" : Color = _zWhite
> case "Black"  : Color = _zBlack
> case "Yellow" : Color = _zYellow
> case "Green"  : Color = _zGreen
> case "Cyan"   : Color = _zCyan
> case "Blue"   : Color = _zBlue
> case "Magenta": Color = _zMagenta
> case "Red"    : Color = _zRed
> case "Eraser" : Color = _zWhite
> case "Other Color..."
> fn ColorPickerX
> LONG COLOR outRGB.red,outRGB.green,outRGB.blue
>
> end select
>
> if outWnd then window output outWnd
>
> end fn
>
> Brian
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>