APLX Help : System Classes : List of Classes : ChooseColor
|
|
![]() |
ChooseColor |
Alternative name: ChooseColourDescriptionThe ChooseColor class implements the pre-defined color-selection dialog. This is a top-level object (i.e. it should not be opened as the child of a window). To use the dialog, you must first create it using The style property applies to Windows only (it is ignored under MacOS and Linux). It defines whether the user can select custom colors, by selecting one of: 0 = Allow custom colours 1 = Open with custom colours displayed 2 = Disallow custom colors You can also add the following to style: 4 = Return nearest solid colour 8 = Allow any colour, dither if necessary Under Windows and Linux, you can pre-define up to 16 custom colors by setting the custom property, as a vector of 16 integers representing the RGB values of each color. (This property is ignored under MacOS). To set the color which will be selected when the dialog is shown, you can assign a value to the color property. When you are ready to show the dialog, call the Show method. This displays the modal dialog. The user can then select a color; if the Cancel button is pressed, the Show method returns 0. If the OK button is pressed, the Show method returns 1. You can then read the color property to retrieve the color selected by the user (only the first element is used); if this is Example∇DEMO_ChooseColor;DLG [1] ⍝ Sample function demonstrating use of the ChooseColor object [2] DLG←'⎕' ⎕NEW 'ChooseColor' [3] ⍝ Show the dialog. If user presses Cancel, quit [4] :If 1=DLG.Show [5] ⍝ He pressed OK. [6] 'Color chosen: ',⍕1↑DLG.color [7] :EndIf ∇ Propertieschildren class color custom data events methods name opened properties self style tie MethodsClose Create Delete New Open Send Set Show Trigger CallbacksonClose onDestroy onOpen onSend |
|
APLX Help : System Classes : List of Classes : ChooseColor
|
Copyright © 1996-2010 MicroAPL Ltd