Type | Description | |||
String | A string expression that indicates the items to be shown on the control's context menu. |
The control's context menu appears when the user right-clicks on it. You can customize this menu using the ContextMenuItems property, which defines the items to be displayed. To enable the context menu, set the AllowContextMenu property to True. When the user selects a custom (unknown) item from the menu, the ExecuteContextMenu event is triggered - this allows you to handle actions for your own menu entries.
By default the ContextMenuItems property is:
Command[id=57625][captionwidth=50][group=19](Undo[id=57643][align=1][button=-1][captionwidth=44],Redo[id=57644][align=1][button=-1]),Edit[id=57624][captionwidth=50][group=19](Cut[id=57635][align=1][button=-1][captionwidth=44],Copy[id=57634][align=1][button=-1],Paste[id=57637][align=1][button=-1],Delete[id=57632][align=1][button=-1],Select All[id=57642][align=1][button=-1]),<font ;6>format[sep][id=57623][height=13],Type[id=57622][show=1][captionwidth=28][group=3]([group=0x33](<font ;18><b>B[id=57648][typ=1][align=1][show=1],<font ;18><i>I[id=57649][typ=1][align=1][show=1],<font ;18><u>U[id=57650][typ=1][align=1][show=1],<font ;18><s>S[id=57651][typ=1][align=1][show=1]),[sep][id=57621],<font ;18><a>A</a>[id=57760][typ=1][align=1][spchk=-1][show=1](ID[id=57761][edittype=1][editwidth=-172],Options[id=57762][edittype=1][editwidth=-72]),<font ;18><fgcolor 0><gra FFFFFF;1;1>G</gra>[id=57715][typ=1][align=1][spchk=-1][show=1](Color[id=57717][edittype=518][border=0][editwidth=-72],Mode[id=57724][group=49](H[id=57725][typ=2][align=1][chk=1][show=1][grp=2],V[id=57726][typ=2][align=1][show=1][grp=2],FD[id=57727][typ=2][align=1][show=1][grp=2],BD[id=57728][typ=2][align=1][show=1][grp=2]),Blend Triangular Shape[id=57729][typ=1][show=-1]),<font ;18><out><fgcolor FFFFFF>O</out>[id=57730][typ=1][align=1][spchk=-1][show=1](Color[id=57732][edittype=518][border=0][editwidth=-96],Width[id=57739][edittype=3][border=0][min=1][max=4][freq=1][editwidth=-72]),<font ;18><sha>S</sha>[id=57743][typ=1][align=1][spchk=-1][show=1](Color[id=57745][edittype=518][border=0][editwidth=-72],Offset[id=57752][edittype=3][border=0][min=-8][max=+8][freq=1][editwidth=-128],Width[id=57756][edittype=3][border=0][min=2][max=+7][freq=1][editwidth=-128])),[sep][id=57620][height=4],Align[id=57619][show=1][captionwidth=24][height=26][group=19]([id=57654][group=49](Left[id=57655][typ=2][align=1][show=1][grp=1],Center[id=57656][typ=2][align=1][chk=1][show=1][grp=1],Right[id=57657][typ=2][align=1][show=1][grp=1]),[id=57618][group=19](Offset[id=57709][typ=1][chk][show=1][showdis][border=0][min=-32][max=+32][freq=4][editwidth=-96][height=24])),Color[id=57618][captionwidth=28][height=26][group=3](Fore[id=57685][typ=1][show=1][showdis][editwidth=-96][height=24],[sep][id=57617],Back[id=57686][typ=1][show=1][showdis][editwidth=-96][height=24]),Font[id=57617][captionwidth=28][height=26][group=3](Face[id=57701][typ=1][show=1][showdis][height=24][editwidth=-116],[sep][id=57616],Size[id=57702][typ=1][show=1][showdis][height=24][editwidth=-82][min=4][max=72][freq=4]),Misc[id=57609][captionwidth=24][group=3]([id=57664][group=49](<font ;6><c>No<br><c>Line[id=57674][typ=2][align=1][chk=1][show=1][grp=3],<solidline>Solid[id=57675][typ=2][align=1][show=1][grp=3],<dotline>Dot[id=57676][typ=2][align=1][show=1][grp=3],<font ;6><c>Up<br><c>Line[id=57677][typ=1][align=1][show=-1]),Image[id=57608](Size[id=57680][edittype=515][border=0][min=16][max=128][freq=16][editwidth=-128][ticklabel=value = %i ? '<b>'+value : ( value = vmax ? '<fgcolor 808080><font ;6><b>'+value : ( value = vmin ? '<fgcolor 808080><font ;6><b>'+value : '' ) )],Insert[id=57679]()))
At first glance, it might seem complex, but once you understand the structure, creating your own context menu becomes straightforward. In short, each item is followed by its options, and its sub-items are enclosed in parentheses. For example, setting ContextMenuItems = "Item(Item 1,Item 2,Item 3)" defines a single top-level item ("Item") with three sub-items: "Item 1", "Item 2", and "Item 3". When a user selects a custom (unknown) command from the context menu, the control triggers the ExecuteContextMenu(Item, ID) event. You can handle this event to implement actions for your custom menu items. Each item can be assigned an id that identifies it. IDs not included in the default ContextMenuItems list are considered unknown commands. For example, IDs like 57625, 57643, and similar are reserved (known commands) and should not be used for custom items.
By default, the control's context menu shows as following:
Let's say you want to remove all groupings and display a standard, flat context menu. To do this, simply remove all [group] tags from the ContextMenuItems property as follows:
Command[id=57625][captionwidth=50](Undo[id=57643][align=1][button=-1][captionwidth=44],Redo[id=57644][align=1][button=-1]),Edit[id=57624][captionwidth=50](Cut[id=57635][align=1][button=-1][captionwidth=44],Copy[id=57634][align=1][button=-1],Paste[id=57637][align=1][button=-1],Delete[id=57632][align=1][button=-1],Select All[id=57642][align=1][button=-1]),<font ;6>format[sep][id=57623][height=13],Type[id=57622][show=1][captionwidth=28]((<font ;18><b>B[id=57648][typ=1][align=1][show=1],<font ;18><i>I[id=57649][typ=1][align=1][show=1],<font ;18><u>U[id=57650][typ=1][align=1][show=1],<font ;18><s>S[id=57651][typ=1][align=1][show=1]),[sep][id=57621],<font ;18><a>A</a>[id=57760][typ=1][align=1][spchk=-1][show=1](ID[id=57761][edittype=1][editwidth=-172],Options[id=57762][edittype=1][editwidth=-72]),<font ;18><fgcolor 0><gra FFFFFF;1;1>G</gra>[id=57715][typ=1][align=1][spchk=-1][show=1](Color[id=57717][edittype=518][border=0][editwidth=-72],Mode[id=57724](H[id=57725][typ=2][align=1][chk=1][show=1][grp=2],V[id=57726][typ=2][align=1][show=1][grp=2],FD[id=57727][typ=2][align=1][show=1][grp=2],BD[id=57728][typ=2][align=1][show=1][grp=2]),Blend Triangular Shape[id=57729][typ=1][show=-1]),<font ;18><out><fgcolor FFFFFF>O</out>[id=57730][typ=1][align=1][spchk=-1][show=1](Color[id=57732][edittype=518][border=0][editwidth=-96],Width[id=57739][edittype=3][border=0][min=1][max=4][freq=1][editwidth=-72]),<font ;18><sha>S</sha>[id=57743][typ=1][align=1][spchk=-1][show=1](Color[id=57745][edittype=518][border=0][editwidth=-72],Offset[id=57752][edittype=3][border=0][min=-8][max=+8][freq=1][editwidth=-128],Width[id=57756][edittype=3][border=0][min=2][max=+7][freq=1][editwidth=-128])),[sep][id=57620][height=4],Align[id=57619][show=1][captionwidth=24][height=26]([id=57654](Left[id=57655][typ=2][align=1][show=1][grp=1],Center[id=57656][typ=2][align=1][chk=1][show=1][grp=1],Right[id=57657][typ=2][align=1][show=1][grp=1]),[id=57618](Offset[id=57709][typ=1][chk][show=1][showdis][border=0][min=-32][max=+32][freq=4][editwidth=-96][height=24])),Color[id=57618][captionwidth=28][height=26](Fore[id=57685][typ=1][show=1][showdis][editwidth=-96][height=24],[sep][id=57617],Back[id=57686][typ=1][show=1][showdis][editwidth=-96][height=24]),Font[id=57617][captionwidth=28][height=26](Face[id=57701][typ=1][show=1][showdis][height=24][editwidth=-116],[sep][id=57616],Size[id=57702][typ=1][show=1][showdis][height=24][editwidth=-82][min=4][max=72][freq=4]),Misc[id=57609][captionwidth=24]([id=57664](<font ;6><c>No<br><c>Line[id=57674][typ=2][align=1][chk=1][show=1][grp=3],<solidline>Solid[id=57675][typ=2][align=1][show=1][grp=3],<dotline>Dot[id=57676][typ=2][align=1][show=1][grp=3],<font ;6><c>Up<br><c>Line[id=57677][typ=1][align=1][show=-1]),Image[id=57608](Size[id=57680][edittype=515][border=0][min=16][max=128][freq=16][editwidth=-128][ticklabel=value = %i ? '<b>'+value : ( value = vmax ? '<fgcolor 808080><font ;6><b>'+value : ( value = vmin ? '<fgcolor 808080><font ;6><b>'+value : '' ) )],Insert[id=57679]()))
and the result should look something like:
The ContextMenuItems's syntax in BNF notation:
<ContextMenuItems> ::= <ITEMS>
<ITEMS> ::= <ITEM>["("<ITEMS>")"][","<ITEMS>]
<ITEM> ::= <CAPTION>[<OPTIONS>]
<OPTIONS> ::= "["<OPTION>"]"["["<OPTIONS>"]"]
<OPTION> ::= <PROPERTY>["="<VALUE>]
<PROPERTY> ::= "img" | "himg" | "sep" | "id" |
"typ" | "group" | "chk" | "button" | "align" |
"spchk" | "show" | "rad" | "dis" | "showdis" |
"bld" | "itl" | "stk" | "und" | "bg" |
"fg" | "edittype" | "edit" | "mask" | "border" |
"editwidth" | "captionwidth" | "height" |
"grp" | "tfi" | "ttp" | "min" | "max" | "tick" | "freq" |
"ticklabel" | "small" | "large"
| "spin" | "ettp" | "float"
where the <CAPTION> is the HTML caption to be shown on the context menu item. The <VALUE> indicates the value of giving property.
!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid character,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."
indicates the following:
The four parts of an input mask, or the Mask property supports up to four parts, separated by a semicolon (;). For instance, "`Time: `00:00:00;;0;overtype,warning=<fgcolor FF0000>invalid character,beep", indicates the pattern "00:00" with the prefix Time:, the masking character being the 0, instead _, the field enters in over-type mode, insert-type mode is not allowed, and the field beeps and displays a tooltip in red with the message invalid character when the user enters an invalid character.
Input masks are made up one mandatory part and three optional parts, and each part is separated by a semicolon (;). If a part should use the semicolon (;) it must uses the \; instead
The purpose of each part is as follows:
The following table lists the placeholder and literal characters for an input mask and explains how it controls data entry:
Characters enclosed in double quotation ("" or ``) marks will be displayed literally. If this part should display/use the semicolon (;) character is should be included between double quotation ("" or ``) characters or as \; ( escape ).
The known options for the forth part are:
float, indicates that the field is edited as a decimal number, integer. The first part of the input mask specifies the pattern to be used for grouping and decimal separators, and - if negative numbers are supported. If the first part is empty, the float is formatted as indicated by current regional settings. For instance, "##;;;float" specifies a 2 digit number in float format. The grouping, decimal, negative and digits options are valid if the float option is present.
Experimental:
multiline, specifies that the field supports multiple lines.
rich, specifies that the field displays a rich type editor. By
default, the standard edit field is shown
disabled, shows as disabled the field.
If the <VALUE> property is empty, the control takes the settings for the regional options like: Decimal Symbol , No. of digits after decimal, Digit grouping symbol.
Here are few samples:
The <VALUE>"-###.###.##0,00" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator ). This format displays leading-zeros.
The <VALUE>"-###.###.###,##" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator )
The <VALUE>"-###,###,###.##" filter floating point numbers a number for English settings ( "." is the decimal sign, "," is the thousands separator )
The <VALUE>"####" indicates a max-4 digit number ( positive ) without a decimal symbol and without digit grouping
The <VALUE>"-##.#" filters a floating point number from the -99.9 to 99.9 ( "." is the decimal sign, no thousands separator )
The <VALUE>"#,###.##" filters a floating point number from the 0 to 9,999.99 with digit grouping ( "." is the decimal sign, "," is the thousands separator ).
ContextMenu - Tick Label Expression
For instance:
The The <VALUE> of [ticklabel] option is a formatted expression which result may include the HTML tags.
The The <VALUE> of [ticklabel] option indicates a formatting expression that may use the following predefined keywords:
The supported binary arithmetic operators are:
The supported unary boolean operators are:
The supported binary boolean operators are:
The supported binary boolean operators, all these with the same priority 0, are :
The supported ternary operators, all these with the same priority 0, are :
"expression ? true_part : false_part"
, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.
The supported n-ary operators are (with priority 5):
"expression array (c1,c2,c3,...cn)"
, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')".
"expression in (c1,c2,c3,...cn)"
, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.
"expression switch (default,c1,c2,c3,...,cn)"
, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.
"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"
If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:
- #4/1/2009#, from hours 06:00 AM to 12:00 PM
- #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
- #5/1/2009#, from hours 12:00 AM to 08:00 AM
The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.
Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.
The supported conversion unary operators are:
Here's few predefined types:
Other known operators for numbers are:
The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:
Other known operators for strings are:
Other known operators for dates are:
The The <VALUE> of [ticklabel] option can display labels using the following built-in HTML tags: