new ElementOptions()
Every option of the ElementOptions type has associated a property of the element. For instance, the option:
caption {string}, defines the element's captionis associated with the property:
Caption {string}, defines the element's captionwhich means that the following statements are equivalent:
oElement.Options = {caption: "name"}
oElement.SetOptions({caption: "name"})
oElement.Caption = "name"
oElement.SetCaption("name")
where oElement is an object of Element type.
Members
(static, readonly) lane :PoolSplitter
Type:
- Since:
- 1.7
Example
oSwimlane.Element(0).Center(oSwimlane.Pool(0), oSwimlane.Lane(0,1), oSwimlane.Phase(0,0)), // centers the first-element within the first-pool, lane with index 1 and phase with index 0
(static, readonly) phase :PoolSplitter
Type:
- Since:
- 1.7
Example
oSwimlane.Element(0).Center(oSwimlane.Pool(0), oSwimlane.Lane(0,1), oSwimlane.Phase(0,0)), // centers the first-element within the first-pool, lane with index 1 and phase with index 0
(static, readonly) pool :Pool
Type:
- Since:
- 1.7
Example
oSwimlane.Element(0).Center(oSwimlane.Pool(0), oSwimlane.Lane(0,1), oSwimlane.Phase(0,0)), // centers the first-element within the first-pool, lane with index 1 and phase with index 0
(static) autoSize :object
The autoSize field is mapped to the Element.AutoSize property, which means that the following statements are equivalent:
oElement.Options = {autoSize: true}
oElement.SetOptions({autoSize: true})
oElement.AutoSize = true
oElement.SetAutoSize(true)
Type:
- object
- Since:
- 2.2
Example
true {boolean}, the element is automatically resized to fit its content
autoSize
(static) caption :object
The caption field is mapped to the Element.Caption property, which means that the following statements are equivalent:
oElement.Options = {caption: "name"}
oElement.SetOptions({caption: "name"})
oElement.Caption = "name"
oElement.SetCaption("name")
Type:
- object
Example
null {null}, indicates no caption
"caption" {string}, declares a plain-caption
"<b>text</b>" {string}, displays the text in bold
"<img>logo</img>" {string}, displays the "logo" image. The image can be added using the exontrol.HTMLPicture.Add method
caption
(static) client :object
The client field is mapped to the Element.Client property, which means that the following statements are equivalent:
oElement.Options = {client: [0,0,128,128]}
oElement.SetOptions({client: [0,0,128,128]})
oElement.Client = [0,0,128,128]
oElement.SetClient([0,0,128,128])
Type:
- object
Example
null {null}, defines an element quivalent with [0,0,32,32]
[0,0,128,128] {number[]}, defines the element at the center of the control of 128 x 128 pixels size
client
(static) cursor :object
The valid CSS cursor values include, but are not limited to:
- "pointer", a hand cursor, indicating a link or clickable element
- "move", a cursor with four arrows, indicating that the element can be moved
- "crosshair", a cross-shaped cursor, often used for precision selection
- "text", an I-beam cursor, indicating that text can be selected
- "wait", a cursor with an hourglass or spinning circle, indicating that the user should wait
- "help", a cursor with a question mark, indicating that help is available
- "not-allowed", a cursor with a circle and a line through it, indicating that the action is not allowed
The cursor field is mapped to the Element.Cursor property, which means that the following statements are equivalent:
oElement.Options = {cursor: "pointer"}
oElement.SetOptions({cursor: "pointer"})
oElement.Cursor = "pointer"
oElement.SetCursor("pointer")
Type:
- object
Example
null {null}, the mouse cursor is determined by the "element" part of the control's cursors field
"pointer" {string}, the mouse cursor changes to a pointer when hovering over the element, indicating that it is clickable
cursor
(static) enabled :object
Type:
- object
Example
false {boolean}, disables the element
true {boolean}, enables the element
enabled
(static) expand :object
The expand field is mapped to the Element.Expand property, which means that the following statements are equivalent:
oElement.Options = {expand: false}
oElement.SetOptions({expand: false})
oElement.Expand = false
oElement.SetExpand(false)
Type:
- object
Example
false {boolean}, collapses the element
expand
(static) formatText :object
The exontrol.DrawTextFormatEnum type support the following flags:
- exTextAlignTop (0x00), justifies the text to the top of the rectangle
- exTextAlignLeft (0x00), aligns text to the left
- exTextAlignCenter (0x01), centers text horizontally in the rectangle
- exTextAlignRight (0x02), aligns text to the right
- exTextAlignVCenter (0x04), centers text vertically
- exTextAlignBottom (0x08), justifies the text to the bottom of the rectangle.
- exTextAlignMask (0x0F), specifies the mask for text's alignment.
- exTextWordBreak (0x10), breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line. If this is not specified, output is on one line.
- exTextSingleLine (0x20), displays text on a single line only. Carriage returns and line feeds do not break the line.
- exTextExpandTabs (0x40), expands tab characters. The default number of characters per tab is eight.
- exPlainText (0x80), treats the text as plain text.
- exTextNoClip (0x0100), draws without clipping.
- exHTMLTextNoColors (0x0200), ignores the
and tags. - exTextCalcRect (0x0400), determines the width and height of the text.
- exHTMLTextNoTags (0x0800), ignores all HTML tags.
- exTextPathEllipsis (0x4000), for displayed text, replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\) characters, exTextPathEllipsis preserves as much as possible of the text after the last backslash.
- exTextEndEllipsis (0x8000), for displayed text, if the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the string goes beyond the limits of the rectangle, it is truncated without ellipses.
- exTextWordEllipsis (0x040000), truncates any word that does not fit in the rectangle and adds ellipses.
The formatText field is mapped to the Element.FormatText property, which means that the following statements are equivalent:
oElement.Options = {formatText: exontrol.DrawTextFormatEnum.exTextAlignCenter | exontrol.DrawTextFormatEnum.exTextWordBreak}where oElement is an object of Element type.
oElement.SetOptions({formatText: exontrol.DrawTextFormatEnum.exTextAlignCenter | exontrol.DrawTextFormatEnum.exTextWordBreak})
oElement.FormatText = exontrol.DrawTextFormatEnum.exTextAlignCenter | exontrol.DrawTextFormatEnum.exTextWordBreak
oElement.SetFormatText(exontrol.DrawTextFormatEnum.exTextAlignCenter | exontrol.DrawTextFormatEnum.exTextWordBreak)
Type:
- object
(static) image :object
The image field is mapped to the Element.Image property, which means that the following statements are equivalent:
oElement.Options = {image: "logo"}
oElement.SetOptions({image: "logo"})
oElement.Image = "logo"
oElement.SetImage("logo")
Type:
- object
Example
null {null}, indicates that the element displays no image
"logo" {string}, specifies that the element displays the "logo" image. The image can be added using the exontrol.HTMLPicture.Add method
image
(static) imageAlign :object
The imageAlign propery can be any of the following:
- {null}, the image is aligned according to the control's imageAlign option (Swimlane.ImageAlign property), so the element's image is aligned according to the control's imageAlign option
- 0, the image is on the left of the node's caption
- 1, the image is on the right of the node's caption
- 2, the image is on the top of the node's caption
- 3, the image is on the bottom of the node's caption
The imageAlign field is mapped to the Element.ImageAlign property, which means that the following statements are equivalent:
oElement.Options = {imageAlign: 2}
oElement.SetOptions({imageAlign: 2})
oElement.ImageAlign = 2
oElement.SetImageAlign(2)
Type:
- object
Example
null {null}, the image is on top of the node's cation, as indicated by the control's imageAlign field
1 {number}, the image is displayed to the left of the node's caption
imageAlign
(static) imageSize :object
The imageSize could be of one of the following types:
- {undefined}, indicates that the control's imageSize option (Swimlane.ImageSize property) is considered, so the element's image is measured according to the control's imageSize option.
- {null}, indicates that the element's image is displayed as it is (full-sized).
- {number}, specifies that the element's image is displayed into a square of giving size (same width and height). If 0 the element displays no image, if negative the element's image is stretched to giving square, else the node's picture is scaled to fit the giving rectangle.
- {number[]}, specifies an array of [aspect-width,aspect-height] type that defines the limits for width or/and height. The aspect-width and aspect-height define the width/height of the node's picture to scale or stretch to.
The imageSize field is mapped to the Element.ImageSize property, which means that the following statements are equivalent:
oElement.Options = {imageSize: 64}
oElement.SetOptions({imageSize: 64})
oElement.ImageSize = 64
oElement.SetImageSize(64)
Type:
- object
Example
null {null}, indicates that the element's image is displayed as it is (full-sized).
0 {number}, no image is displayed
64 {number}, the image is scaled to fit a 64 x 64 rectangle
-64 {number}, the image is strected to a 64 x 64 rectangle
[32,64] {array}, scales the image to the largest ratio-rectangle (32 x 64) that fits the client
[-32,-64] {array}, stretches the image to a 32 x 64 rectangle
imageSize
(static) key :object
The key field is mapped to the Element.Key property, which means that the following statements are equivalent:
oElement.Options = {key: "logo"}
oElement.SetOptions({key: "logo"})
oElement.Key = "logo"
oElement.SetKey("logo")
Type:
- object
Example
"logo" {string}, defines the element with the giving key (logo). You can use the Root.Item("logo") method to request the element giving its key.
key
(static) movable :object
The movable field is mapped to the Element.Movable property, which means that the following statements are equivalent:
oElement.Options = {movable: false}
oElement.SetOptions({movable: false})
oElement.Movable = false
oElement.SetMovable(false)
Type:
- object
- Since:
- 2.2
Example
false {boolean}, the user can not move the element (by drag and drop)
movable
(static) pad :object
The pad field can be of one of the following types:
- {number} a numeric value, to pad horizontal and vertical size with the same value,
- {string|number[]} a "x,y" or [x,y] type to specify the padding on h/v size
The pad field is mapped to the Element.Pad property, which means that the following statements are equivalent:
oElement.Options = {pad: "8,4"}
oElement.SetOptions({pad: "8,4"})
oElement.Pad = "8,4"
oElement.SetPad("8,4")
where oElement is an object of Element type.
Type:
- object
Example
null {null}, indicates that the default padding value of [4,4] is applied
0 {number}, indicates no padding
"8,4" {string}, increases the node's width with 2 * 8-pixels and node's height with 2 * 4-pixels
[8,4] {array}, increases the node's width with 2 * 8-pixels and node's height with 2 * 4-pixels
pad
(static) parent :object
The parent field can be of one of the following types:
- {null}, indicates that the element is a root element, so it has no parent
- {number}, indicates a numeric value that defines the index of the parent's element (0-based)
- {string}, specifies a string expression that defines the identifier/key/plain-caption of the parent's element
- {Element}, specifies the object reference to the parent's element
The parent field is mapped to the Element.Parent property, which means that the following statements are equivalent:
oElement.Options = {parent: 0}
oElement.SetOptions({parent: 0})
oElement.Parent = 0
oElement.SetParent(0)
Type:
- object
Example
0 {number}, indicates that the element with the index 0 is the parent of the current element
"key" {string}, specifies that the parent of the current element is the element with the giving key
parent
(static) position :object
The position field is mapped to the Element.Position property, which means that the following statements are equivalent:
oElement.Options = {position: 0}
oElement.SetOptions({position: 0})
oElement.Position = 0
oElement.SetPosition(0)
Type:
- object
- Since:
- 2.0
Example
0 {number}, indicates the first-child of the parent element, or an element displayed on the background
position
(static) resizable :object
The resizable field is mapped to the Element.Resizable property, which means that the following statements are equivalent:
oElement.Options = {resizable: false}
oElement.SetOptions({resizable: false})
oElement.Resizable = false
oElement.SetResizable(false)
Type:
- object
- Since:
- 2.2
Example
false {boolean}, the user can not resize the element (by drag and drop)
resizable
(static) selectable :object
The selectable field is mapped to the Element.Selectable property, which means that the following statements are equivalent:
oElement.Options = {selectable: false}
oElement.SetOptions({selectable: false})
oElement.Selectable = false
oElement.SetSelectable(false)
Type:
- object
Example
false {boolean}, the user can't select, resize or move the element
true {boolean}, the user can select, resize or move the element
selectable
(static) shape :object
The shape field can be one of the following:
- the shape's name within the exontrol.Shapes.Swimlane or exontrol.Shapes namespace
- a CSS color
- a JSON string-representation of an object of exontrol.Def.Shape type
- an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
The shape field is mapped to the Element.Shape property, which means that the following statements are equivalent:
oElement.Options = {shape: "red"}
oElement.SetOptions({shape: "red"})
oElement.Shape = "red"
oElement.SetShape("red")
Type:
- object
Example
"red" {string}, the element is displayed with a red background color
shape
(static) visible :object
The visible field is mapped to the Element.Visible property, which means that the following statements are equivalent:
oElement.Options = {visible: false}
oElement.SetOptions({visible: false})
oElement.Visible = false
oElement.SetVisible(false)
Type:
- object
Example
false {boolean}, hides the element
true {boolean}, shows the element
visible