newObjects Active Label Text object (text box)

Drawing object (element).

oText = VisiLabel.Element(x);
oText = VisiLabel(x); 

The Text object displays multiple lines of text. It supports different fonts and text decorations. When resized the text is rearranged to fit into the element's rectangle. The Text element supports asynchronous load/post operations and can be change not only directly (through the Text property), but can be also loaded (downloaded) from an URL or posted (uploaded) to an URL.

Text command:

The text commands are used to represent objects and their settings in the saved label data. When the label is saved or uploaded (see How to Download and Upload) text commands are generated and packed in the specified format (see Misc.SaveFormat). The representation of the entire label with its elements can be also obtained programmatically through VisiLabel.TextCommands and VisiLabel.ObjectParams. The commands have simple syntax and can be generated from the application (just like a HTML output) where appropriate allowing the developer implement different tasks in any suitable way. The label can be instantiated from set of text commands (see the list of the different options to do this). The text commands can be feed into the control programmatically (see VisiLabel.TextCommands) or a download can be invoked (see VisiLabel.Src and VisiLabel.MergeSrc).

A Text element object is represented by a TEXT text command. 

Members reference:

Properties
X Sets/Gets the horizontal position of the element's reference point. See the label coordinate space. The property is long integer.
Syntax:
obj.X = value;
v = obj.X;
Y Sets/Gets the vertical position of the element's reference point. See the label coordinate space. The property is long integer.
Syntax:
obj.Y = value;
v = obj.Y;
Width
Height
Color Specifies the foreground color of the element. See Active Label colors.
Syntax:
obj.Color = 0x00FF00; // Sets the color to green
v = obj.Color;
BkColor Specifies the background color of the element. See Active Label colors.
Syntax:
obj.BkColor = 0x0000FF; // Sets the background color to red
v = obj.BkColor;

Remarks:
If the element supports transparency the background color will not have effect when the element is drawn transparently. For example the text labels can be drawn opaque and transparent. The background color will actually show on the screen if the particular element is drawn opaque. 
Transparent Specifies the draw mode: True - Transparent, False - opaque
Syntax:
obj.Transparent = true; // Makes the element transparent
v = obj.Transparent;

Remarks:
The effect of this property may differ for the different element types. For example a text label or a text box will draw the text background if this is set to false. Otherwise they will draw only the text not touching the background.
HAlignment
VAlignment
FontFace String. Specifies the face name for the font used in the element.
Syntax:
obj.FontFace = "Arial"; // Specifies font face Arial
vfontface = obj.FontFace;

Remarks:
In WEB applications you should use fonts that are installed on the client machines. Because Active Label is most often used in intranets this is not a problem, but the administrators should make sure all the fonts in use are installed on the workstations.
FontSize Specifies the size of the font used in the element. The size is specified in the current measurement units.
Syntax:
obj.FontSize = 300; // If the default settings are in effect this specifies font size of 3 millimeters
vsize = obj.FontSize;

Remarks:
Note that in contrast with the most applications Active Label uses the same measurement units for all the sizes and locations - including the font size. We believe this is more convenient when the content must be fit on very small sized areas such as sticky labels.
Charset Specifies the font charset to be used. See the remarks below.
Syntax:
obj.Charset = 204; // Sets cyrillic charset
v = obj.Charset;

Remarks:
Active Label is implemented for the ANSI subsystem and not for the UNICODE subsystem. This makes it compatible with all the Windows versions - even Windows 95 without need of additional system updates. Thus when working with fonts that contain characters for multiple alphabets you will need to specify which one to use. Each element may have different charset thus you can display elements in different languages on the same label. See also the CodePage property.
Bold Boolean. Specifies if the font used by the element is bold.
Syntax:
obj.Bold = true; // Make the text bold
vbold = obj.Bold;
Itallic Boolean. Specifies if the font used by the element is itallic.
Syntax:
obj.Itallic = true; // Make the text itallic.
vbold = obj.Itallic;
Underline Boolean. Specifies if the font used by the element is underlined.
Syntax:
obj.Underline = true; // Make the text underlined.
vbold = obj.Underline;
Orientation not supported in v.1.0
Text String. Specifies the text displayed in the text box.
Syntax:
obj.Text = "My Text Label";
vtext = obj.Text;
Standard drawing object (element) properties
ElementType Returns an integer constant which describes the element type:
1 - Text Label
2 - Text box
3 - Simple shape
4 - Symbol
5 - Image
6 - Barcode
Syntax:
et = obj.ElementType;
Remarks:
This property is a must when you want to enumerate the elements on the label and perform certain actions on some of them (for example invoke save for the image elements, or check the correctness of the text elements and so on). 
VisiLabel Returns the VisiLabel object on which the element resides.
Index Returns the element's index in the elements stack. 
Syntax:
i = obj.Index;
For example you can use later VisiLabel.Element(i) to obtain the same element.
PropInfo Implements simple type information interface which allows the application to obtain a list of properties supported by the object.
Syntax:

