newObjects Active Label Shape object

Drawing object (element).

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

The Shape object displays simple shapes which can be represented by 2 points - Line, Rectangle, Ellipse and Rounded rectangle. 

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 Shape element object is represented by a SHAPE text command. 

Members reference:

Shape Long integer. Specifies the shape.
obj.Shape = 1; // Rectangle
v = obj.Shape;
The supported shapes are:
0 - line drawn from the left top to the bottom right corners
1 - rectangle
2 - ellipse (oval)
3 - rounded rectangle
Note that the fill color and style apply only to the shapes that can be filled.
X Sets/Gets the horizontal position of the element's reference point. See the label coordinate space. The property is long integer.
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.
obj.Y = value;
v = obj.Y;
Width Long integer. Specifies the width of the bounding rectangle of the element.
obj.Width = 3000; // Sets the element width to 3 cm.
v = obj.Width;
Height Long integer. Specifies the height of the bounding rectangle of the element.
obj.Height = 3000; // Sets the element width to 3 cm.
v = obj.Height;
Color Specifies the foreground color of the element. See Active Label colors.
obj.Color = 0x00FF00; // Sets the color to green
v = obj.Color;
FillColor Specifies the fill color of the element. See Active Label colors.
obj.Color = 0x00FF00; // Sets the color to green
v = obj.Color;
LineWidth Long integer. Specifies the line thickness used to draw the element.
obj.LineWidth = 0; // Thin 1 pixel line
obj.LineWidth = 100; // 1 mm thick line
v = obj.LineWidth;
LineStyle Long integer. Specifies the line style used for element drawing.
obj.LineStyle = 1; // Dashed line
v = obj.LineStyle;

The supported line styles are:
0 - solid
1 - dashed
2 - dotted
3 - dash dot
4 - dash dot dot
5 - none
6 - solid inside frame (makes sense for closed shapes only - the line is solid but is drawn inside the shape and not over the shape borders).
FillStyle Long integer. Specifies the fill style.
obj.FillStyle = -1; // Solid fill
v = obj.FillStyle;
Supported fill styles are:
-1 - solid
0 - horizontal hatching
1 - vertical hatching
2 - diagonal left to right hatching
3 - diagonal right to left hatching
4 - cross (horizontal and vertical) hatching
5 - diagonal cross
Rounding Long integer. Specifies the corners rounding for the rounded rectangle shape.
obj.Rounding = 100; Rounding 1 mm;
v = obj.Rounding;
This property has effect only for rounded rectangle - Shape = 3. It specifies the radius of the circle used to draw the shape corners. It is specified in the current measurement units (see also Misc.Units)
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
et = obj.ElementType;
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. 
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.

v = obj.PropInfo( nProp [, infoType]);
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.
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
obj.Name = "some name";
v = obj.Name;

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.
obj.Selected = value;
issel = obj.Selected;

the property is Boolean.
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).
obj.Locked = value;
v = obj.Locked;

the property is Boolean.
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).
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.
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.
obj.CodePage = value;
cp = obj.CodePage;
For simple shape CodePage has no effect currently.
Href String. An arbitrary textual value that can be used for a hyperlink if the application that hosts the label desires so.
obj.Href = "../anotherlabel.activelabel"; // points to another label in the parent directory.
vhref = obj.Href;

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
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.
ShowProperties Displays the property sheets of the element giving the user the opportunity to change the element's settings and visual appearance through them.

In interactive editing mode this can be done also by double clicking over an element or by pressing enter for the selected element.






newObjects Copyright 2001-2006 newObjects [ ]