Type | Description | |||
String | A String expression that specifies the item to be loaded/saved. |
The ToString property of the Items object, builds the control/ribbon using a string, rather than adding item one by one. The control's setup installs the WYSIWYG EditRibbon Tool, that helps you to define the ToString format.
The ToString property looks like follows:
[id=10][group=0x03]([id=10][group=0x03][itemspad=4,4,4,4][itemsbghot=0x1F000000](Annoyed1[id=20],Bunny2[id=30],[id=50][edittype=0x01][editwidth=-100],Cellphone3[id=40]),[id=10][group=0x03][itemspad=4,4,4,4][itemsbghot=0x1F000000](Annoyed1[id=20],Bunny2[id=30],Cellphone3[id=40]))
Each item is followed by its options, and its sub-items between () parentheses. The item's option includes the icons, pictures, edit attributes and so on.
The ToString syntax in BNF notation:
<ToString> ::= <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"
| "close" | "local"
| "popupapp"
| "itemspad"
| "itemsbg"
| "itemsbghot"
| "itemsbgext"
| "visible"
| "tab"
| "pad"
| "bghot"
| "bgsel"
| "bgselhot"
| "arrow"
| "popupalign"
| "popupoffset"
| "popupat"| "hid"
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 ).
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:
The EBN String Format syntax in BNF notation is defined like follows:
<EBN> ::= <elements> | <root> "(" [<elements>] ")" <elements> ::= <element> [ "," <elements> ] <root> ::= "root" [ <attributes> ] | [ <attributes> ] <element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ] <anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom" <attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]" <client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression> <expression> ::= <number> | <number> "%" <attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others> <equal> ::= "=" <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 <decimal> ::= <digit><decimal> <hexadigit> ::= <digit> | "A" | "B" "C" | "D" | "E" "F" <hexa> ::= <hexadigit><hexa> <number> ::= <decimal> | "0x" <hexa> <color> ::= <rgbcolor> | number <rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")" <string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> " <characters> ::= <char>|<characters> <char> ::= <any_character_excepts_null> <backcolor> ::= "back" <equal> <color> <text> ::= "text" <equal> <string> <align> ::= "align" <equal> <number> <pattern> ::= "pattern" <equal> <number> <patterncolor> ::= "patterncolor" <equal> <color> <frame> ::= "frame" <equal> <color> <data> ::= "data" <equal> <number> | <string> <framethick> ::= "framethick" <wordwrap> ::= "wordwrap"
Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.
"[pattern=6]", shows the BDiagonal pattern on the object's background.
"[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.
"[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.
"[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:
"top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.
"[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.
"[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.
"left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.
"bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.
"root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side