new Options()
Every option of the Menu.Options type has associated a property of the control. For instance, the option:
debug {boolean}, indicates whether the control displays debug-informationis associated with the property:
Debug {boolean}, indicates whether the control displays debug-informationwhich means that the following statements are equivalent:
oMenu.Options = {debug: true}where oMenu is an object of Menu type
oMenu.SetOptions({debug: true})
oMenu.Debug = true
oMenu.SetDebug(true)
Members
(static) align :number
The align property can be any of the following values:
- -1 {number}, specifies that the item's caption full-fits the item's background. You can use the <c> or <r> ex-HTML tags to align portions of caption inside the item
- 0 {number}, indicates that the caption is left-aligned
- +1 {number}, specifies that the caption is centered
- +2 {number}, specifies that the caption is right-aligned
The align field is mapped to the Align property, which means that the following statements are equivalent:
oMenu.Options = {align: 1}
oMenu.SetOptions({align: 1})
oMenu.Align = 1
oMenu.SetAlign(1)
Type:
- number
Example
2 {number}, right aligns the item's caption
align
(static) alignClient :boolean
The alignClient field is mapped to the AlignClient property, which means that the following statements are equivalent:
oMenu.Options = {alignClient: true}
oMenu.SetOptions({alignClient: true})
oMenu.AlignClient = true
oMenu.SetAlignClient(true)
Type:
- boolean
Example
false {boolean}, specifies that the item and its sub-items are not vertically aligned (when a popup is opened)
true {boolean}, specifies that the item and its sub-items are vertically aligned (when a popup is opened)
alignClient
(static) alignContextMenu :Menu.AlignContextMenuEnum
The Menu.AlignContextMenuEnum type defines the following flags:
- exLeftAlign (0x00), positions the shortcut menu so that its left side is aligned with the coordinate specified by the x parameter
- exCenterAlign (0x04), centers the shortcut menu horizontally relative to the coordinate specified by the x parameter
- exRightAlign (0x08), positions the shortcut menu so that its right side is aligned with the coordinate specified by the x parameter
- exTopAlign (0x00), positions the shortcut menu so that its top side is aligned with the coordinate specified by the y parameter
- exVCenterAlign (0x10), centers the shortcut menu vertically relative to the coordinate specified by the y parameter
- exBottomAlign (0x20), positions the shortcut menu so that its bottom side is aligned with the coordinate specified by the y parameter
The alignContextMenu property has effect only, if the control is opened as a context-menu, using the Open() method.
The alignContextMenu field is mapped to the AlignContextMenu property, which means that the following statements are equivalent:
oMenu.Options = {alignContextMenu: 0}
oMenu.SetOptions({alignContextMenu: 0})
oMenu.AlignContextMenu = 0
oMenu.SetAlignContextMenu(0)
Type:
Example
0 or Menu.AlignContextMenuEnum.exLeftAlign | Menu.AlignContextMenuEnum.exTopAlign {number}, the context-menu is shown aligned to x and y properties
20 or Menu.AlignContextMenuEnum.exCenterAlign | Menu.AlignContextMenuEnum.exVCenterAlign {number}, centers the context-menu relative to x and y properties
32 or Menu.AlignContextMenuEnum.exLeftAlign | Menu.AlignContextMenuEnum.exBottomAlign {number}, opens the context-menu right to the x and y properties
alignContextMenu
(static) allowToggleRadio :boolean
The allowToggleRadio field is mapped to the AllowToggleRadio property, which means that the following statements are equivalent:
oMenu.Options = {allowToggleRadio: false}
oMenu.SetOptions({allowToggleRadio: false})
oMenu.AllowToggleRadio = false
oMenu.SetAllowToggleRadio(false)
Type:
- boolean
Example
false {boolean}, no radio-item toggles its state (once the user clicks a checked radio-item, it stays checked (state on 1))
true {number}, any radio-item toggles its state (once the user clicks a checked radio-item, it gets unchecked (state on 0))
allowToggleRadio
(static) arrSize :number
The arrSize field is mapped to the ArrSize property, which means that the following statements are equivalent:
oMenu.Options = {arrSize: 6}
oMenu.SetOptions({arrSize: 6})
oMenu.ArrSize = 6
oMenu.SetArrSize(6)
Type:
- number
Example
0 {number}, indicates that no arrow is shown
6 {number}, indicates that the arrow is displayed into a square of 6x6 pixels
arrSize
(static) arrangeItemsAs :Menu.ArrangeItemsEnum
The Menu.ArrangeItemsEnum type supports the following flags:
- exArrangeItemsHorizontal (1), specifies that the items are horizontally arranged from left to right
- exArrangeItemsVertical (2), specifies that the items are vertically arranged from top to bottom
- exArrangeItemsHideTopArrow (0x10), indicates that the arrow for any top-item is not visible (not valid for float-menu)
- exArrangeItemsPopupAlign (0x20), specifies that the item's float/popup-menu should be displayed to prevent overlapping other items
- exArrangeItemsWrap (0x100), wraps items on a new row/column (not valid for float-menu)
- exArrangeItemsScroll (0x200), specifies that the control's scroll bar is displayed if required
- exArrangeItemsAlignCenter (0x400), centers the items on each row/column
- exArrangeItemsAlignReverse (0x800), reverses the alignment of the items
The arrangeItemsAs field is mapped to the ArrangeItemsAs property, which means that the following statements are equivalent:
oMenu.Options = {arrangeItemsAs: 1}
oMenu.SetOptions({arrangeItemsAs: 1})
oMenu.ArrangeItemsAs = 1
oMenu.SetArrangeItemsAs(1)
Type:
Example
561 or Menu.ArrangeItemsEnum.exArrangeItemsHideTopArrow | Menu.ArrangeItemsEnum.exArrangeItemsHorizontal | Menu.ArrangeItemsEnum.exArrangeItemsScroll | Menu.ArrangeItemsEnum.exArrangeItemsPopupAlign {number}, arranges horizontally all items of top-level menu
arrangeItemsAs
(static) btnArrSize :number
The btnArrSize field is mapped to the BtnArrSize property, which means that the following statements are equivalent:
oMenu.Options = {btnArrSize: 6}
oMenu.SetOptions({btnArrSize: 6})
oMenu.BtnArrSize = 6
oMenu.SetBtnArrSize(6)
Type:
- number
Example
0 {number}, indicates that no arrow is shown for an item of button type ([button])
6 {number}, indicates that the arrow is displayed into a square of 6x6 pixels
btnArrSize
(static) btnPad :number|Array.<number>|string
The btnPad field is mapped to the BtnPad property, which means that the following statements are equivalent:
oMenu.Options = {btnPad: 4}
oMenu.SetOptions({btnPad: 4})
oMenu.BtnPad = 4
oMenu.SetBtnPad(4)
Type:
- number | Array.<number> | string
Example
4 {number}, increases the object's client with 2 * 4-pixels, which includes width and height
"8,4" {string}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
[8,4] {array}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
btnPad
(static) close :number
The value of close property can be any of the following:
- if positive, indicates the time in ms the sub-menu is closed once the cursor hovers the top-level item.
- if 0, indicates that the sub-menu is closed as soon as the cursor hovers a top-level item
- if negative, it has no effect
The close field is mapped to the Close property, which means that the following statements are equivalent:
oMenu.Options = {close: 0}
oMenu.SetOptions({close: 0})
oMenu.Close = 0
oMenu.SetClose(0)
Type:
- number
Example
0 {number}, indicates that the sub-menu is closed as soon as the cursor hovers a top-level item.
350 {number}, the sub-menu is closed once 350 ms ellapsed after the cursor hovers a top-level item.
close
(static) closeOnClick :Menu.CloseOnClickEnum
The Menu.CloseOnClickEnum type defines the following flags:
- exCloseOnDefault (0), indicates that the float-menu is closed once the user clicks an enabled item with no check, radio or button associated
- exCloseOnDisabled (1), specifies that the float-menu is closed once the user clicks a disabled item
- exCloseOnSeparator (2), specifies that the float-menu is closed once the user clicks a separator item
- exCloseOnButton (4), specifies that the float-menu is closed once the user clicks an item of button-type
- exCloseOnCheck (8), specifies that the float-menu is closed once the user clicks an item of check-type
- exCloseOnRadio (16), specifies that the float-menu is closed once the user clicks an item of radio-type
- exCloseOnState (24), specifies that the float-menu is closed once the user clicks an item of check or radio-type
- exCloseOnAny (-1), specifies that the float-menu is closed once the user clicks any type of item anywhere
The closeOnClick field is mapped to the CloseOnClick property, which means that the following statements are equivalent:
oMenu.Options = {closeOnClick: 0}
oMenu.SetOptions({closeOnClick: 0})
oMenu.CloseOnClick = 0
oMenu.SetCloseOnClick(0)
Type:
Example
0 or Menu.CloseOnClickEnum.exCloseOnDefault {number}, specifies that the float-menu is closed once the user clicks an enabled item with no check, radio or button associated
-1 or Menu.CloseOnClickEnum.exCloseOnAny {number}, specifies that the float-menu is closed once the user clicks any type of item anywhere
closeOnClick
(static) criAlign :boolean
The criAlign field is mapped to the CriAlign property, which means that the following statements are equivalent:
oMenu.Options = {criAlign: true}
oMenu.SetOptions({criAlign: true})
oMenu.CriAlign = true
oMenu.SetCriAlign(true)
Type:
- boolean
Example
false {boolean}, check-box/radio-button or the item's image is not vertically aligned
true {boolean}, check-box/radio-button or the item's image is vertically aligned
criAlign
(static) criFlat :Menu.FlatEnum
The Menu.FlatEnum type supports the following values:
- exNormal (0), indicates that the menu's flat bar is not shown
- exShowFlat (1), indicates that the menu's flat bar is visible only if the menu contains items with check, radio or image
- exAlwaysFlat (2), indicates that the menu's flat bar is always visible
The criFlat field is mapped to the CriFlat property, which means that the following statements are equivalent:
oMenu.Options = {criFlat: 1}
oMenu.SetOptions({criFlat: 1})
oMenu.CriFlat = 1
oMenu.SetCriFlat(1)
Type:
Example
2 or Menu.FlatEnum.exAlwaysFlat {number}, defines a flat-menu
criFlat
(static) criPad :number|Array.<number>|string
The criPad field is mapped to the CriPad property, which means that the following statements are equivalent:
oMenu.Options = {criPad: 4}
oMenu.SetOptions({criPad: 4})
oMenu.CriPad = 4
oMenu.SetCriPad(4)
Type:
- number | Array.<number> | string
Example
4 {number}, increases the object's client with 2 * 4-pixels, which includes width and height
"8,4" {string}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
[8,4] {array}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
criPad
(static) criSize :number
The criSize field is mapped to the CriSize property, which means that the following statements are equivalent:
oMenu.Options = {criSize: 16}
oMenu.SetOptions({criSize: 16})
oMenu.CriSize = 16
oMenu.SetCriSize(16)
Type:
- number
Example
16 {number}, indicates that any check-box, radio or image uses a 16x16 rectangle to display it within the item
criSize
(static) cursors :string
The format of the property is:
"cursor(part),cursor(part),..."where:
- "cursor", defines the CSS mouse cursor to display while cursor hovers the part
- "part", defines the name of the part the cursor is applied on (as defined below)
The "part" can be any of the following:
Cursor Description "alias" indicates a shortcut or alias will be created "all-scroll" indicates scrolling in any direction "auto" lets the browser decide the cursor based on context "cell" indicates a table cell "col-resize" indicates a column can be resized horizontally "context-menu" indicates a context menu is available "copy" indicates something will be copied "crosshair" a precise crosshair cursor "default" the default arrow cursor "e-resize" resize east (right edge) "ew-resize" resize horizontally "grab" indicates an item can be grabbed "grabbing" indicates an item is being grabbed "help" indicates help information is available "move" indicates something can be moved "n-resize" resize north (top edge) "ne-resize" resize northeast (top-right corner) "nesw-resize" resize along the northeast–southwest axis "no-drop" indicates dropping is not permitted "not-allowed" indicates the action is not allowed "ns-resize" resize vertically "nw-resize" resize northwest (top-left corner) "nwse-resize" resize along the northwest–southeast axis "pointer" the pointer cursor (a hand with a pointing finger) "progress" indicates background processing "row-resize" indicates a row can be resized vertically "s-resize" resize south (bottom edge) "se-resize" resize southeast (bottom-right corner) "sw-resize" resize southwest (bottom-left corner) "text" the text selection cursor (I-beam) "url(...)" uses a custom cursor image (with optional fallback) "vertical-text" the vertical text selection cursor "w-resize" resize west (left edge) "wait" indicates the program is busy "zoom-in" indicates zooming in "zoom-out" indicates zooming out
Part Description "anchor" (hyperlink) defines the mouse-cursor when the mouse pointer hovers the anchor (the <a> ex-HTML part marks an anchor or hyperlink element) (@since 2.2) "arr" (arrow) defines the mouse-cursor to show when the mouse pointer hovers the item's arrow (while the item contains un-grouped sub-items) "barr" (bottom-arrow) defines the mouse-cursor to show when the mouse pointer hovers the button's arrow (to bottom) "btn" (button) defines the mouse-cursor to show when the mouse pointer hovers the buttons "cap" (caption) defines the mouse-cursor to show when the mouse pointer hovers the item's caption "chk" (check) defines the mouse-cursor to show when the mouse pointer hovers the item's check-box "flat" (flat) defines the mouse-cursor to show when the mouse pointer hovers menu's flat bar (usually shown in the left side of the menu) "img" (image) defines the mouse-cursor to show when the mouse pointer hovers the item's image "item" (item) defines the mouse-cursor to show when the mouse pointer hovers the item's background. It covers all parts of the item as check, image, caption/button, popup arrow and sub-items "menu" (menu) defines the mouse-cursor to show when the mouse pointer hovers the entire menu "rad" (radio) defines the mouse-cursor to show when the mouse pointer hovers the item's radio-button "rarr" (right-arrow) defines the mouse-cursor to show when the mouse pointer hovers the button's arrow (to right) "sep" (separator) defines the mouse-cursor to show when the mouse pointer hovers the separator-items "sub" (sub-items) defines the mouse-cursor to show when the mouse pointer hovers the sub-items of the item (while the item is grouped)
The cursors property is mapped to the Cursors property, which means that the following statements are equivalent:
oMenu.Options = {cursors: "pointer(btn)"}
oMenu.SetOptions({cursors: "pointer(btn)"})
oMenu.Cursors = "pointer(btn)"
oMenu.SetCursors("pointer(btn)")
Type:
- string
Example
"" {string}, no mouse cursor support
"pointer(chk,rad,btn)" {string}, indicates that the "pointer" mouse cursor is shown once the cursor hovers the "chk", "rad" or "btn" parts of the control
cursors
(static) debug :boolean
The debug field is mapped to the Debug property, which means that the following statements are equivalent:
oMenu.Options = {debug: true}
oMenu.SetOptions({debug: true})
oMenu.Debug = true
oMenu.SetDebug(true)
Type:
- boolean
Example
false {boolean}, no debug-information is displayed
true {boolean}, debug-information is displayed for each item (usually the item's identifier)
debug
(static) items :string
The format of the items'string representation is (everything between () refers to children, and everything between [] refers to flags):
"item1[flag=value]...[flag=value](sub-item1[flag=value]...[flag=value],...,sub-itemn[flag=value]...[flag=value]),...,itemn[flag=value]...[flag=value](sub-item1[flag=value]...[flag=value],...,sub-itemn[flag=value]...[flag=value])"or shortly:
item[flag=value][...](sub-item[flag=value][...], ...), ...
The string-representation supports the following flags:
Flag Description Sample [align] Horizontally aligns the caption. Align could be -1 (full-fits the item), 0 (left), 1 (center), or 2 (right). "[align=2]" [arrow] Indicates whether the item's popup-arrow is shown(1) or hidden(0). "[arrow=0]", "[arrow=1]" [button] Associates a button with the item. The option may be a combination of Menu.ShowAsButtonEnum flags. The btnPad field defines the button's padding (space between the button border and the item content) The btnArrSize field specifies the size (width and height) to show the button's arrow. "[button]" or "[button=down]" [captionHeight] / [ch] Specifies the height of the item's caption. A negative value removes the limitation. "[ch=128]" [captionWidth] / [cw] Specifies the width of the item's caption. A negative value removes the limitation. "[cw=128]" [close] Specifies whether the float-menu is closed once the user clicks the item. The option could be a value of Menu.CloseOnClickEnum type. "[close=any]" or "[close=-1]" [chk] Indicates that the item has a check-box associated. If [typ] is present, [chk] indicates the state of the item, and [rad] is ignored. "[chk]", "[chk=0]", "[chk=1]" [cursors] Defines the mouse cursor for the item only. "[cursors=pointer(item)]" [dis] Disables the item and all its descendents. "[dis]" [grp] Defines the radio group. Use when defining multiple groups of radio buttons. "[grp=sample]" [height] Specifies the height of the item. "[height=64]" [hid] Hides or shows the item. "[hid]" [id] Specifies the item's identifier. "[id=10]" [img] Indicates the item's image. The image must be previously added using exontrol.HTMLPicture.Add. "[img=logo]" [itemsPad] Specifies the items' padding (space between the menu border and the item content). "[itemsPad=2]", "[itemsPad=2,2]" [pad] Specifies the item's padding (space between the menu border and the item content). "[pad=2]", "[pad=2,2]" [popupalign] / [pa] Aligns the sub-menu/popup/float relative to the parent item. The option may be a combination of Menu.ShowPopupAlignEnum flags. "[pa=down]" or "[pa=1]" [sep] Specifies a separator item. The sepSize field specifies the size of a separator item. "[sep]" [show] Specifies how an item with check-box/radio-button is displayed. The option may be any value of Menu.ShowCheckedAsSelectedEnum type. "[show=check]" or "[show=-1]" [showdis] Displays the item as disabled while still enabled. "[showdis]" [spchk] Indicates whether sub-items are shown when the item is checked. "[spchk]" [tab] Indicates the identifier of the sub-items of the current item. "[tab=page]", "[tab=1]" [typ] Specifies the type of the item: 0 (normal), 1 (check-box), or 2 (radio button). If [typ] is present, [chk] indicates the state and [rad] is ignored. This option may be any value of Menu.DisplayTypeEnum type. "[typ=check]" or "[typ=1]" [width] Specifies the width of the item. "[width=64]" [group] Specifies how the sub-items are grouped. The option may be a combination of Menu.GroupPopupEnum flags. "[group=vertical]" or "[group=0x100]" [rad] Indicates that the item has a radio-button associated. If [typ] is present, [chk] indicates the state and [rad] is ignored. "[rad]", "[rad=0]", "[rad=1]" [shapes] Specifies shapes to apply on the item only. "[shapes=dfitem(item),dfcap(cap)]"
Type:
- string
Example
"" {string}, clears the items collection
"Popup(A,B,C)" {string}, adds a popup-item with three sub-items A, B and C
"Popup[group](A,B,C)" {string}, adds an item with three sub-items A, B and C, and all items are visible and displayed as an horizontally group
"Popup[group][chk][spchk](A,B,C)" {string}, adds an item with three sub-items A, B and C, but A, B and C sub-items are visible and displayed only if the popup is checked
items
(static) itemsPad :number|Array.<number>|string
The itemsPad field is mapped to the ItemsPad property, which means that the following statements are equivalent:
oMenu.Options = {itemsPad: 4}
oMenu.SetOptions({itemsPad: 4})
oMenu.ItemsPad = 4
oMenu.SetItemsPad(4)
Type:
- number | Array.<number> | string
Example
4 {number}, increases the object's client with 2 * 4-pixels, which includes width and height
"8,4" {string}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
[8,4] {array}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
itemsPad
(static) locked :boolean
The locked field is mapped to the Locked property, which means that the following statements are equivalent:
oMenu.Options = {locked: true}
oMenu.SetOptions({locked: true})
oMenu.Locked = true
oMenu.SetLocked(true)
Type:
- boolean
Example
false {boolean}, unlocks the control (can select any item)
true {boolean}, locks the control (can't select any item)
locked
(static) open :number
The value of open property can be any of the following:
- if positive, indicates the time in ms the top-level item opens its sub-menu once the cursor hovers it.
- if 0, indicates that the top-level item opens its sub-menu as soon as cursor hovers it
- if negative, indicates that the item requires click to to open its sub-menu
The open field is mapped to the Open property, which means that the following statements are equivalent:
oMenu.Options = {open: 0}
oMenu.SetOptions({open: 0})
oMenu.Open = 0
oMenu.SetOpen(0)
Type:
- number
Example
0 {number}, indicates that the top-level item opens its sub-menu as soon as cursor hovers it.
-1 {number}, indicates that the top-level item opens its sub-menu as soon as user clicks it.
open
(static) outClose :number
The value of outClose property can be any of the following:
- if positive, specifies the time in ms the control closes all its float-menu as soon as the cursor hovers outside portion of the menu
- if 0, indicates that the menu's floats are closed as soon as the cursor hovers outside portion of it
- if negative, it has no effect
The outClose field is mapped to the OutClose property, which means that the following statements are equivalent:
oMenu.Options = {outClose: 0}
oMenu.SetOptions({outClose: 0})
oMenu.OutClose = 0
oMenu.SetOutClose(0)
Type:
- number
Example
0 {number}, indicates that the menu's floats are closed as soon as the cursor hovers outside portion of it
350 {number}, the control's float-menus are closed once 350 ms ellapsed after the cursor hovers outside portion of the menu
outClose
(static) pad :number|Array.<number>|string
The pad field is mapped to the Pad property, which means that the following statements are equivalent:
oMenu.Options = {pad: 4}
oMenu.SetOptions({pad: 4})
oMenu.Pad = 4
oMenu.SetPad(4)
Type:
- number | Array.<number> | string
Example
4 {number}, increases the object's client with 2 * 4-pixels, which includes width and height
"8,4" {string}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
[8,4] {array}, increases the object's width with 2 * 8-pixels and object's height with 2 * 4-pixels
pad
(static) popupRatio :number
The popupRatio field is mapped to the PopupRatio property, which means that the following statements are equivalent:
oMenu.Options = {popupRatio: 0.5}
oMenu.SetOptions({popupRatio: 0.5})
oMenu.PopupRatio = 0.5
oMenu.SetPopupRatio(0.5)
Type:
- number
Example
0 {number}, indicates that the size of the float-menu is not influenced by the document's view size, so it will be displayed entirely as it is
0.5 {number}, indicates that the width / height of the float-menu can not exceed half of the width / height of the document's view page (control's scroll is automatically added if exArrangeItemsScroll flag is specified)
popupRatio
(static) readOnly :boolean
The readOnly field is mapped to the ReadOnly property, which means that the following statements are equivalent:
oMenu.Options = {readOnly: true}
oMenu.SetOptions({readOnly: true})
oMenu.ReadOnly = true
oMenu.SetReadOnly(true)
Type:
- boolean
Example
false {boolean}, the user can select or check any item
true {boolean}, the user can not select or check the items
readOnly
(static) scrollClip :boolean
The scrollClip field is mapped to the ScrollClip property, which means that the following statements are equivalent:
oMenu.Options = {scrollClip: true}
oMenu.SetOptions({scrollClip: true})
oMenu.ScrollClip = true
oMenu.SetScrollClip(true)
Type:
- boolean
Example
false {boolean}, the scroll is not clipped, so it is shown over the menu
true {boolean}, the scroll and items portions of the menu are separatly
scrollClip
(static) scrollOpt :exontrol.ScrollBar.Options
The scrollOpt field is mapped to the ScrollOpt property, which means that the following statements are equivalent:
oMenu.Options = {scrollOpt: {...}}
oMenu.SetOptions({scrollOpt: {...}})
oMenu.ScrollOpt = {...}
oMenu.SetScrollOpt({...})
Type:
- exontrol.ScrollBar.Options
Example
The following example shows how to set the scrollOpt field to customize the scroll bar's appearance and behavior:
scrollOpt:
{
cursors: "pointer(t,b)",
visibleParts: "t,b",
horizontalShapes: "button(t)",
verticalShapes: "button(t)"
}
scrollOpt
(static) scrollSize :number
The scrollSize field is mapped to the ScrollSize property, which means that the following statements are equivalent:
oMenu.Options = {scrollSize: 4}
oMenu.SetOptions({scrollSize: 4})
oMenu.ScrollSize = 4
oMenu.SetScrollSize(4)
Type:
- number
Example
0 {number}, hides the menu's scroll-bar but scrolling it is still posible by drag. Click an item and drag outside the margins so the menu gets scrolled
4 {number}, defines a 4-pixels wide scroll bar
scrollSize
(static) sepSize :number
The sepSize field is mapped to the SepSize property, which means that the following statements are equivalent:
oMenu.Options = {sepSize: 4}
oMenu.SetOptions({sepSize: 4})
oMenu.SepSize = 4
oMenu.SetSepSize(4)
Type:
- number
Example
0 {number}, hides all separator items ([sep])
4 {number}, specifies the separator items of 4-pixels size
sepSize
(static) shapes :string
The format of the property is:
"shape(part),shape(part),..."where:
- "shape", defines the shape to apply on the UI part as one of the following:
◦ any of 140 color names any browser supports (such as red, blue, green, ...)
◦ hexadecimal colors, is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF (such as #0000ff which defines a blue background)
◦ hexadecimal colors with transparency, is specified with: #RRGGBBAA, where AA (alpha) value must be between 00 and FF (such as #0000ff80 which defines a semi-transparent blue background)
◦ RGB colors, is specified with the RGB(red, green, blue) function. Each parameter (red, green, and blue) defines the intensity of the color and can be an integer between 0 and 255( such as rgb(0,0,255) that defines a blue background)
◦ RGBA colors, are an extension of RGB color values with an alpha channel as RGBA(red, green, blue, alpha) function, where the alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque) ( such as rgba(0,0,255,0.5) which defines a semi-transparent blue background)
◦ HSL colors, is specified with the HSL(hue, saturation, lightness) function, where hue is a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue. saturation is a percentage value; 0% means a shade of gray and 100% is the full color. lightness is also a percentage; 0% is black, 100% is white. HSL stands for hue, saturation, and lightness - and represents a cylindrical-coordinate representation of colors (such as hsl(240, 100%, 50%) that defines a blue background)
◦ HSLA colors, are an extension of HSL color values with an alpha channel - which specifies the opacity of the object as HSLA(hue, saturation, lightness, alpha) function, where alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque) (such as hsla(240, 100%, 50%,0.5) that defines a semi-transparent blue background)
◦ a JSON representation of the shape object to apply (while it starts with { character, such as '{"normal": {"primitive": "RoundRect","fillColor":"black","tfi": {"fgColor": "white"}}}')
◦ specifies the name of the field within the exontrol.Shapes.Menu object (while it starts with a lowercase letter, such as dfitem which refers to exontrol.Shapes.Menu.dfitem shape)
◦ specifies the name of the field within the exontrol.Shapes object (while it starts with an uppercase letter, such as Button which refers to exontrol.Shapes.Button shape)
- "part", defines the name of the part the shape is applied on (as defined bellow)
Part Description "arr" (arrow) defines the visual appearance to display item's arrow (while the item contains un-grouped sub-items) "barr" (bottom-arrow) defines the visual appearance to display button's arrow (to bottom) "btn" (button) defines the visual appearance to display the buttons "cap" (caption) defines the visual appearance for the item's caption "chk" (check) defines the visual appearance to display the item's check-box "flat" (flat) defines the visual appearance for menu's flat bar (usually shown in the left side of the menu) "img" (image) defines the visual appearance to display the item's image "item" (item) defines the visual appearance for the item's background. It covers all parts of the item as check, image, caption/button, popup arrow and sub-items "menu" (menu) defines the visual appearance for the entire menu "rad" (radio) defines the visual appearance to display the item's radio-button "rarr" (right-arrow) defines the visual appearance to display button's arrow (to right) "sep" (separator) defines the visual appearance to display separator-items "sub" (sub-items) defines the visual appearance to display sub-items of the item (while the item is grouped)
The shapes property is mapped to the Shapes property, which means that the following statements are equivalent:
oMenu.Options = {shapes: "red(item)"}
oMenu.SetOptions({shapes: "red(item)"})
oMenu.Shapes = "red(item)"
oMenu.SetShapes("red(item)")
Type:
- string
Example
null {null}, specifies the default visual appearance
"" {string}, no shape (no visual appearance is applied to any part of the control)
"red(item)", "#FF0000(item)", "rgb(255,0,0)(item)", "rgba(255,0,0,1)(item)" {string}, shows all-items in red
'{"hover":{"frameColor":"black","pad":-0.5}}(item)' {string}, draws a black-frame arround the item being hovered
"xxx(d),yyy(d,m),zzz(y)" {string}, specifies that the exontrol.Shapes.Menu.xxx combined with exontrol.Shapes.Menu.yyy object defines the visual appearance of "d" part of the control, exontrol.Shapes.Menu.yyy object defines the visual appearance of "m" part of the control and exontrol.Shapes.Menu.zzz object defines the visual appearance of "y" part of the control
shapes
(static) show :Menu.ShowCheckedAsSelectedEnum
The Menu.ShowCheckedAsSelectedEnum type defines the following values:
- exDefault (0), indicates that no highlight is applied to the item's check/radio
- exCheckHighlight (-1), highlights the checked item
- exItemHighlight (1), highlights the checked item, but hides the item's check/radio button
The show field is mapped to the Show property, which means that the following statements are equivalent:
oMenu.Options = {show: 1}
oMenu.SetOptions({show: 1})
oMenu.Show = 1
oMenu.SetShow(1)
Type:
Example
1 (Menu.ShowCheckedAsSelectedEnum.exItemHighlight) {number}, specifies that any checked-item gets highlighted, by not showing the item's check/radio button
show
(static) smoothSel :number
The smoothSel field is mapped to the SmoothSel property, which means that the following statements are equivalent:
oMenu.Options = {smoothSel: 125}
oMenu.SetOptions({smoothSel: 125})
oMenu.SmoothSel = 125
oMenu.SetSmoothSel(125)
Type:
- number
Example
0 {number}, no smooth changes once the user selects a new item
125 {number}, specifies that a smooth-transition is performed from a layout to another for 125 ms.
smoothSel
(static) subArrangeItemsAs :Menu.ArrangeItemsEnum
The Menu.ArrangeItemsEnum type supports the following flags:
- exArrangeItemsHorizontal (1), specifies that the items are horizontally arranged from left to right
- exArrangeItemsVertical (2), specifies that the items are vertically arranged from top to bottom
- exArrangeItemsHideTopArrow (0x10), indicates that the arrow for any top-item is not visible (not valid for float-menu)
- exArrangeItemsPopupAlign (0x20), specifies that the item's float/popup-menu should be displayed to prevent overlapping other items
- exArrangeItemsWrap (0x100), wraps items on a new row/column (not valid for float-menu)
- exArrangeItemsScroll (0x200), specifies that the control's scroll bar is displayed if required
- exArrangeItemsAlignCenter (0x400), centers the items on each row/column
- exArrangeItemsAlignReverse (0x800), reverses the alignment of the items
The subArrangeItemsAs field is mapped to the SubArrangeItemsAs property, which means that the following statements are equivalent:
oMenu.Options = {subArrangeItemsAs: 1}
oMenu.SetOptions({subArrangeItemsAs: 1})
oMenu.SubArrangeItemsAs = 1
oMenu.SetSubArrangeItemsAs(1)
Type:
Example
257 or Menu.ArrangeItemsEnum.exArrangeItemsHorizontal | Menu.ArrangeItemsEnum.exArrangeItemsWrap {number}, wraps items within the float-menu
546 or Menu.ArrangeItemsEnum.exArrangeItemsVertical | Menu.ArrangeItemsEnum.exArrangeItemsScroll | Menu.ArrangeItemsEnum.exArrangeItemsPopupAlign {number}, arranges vertically the items within the float-menu
subArrangeItemsAs
(static) subClose :number
The value of subClose field can be any of the following:
- if positive, indicates the time in ms the sub-menu is closed once the cursor hovers the second-level item
- if 0, indicates that the sub-menu is closed as soon as the cursor hovers a second-level item
- if negative, it has no effect
The subClose field is mapped to the SubClose property, which means that the following statements are equivalent:
oMenu.Options = {subClose: 0}
oMenu.SetOptions({subClose: 0})
oMenu.SubClose = 0
oMenu.SetSubClose(0)
Type:
- number
Example
0 {number}, indicates that the sub-menu is closed as soon as the cursor hovers a second-level item
350 {number}, the sub-menu is closed once 350 ms ellapsed after the cursor hovers the second-level item
subClose
(static) subOpen :number
The value of subOpen field can be any of the following:
- if positive, indicates the time in ms the item opens its sub-menu once the cursor hovers it.
- if 0, indicates that the item opens its sub-menu as soon as the cursor hovers it
- if negative, it has no effect so the item requires click in order to open its sub-menu
The subOpen field is mapped to the SubOpen property, which means that the following statements are equivalent:
oMenu.Options = {subOpen: 0}
oMenu.SetOptions({subOpen: 0})
oMenu.SubOpen = 0
oMenu.SetSubOpen(0)
Type:
- number
Example
0 {number}, indicates that the item opens its sub-menu as soon as the cursor hovers it
-1 {number}, indicates that the item's sub-menu is opened once the user clicks it
subOpen
(static) tfi :string|object
The tfi field as string supports any of the following keywords (each keyword can be specified using first letters only such as "b" for "bold) separated by space characters:
- bold, displays the text in bold (equivalent of <b> tag)
- italic, displays the text in italics (equivalent of <i> tag)
- underline, underlines the text (equivalent of <u> tag)
- strikeout, specifies whether the text is strike-through (equivalent of <s> tag)
- <fontName name>, specifies the font's family (equivalent of <font name> tag)
- <fontSize size>, specifies the size of the font (equivalent of <font ;size> tag)
- <fgColor CSSColor>, specifies the text's foreground color (equivalent of <fgcolor> tag)
- <bgColor CSSColor>, specifies the text's background color (equivalent of <bgcolor> tag)
- <shaColor CSSColor;width;offset>, defines the text's shadow (equivalent of <sha color;width;offset> tag)
- <outColor CSSColor>, shows the text with outlined characters (CSScolor) (equivalent of <out color> tag)
- <graColor CSSColor;mode;blend>, defines a gradient text (equivalent of <gra color;mode;blend> tag)
Any other word within the tfi field that's not recognized as a keyword is interpreted as:
- name of the font (not a number), specifies the font's family (equivalent of <font name> tag)
- size of the font (number), specifies the size of the font (equivalent of <font ;size> tag)
The tfi field as object supports any of the following fields:
- bold {boolean}, displays the text in bold (equivalent of <b> tag)
- italic {boolean}, displays the text in italics (equivalent of <i> tag)
- underline {boolean}, underlines the text (equivalent of <u> tag)
- strikeout {boolean}, specifies whether the text is strike-through (equivalent of <s> tag)
- fontName {string}, specifies the font's family (equivalent of <font name> tag)
- fontSize {number}, specifies the size of the font (equivalent of <font ;size> tag)
- fgColor {string}, specifies the text's foreground color (CSScolor) (equivalent of <fgcolor> tag)
- bgColor {string}, specifies the text's background color (CSScolor) (equivalent of <bgcolor> tag)
- shaColor {object}, specifies an object of {color, width, offset} type that defines the text's shadow (equivalent of <sha color;width;offset> tag), where:
- color {string}, defines the color of the text's shadow (CSScolor)
- width {number}, defines the size of the text's shadow
- offset {number}, defines the offset to show the text's shadow relative to the text
- outColor {string}, shows the text with outlined characters (CSScolor) (equivalent of <out color> tag)
- graColor {object}, specifies an object of {color, mode, blend} type that defines a gradient text (equivalent of <gra color;mode;blend> tag), where:
- color {string}, defines the gradient-color (CSScolor)
- mode {number}, defines the gradient direction as 0 (left-right), 1 (default, top-bottom), 2 (left-center-right), and 3 (top-center-bottom)
- blend {number}, defines the gradient blend as a value between 0 and 1
CSSColor or CSS legal color values can be specified by the following methods:
- Hexadecimal colors, is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF. For example, #0000ff value is rendered as blue, because the blue component is set to its highest value (ff) and the others are set to 00.
- Hexadecimal colors with transparency, is specified with: #RRGGBBAA, where AA (alpha) value must be between 00 and FF. For example, #0000ff80 defines a semi-transparent blue.
- RGB colors, is specified with the RGB(red, green, blue) function. Each parameter (red, green, and blue) defines the intensity of the color and can be an integer between 0 and 255. For example, rgb(0,0,255) defines the blue color.
- RGBA colors, are an extension of RGB color values with an alpha channel as RGBA(red, green, blue, alpha) function, where the alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque). For example, rgba(0,0,255,0.5) defines a semi-transparent blue.
- HSL colors, is specified with the HSL(hue, saturation, lightness) function, where hue is a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue. saturation is a percentage value; 0% means a shade of gray and 100% is the full color. lightness is also a percentage; 0% is black, 100% is white. HSL stands for hue, saturation, and lightness - and represents a cylindrical-coordinate representation of colors. For example, hsl(240, 100%, 50%) defines the blue color.
- HSLA colors, are an extension of HSL color values with an alpha channel - which specifies the opacity of the object as HSLA(hue, saturation, lightness, alpha) function, where alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque). For example, hsla(240, 100%, 50%,0.5) defines a semi-transparent blue.
- Predefined/Cross-browser color names, 140 color names are predefined in the HTML and CSS color specification. For example, blue defines the blue color.
The tfi field is mapped to the Tfi property, which means that the following statements are equivalent:
oMenu.Options = {tfi: "b monospace 16 <fg blue>"}
oMenu.SetOptions({tfi: "b monospace 16 <fg blue>"})
oMenu.Tfi = "b monospace 16 <fg blue>"
oMenu.SetTfi("b monospace 16 <fg blue>")
Type:
- string | object
Example
null {null}, the tfi field is ignored
"bold monospace 16 <fg blue>" {string}, defines Monospace font of 16px height, bold and blue
{bold: true, fontName: "monospace", fontSize: 16, fgColor: "blue"} {object}, defines Monospace font of 16px height, bold and blue
tfi
(static) wheelChange :number
- Setting wheelChange to 0 disables mouse wheel actions, preventing the control from changing when the wheel is scrolled
- Setting wheelChange to a positive number, such as 5, increases the control's value by that amount each time the wheel is rotated, enabling faster adjustments
By modifying this value, you can fine-tune the control's responsiveness, making it easier for users to perform precise changes or larger adjustments as needed.
The wheelChange field is mapped to the WheelChange property, which means that the following statements are equivalent:
oMenu.Options = {wheelChange: 5}
oMenu.SetOptions({wheelChange: 5})
oMenu.WheelChange = 5
oMenu.SetWheelChange(5)
Type:
- number
Example
0 {number}, locks any action the mouse's wheel performs
1 {number}, indicates that the wheelChange property is applied for 1-time when user rotates the mouse wheel. Changes the wheelChange property to provide a different step to scroll once the user rotates the mouse wheel
wheelChange
(static) x :number
The x field is mapped to the X property, which means that the following statements are equivalent:
oMenu.Options = {x: 0}
oMenu.SetOptions({x: 0})
oMenu.X = 0
oMenu.SetX(0)
Type:
- number
Example
event.pageX {number}, The pageX read-only property of the MouseEvent(event) interface returns the X (horizontal) coordinate (in pixels) at which the mouse was clicked, relative to the left edge of the entire document.
x
(static) y :number
The y field is mapped to the Y property, which means that the following statements are equivalent:
oMenu.Options = {y: 0}
oMenu.SetOptions({y: 0})
oMenu.Y = 0
oMenu.SetY(0)
Type:
- number
Example
event.pageY {number}, The pageY read-only property of the MouseEvent(event) interface returns the Y (vertical) coordinate in pixels of the event relative to the whole document.
y