The Exontrol's eXPression component is a syntax-editor that helps you to define, view, edit and evaluate expressions. Most of our UI components support formatting based on arithmetic expressions. For instance, the Column.FormatColumn property specifies the format to display the column's content. In other words, if the Column.FormatColumn property is "currency(value)" the column displays values as currency, like $1,234.00, instead 1234. Having the eXPression component you can easily view or check if the expression you have used is syntactically correct, and you can evaluate what is the result you get giving different values to be tested. The Exontrol's eXPression component can be used as an user-editor, to configure your applications.

(all)
(all)

51:

The sample displays the value in years, months, weeks, days, hours, minutes and secons

The sample displays the positive values in blue, being preceded by + sign, negative values in red preceded by - sign, 0 as 0.00 while for null values is displays null. The numbers are displayed using 2 digits, . as decimal separator and grouping by 3 digits by , separator

Expression1->AllowValueKeyword = false;
Expression1->AllowDefaultOperators = false;
Expression1->AddCustomOperator(L"+",TVariant("<b>+</b>"),TVariant("This is a new binary-operator"),TVariant(2));
Expression1->AddCustomOperator(L"xxx",TVariant("<b>xxx</b>"),TVariant("This is a new keyword"),TVariant(0));
Expression1->AddCustomOperator(L"yyy",TVariant("<b>yyy</b>"),TVariant("This is a unary-operator"),TVariant(1));
Expression1->AddCustomOperator(L"zzz",TVariant("<b>zzz</b>"),TVariant("This is a binary-operator"),TVariant(2));
Expression1->Text = L"xxx + yyy(100 zzz 200)";

Expression1->Expression = L"value";
Expression1->Description[Expressionlib_tlb::KeywordEnum::exKeywordValue] = L"This is a bit of text to be shown when cursor hovers the <b>value</b> keyword.";
Expression1->Refresh();