Type | Description | |||
String | A String that indicates the expression to validate the rotation angle of the layer, during dragging. |
For instance, RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)", validates the rotation-angle so it always will be between 0 and 360, in other words limits the rotation angle.
The Exontrol's eXPression component is a syntax-editor that helps you to define, view, edit and evaluate expressions. Using 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.
The value keyword indicates the cumulative rotation angle ( CumulativeRotateAngle property ), during the dragging operation.
The constants are ( DPI-Aware components ):
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 binary range operators, all these with the same priority 5, are :
The supported binary operators, all these with the same priority 0, are :
:= (Store operator), stores the result of expression to variable. The syntax for := operator is
variable := expression
where variable is a integer between 0 and 9. You can use the =: operator to restore any stored variable ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable
=: (Restore operator), restores the giving variable ( previously saved using the store operator ). The syntax for =: operator is
=: variable
where variable is a integer between 0 and 9. You can use the := operator to store the value of any expression ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable
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:
How can I limit the rotation from 0 to 360 degree, while dragging?
VBA (MS Access, Excell...)
' DragStart event - Occurs once the user starts dragging a layer. Private Sub Gauge1_DragStart(ByVal DragInfo As Object,Cancel As Boolean) ' DragInfo.Debug = 483 ' DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" End Sub With Gauge1 With .Layers.Add("back") .RotateType = 2 .Left = "(width-512)/2" .Top = "(height-512)/2" .Height = 512 .Width = 512 With .Background.Picture .Value = "c:\exontrol\images\card.png" .Left = "(width-pwidth)/2" .Top = "(height-pheight)/2" .Width = "pwidth" .Height = "pheight" End With .OnDrag = 2 .RotateAngle = -45 End With End With
VB6
' DragStart event - Occurs once the user starts dragging a layer. Private Sub Gauge1_DragStart(ByVal DragInfo As EXGAUGELibCtl.IDragInfo,Cancel As Boolean) ' DragInfo.Debug = 483 ' DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" End Sub With Gauge1 With .Layers.Add("back") .RotateType = exRotateBilinearInterpolation .Left = "(width-512)/2" .Top = "(height-512)/2" .Height = 512 .Width = 512 With .Background.Picture .Value = "c:\exontrol\images\card.png" .Left = "(width-pwidth)/2" .Top = "(height-pheight)/2" .Width = "pwidth" .Height = "pheight" End With .OnDrag = exDoRotate .RotateAngle = -45 End With End With
VB.NET
' DragStart event - Occurs once the user starts dragging a layer. Private Sub Exgauge1_DragStart(ByVal sender As System.Object,ByVal DragInfo As exontrol.EXGAUGELib.DragInfo,ByRef Cancel As Boolean) Handles Exgauge1.DragStart ' DragInfo.Debug = 483 ' DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" End Sub With Exgauge1 With .Layers.Add("back") .RotateType = exontrol.EXGAUGELib.RotateTypeEnum.exRotateBilinearInterpolation .Left = "(width-512)/2" .Top = "(height-512)/2" .Height = 512 .Width = 512 With .Background.Picture .Value = "c:\exontrol\images\card.png" .Left = "(width-pwidth)/2" .Top = "(height-pheight)/2" .Width = "pwidth" .Height = "pheight" End With .OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate .RotateAngle = -45 End With End With
VB.NET for /COM
' DragStart event - Occurs once the user starts dragging a layer. Private Sub AxGauge1_DragStart(ByVal sender As System.Object, ByVal e As AxEXGAUGELib._IGaugeEvents_DragStartEvent) Handles AxGauge1.DragStart ' DragInfo.Debug = 483 ' DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" End Sub With AxGauge1 With .Layers.Add("back") .RotateType = EXGAUGELib.RotateTypeEnum.exRotateBilinearInterpolation .Left = "(width-512)/2" .Top = "(height-512)/2" .Height = 512 .Width = 512 With .Background.Picture .Value = "c:\exontrol\images\card.png" .Left = "(width-pwidth)/2" .Top = "(height-pheight)/2" .Width = "pwidth" .Height = "pheight" End With .OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate .RotateAngle = -45 End With End With
C++
// DragStart event - Occurs once the user starts dragging a layer.
void OnDragStartGauge1(LPDISPATCH DragInfo,BOOL FAR* Cancel)
{
// DragInfo.Debug = 483
// DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)"
}
/*
Copy and paste the following directives to your header file as
it defines the namespace 'EXGAUGELib' for the library: 'ExGauge 1.0 Control Library'
#import <ExGauge.dll>
using namespace EXGAUGELib;
*/
EXGAUGELib::IGaugePtr spGauge1 = GetDlgItem(IDC_GAUGE1)->GetControlUnknown();
EXGAUGELib::ILayerPtr var_Layer = spGauge1->GetLayers()->Add("back");
var_Layer->PutRotateType(EXGAUGELib::exRotateBilinearInterpolation);
var_Layer->PutLeft(L"(width-512)/2");
var_Layer->PutTop(L"(height-512)/2");
var_Layer->PutHeight(L"512");
var_Layer->PutWidth(L"512");
EXGAUGELib::ILPicturePtr var_Picture = var_Layer->GetBackground()->GetPicture();
var_Picture->PutValue("c:\\exontrol\\images\\card.png");
var_Picture->PutLeft(L"(width-pwidth)/2");
var_Picture->PutTop(L"(height-pheight)/2");
var_Picture->PutWidth(L"pwidth");
var_Picture->PutHeight(L"pheight");
var_Layer->PutOnDrag(EXGAUGELib::exDoRotate);
var_Layer->PutRotateAngle(-45);
C++ Builder
// DragStart event - Occurs once the user starts dragging a layer. void __fastcall TForm1::Gauge1DragStart(TObject *Sender,Exgaugelib_tlb::IDragInfo *DragInfo,VARIANT_BOOL * Cancel) { // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" } Exgaugelib_tlb::ILayerPtr var_Layer = Gauge1->Layers->Add(TVariant("back")); var_Layer->RotateType = Exgaugelib_tlb::RotateTypeEnum::exRotateBilinearInterpolation; var_Layer->Left = L"(width-512)/2"; var_Layer->Top = L"(height-512)/2"; var_Layer->Height = L"512"; var_Layer->Width = L"512"; Exgaugelib_tlb::ILPicturePtr var_Picture = var_Layer->Background->Picture; var_Picture->set_Value(TVariant("c:\\exontrol\\images\\card.png")); var_Picture->Left = L"(width-pwidth)/2"; var_Picture->Top = L"(height-pheight)/2"; var_Picture->Width = L"pwidth"; var_Picture->Height = L"pheight"; var_Layer->OnDrag = Exgaugelib_tlb::OnDragLayerEnum::exDoRotate; var_Layer->RotateAngle = -45;
C#
// DragStart event - Occurs once the user starts dragging a layer. private void exgauge1_DragStart(object sender,exontrol.EXGAUGELib.DragInfo DragInfo,ref bool Cancel) { // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" } //this.exgauge1.DragStart += new exontrol.EXGAUGELib.exg2antt.DragStartEventHandler(this.exgauge1_DragStart); exontrol.EXGAUGELib.Layer var_Layer = exgauge1.Layers.Add("back"); var_Layer.RotateType = exontrol.EXGAUGELib.RotateTypeEnum.exRotateBilinearInterpolation; var_Layer.Left = "(width-512)/2"; var_Layer.Top = "(height-512)/2"; var_Layer.Height = 512.ToString(); var_Layer.Width = 512.ToString(); exontrol.EXGAUGELib.Picture var_Picture = var_Layer.Background.Picture; var_Picture.Value = "c:\\exontrol\\images\\card.png"; var_Picture.Left = "(width-pwidth)/2"; var_Picture.Top = "(height-pheight)/2"; var_Picture.Width = "pwidth"; var_Picture.Height = "pheight"; var_Layer.OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer.RotateAngle = -45;
JScript/JavaScript
<BODY onload="Init()"> <SCRIPT FOR="Gauge1" EVENT="DragStart(DragInfo,Cancel)" LANGUAGE="JScript"> // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" </SCRIPT> <OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_Layer = Gauge1.Layers.Add("back"); var_Layer.RotateType = 2; var_Layer.Left = "(width-512)/2"; var_Layer.Top = "(height-512)/2"; var_Layer.Height = 512; var_Layer.Width = 512; var var_Picture = var_Layer.Background.Picture; var_Picture.Value = "c:\\exontrol\\images\\card.png"; var_Picture.Left = "(width-pwidth)/2"; var_Picture.Top = "(height-pheight)/2"; var_Picture.Width = "pwidth"; var_Picture.Height = "pheight"; var_Layer.OnDrag = 2; var_Layer.RotateAngle = -45; } </SCRIPT> </BODY>
VBScript
<BODY onload="Init()"> <SCRIPT LANGUAGE="VBScript"> Function Gauge1_DragStart(DragInfo,Cancel) ' DragInfo.Debug = 483 ' DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" End Function </SCRIPT> <OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Gauge1 With .Layers.Add("back") .RotateType = 2 .Left = "(width-512)/2" .Top = "(height-512)/2" .Height = 512 .Width = 512 With .Background.Picture .Value = "c:\exontrol\images\card.png" .Left = "(width-pwidth)/2" .Top = "(height-pheight)/2" .Width = "pwidth" .Height = "pheight" End With .OnDrag = 2 .RotateAngle = -45 End With End With End Function </SCRIPT> </BODY>
C# for /COM
// DragStart event - Occurs once the user starts dragging a layer. private void axGauge1_DragStart(object sender, AxEXGAUGELib._IGaugeEvents_DragStartEvent e) { // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" } //this.axGauge1.DragStart += new AxEXGAUGELib._IGaugeEvents_DragStartEventHandler(this.axGauge1_DragStart); EXGAUGELib.Layer var_Layer = axGauge1.Layers.Add("back"); var_Layer.RotateType = EXGAUGELib.RotateTypeEnum.exRotateBilinearInterpolation; var_Layer.Left = "(width-512)/2"; var_Layer.Top = "(height-512)/2"; var_Layer.Height = 512.ToString(); var_Layer.Width = 512.ToString(); EXGAUGELib.Picture var_Picture = var_Layer.Background.Picture; var_Picture.Value = "c:\\exontrol\\images\\card.png"; var_Picture.Left = "(width-pwidth)/2"; var_Picture.Top = "(height-pheight)/2"; var_Picture.Width = "pwidth"; var_Picture.Height = "pheight"; var_Layer.OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer.RotateAngle = -45;
X++ (Dynamics Ax 2009)
// DragStart event - Occurs once the user starts dragging a layer. void onEvent_DragStart(COM _DragInfo,COMVariant /*bool*/ _Cancel) { // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" ; } public void init() { COM com_Background,com_Layer,com_Picture; anytype var_Background,var_Layer,var_Picture; ; super(); var_Layer = COM::createFromObject(exgauge1.Layers()).Add("back"); com_Layer = var_Layer; com_Layer.RotateType(2/*exRotateBilinearInterpolation*/); com_Layer.Left("(width-512)/2"); com_Layer.Top("(height-512)/2"); com_Layer.Height(512); com_Layer.Width(512); var_Background = COM::createFromObject(com_Layer.Background()); com_Background = var_Background; var_Picture = com_Background.Picture(); com_Picture = var_Picture; com_Picture.Value("c:\\exontrol\\images\\card.png"); com_Picture.Left("(width-pwidth)/2"); com_Picture.Top("(height-pheight)/2"); com_Picture.Width("pwidth"); com_Picture.Height("pheight"); com_Layer.OnDrag(2/*exDoRotate*/); com_Layer.RotateAngle(-45); }
Delphi 8 (.NET only)
// DragStart event - Occurs once the user starts dragging a layer. procedure TWinForm1.AxGauge1_DragStart(sender: System.Object; e: AxEXGAUGELib._IGaugeEvents_DragStartEvent); begin // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" end; with AxGauge1 do begin with Layers.Add('back') do begin RotateType := EXGAUGELib.RotateTypeEnum.exRotateBilinearInterpolation; Left := '(width-512)/2'; Top := '(height-512)/2'; Height := 512; Width := 512; with Background.Picture do begin Value := 'c:\exontrol\images\card.png'; Left := '(width-pwidth)/2'; Top := '(height-pheight)/2'; Width := 'pwidth'; Height := 'pheight'; end; OnDrag := EXGAUGELib.OnDragLayerEnum.exDoRotate; RotateAngle := -45; end; end
Delphi (standard)
// DragStart event - Occurs once the user starts dragging a layer. procedure TForm1.Gauge1DragStart(ASender: TObject; DragInfo : IDragInfo;var Cancel : WordBool); begin // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" end; with Gauge1 do begin with Layers.Add('back') do begin RotateType := EXGAUGELib_TLB.exRotateBilinearInterpolation; Left := '(width-512)/2'; Top := '(height-512)/2'; Height := 512; Width := 512; with Background.Picture do begin Value := 'c:\exontrol\images\card.png'; Left := '(width-pwidth)/2'; Top := '(height-pheight)/2'; Width := 'pwidth'; Height := 'pheight'; end; OnDrag := EXGAUGELib_TLB.exDoRotate; RotateAngle := -45; end; end
VFP
*** DragStart event - Occurs once the user starts dragging a layer. *** LPARAMETERS DragInfo,Cancel *** DragInfo.Debug = 483 *** DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" with thisform.Gauge1 with .Layers.Add("back") .RotateType = 2 .Left = "(width-512)/2" .Top = "(height-512)/2" .Height = 512 .Width = 512 with .Background.Picture .Value = "c:\exontrol\images\card.png" .Left = "(width-pwidth)/2" .Top = "(height-pheight)/2" .Width = "pwidth" .Height = "pheight" endwith .OnDrag = 2 .RotateAngle = -45 endwith endwith
dBASE Plus
/* with (this.EXGAUGEACTIVEXCONTROL1.nativeObject) DragStart = class::nativeObject_DragStart endwith */ // Occurs once the user starts dragging a layer. function nativeObject_DragStart(DragInfo,Cancel) /* DragInfo.Debug = 483 */ /* DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" */ oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject return local oGauge,var_Layer,var_Picture oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject var_Layer = oGauge.Layers.Add("back") var_Layer.RotateType = 2 var_Layer.Left = "(width-512)/2" var_Layer.Top = "(height-512)/2" var_Layer.Height = Str(512) var_Layer.Width = Str(512) var_Picture = var_Layer.Background.Picture var_Picture.Value = "c:\exontrol\images\card.png" var_Picture.Left = "(width-pwidth)/2" var_Picture.Top = "(height-pheight)/2" var_Picture.Width = "pwidth" var_Picture.Height = "pheight" var_Layer.OnDrag = 2 var_Layer.RotateAngle = -45
XBasic (Alpha Five)
' Occurs once the user starts dragging a layer. function DragStart as v (DragInfo as OLE::Exontrol.Gauge.1::IDragInfo,Cancel as L) ' DragInfo.Debug = 483 ' DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" oGauge = topparent:CONTROL_ACTIVEX1.activex end function Dim oGauge as P Dim var_Layer as P Dim var_Picture as P oGauge = topparent:CONTROL_ACTIVEX1.activex var_Layer = oGauge.Layers.Add("back") var_Layer.RotateType = 2 var_Layer.Left = "(width-512)/2" var_Layer.Top = "(height-512)/2" var_Layer.Height = 512 var_Layer.Width = 512 var_Picture = var_Layer.Background.Picture var_Picture.Value = "c:\exontrol\images\card.png" var_Picture.Left = "(width-pwidth)/2" var_Picture.Top = "(height-pheight)/2" var_Picture.Width = "pwidth" var_Picture.Height = "pheight" var_Layer.OnDrag = 2 var_Layer.RotateAngle = -45
Visual Objects
METHOD OCX_Exontrol1DragStart(DragInfo,Cancel) CLASS MainDialog // DragStart event - Occurs once the user starts dragging a layer. // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" RETURN NIL local var_Picture as ILPicture local var_Layer as ILayer var_Layer := oDCOCX_Exontrol1:Layers:Add("back") var_Layer:RotateType := exRotateBilinearInterpolation var_Layer:Left := "(width-512)/2" var_Layer:Top := "(height-512)/2" var_Layer:Height := AsString(512) var_Layer:Width := AsString(512) var_Picture := var_Layer:Background:Picture var_Picture:Value := "c:\exontrol\images\card.png" var_Picture:Left := "(width-pwidth)/2" var_Picture:Top := "(height-pheight)/2" var_Picture:Width := "pwidth" var_Picture:Height := "pheight" var_Layer:OnDrag := exDoRotate var_Layer:RotateAngle := -45
PowerBuilder
/*begin event DragStart(oleobject DragInfo,boolean Cancel) - Occurs once the user starts dragging a layer.*/ /* DragInfo.Debug = 483 DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" oGauge = ole_1.Object */ /*end event DragStart*/ OleObject oGauge,var_Layer,var_Picture oGauge = ole_1.Object var_Layer = oGauge.Layers.Add("back") var_Layer.RotateType = 2 var_Layer.Left = "(width-512)/2" var_Layer.Top = "(height-512)/2" var_Layer.Height = String(512) var_Layer.Width = String(512) var_Picture = var_Layer.Background.Picture var_Picture.Value = "c:\exontrol\images\card.png" var_Picture.Left = "(width-pwidth)/2" var_Picture.Top = "(height-pheight)/2" var_Picture.Width = "pwidth" var_Picture.Height = "pheight" var_Layer.OnDrag = 2 var_Layer.RotateAngle = -45
Visual DataFlex
// Occurs once the user starts dragging a layer. Procedure OnComDragStart Variant llDragInfo Boolean llCancel Forward Send OnComDragStart llDragInfo llCancel // DragInfo.Debug = 483 // DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)" End_Procedure Procedure OnCreate Forward Send OnCreate Variant voLayers Get ComLayers to voLayers Handle hoLayers Get Create (RefClass(cComLayers)) to hoLayers Set pvComObject of hoLayers to voLayers Variant voLayer Get ComAdd of hoLayers "back" to voLayer Handle hoLayer Get Create (RefClass(cComLayer)) to hoLayer Set pvComObject of hoLayer to voLayer Set ComRotateType of hoLayer to OLEexRotateBilinearInterpolation Set ComLeft of hoLayer to "(width-512)/2" Set ComTop of hoLayer to "(height-512)/2" Set ComHeight of hoLayer to 512 Set ComWidth of hoLayer to 512 Variant voBackground Get ComBackground of hoLayer to voBackground Handle hoBackground Get Create (RefClass(cComBackground)) to hoBackground Set pvComObject of hoBackground to voBackground Variant voPicture Get ComPicture of hoBackground to voPicture Handle hoPicture Get Create (RefClass(cComPicture)) to hoPicture Set pvComObject of hoPicture to voPicture Set ComValue of hoPicture to "c:\exontrol\images\card.png" Set ComLeft of hoPicture to "(width-pwidth)/2" Set ComTop of hoPicture to "(height-pheight)/2" Set ComWidth of hoPicture to "pwidth" Set ComHeight of hoPicture to "pheight" Send Destroy to hoPicture Send Destroy to hoBackground Set ComOnDrag of hoLayer to OLEexDoRotate Set ComRotateAngle of hoLayer to -45 Send Destroy to hoLayer Send Destroy to hoLayers End_Procedure
XBase++
PROCEDURE OnDragStart(oGauge,DragInfo,Cancel) /*DragInfo.Debug = 483*/ /*DragInfo.RotateAngleValid = "value < 0 ? 0 : (value > 360 ? 359.999999 : value)"*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGauge LOCAL oPicture LOCAL oLayer oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oGauge := XbpActiveXControl():new( oForm:drawingArea ) oGauge:CLSID := "Exontrol.Gauge.1" /*{91628F12-393C-44EF-A558-83ED1790AAD3}*/ oGauge:create(,, {10,60},{610,370} ) oGauge:DragStart := {|DragInfo,Cancel| OnDragStart(oGauge,DragInfo,Cancel)} /*Occurs once the user starts dragging a layer.*/ oLayer := oGauge:Layers():Add("back") oLayer:RotateType := 2/*exRotateBilinearInterpolation*/ oLayer:Left := "(width-512)/2" oLayer:Top := "(height-512)/2" oLayer:Height := Transform(512,"") oLayer:Width := Transform(512,"") oPicture := oLayer:Background():Picture() oPicture:Value := "c:\exontrol\images\card.png" oPicture:Left := "(width-pwidth)/2" oPicture:Top := "(height-pheight)/2" oPicture:Width := "pwidth" oPicture:Height := "pheight" oLayer:OnDrag := 2/*exDoRotate*/ oLayer:RotateAngle := -45 oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN