SBProfile

<< Click to Display Table of Contents >>

Navigation:  Using SyncBackPro > Technical Reference > Scripting >

SBProfile

 

These are functions that can be accessed from scripts via the SBProfile object. For example:

 

SBProfile.Name

 

The SBProfile object is only accessible from Profile Configuration scripts.

 

All the example code below is written in using the Pascal scripting language.

 


function GetCheckbox(Tag);

 

Tag: The tag ID of the checkbox control

 

Return value: TRUE if the checkbox is ticked

 

This function returns the state of a checkbox control (created with AddCheckbox). To change the state of a checkbox you can use SetCheckbox.

 

 

function GetComboBoxIndex(Tag);

 

Tag: The tag ID of the combobox control

 

Return value: The index of the selected item (zero is the first item, -1 if no item is selected)

 

This function returns the index of the currently selected item in a combobox control (created with AddComboBox). Note that if the control can be edited then the index can be -1, e.g. the user has entered their own text instead of selecting an item. In that case you can get the text entered by using GetComboBoxText.

 

To change the state of a checkbox you can use SetComboBoxItem or SetComboBoxText.

 

 

function GetComboBoxText(Tag);

 

Tag: The tag ID of the combobox control

 

Return value: The text in the combobox control

 

This function returns the text entered into a combobox control (created with AddComboBox).

 

To change the state of a checkbox you can use SetComboBoxItem or SetComboBoxText.

 

 

function GetEdit(Tag);

 

Tag: The tag ID of the edit control

 

Return value: The text in the edit control

 

This function returns the text in an edit control (created with AddEdit). To change the text in an edit control you can use SetEdit.

 

 

function GetRadioGroup(Tag);

 

Tag: The tag ID of the radiogroup control

 

Return value: The index of the selected item (zero is the first item, -1 if no item is selected)

 

This function returns the index of the currently selected item in a radiogroup control (created with AddRadioGroup).

 

To change the state of a checkbox you can use SetRadioGroup.

 

 

function SetButton(Caption, Tag);

 

Value: The text set the button control to

Tag: The tag ID of the button control

 

This sub routine sets the text of a button control (created with AddButton).

 

NOTE: This function is not available when using the old Windows scripting.

 

 

function SetCheckbox(Value, Tag);

 

Value: Pass TRUE to tick the checkbox

Tag: The tag ID of the edit control

 

This sub routine sets the state of a checkbox control (created with AddCheckbox). To get the state of a checkbox control you can use GetCheckbox.

 

 

function SetComboBoxItem(ItemIndex, Tag);

 

ItemIndex: The item index to use (0 is the first item, -1 means nothing selected)

Tag: The tag ID of the combobox control

 

This sub routine sets the selected item index of a combobox control (created with AddComboBox).

 

To get the current index of a checkbox control you can use GetComboBoxIndex.

 

 

function SetComboBoxText(ItemText, Tag);

 

ItemText: The text to set the combobox control to use

Tag: The tag ID of the combobox control

 

This sub routine sets the text of a combobox control (created with AddComboBox).

 

To get the text of a checkbox control you can use GetComboBoxText.

 

 

function SetEdit(Value, Tag);

 

Value: The text to put into the edit control

Tag: The tag ID of the edit control

 

This sub routine sets the text in an edit control (created with AddEdit). To get the text in an edit control you can use GetEdit.

 

 

function SetLabel(Caption, Tag);

 

Value: The text set the label control to

Tag: The tag ID of the label control

 

This sub routine sets the text of a label control (created with AddLabel).

 

 

function SetRadioGroup(ItemIndex, Tag);

 

ItemIndex: The item index to use (0 is the first item, -1 means nothing selected)

Tag: The tag ID of the radiogroup control

 

This sub routine sets the selected item index of a radiogroup control (created with AddRadioGroup).

 

To get the current index of a radiogroup control you can use GetRadioGroup.

 

 

procedure AddButton(Caption, Tag);

 

Caption: Pass the caption text to use for the button control

Tag: Pass the unique tag ID for this control

 

Adds a button control to the profile setup window.

 

This function should only be called from ConfigSetupDisplay.

 

NOTE: This function is not available when using the old Windows scripting.

 

 

procedure AddCheckbox(Caption, Tag);

 

Caption: Pass the caption text to use for the control

Tag: Pass the unique tag ID for this control

 

Adds a checkbox control to the profile setup window.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure AddComboBox(ListOnly, Tag);

 

ListOnly: If the combobox text cannot be edited then pass TRUE

Tag: Pass the unique tag ID for this control

 

Adds a combobox control to the profile setup window. To add items to the combobox use AddComboBoxItem.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure AddComboBoxItem(Value, Tag);

 

Value: The text to add to the combobox

Tag: The tag ID of the combobox to add the item to

 

Adds an item to a combobox control.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure AddEdit(Caption, MaxLen, NumbersOnly, Password, Tag);

 

Caption: Pass the caption text to use for the edit control

MaxLen: The maximum length of text that can be entered into the edit control

NumbersOnly: Pass as TRUE if the edit control is for numbers only (no negative signs or decimal points)

Password: Pass as TRUE if the edit control is for passwords

Tag: Pass the unique tag ID for this control

 

Adds an edit control to the profile setup window.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure AddLabel(Caption, Tag);

 

Caption: Pass the caption text to use for the label

Tag: Pass the unique tag ID for this label

 

Adds a label to the profile setup window.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure AddRadioGroup(Caption, Tag);

 

Caption: The caption to use for the control

Tag: Pass the unique tag ID for this control

 

Adds a radio group control to the profile setup window. To add items to the combobox use AddRadioGroupItem.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure AddRadioGroupItem(Caption, Tag);

 

Caption: The caption text to use for the new radio item

Tag: The tag ID of the radio group to add the item to

 

Adds an item to a radio group control.

 

This function should only be called from ConfigSetupDisplay.

 

 

procedure EnableControl(Enable, Tag);

 

Value: Pass TRUE to enable the control, and FALSE to disable it

Tag: The tag ID of the control to enabled or disable

 

Enables or disables a control. For example, to disable or enable another control based of a checkbox being checked or not:

 

SBProfile.EnableControl(SBProfile.GetCheckbox(1), 2);

 

 

Property Group

 

Returns the TRUE if this is a group profile.

 

This property is read-only.

 

 

Property Name

 

Returns the name of the profile.

 

This property is read-only.

 

 

Property UsesScript

 

Returns the TRUE if this profile is using this script. For example, you may have a script that is both a configuration and run-time script. Although the script may be enabled as a configuration script, the profile that is currently being edited may not be using the profile as a run-time script.

 

This property is read-only.

 

 

 

 

 

All Content: 2BrightSparks Pte Ltd © 2003-2024