Documentation component by D.Glodt (c)2000-2001 Appendix A: QColorDialog

QColorDialog Component

QColorDialog is a dialogue box used to select a color.

          WARNING:don't use Caption property with an other component using a WindowProc.

QColorDialog Properties
Field Type R/W Default




Caption STRING RW
Colors Array of LONG RW
Define the value of 16 colors perso. 
Color LONG R
Value color selected. 
Style INTEGER RW cdNormal
Style dialog box, can be cdFullOpen or cdNoFullOpen

QColorDialog Methods
Method Type Description Params




Execute FUNCTION Open the dialog box , return True if color selection

QColorDialog Events
Event Type Occurs when... Params




QColorDialog Examples

' Color chooser dialog example
$INCLUDE "RAPIDQ.INC"
$INCLUDE "QCOLORDIALOG.INC"
$TYPECHECK ON

DECLARE SUB ButtonClick (Sender AS QBUTTON)

dim Dial as QColorDialog
    Dial.Style=cdNoFullOpen
    Dial.Caption="Select Color"

CREATE Form AS QFORM
    CREATE Button AS QBUTTON
        Width = 100
        Caption = "Choose color"
        OnClick = ButtonClick
    END CREATE
    Center
END CREATE
form.ShowModal


SUB ButtonClick (Sender AS BUTTON)
    if Dial.Execute then
      Form.Color=Dial.Color
    end if
END SUB