guides:oi10:presentation_server:choosecolor_method_system

CHOOSECOLOR Method (System)

Displays the "Choose Color" Windows Common Dialog Box to allow the user to select a color:

 
Color = Exec_Method( "SYSTEM",          

                        "CHOOSECOLOR",     

                        OwnerWindow,       

                        InitialColor )
 
NameRequiredDescription
OwnerWindowNoID of the parent window for the dialog. This can be null, in which case the parent window is the desktop.
InitialColorNoInitial color to select when the dialog is displayed.

The color value the user selected, or null if the user clicked the "Cancel" button.

The dialog supports a set of 16 custom colors that may be chosen by the user. They may be accessed at runtime via the SYSTEM CUSTOMCOLORS property and they are cached between instances of the dialog being executed and loaded automatically. They are not saved between OI sessions.

The CHOOSECOLOR method is basically a wrapper around the ChooseColor Windows API function, so further information on this can be found on the MSDN website.

 
// Display the Windows ChooseColor dialog to allow the user to select a new

  //  FORECOLOR for a control, using the current window as the parent

  

  InitColor = Get_Property( ctrlID, "FORECOLOR" )

  

  NewColor  = Exec_Method( "SYSTEM", "CHOOSECOLOR", @Window, InitColor )

  

  If BLen( NewColor ) Then

     // The user selected a color

     Call Set_Property_Only( ctrlID, "FORECOLOR", NewColor )

  End
 
 
 

CUSTOMCOLORS property

  • guides/oi10/presentation_server/choosecolor_method_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1