v = obj.PropInfo( nProp [, infoType]);
Parameters:
nProp - >= 0 integer value - the property index for which to obtain infromation. See the remarks.
infoType - What information to return. Currently supported values are:
   0 - the name of the property
   1 - the type of the property as VARTYPE constant.
   2 - the property description.
Remarks:
This is used mostly for internal purposes, but can be useful for some advanced applications as well. The PropInfo can be called with nProp argument ranging from 0 to a certain positive number N. For values greater than N PropInfo returns null. Through it you can obtain a list of the properties supported by the drawing object and some other information about them.
Note that not all the properties you can see in the documentation are described by the PropInfo property. It returns information only for the properties that are best suitable for run-time changes - for example linked to fields in the internal data source. A good example is the Selected property - it is not returned by the PropInfo for any kind of element because it is useful only in interactive mode and makes no sense otherwise.
Name Sets/gets the name of the element
Syntax:
obj.Name = "some name";
v = obj.Name;

Remarks:
It is recommended to keep the element names constant once the label design is complete. For instance when using data to print set of labels, linking the name of an element to a field will change its data linkage once the name is changed. This can be used as a trick, but it will need extreme caution and careful planning.  
Selected Makes the element selected/non-selected in interactive mode.
Syntax:
obj.Selected = value;
issel = obj.Selected;

the property is Boolean.
Remarks:
Makes sense only in interactive editing mode (see Edit object). Most often used by applications/WEB pages that display a list of the elements on the label and allow the user to select an element by clicking its entry in the list. Can be used also for any purpose that requires the application to direct the user's attention to a particular element. 
Locked Changes the locked state of a drawing object (element).
Syntax:
obj.Locked = value;
v = obj.Locked;


the property is Boolean.
Remarks:
This property is used in interactive editing mode (see Edit object). If the VisiLabel.Edit.ProtectLockedElements is set to true then all the locked elements cannot be changed. This allows implementation of visual editing over label design templates where some elements are constant and cannot be changed.
Hidden Changes the visible state of a drawing object (element).
Syntax:
obj.Hidden = value;
v = obj.Hidden;


the property is Boolean. When set to true the element is invisible on the screen and on the printer.
Remarks:
This property is useful in various situations. For example it can be linked to a field in the internal data source to make a particular element visible or invisible depending on the data in the current record.
CodePage Sets/gets the code page as numeric value. The code page is used for all the text translations from UNICODE to ANSI and reverse.
Syntax:
obj.CodePage = value;
cp = obj.CodePage;
Remarks:
By default the system's code page is used. This is usually enough for the most applications, but if you need to place texts in different languages on the label you may need to change the code page of some of the text elements.
Href String. An arbitrary textual value that can be used for a hyperlink if the application that hosts the label desires so.
Syntax:
obj.Href = "../anotherlabel.activelabel"; // points to another label in the parent directory.
vhref = obj.Href;

Remarks:
The Active Label Browser application treats this property as a hyperlink. It is relative to the source location from which the label on which the element resides is loaded. On WEB pages your application may use this property to invoke navigation to another label - i.e. changing the label displayed when the user clicks over certain element on it. However note that on WEB pages all the navigational properties (Src and Dst) are relative to the WEB page's location and not the label load location. See also OnElementClicked event.
Connectivity properties
Src
Dst
ObjectState Returns the load state of the object. For the TextLabel element it is always 4 (completed) because it does not support asynchronous load/save operations.
PostResult
DisableConnectivity
PostVerb
PostParams
Methods
ShowProperties Displays the property sheets of the element giving the user the opportunity to change the element's settings and visual appearance through them.
Syntax:

obj.ShowProperties();
Remarks:
In interactive editing mode this can be done also by double clicking over an element or by pressing enter for the selected element.
PostData
Reload

Remarks: 

 

 

 

newObjects Copyright 2001-2006 newObjects [ ]