BBjColorChooser::setPreviewPanelVisible

Description

In BBj 7.0 and higher, this method sets the visibility of the BBjColorChooser's preview panel

Syntax

Return Value

Method

void

setPreviewPanelVisible(boolean show)

Parameters

Variable

Description

show

True, if the preview panel should be visible; otherwise, false.

Return Value

None.

Remarks

None.

Example

rem 'Add a color chooser to a window

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Open the SysGui device
SYSGUI = UNT
OPEN (SYSGUI) "X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui! = myAPI!.getSysGui()

rem 'Set addWindow param values
X = 10
Y = 10
WIDTH = 650
HEIGHT = 350
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)
myCEdit! = myWindow!.addCEdit(101, 10, 10, 190, 190, "Text")

rem 'Add a color chooser on the window
myColorChooser! = myWindow!.addColorChooser(201,200,0,450,350)
if (myColorChooser!.isPreviewPanelVisible())
    myColorChooser!.setPreviewPanelVisible(0)
endif
myColorChooser!.setControlButtonsAreShown(0)

rem 'Register the CALLBACK routines
CALLBACK(ON_COLORCHOOSER_CHANGE,CHANGE_COLOR,mySysGui!.getContext(),myColorChooser!.getID())
CALLBACK(ON_CLOSE,DO_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

CHANGE_COLOR:
    color! = myAPI!.getLastEvent().getColor()
    myCEdit!.setForeColor(color!)
return

rem 'Callback routine called when the colorchooser's OK button is pressed
DO_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjColor

BBjColorChooser

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.