[futurebasic] Re: [FB] color picker

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2009 : Group Archive : Group : All Groups

From: Brian Heibert <heibert@...>
Date: Sun, 18 Oct 2009 13:35:03 -0400
Error If/Endif structure error in line 130 of color picker
Error If/Endif structure error in line 126 of color picker

There is nothing on those lines so I don't know where it is getting  
that from

Here is the example  I found; It should run right? But it doesn't

Brian


/*

      Release 7 compliance update by STAZ { 8/17/02 }
*/
'~'6
#IF DEF _usingLiteRuntime
PRINT "Sorry!"
PRINT "This program will not work in the console runtime."
PRINT "Select Standard BASIC or Appearance Compliant from the Command  
menu."
#ELSE

'~Globals
BEGIN GLOBALS
DIM gRGBChoice AS RGBColor
END GLOBALS

_kExampleName$ = "Color Picker"
_fileMenu = 1
_quitItem = 1

'~Example Functions
CLEAR LOCAL
LOCAL FN DisplayColorValues (@RGBOut AS POINTER TO RGBColor)
'---> Variables
DIM SampleRect AS RECT
DIM cyan&,magenta&,yellow&
'---> Get CMY values.
cyan&    = RGBOut.red   AND &FFFF
magenta& = RGBOut.green AND &FFFF
yellow&  = RGBOut.blue  AND &FFFF
CALL moveto (0,0)
PRINT
PRINT "    Color picked:"
PRINT ,"red:  " RGBOut.red%   ,"cyan:   "cyan&
PRINT ,"green:" RGBOut.green% ,"magenta:"magenta&
PRINT ,"blue: " RGBOut.blue%  ,"yellow: "yellow&

RGBForeColor(#RGBOut)
SetRect(SampleRect, 95,70,250,170)
PaintRect(SampleRect)
COLOR _zBlack'reset color to black
END FN

CLEAR LOCAL
LOCAL FN ColorPicker
'---> Variables
DIM RGBIn   AS RGBColor
DIM RGBOut  AS RGBColor
DIM WherePt AS POINT
DIM Msg$
DIM Picked AS BOOLEAN
'---> Pick Color
WherePt.h% = 50
WherePt.v% = 50
Msg$       = "Pick a color (any color)!"
Picked    = FN GetColor (WherePt, Msg$, RGBIn, RGBOut)
'---> Pick Anything?
LONG IF Picked
gRGBChoice = RGBOut
#IF CarbonLib
FN DisplayColorValues(gRGBChoice)
#ENDIF
END IF
END FN

'~Dialog
LOCAL
DIM action,reference
LOCAL FN DoDialog
'~'
action    = DIALOG (0)
reference = DIALOG (action)

SELECT action
CASE _wndClose   : gFBQuit = _zTrue
CASE _btnclick   : FN ColorPicker
CASE _wndrefresh : FN DisplayColorValues (gRGBChoice)
END SELECT

END FN

'~Windows
LOCAL
DIM t,b
LOCAL FN InitProgram
'~'
WINDOW 1,_kExampleName$
TEXT _courier,10,,0
b = WINDOW(_height) - 60
t = b - 20
BUTTON 1,1,"Pick Color",(20,t)-(160,b)
END FN

'~Menus
LOCAL
DIM menuID,itemID
LOCAL FN handleMenu
'~'
menuId = MENU(_menuID)
itemID = MENU(_itemID)
MENU
LONG IF menuID = _fileMenu AND itemID = _quitItem
gFBQuit = _zTrue
END IF
END FN

LOCAL FN DefineMenus
'~'
MENU _fileMenu,0,1,"File"
MENU _fileMenu,_quitItem,1,"Quit/Q"
APPLE MENU "Example: "+_kExampleName$
END FN

'~Setup
FN InitProgram
FN DefineMenus

ON DIALOG FN DoDialog
ON MENU   FN handleMenu

DO
HANDLEEVENTS
UNTIL gFBQuit
END


On Oct 18, 2009, at 1:24 PM, Brian Stevens wrote:

>
> On Oct 18, 2009, at 10:11 AM, Brian Heibert wrote:
>
>> I looked at the example for FB5 color picker
>> But I couldn't get it to run
>
>
> ColorPicker Demo in FB5 Examples>Controls compiles and runs as  
> expected here.
> Please post code that fails and error messages received from the FB  
> Build Log.
>
> Brian S.
>
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>