PROPLIST.SetOption

Previous  Next

 

ok = PROPLIST.SetOption( propname     AS STRING,

                         option       AS VARIANT,

                         item         AS INTEGER = 0 ) AS INTEGER

 


 

Set a property option.  The contents and type of options depends on the property.  The item parameter specified the type of option.  The following options have been implemented

 

CONST PL_Opt_FileFilter    = 1            ' Specifies the File Filter for the ButtonOpen file open dialog.  Type STRING

CONST PL_Opt_SpinnerStep   = 2            ' Specifies the step length of a spinner. Type INTEGER or REAL

CONST PL_Opt_AutoEnable    = 3            ' Allows the property to be enabled/disabled by a boolean check.

                                          ' The option parameter is the property name of a boolean check that will

                                          ' enable or disable the property.  This can also be used on a PL_ButtonCombo where

                                          ' first item in list will disable the item and any other enable item.

CONST PL_Opt_ComboList     = 4            ' Configure a ComboBox to be automatically populated with File, Marker or Analogs. 

                                          ' See below for the different lists

CONST PL_Opt_Enabled       = 5            ' Sets the controls enable state to on or off.  The state can be retrieved by

                                          ' using the PROPLIST.GETITEM function

CONST PL_Opt_Error         = 6            ' Sets the item error flag and if true sets the text color to red to indicate error

CONST PL_Opt_ExcludeChars  = 7            ' Specifies characters not allowed

CONST PL_Opt_Trigger       = 8            ' Specifies that change of item property will trigger DoModal end return the

                                          ' negative of (item index + 1).  Default is off.

CONST PL_Opt_ItemColor     = 9             ' Set the color of the Items Text.  This is any text on the right hand side

CONST PL_Opt_CapColor      = 10            ' Set the color of the caption text

CONST PL_Opt_CheckText     = 11            ' Sets the text of a Check Box.  The text should be of format "OffText|OnText"

 

These are the different lists that a ComboBox can be automatically populated with.  Note;  This will require the File Pane with the PL_UpdateComboLists flag set.

 

CONST PL_List_Files        = 0x0000FFFF   ' All Files

CONST PL_List_Markers      = 0x0001FFFF   ' All Markers in all Files

CONST PL_List_Analogs      = 0x0002FFFF   ' All Analogs in all Files

CONST PL_List_SL_Files     = 0x00000001   ' Selected Files

CONST PL_List_SL_Markers   = 0x00010001   ' Selected Markers in all Files

CONST PL_List_SL_Analogs   = 0x00020001   ' Selected Analogs in all Files

CONST PL_List_NS_Files     = 0x00000000   ' Not Selected Files

CONST PL_List_NS_Markers   = 0x00010000   ' Not Selected Markers

CONST PL_List_NS_Analogs   = 0x00020000   ' Not Selected Analogs

 

The function uses the default panel selected by using PROPLIST.SelectPane.

 

Example:

 

' Create the Dialog with Property and File Panes.  Make the File Pane auto update ComboBoxes

PROPLIST.CREATE( PL_ActiveWindow, TITLE( MODULE ), "Update Graph", LONG.MAKE( 2, PL_UpdateComboLists ) )

 

PROPLIST.SetOption( "FileOpen", "XML Files (*.xml)|*.xml|All Files (*.*)|*.*||", PL_Opt_FileFilter )

 

PROPLIST.ADDPROPERTY( "Property", "Select Color", 0x008000ff, "?", PL_ButtonColor, TRUE )

PROPLIST.ADDPROPERTY( "Property", "Checked Item ?", FALSE, "?", PL_ButtonCheck, TRUE )

 

' Select Color will be enabled or disabled depending on the state of Checked Items ?

PROPLIST.SETOPTION( "Select Color", "Checked Item ?", PL_Opt_AutoEnable )

 

' Set Spinner increment step. 

' Note; we're using hidden text for unique ID with alignment formatting

PROPLIST.ADDPROPERTY( "Plot", "{Start Time>}Seconds ", 0.00, "?", PL_ButtonSpin, TRUE )

PROPLIST.SETOPTION( "{Start Time>}Seconds ", 0.1, PL_Opt_SpinnerStep )

 

' Add a ComboBox that will be populated with selected markers

PROPLIST.ADDPROPERTY( "Options", "{>}to Marker ", "<empty>", "?", PL_ButtonCombo, FALSE )

PROPLIST.SETOPTION( "{>}to Marker ", PL_List_SL_Markers, PL_Opt_ComboList )

 

' Enable or Disable the "OK" and "Update Graph" Dialog Buttons

DIM bEnable AS INTEGER

 

bEnable = PROPLIST.GetValue( "Graph Control", TRUE )

bEnable = bEnable + PROPLIST.GetValue( "Table Control", TRUE )

 

PROPLIST.SetOption( "Update Graph", bEnable, PL_Opt_Enabled )

PROPLIST.SetOption( "OK", bEnable, PL_Opt_Enabled )