Type | Description | |||
Name as String | A string expression that defines the name of the new operator to be added. The name should not contain any or # , " ' `( ). The name must not start with a digit character. | |||
Keyword as Variant | A HTML expression that specifies how the operator will be displayed in the control's context menu. You can press the CTRL + Space key to display the control's drop down that lists all available operators. | |||
ToolTip as Variant | A HTML expression that defines the operator's tooltip. For instance, the operator's tooltip may be displayed as soon as the cursor hovers the operator. | |||
Type as Variant | A OperatorTypeEnum expression that specifies the type of the operator. If missing, the method adds a keyword (exKeywordOperator). |
The following samples shows how you can define your own operators only:
VB
With Expression1 .AllowValueKeyword = False .AllowDefaultOperators = False .AddCustomOperator "+","<b>+</b>","This is a new binary-operator",2 .AddCustomOperator "xxx","<b>xxx</b>","This is a new keyword",0 .AddCustomOperator "yyy","<b>yyy</b>","This is a unary-operator",1 .AddCustomOperator "zzz","<b>zzz</b>","This is a binary-operator",2 .Text = "xxx + yyy(100 zzz 200)" End WithVB.NET
With Expression1 .AllowValueKeyword = False .AllowDefaultOperators = False .AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) .AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) .AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) .AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) .Text = "xxx + yyy(100 zzz 200)" End With
C++
/* Copy and paste the following directives to your header file as it defines the namespace 'EXPRESSIONLib' for the library: 'Expression 1.0 Control Library' #import <Expression.dll> using namespace EXPRESSIONLib; */ EXPRESSIONLib::IExpressionPtr spExpression1 = GetDlgItem(IDC_EXPRESSION1)->GetControlUnknown(); spExpression1->PutAllowValueKeyword(VARIANT_FALSE); spExpression1->PutAllowDefaultOperators(VARIANT_FALSE); spExpression1->AddCustomOperator(L"+","<b>+</b>","This is a new binary-operator",long(2)); spExpression1->AddCustomOperator(L"xxx","<b>xxx</b>","This is a new keyword",long(0)); spExpression1->AddCustomOperator(L"yyy","<b>yyy</b>","This is a unary-operator",long(1)); spExpression1->AddCustomOperator(L"zzz","<b>zzz</b>","This is a binary-operator",long(2)); spExpression1->PutText(L"xxx + yyy(100 zzz 200)");C++ Builder
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)";C#
expression1.AllowValueKeyword = false; expression1.AllowDefaultOperators = false; expression1.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2); expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0); expression1.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1); expression1.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2); expression1.Text = "xxx + yyy(100 zzz 200)";JScript/JavaScript
<BODY onload="Init()"> <OBJECT CLASSID="clsid:B33F5489-49AC-4155-98E7-9BBFC57FF019" id="Expression1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { Expression1.AllowValueKeyword = false; Expression1.AllowDefaultOperators = false; Expression1.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2); Expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0); Expression1.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1); Expression1.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2); Expression1.Text = "xxx + yyy(100 zzz 200)"; } </SCRIPT> </BODY>VBScript
<BODY onload="Init()"> <OBJECT CLASSID="clsid:B33F5489-49AC-4155-98E7-9BBFC57FF019" id="Expression1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Expression1 .AllowValueKeyword = False .AllowDefaultOperators = False .AddCustomOperator "+","<b>+</b>","This is a new binary-operator",2 .AddCustomOperator "xxx","<b>xxx</b>","This is a new keyword",0 .AddCustomOperator "yyy","<b>yyy</b>","This is a unary-operator",1 .AddCustomOperator "zzz","<b>zzz</b>","This is a binary-operator",2 .Text = "xxx + yyy(100 zzz 200)" End With End Function </SCRIPT> </BODY>C# for /COM
axExpression1.AllowValueKeyword = false; axExpression1.AllowDefaultOperators = false; axExpression1.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2); axExpression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0); axExpression1.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1); axExpression1.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2); axExpression1.Text = "xxx + yyy(100 zzz 200)";X++ (Dynamics Ax 2009)
public void init() { ; super(); expression1.AllowValueKeyword(false); expression1.AllowDefaultOperators(false); expression1.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",COMVariant::createFromInt(2)); expression1.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",COMVariant::createFromInt(0)); expression1.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",COMVariant::createFromInt(1)); expression1.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",COMVariant::createFromInt(2)); expression1.Text("xxx + yyy(100 zzz 200)"); }VFP
with thisform.Expression1 .AllowValueKeyword = .F. .AllowDefaultOperators = .F. .AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) .AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) .AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) .AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) .Text = "xxx + yyy(100 zzz 200)" endwithdBASE Plus
local oExpression oExpression = form.EXPRESSIONACTIVEXCONTROL1.nativeObject oExpression.AllowValueKeyword = false oExpression.AllowDefaultOperators = false oExpression.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) oExpression.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) oExpression.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) oExpression.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) oExpression.Text = "xxx + yyy(100 zzz 200)"XBasic (Alpha Five)
Dim oExpression as P oExpression = topparent:CONTROL_ACTIVEX1.activex oExpression.AllowValueKeyword = .f. oExpression.AllowDefaultOperators = .f. oExpression.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) oExpression.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) oExpression.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) oExpression.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) oExpression.Text = "xxx + yyy(100 zzz 200)"Delphi 8 (.NET only)
with AxExpression1 do begin AllowValueKeyword := False; AllowDefaultOperators := False; AddCustomOperator('+','<b>+</b>','This is a new binary-operator',TObject(2)); AddCustomOperator('xxx','<b>xxx</b>','This is a new keyword',TObject(0)); AddCustomOperator('yyy','<b>yyy</b>','This is a unary-operator',TObject(1)); AddCustomOperator('zzz','<b>zzz</b>','This is a binary-operator',TObject(2)); Text := 'xxx + yyy(100 zzz 200)'; endDelphi (standard)
with Expression1 do begin AllowValueKeyword := False; AllowDefaultOperators := False; AddCustomOperator('+','<b>+</b>','This is a new binary-operator',OleVariant(2)); AddCustomOperator('xxx','<b>xxx</b>','This is a new keyword',OleVariant(0)); AddCustomOperator('yyy','<b>yyy</b>','This is a unary-operator',OleVariant(1)); AddCustomOperator('zzz','<b>zzz</b>','This is a binary-operator',OleVariant(2)); Text := 'xxx + yyy(100 zzz 200)'; endVisual Objects
oDCOCX_Exontrol1:AllowValueKeyword := false oDCOCX_Exontrol1:AllowDefaultOperators := false oDCOCX_Exontrol1:AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) oDCOCX_Exontrol1:AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) oDCOCX_Exontrol1:AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) oDCOCX_Exontrol1:AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) oDCOCX_Exontrol1:Text := "xxx + yyy(100 zzz 200)"PowerBuilder
OleObject oExpression oExpression = ole_1.Object oExpression.AllowValueKeyword = false oExpression.AllowDefaultOperators = false oExpression.AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) oExpression.AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) oExpression.AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) oExpression.AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) oExpression.Text = "xxx + yyy(100 zzz 200)"Visual DataFlex
Procedure OnCreate Forward Send OnCreate Set ComAllowValueKeyword to False Set ComAllowDefaultOperators to False Send ComAddCustomOperator "+" "<b>+</b>" "This is a new binary-operator" 2 Send ComAddCustomOperator "xxx" "<b>xxx</b>" "This is a new keyword" 0 Send ComAddCustomOperator "yyy" "<b>yyy</b>" "This is a unary-operator" 1 Send ComAddCustomOperator "zzz" "<b>zzz</b>" "This is a binary-operator" 2 Set ComText to "xxx + yyy(100 zzz 200)" End_ProcedureXbase++
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oExpression oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oExpression := XbpActiveXControl():new( oForm:drawingArea ) oExpression:CLSID := "Exontrol.Expression.1" /*{B33F5489-49AC-4155-98E7-9BBFC57FF019}*/ oExpression:create(,, {10,60},{610,370} ) oExpression:AllowValueKeyword := .F. oExpression:AllowDefaultOperators := .F. oExpression:AddCustomOperator("+","<b>+</b>","This is a new binary-operator",2) oExpression:AddCustomOperator("xxx","<b>xxx</b>","This is a new keyword",0) oExpression:AddCustomOperator("yyy","<b>yyy</b>","This is a unary-operator",1) oExpression:AddCustomOperator("zzz","<b>zzz</b>","This is a binary-operator",2) oExpression:Text := "xxx + yyy(100 zzz 200)" oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN