GRAPH.Options

Previous  Next

 

nStatus = GRAPH.Options(  BYVAL nControl AS INTEGER,

                          BYVAL file     AS STRING,

                         [BYVAL save     AS INTEGER = FALSE] ) AS INTEGER

 


 

Loads or saves options and defaults for the specified control.  The options are saved as a XML formatted profile file that can be read by using the MyBASIC2_ExtLib libraries PROFILE functions.  The GRAPH.Option Open function should be called before you create a graph using GRAPH.New.  Call the save function before closing the graph.

 

The following CONSTs are defined in MyBASIC2_Graph.BIS

 

CONST NG_Open        = 0x0000    ' Open and load options

CONST NG_Save        = 0x0001    ' Save current options

CONST NG_Defaults    = 0x0002    ' Save Defaults Only

 

Note; The default action is for the settings of the current graph to be used as the options to be saved unless you specify NG_Defaults.  In this case the current defaults are being saved, i.e. none of the changes applied to the graph by using any the the GRAPH functions will be saved.

 

Example:

 

GRAPH.Options( nControl, "MyOptions.xml" )

.

.

.

' Sets element line 1,2 and 3 to Red, Green and Blue

GRAPH.Color( nControl, NG_Line, 1, RGB( 255, 0, 0 ) )

GRAPH.Color( nControl, NG_Line, 2, RGB( 0, 255, 0 ) )

GRAPH.Color( nControl, NG_Line, 3, RGB( 0, 0, 255 ) )

 

' Save current settings for next time

GRPAH.Options( nControl, "MyOptions.xml", NG_Save )