Hide

SftOptions 1.0 - ActiveX Options Control

Display
Print

SftOptions.Add Method

Adds a new entry.

Syntax

VB.NETobject.Add(ByVal ParentName As String, ByVal Name As String, ByVal Text As String, ByVal Type As SftOptionsEntryConstants, ByVal Value As String, ByVal DefaultValue As String, ByVal refPictureObj As System.Drawing.Image, ByVal Description As String, ByVal Help As String, ByVal ContextHelp As String, ByVal StatusBarHelp As String)
VBobject.Add(ByVal ParentName As String, ByVal Name As String, ByVal Text As String, ByVal Type As SftOptionsEntryConstants, ByVal Value As String, ByVal DefaultValue As String, refPictureObj As IPictureDisp, ByVal Description As String, ByVal Help As String, ByVal ContextHelp As String, ByVal StatusBarHelp As String)
C#.NETvoid object.Add(string ParentName, string Name, string Text, SftOptionsEntryConstants Type, string Value, string DefaultValue, System.Drawing.Image refPictureObj, string Description, string Help, string ContextHelp, string StatusBarHelp);
VC++HRESULT object->Add(_bstr_t ParentName, _bstr_t Name, _bstr_t Text, enum SftOptionsEntryConstants Type, _bstr_t Value, _bstr_t DefaultValue, IPictureDisp* refPictureObj, _bstr_t Description, _bstr_t Help, _bstr_t ContextHelp, _bstr_t StatusBarHelp);
CHRESULT object->raw_Add(BSTR ParentName, BSTR Name, BSTR Text, enum SftOptionsEntryConstants Type, BSTR Value, BSTR DefaultValue, IPictureDisp* refPictureObj, BSTR Description, BSTR Help, BSTR ContextHelp, BSTR StatusBarHelp);

object

A SftOptions object.

ParentName

A string defining the parent entry to which the new entry is attached as a child item. If an empty string is supplied, the new entry is added at the end of the list, otherwise a new child item is added to entry ParentName. The new child entry is added as the last child entry.

Name

A string defining the name of the entry (see Entry.Name). The name is used by an application to refer to this item and is used to save the associated option in an external file (see IO.File and IO.Registry).

Text

A string defining the displayed text (see Entry.Text). The text is displayed to the end-user as the title of the option.

Type

Defines the entry type.

NameValueDescription
entrySftOptionsTopic0The entry is a topic heading. No option or option value is associated with this entry.
entrySftOptionsCheckBox1The entry is a check box entry. A True/False value is associated with this entry (see Entry.Value).
entrySftOptionsCheckBox32The entry is a 3-state check box entry. A True/False/Unknown value is associated with this entry (see Entry.Value).
entrySftOptionsRadioButton3The entry is a radio button entry. A True/False value is associated with this entry (see Entry.Value).
entrySftOptionsEllipse4The entry is an ellipse entry. A string value is associated with this entry (see Entry.Value) which can be modified by the user by clicking on the ellipse button.

Value

Defines the current value of the option. For possible values based on the entry type, please see the Entry.Value property.

DefaultValue

Defines the default value of the option. For possible values based on the entry type, please see the Entry.Value property.

refPictureObj

Defines the image associated with this entry. The image is used for Topic and Ellipse entries only (see Entry.Picture).

Description

Defines the description of this entry. The description is not used by the SftOptions control and can be used by the application to hold a string value (see SftOptionsEntry.Description).

Help

Defines the help text of this entry. The help text is not used by the SftOptions control and can be used by the application to hold a string value (see Entry.Help).

ContextHelp

Defines the context sensitive help of this entry. The context sensitive help is not used by the SftOptions control and can be used by the application to hold a string value (see Entry.ContextHelp).

StatusBarHelp

Defines the status bar help of this entry. The status bar help is not used by the SftOptions control and can be used by the application to hold a string value (see Entry.StatusBarHelp).

Comments

The Add method adds a new entry. If ParentName is not defined, the entry is added at the end of the list, otherwise a new child item is added to entry ParentName. The new child entry is added as the last child entry.

Example (VB.NET)

' A picture box is used to hold the bitmap for the topic's Picture property. A
' suitable bitmap has been defined in the picture box using its Image property.
AxSftOptions1.Add("", "Topic1", "Sample Topic", SftOptionsEntryConstants.entrySftOptionsTopic, "", "", OLECvt.ToOLE_IPictureDisp(PictureBox1.Image), "", "", "", "")
AxSftOptions1.Add("", "Topic2", "Sample Topic", SftOptionsEntryConstants.entrySftOptionsTopic, "", "", Nothing, "", "", "", "")
AxSftOptions1.InitializationComplete()

Example (VB)

' A picture box is used to hold the bitmap for the topic's Picture property. A
' suitable ' bitmap has been defined in the picture box using its Picture property.
SftOptions1.Add "", "Topic1", "Sample Topic", entrySftOptionsTopic, "", "", _
 Picture1.Picture, "", "", "", ""
SftOptions1.Add "", "Topic2", "Sample Topic", entrySftOptionsTopic, "", "", _
 Nothing, "", "", "", ""

Example (C#.NET)

// A picture box is used to hold the bitmap for the topic's Picture property. A
// suitable bitmap has been defined in the picture box using its Image property.
axSftOptions1.Add("", "Topic1", "Sample Topic", SftOptionsEntryConstants.entrySftOptionsTopic, "", "", OLECvt.ToOLE_IPictureDisp(pictureBox1.Image), "", "", "", "");
axSftOptions1.Add("", "Topic2", "Sample Topic", SftOptionsEntryConstants.entrySftOptionsTopic, "", "", null, "", "", "", "");
axSftOptions1.InitializationComplete();

Example (VC++)

ISftOptionsPtr vOptions1 = m_Options1.GetControlUnknown();

IPictureDispPtr pIPictureDisp;
PICTDESC PictDesc;
PictDesc.cbSizeofstruct = sizeof(PICTDESC);
PictDesc.picType = PICTYPE_ICON;
PictDesc.icon.hicon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));
HRESULT hr = OleCreatePictureIndirect(&PictDesc, IID_IPictureDisp, TRUE, (void**)&pIPictureDisp);
ASSERT(SUCCEEDED(hr));

vOptions1->Add(_bstr_t(""), _bstr_t("Topic1"), _bstr_t("Sample Topic"),
 entrySftOptionsTopic, _bstr_t(""), _bstr_t(""), pIPictureDisp,
 _bstr_t(""), _bstr_t(""), _bstr_t(""), _bstr_t(""));
vOptions1->Add(_bstr_t(""), _bstr_t("Topic2"), _bstr_t("Sample Topic"),
 entrySftOptionsTopic, _bstr_t(""), _bstr_t(""), NULL,
 _bstr_t(""), _bstr_t(""), _bstr_t(""), _bstr_t(""));
vOptions1->InitializationComplete();

Example (Delphi)

// uses ActiveX
// var pic: IPictureDisp;
// A TImage control is used to hold the bitmap for the topic's Picture property. A suitable
// bitmap has been defined in the image control using its Picture property.
GetOlePicture(Image1.Picture, pic);
SftOptions1.Add('', 'Topic1', 'Sample Topic', entrySftOptionsTopic, '', '', pic, '', '', '', '');
SftOptions1.Add('', 'Topic2', 'Sample Topic', entrySftOptionsTopic, '', '', nil, '', '', '', '');
SftOptions1.InitializationComplete();

See Also SftOptions Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.