Type | Description | |||
Long | A Long expression that specifies the number of milliseconds between calls of control's Timer event. |
You can use any of the following properties to update the layer:
The Change event occurs when the layer's value is changed.
The following sample shows how you can display a clock:
VBA (MS Access, Excell...)
' Change event - Occurs when the layer's value is changed. Private Sub Gauge1_Change(ByVal Layer As Long) With Gauge1 .Layers.Item("sec").Value = Gauge1.Value .Layers.Item("min").Value = Gauge1.Value .Layers.Item("hour").Value = Gauge1.Value End With End Sub ' Timer event - Occurs when the interval elapses. Private Sub Gauge1_Timer(ByVal TickCount As Long) With Gauge1 .Value = .FormatABC("value + 1/24/60/60",.Value) End With End Sub With Gauge1 .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" .DefaultLayer(185) = 2 .Layers.Count = 4 With .Layers.Item(0) .Background.Picture.Name = "vista_clock.png" End With With .Layers.Item(1) .Position = 3 .Key = "sec" .OnDrag = 2 .Selectable = False .Background.Picture.Name = "second-hand.png" .ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " & _ "floor(=:1)) * 60 )) - floor(=:2) ) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(2) .Position = 2 .Key = "min" .OnDrag = 2 .Selectable = False .Background.Picture.Name = "Minute.png" .ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" & _ "=:1)) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(3) .Position = 1 .Key = "hour" .OnDrag = 2 .Selectable = False .Background.Picture.Name = "Hour.png" .ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" .RotateAngleToValue = "value / 360 * 0.5" End With .LayerOfValue = 3 .Value = .FormatABC("date(`now`)") .TimerInterval = 1000 End With
VB6
' Change event - Occurs when the layer's value is changed. Private Sub Gauge1_Change(ByVal Layer As Long) With Gauge1 .Layers.Item("sec").Value = Gauge1.Value .Layers.Item("min").Value = Gauge1.Value .Layers.Item("hour").Value = Gauge1.Value End With End Sub ' Timer event - Occurs when the interval elapses. Private Sub Gauge1_Timer(ByVal TickCount As Long) With Gauge1 .Value = .FormatABC("value + 1/24/60/60",.Value) End With End Sub With Gauge1 .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" .DefaultLayer(exDefLayerRotateType) = 2 .Layers.Count = 4 With .Layers.Item(0) .Background.Picture.Name = "vista_clock.png" End With With .Layers.Item(1) .Position = 3 .Key = "sec" .OnDrag = exDoRotate .Selectable = False .Background.Picture.Name = "second-hand.png" .ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " & _ "floor(=:1)) * 60 )) - floor(=:2) ) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(2) .Position = 2 .Key = "min" .OnDrag = exDoRotate .Selectable = False .Background.Picture.Name = "Minute.png" .ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" & _ "=:1)) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(3) .Position = 1 .Key = "hour" .OnDrag = exDoRotate .Selectable = False .Background.Picture.Name = "Hour.png" .ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" .RotateAngleToValue = "value / 360 * 0.5" End With .LayerOfValue = 3 .Value = .FormatABC("date(`now`)") .TimerInterval = 1000 End With
VB.NET
' Change event - Occurs when the layer's value is changed. Private Sub Exgauge1_Change(ByVal sender As System.Object,ByVal Layer As Integer) Handles Exgauge1.Change With Exgauge1 .Layers.Item("sec").Value = Exgauge1.Value .Layers.Item("min").Value = Exgauge1.Value .Layers.Item("hour").Value = Exgauge1.Value End With End Sub ' Timer event - Occurs when the interval elapses. Private Sub Exgauge1_Timer(ByVal sender As System.Object,ByVal TickCount As Integer) Handles Exgauge1.Timer With Exgauge1 .Value = .FormatABC("value + 1/24/60/60",.Value) End With End Sub With Exgauge1 .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" .set_DefaultLayer(exontrol.EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2) .Layers.Count = 4 With .Layers.Item(0) .Background.Picture.Name = "vista_clock.png" End With With .Layers.Item(1) .Position = 3 .Key = "sec" .OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate .Selectable = False .Background.Picture.Name = "second-hand.png" .ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " & _ "floor(=:1)) * 60 )) - floor(=:2) ) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(2) .Position = 2 .Key = "min" .OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate .Selectable = False .Background.Picture.Name = "Minute.png" .ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" & _ "=:1)) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(3) .Position = 1 .Key = "hour" .OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate .Selectable = False .Background.Picture.Name = "Hour.png" .ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" .RotateAngleToValue = "value / 360 * 0.5" End With .LayerOfValue = 3 .Value = .FormatABC("date(`now`)") .TimerInterval = 1000 End With
VB.NET for /COM
' Change event - Occurs when the layer's value is changed. Private Sub AxGauge1_Change(ByVal sender As System.Object, ByVal e As AxEXGAUGELib._IGaugeEvents_ChangeEvent) Handles AxGauge1.Change With AxGauge1 .Layers.Item("sec").Value = AxGauge1.Value .Layers.Item("min").Value = AxGauge1.Value .Layers.Item("hour").Value = AxGauge1.Value End With End Sub ' Timer event - Occurs when the interval elapses. Private Sub AxGauge1_Timer(ByVal sender As System.Object, ByVal e As AxEXGAUGELib._IGaugeEvents_TimerEvent) Handles AxGauge1.Timer With AxGauge1 .Value = .FormatABC("value + 1/24/60/60",.Value) End With End Sub With AxGauge1 .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" .set_DefaultLayer(EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2) .Layers.Count = 4 With .Layers.Item(0) .Background.Picture.Name = "vista_clock.png" End With With .Layers.Item(1) .Position = 3 .Key = "sec" .OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate .Selectable = False .Background.Picture.Name = "second-hand.png" .ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " & _ "floor(=:1)) * 60 )) - floor(=:2) ) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(2) .Position = 2 .Key = "min" .OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate .Selectable = False .Background.Picture.Name = "Minute.png" .ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" & _ "=:1)) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(3) .Position = 1 .Key = "hour" .OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate .Selectable = False .Background.Picture.Name = "Hour.png" .ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" .RotateAngleToValue = "value / 360 * 0.5" End With .LayerOfValue = 3 .Value = .FormatABC("date(`now`)") .TimerInterval = 1000 End With
C++
// Change event - Occurs when the layer's value is changed. void OnChangeGauge1(long Layer) { /* 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(); spGauge1->GetLayers()->GetItem("sec")->PutValue(spGauge1->GetValue()); spGauge1->GetLayers()->GetItem("min")->PutValue(spGauge1->GetValue()); spGauge1->GetLayers()->GetItem("hour")->PutValue(spGauge1->GetValue()); } // Timer event - Occurs when the interval elapses. void OnTimerGauge1(long TickCount) { EXGAUGELib::IGaugePtr spGauge1 = GetDlgItem(IDC_GAUGE1)->GetControlUnknown(); spGauge1->PutValue(spGauge1->FormatABC(L"value + 1/24/60/60",spGauge1->GetValue(),vtMissing,vtMissing)); } EXGAUGELib::IGaugePtr spGauge1 = GetDlgItem(IDC_GAUGE1)->GetControlUnknown(); spGauge1->PutPicturesPath(L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Clock"); spGauge1->PutDefaultLayer(EXGAUGELib::exDefLayerRotateType,long(2)); spGauge1->GetLayers()->PutCount(4); EXGAUGELib::ILayerPtr var_Layer = spGauge1->GetLayers()->GetItem(long(0)); var_Layer->GetBackground()->GetPicture()->PutName("vista_clock.png"); EXGAUGELib::ILayerPtr var_Layer1 = spGauge1->GetLayers()->GetItem(long(1)); var_Layer1->PutPosition(3); var_Layer1->PutKey("sec"); var_Layer1->PutOnDrag(EXGAUGELib::exDoRotate); var_Layer1->PutSelectable(VARIANT_FALSE); var_Layer1->GetBackground()->GetPicture()->PutName("second-hand.png"); var_Layer1->PutValueToRotateAngle(_bstr_t("((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - ") + "floor(=:1)) * 60 )) - floor(=:2) ) * 360"); var_Layer1->PutRotateAngleToValue(L"value / 360 / 24 / 60"); EXGAUGELib::ILayerPtr var_Layer2 = spGauge1->GetLayers()->GetItem(long(2)); var_Layer2->PutPosition(2); var_Layer2->PutKey("min"); var_Layer2->PutOnDrag(EXGAUGELib::exDoRotate); var_Layer2->PutSelectable(VARIANT_FALSE); var_Layer2->GetBackground()->GetPicture()->PutName("Minute.png"); var_Layer2->PutValueToRotateAngle(_bstr_t("((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(") + "=:1)) * 360"); var_Layer2->PutRotateAngleToValue(L"value / 360 / 24 / 60"); EXGAUGELib::ILayerPtr var_Layer3 = spGauge1->GetLayers()->GetItem(long(3)); var_Layer3->PutPosition(1); var_Layer3->PutKey("hour"); var_Layer3->PutOnDrag(EXGAUGELib::exDoRotate); var_Layer3->PutSelectable(VARIANT_FALSE); var_Layer3->GetBackground()->GetPicture()->PutName("Hour.png"); var_Layer3->PutValueToRotateAngle(L"2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )"); var_Layer3->PutRotateAngleToValue(L"value / 360 * 0.5"); spGauge1->PutLayerOfValue(3); spGauge1->PutValue(spGauge1->FormatABC(L"date(`now`)",vtMissing,vtMissing,vtMissing)); spGauge1->PutTimerInterval(1000);
C++ Builder
// Change event - Occurs when the layer's value is changed. void __fastcall TForm1::Gauge1Change(TObject *Sender,long Layer) { Gauge1->Layers->get_Item(TVariant("sec"))->set_Value(TVariant(Gauge1->get_Value())); Gauge1->Layers->get_Item(TVariant("min"))->set_Value(TVariant(Gauge1->get_Value())); Gauge1->Layers->get_Item(TVariant("hour"))->set_Value(TVariant(Gauge1->get_Value())); } // Timer event - Occurs when the interval elapses. void __fastcall TForm1::Gauge1Timer(TObject *Sender,long TickCount) { Gauge1->set_Value(TVariant(Gauge1->FormatABC(L"value + 1/24/60/60",TVariant(Gauge1->get_Value()),TNoParam(),TNoParam()))); } Gauge1->PicturesPath = L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Clock"; Gauge1->DefaultLayer[Exgaugelib_tlb::DefaultLayerPropertyEnum::exDefLayerRotateType] = TVariant(2); Gauge1->Layers->Count = 4; Exgaugelib_tlb::ILayerPtr var_Layer = Gauge1->Layers->get_Item(TVariant(0)); var_Layer->Background->Picture->set_Name(TVariant("vista_clock.png")); Exgaugelib_tlb::ILayerPtr var_Layer1 = Gauge1->Layers->get_Item(TVariant(1)); var_Layer1->Position = 3; var_Layer1->set_Key(TVariant("sec")); var_Layer1->OnDrag = Exgaugelib_tlb::OnDragLayerEnum::exDoRotate; var_Layer1->Selectable = false; var_Layer1->Background->Picture->set_Name(TVariant("second-hand.png")); var_Layer1->ValueToRotateAngle = TVariant(String("((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - ") + "floor(=:1)) * 60 )) - floor(=:2) ) * 360"); var_Layer1->RotateAngleToValue = L"value / 360 / 24 / 60"; Exgaugelib_tlb::ILayerPtr var_Layer2 = Gauge1->Layers->get_Item(TVariant(2)); var_Layer2->Position = 2; var_Layer2->set_Key(TVariant("min")); var_Layer2->OnDrag = Exgaugelib_tlb::OnDragLayerEnum::exDoRotate; var_Layer2->Selectable = false; var_Layer2->Background->Picture->set_Name(TVariant("Minute.png")); var_Layer2->ValueToRotateAngle = TVariant(String("((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(") + "=:1)) * 360"); var_Layer2->RotateAngleToValue = L"value / 360 / 24 / 60"; Exgaugelib_tlb::ILayerPtr var_Layer3 = Gauge1->Layers->get_Item(TVariant(3)); var_Layer3->Position = 1; var_Layer3->set_Key(TVariant("hour")); var_Layer3->OnDrag = Exgaugelib_tlb::OnDragLayerEnum::exDoRotate; var_Layer3->Selectable = false; var_Layer3->Background->Picture->set_Name(TVariant("Hour.png")); var_Layer3->ValueToRotateAngle = L"2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )"; var_Layer3->RotateAngleToValue = L"value / 360 * 0.5"; Gauge1->LayerOfValue = 3; Gauge1->set_Value(TVariant(Gauge1->FormatABC(L"date(`now`)",TNoParam(),TNoParam(),TNoParam()))); Gauge1->TimerInterval = 1000;
C#
// Change event - Occurs when the layer's value is changed. private void exgauge1_Change(object sender,int Layer) { exgauge1.Layers["sec"].Value = exgauge1.Value; exgauge1.Layers["min"].Value = exgauge1.Value; exgauge1.Layers["hour"].Value = exgauge1.Value; } //this.exgauge1.Change += new exontrol.EXGAUGELib.exg2antt.ChangeEventHandler(this.exgauge1_Change); // Timer event - Occurs when the interval elapses. private void exgauge1_Timer(object sender,int TickCount) { exgauge1.Value = exgauge1.FormatABC("value + 1/24/60/60",exgauge1.Value,null,null); } //this.exgauge1.Timer += new exontrol.EXGAUGELib.exg2antt.TimerEventHandler(this.exgauge1_Timer); exgauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Clock"; exgauge1.set_DefaultLayer(exontrol.EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2); exgauge1.Layers.Count = 4; exontrol.EXGAUGELib.Layer var_Layer = exgauge1.Layers[0]; var_Layer.Background.Picture.Name = "vista_clock.png"; exontrol.EXGAUGELib.Layer var_Layer1 = exgauge1.Layers[1]; var_Layer1.Position = 3; var_Layer1.Key = "sec"; var_Layer1.OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer1.Selectable = false; var_Layer1.Background.Picture.Name = "second-hand.png"; var_Layer1.ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " + "floor(=:1)) * 60 )) - floor(=:2) ) * 360"; var_Layer1.RotateAngleToValue = "value / 360 / 24 / 60"; exontrol.EXGAUGELib.Layer var_Layer2 = exgauge1.Layers[2]; var_Layer2.Position = 2; var_Layer2.Key = "min"; var_Layer2.OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer2.Selectable = false; var_Layer2.Background.Picture.Name = "Minute.png"; var_Layer2.ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" + "=:1)) * 360"; var_Layer2.RotateAngleToValue = "value / 360 / 24 / 60"; exontrol.EXGAUGELib.Layer var_Layer3 = exgauge1.Layers[3]; var_Layer3.Position = 1; var_Layer3.Key = "hour"; var_Layer3.OnDrag = exontrol.EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer3.Selectable = false; var_Layer3.Background.Picture.Name = "Hour.png"; var_Layer3.ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )"; var_Layer3.RotateAngleToValue = "value / 360 * 0.5"; exgauge1.LayerOfValue = 3; exgauge1.Value = exgauge1.FormatABC("date(`now`)",null,null,null); exgauge1.TimerInterval = 1000;
JScript/JavaScript
<BODY onload="Init()"> <SCRIPT FOR="Gauge1" EVENT="Change(Layer)" LANGUAGE="JScript"> Gauge1.Layers.Item("sec").Value = Gauge1.Value; Gauge1.Layers.Item("min").Value = Gauge1.Value; Gauge1.Layers.Item("hour").Value = Gauge1.Value; </SCRIPT> <SCRIPT FOR="Gauge1" EVENT="Timer(TickCount)" LANGUAGE="JScript"> Gauge1.Value = Gauge1.FormatABC("value + 1/24/60/60",Gauge1.Value,null,null); </SCRIPT> <OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { Gauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Clock"; Gauge1.DefaultLayer(185) = 2; Gauge1.Layers.Count = 4; var var_Layer = Gauge1.Layers.Item(0); var_Layer.Background.Picture.Name = "vista_clock.png"; var var_Layer1 = Gauge1.Layers.Item(1); var_Layer1.Position = 3; var_Layer1.Key = "sec"; var_Layer1.OnDrag = 2; var_Layer1.Selectable = false; var_Layer1.Background.Picture.Name = "second-hand.png"; var_Layer1.ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " + "floor(=:1)) * 60 )) - floor(=:2) ) * 360"; var_Layer1.RotateAngleToValue = "value / 360 / 24 / 60"; var var_Layer2 = Gauge1.Layers.Item(2); var_Layer2.Position = 2; var_Layer2.Key = "min"; var_Layer2.OnDrag = 2; var_Layer2.Selectable = false; var_Layer2.Background.Picture.Name = "Minute.png"; var_Layer2.ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" + "=:1)) * 360"; var_Layer2.RotateAngleToValue = "value / 360 / 24 / 60"; var var_Layer3 = Gauge1.Layers.Item(3); var_Layer3.Position = 1; var_Layer3.Key = "hour"; var_Layer3.OnDrag = 2; var_Layer3.Selectable = false; var_Layer3.Background.Picture.Name = "Hour.png"; var_Layer3.ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )"; var_Layer3.RotateAngleToValue = "value / 360 * 0.5"; Gauge1.LayerOfValue = 3; Gauge1.Value = Gauge1.FormatABC("date(`now`)",null,null,null); Gauge1.TimerInterval = 1000; } </SCRIPT> </BODY>
VBScript
<BODY onload="Init()"> <SCRIPT LANGUAGE="VBScript"> Function Gauge1_Change(Layer) With Gauge1 .Layers.Item("sec").Value = Gauge1.Value .Layers.Item("min").Value = Gauge1.Value .Layers.Item("hour").Value = Gauge1.Value End With End Function </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function Gauge1_Timer(TickCount) With Gauge1 .Value = .FormatABC("value + 1/24/60/60",.Value) End With End Function </SCRIPT> <OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Gauge1 .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" .DefaultLayer(185) = 2 .Layers.Count = 4 With .Layers.Item(0) .Background.Picture.Name = "vista_clock.png" End With With .Layers.Item(1) .Position = 3 .Key = "sec" .OnDrag = 2 .Selectable = False .Background.Picture.Name = "second-hand.png" .ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " & _ "floor(=:1)) * 60 )) - floor(=:2) ) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(2) .Position = 2 .Key = "min" .OnDrag = 2 .Selectable = False .Background.Picture.Name = "Minute.png" .ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" & _ "=:1)) * 360" .RotateAngleToValue = "value / 360 / 24 / 60" End With With .Layers.Item(3) .Position = 1 .Key = "hour" .OnDrag = 2 .Selectable = False .Background.Picture.Name = "Hour.png" .ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" .RotateAngleToValue = "value / 360 * 0.5" End With .LayerOfValue = 3 .Value = .FormatABC("date(`now`)") .TimerInterval = 1000 End With End Function </SCRIPT> </BODY>
C# for /COM
// Change event - Occurs when the layer's value is changed. private void axGauge1_Change(object sender, AxEXGAUGELib._IGaugeEvents_ChangeEvent e) { axGauge1.Layers["sec"].Value = axGauge1.Value; axGauge1.Layers["min"].Value = axGauge1.Value; axGauge1.Layers["hour"].Value = axGauge1.Value; } //this.axGauge1.Change += new AxEXGAUGELib._IGaugeEvents_ChangeEventHandler(this.axGauge1_Change); // Timer event - Occurs when the interval elapses. private void axGauge1_Timer(object sender, AxEXGAUGELib._IGaugeEvents_TimerEvent e) { axGauge1.Value = axGauge1.FormatABC("value + 1/24/60/60",axGauge1.Value,null,null); } //this.axGauge1.Timer += new AxEXGAUGELib._IGaugeEvents_TimerEventHandler(this.axGauge1_Timer); axGauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Clock"; axGauge1.set_DefaultLayer(EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,2); axGauge1.Layers.Count = 4; EXGAUGELib.Layer var_Layer = axGauge1.Layers[0]; var_Layer.Background.Picture.Name = "vista_clock.png"; EXGAUGELib.Layer var_Layer1 = axGauge1.Layers[1]; var_Layer1.Position = 3; var_Layer1.Key = "sec"; var_Layer1.OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer1.Selectable = false; var_Layer1.Background.Picture.Name = "second-hand.png"; var_Layer1.ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - " + "floor(=:1)) * 60 )) - floor(=:2) ) * 360"; var_Layer1.RotateAngleToValue = "value / 360 / 24 / 60"; EXGAUGELib.Layer var_Layer2 = axGauge1.Layers[2]; var_Layer2.Position = 2; var_Layer2.Key = "min"; var_Layer2.OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer2.Selectable = false; var_Layer2.Background.Picture.Name = "Minute.png"; var_Layer2.ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(" + "=:1)) * 360"; var_Layer2.RotateAngleToValue = "value / 360 / 24 / 60"; EXGAUGELib.Layer var_Layer3 = axGauge1.Layers[3]; var_Layer3.Position = 1; var_Layer3.Key = "hour"; var_Layer3.OnDrag = EXGAUGELib.OnDragLayerEnum.exDoRotate; var_Layer3.Selectable = false; var_Layer3.Background.Picture.Name = "Hour.png"; var_Layer3.ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )"; var_Layer3.RotateAngleToValue = "value / 360 * 0.5"; axGauge1.LayerOfValue = 3; axGauge1.Value = axGauge1.FormatABC("date(`now`)",null,null,null); axGauge1.TimerInterval = 1000;
X++ (Dynamics Ax 2009)
// Change event - Occurs when the layer's value is changed. void onEvent_Change(int _Layer) { COM com_Layer; anytype var_Layer; ; var_Layer = COM::createFromObject(exgauge1.Layers()).Item("sec"); com_Layer = var_Layer; com_Layer.Value(exgauge1.Value()); var_Layer = COM::createFromObject(exgauge1.Layers()).Item("min"); com_Layer = var_Layer; com_Layer.Value(exgauge1.Value()); var_Layer = COM::createFromObject(exgauge1.Layers()).Item("hour"); com_Layer = var_Layer; com_Layer.Value(exgauge1.Value()); } // Timer event - Occurs when the interval elapses. void onEvent_Timer(int _TickCount) { ; exgauge1.Value(exgauge1.FormatABC("value + 1/24/60/60",exgauge1.Value())); } public void init() { COM com_Background,com_Layer,com_Layer1,com_Layer2,com_Layer3,com_Picture; anytype var_Background,var_Layer,var_Layer1,var_Layer2,var_Layer3,var_Picture; str var_s,var_s1; ; super(); exgauge1.PicturesPath("C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Clock"); exgauge1.DefaultLayer(185/*exDefLayerRotateType*/,COMVariant::createFromInt(2)); exgauge1.Layers().Count(4); var_Layer = COM::createFromObject(exgauge1.Layers()).Item(COMVariant::createFromInt(0)); com_Layer = var_Layer; var_Background = COM::createFromObject(com_Layer.Background()); com_Background = var_Background; var_Picture = COM::createFromObject(com_Background).Picture(); com_Picture = var_Picture; com_Picture.Name("vista_clock.png"); var_Layer1 = COM::createFromObject(exgauge1.Layers()).Item(COMVariant::createFromInt(1)); com_Layer1 = var_Layer1; com_Layer1.Position(3); com_Layer1.Key("sec"); com_Layer1.OnDrag(2/*exDoRotate*/); com_Layer1.Selectable(false); var_Background = COM::createFromObject(com_Layer1.Background()); com_Background = var_Background; var_Picture = COM::createFromObject(com_Background).Picture(); com_Picture = var_Picture; com_Picture.Name("second-hand.png"); var_s = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - f"; var_s = var_s + "loor(=:1)) * 60 )) - floor(=:2) ) * 360"; com_Layer1.ValueToRotateAngle(var_s); com_Layer1.RotateAngleToValue("value / 360 / 24 / 60"); var_Layer2 = COM::createFromObject(exgauge1.Layers()).Item(COMVariant::createFromInt(2)); com_Layer2 = var_Layer2; com_Layer2.Position(2); com_Layer2.Key("min"); com_Layer2.OnDrag(2/*exDoRotate*/); com_Layer2.Selectable(false); var_Background = COM::createFromObject(com_Layer2.Background()); com_Background = var_Background; var_Picture = COM::createFromObject(com_Background).Picture(); com_Picture = var_Picture; com_Picture.Name("Minute.png"); var_s1 = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(="; var_s1 = var_s1 + ":1)) * 360"; com_Layer2.ValueToRotateAngle(var_s1); com_Layer2.RotateAngleToValue("value / 360 / 24 / 60"); var_Layer3 = COM::createFromObject(exgauge1.Layers()).Item(COMVariant::createFromInt(3)); com_Layer3 = var_Layer3; com_Layer3.Position(1); com_Layer3.Key("hour"); com_Layer3.OnDrag(2/*exDoRotate*/); com_Layer3.Selectable(false); var_Background = COM::createFromObject(com_Layer3.Background()); com_Background = var_Background; var_Picture = COM::createFromObject(com_Background).Picture(); com_Picture = var_Picture; com_Picture.Name("Hour.png"); com_Layer3.ValueToRotateAngle("2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )"); com_Layer3.RotateAngleToValue("value / 360 * 0.5"); exgauge1.LayerOfValue(3); exgauge1.Value(exgauge1.FormatABC("date(`now`)")); exgauge1.TimerInterval(1000); }
Delphi 8 (.NET only)
// Change event - Occurs when the layer's value is changed. procedure TWinForm1.AxGauge1_Change(sender: System.Object; e: AxEXGAUGELib._IGaugeEvents_ChangeEvent); begin with AxGauge1 do begin Layers.Item['sec'].Value := AxGauge1.Value; Layers.Item['min'].Value := AxGauge1.Value; Layers.Item['hour'].Value := AxGauge1.Value; end end; // Timer event - Occurs when the interval elapses. procedure TWinForm1.AxGauge1_Timer(sender: System.Object; e: AxEXGAUGELib._IGaugeEvents_TimerEvent); begin with AxGauge1 do begin Value := FormatABC('value + 1/24/60/60',Value,Nil,Nil); end end; with AxGauge1 do begin PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock'; set_DefaultLayer(EXGAUGELib.DefaultLayerPropertyEnum.exDefLayerRotateType,TObject(2)); Layers.Count := 4; with Layers.Item[TObject(0)] do begin Background.Picture.Name := 'vista_clock.png'; end; with Layers.Item[TObject(1)] do begin Position := 3; Key := 'sec'; OnDrag := EXGAUGELib.OnDragLayerEnum.exDoRotate; Selectable := False; Background.Picture.Name := 'second-hand.png'; ValueToRotateAngle := '((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - f' + 'loor(=:1)) * 60 )) - floor(=:2) ) * 360'; RotateAngleToValue := 'value / 360 / 24 / 60'; end; with Layers.Item[TObject(2)] do begin Position := 2; Key := 'min'; OnDrag := EXGAUGELib.OnDragLayerEnum.exDoRotate; Selectable := False; Background.Picture.Name := 'Minute.png'; ValueToRotateAngle := '((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=' + ':1)) * 360'; RotateAngleToValue := 'value / 360 / 24 / 60'; end; with Layers.Item[TObject(3)] do begin Position := 1; Key := 'hour'; OnDrag := EXGAUGELib.OnDragLayerEnum.exDoRotate; Selectable := False; Background.Picture.Name := 'Hour.png'; ValueToRotateAngle := '2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )'; RotateAngleToValue := 'value / 360 * 0.5'; end; LayerOfValue := 3; Value := FormatABC('date(`now`)',Nil,Nil,Nil); TimerInterval := 1000; end
Delphi (standard)
// Change event - Occurs when the layer's value is changed. procedure TForm1.Gauge1Change(ASender: TObject; Layer : Integer); begin with Gauge1 do begin Layers.Item['sec'].Value := Gauge1.Value; Layers.Item['min'].Value := Gauge1.Value; Layers.Item['hour'].Value := Gauge1.Value; end end; // Timer event - Occurs when the interval elapses. procedure TForm1.Gauge1Timer(ASender: TObject; TickCount : Integer); begin with Gauge1 do begin Value := FormatABC('value + 1/24/60/60',Value,Null,Null); end end; with Gauge1 do begin PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock'; DefaultLayer[EXGAUGELib_TLB.exDefLayerRotateType] := OleVariant(2); Layers.Count := 4; with Layers.Item[OleVariant(0)] do begin Background.Picture.Name := 'vista_clock.png'; end; with Layers.Item[OleVariant(1)] do begin Position := 3; Key := 'sec'; OnDrag := EXGAUGELib_TLB.exDoRotate; Selectable := False; Background.Picture.Name := 'second-hand.png'; ValueToRotateAngle := '((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - f' + 'loor(=:1)) * 60 )) - floor(=:2) ) * 360'; RotateAngleToValue := 'value / 360 / 24 / 60'; end; with Layers.Item[OleVariant(2)] do begin Position := 2; Key := 'min'; OnDrag := EXGAUGELib_TLB.exDoRotate; Selectable := False; Background.Picture.Name := 'Minute.png'; ValueToRotateAngle := '((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=' + ':1)) * 360'; RotateAngleToValue := 'value / 360 / 24 / 60'; end; with Layers.Item[OleVariant(3)] do begin Position := 1; Key := 'hour'; OnDrag := EXGAUGELib_TLB.exDoRotate; Selectable := False; Background.Picture.Name := 'Hour.png'; ValueToRotateAngle := '2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )'; RotateAngleToValue := 'value / 360 * 0.5'; end; LayerOfValue := 3; Value := FormatABC('date(`now`)',Null,Null,Null); TimerInterval := 1000; end
VFP
*** Change event - Occurs when the layer's value is changed. *** LPARAMETERS Layer with thisform.Gauge1 .Layers.Item("sec").Value = thisform.Gauge1.Value .Layers.Item("min").Value = thisform.Gauge1.Value .Layers.Item("hour").Value = thisform.Gauge1.Value endwith *** Timer event - Occurs when the interval elapses. *** LPARAMETERS TickCount with thisform.Gauge1 .Value = .FormatABC("value + 1/24/60/60",.Value) endwith with thisform.Gauge1 .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" .Object.DefaultLayer(185) = 2 .Layers.Count = 4 with .Layers.Item(0) .Background.Picture.Name = "vista_clock.png" endwith with .Layers.Item(1) .Position = 3 .Key = "sec" .OnDrag = 2 .Selectable = .F. .Background.Picture.Name = "second-hand.png" var_s = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - f" var_s = var_s + "loor(=:1)) * 60 )) - floor(=:2) ) * 360" .ValueToRotateAngle = var_s .RotateAngleToValue = "value / 360 / 24 / 60" endwith with .Layers.Item(2) .Position = 2 .Key = "min" .OnDrag = 2 .Selectable = .F. .Background.Picture.Name = "Minute.png" var_s1 = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=" var_s1 = var_s1 + ":1)) * 360" .ValueToRotateAngle = var_s1 .RotateAngleToValue = "value / 360 / 24 / 60" endwith with .Layers.Item(3) .Position = 1 .Key = "hour" .OnDrag = 2 .Selectable = .F. .Background.Picture.Name = "Hour.png" .ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" .RotateAngleToValue = "value / 360 * 0.5" endwith .LayerOfValue = 3 .Value = .FormatABC("date(`now`)") .TimerInterval = 1000 endwith
dBASE Plus
/* with (this.EXGAUGEACTIVEXCONTROL1.nativeObject) Change = class::nativeObject_Change endwith */ // Occurs when the layer's value is changed. function nativeObject_Change(Layer) oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject oGauge.Layers.Item("sec").Value = oGauge.Value oGauge.Layers.Item("min").Value = oGauge.Value oGauge.Layers.Item("hour").Value = oGauge.Value return /* with (this.EXGAUGEACTIVEXCONTROL1.nativeObject) Timer = class::nativeObject_Timer endwith */ // Occurs when the interval elapses. function nativeObject_Timer(TickCount) oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject oGauge.Value = oGauge.FormatABC("value + 1/24/60/60",oGauge.Value) return local oGauge,var_Layer,var_Layer1,var_Layer2,var_Layer3 oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" oGauge.Template = [DefaultLayer(185) = 2] // oGauge.DefaultLayer(185) = 2 oGauge.Layers.Count = 4 var_Layer = oGauge.Layers.Item(0) var_Layer.Background.Picture.Name = "vista_clock.png" var_Layer1 = oGauge.Layers.Item(1) var_Layer1.Position = 3 var_Layer1.Key = "sec" var_Layer1.OnDrag = 2 var_Layer1.Selectable = false var_Layer1.Background.Picture.Name = "second-hand.png" var_Layer1.ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 60 )) - floor(=:2) ) * 360" var_Layer1.RotateAngleToValue = "value / 360 / 24 / 60" var_Layer2 = oGauge.Layers.Item(2) var_Layer2.Position = 2 var_Layer2.Key = "min" var_Layer2.OnDrag = 2 var_Layer2.Selectable = false var_Layer2.Background.Picture.Name = "Minute.png" var_Layer2.ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 360" var_Layer2.RotateAngleToValue = "value / 360 / 24 / 60" var_Layer3 = oGauge.Layers.Item(3) var_Layer3.Position = 1 var_Layer3.Key = "hour" var_Layer3.OnDrag = 2 var_Layer3.Selectable = false var_Layer3.Background.Picture.Name = "Hour.png" var_Layer3.ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" var_Layer3.RotateAngleToValue = "value / 360 * 0.5" oGauge.LayerOfValue = 3 oGauge.Value = oGauge.FormatABC("date(`now`)") oGauge.TimerInterval = 1000
XBasic (Alpha Five)
' Occurs when the layer's value is changed. function Change as v (Layer as N) oGauge = topparent:CONTROL_ACTIVEX1.activex oGauge.Layers.Item("sec").Value = oGauge.Value oGauge.Layers.Item("min").Value = oGauge.Value oGauge.Layers.Item("hour").Value = oGauge.Value end function ' Occurs when the interval elapses. function Timer as v (TickCount as N) oGauge = topparent:CONTROL_ACTIVEX1.activex oGauge.Value = oGauge.FormatABC("value + 1/24/60/60",oGauge.Value) end function Dim oGauge as P Dim var_Layer as P Dim var_Layer1 as P Dim var_Layer2 as P Dim var_Layer3 as P oGauge = topparent:CONTROL_ACTIVEX1.activex oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" oGauge.Template = "DefaultLayer(185) = 2" // oGauge.DefaultLayer(185) = 2 oGauge.Layers.Count = 4 var_Layer = oGauge.Layers.Item(0) var_Layer.Background.Picture.Name = "vista_clock.png" var_Layer1 = oGauge.Layers.Item(1) var_Layer1.Position = 3 var_Layer1.Key = "sec" var_Layer1.OnDrag = 2 var_Layer1.Selectable = .f. var_Layer1.Background.Picture.Name = "second-hand.png" var_Layer1.ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 60 )) - floor(=:2) ) * 360" var_Layer1.RotateAngleToValue = "value / 360 / 24 / 60" var_Layer2 = oGauge.Layers.Item(2) var_Layer2.Position = 2 var_Layer2.Key = "min" var_Layer2.OnDrag = 2 var_Layer2.Selectable = .f. var_Layer2.Background.Picture.Name = "Minute.png" var_Layer2.ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 360" var_Layer2.RotateAngleToValue = "value / 360 / 24 / 60" var_Layer3 = oGauge.Layers.Item(3) var_Layer3.Position = 1 var_Layer3.Key = "hour" var_Layer3.OnDrag = 2 var_Layer3.Selectable = .f. var_Layer3.Background.Picture.Name = "Hour.png" var_Layer3.ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" var_Layer3.RotateAngleToValue = "value / 360 * 0.5" oGauge.LayerOfValue = 3 oGauge.Value = oGauge.FormatABC("date(`now`)") oGauge.TimerInterval = 1000
Visual Objects
METHOD OCX_Exontrol1Change(Layer) CLASS MainDialog // Change event - Occurs when the layer's value is changed. oDCOCX_Exontrol1:Layers:[Item,"sec"]:Value := oDCOCX_Exontrol1:Value oDCOCX_Exontrol1:Layers:[Item,"min"]:Value := oDCOCX_Exontrol1:Value oDCOCX_Exontrol1:Layers:[Item,"hour"]:Value := oDCOCX_Exontrol1:Value RETURN NIL METHOD OCX_Exontrol1Timer(TickCount) CLASS MainDialog // Timer event - Occurs when the interval elapses. oDCOCX_Exontrol1:Value := oDCOCX_Exontrol1:FormatABC("value + 1/24/60/60",oDCOCX_Exontrol1:Value,nil,nil) RETURN NIL local var_Layer,var_Layer1,var_Layer2,var_Layer3 as ILayer oDCOCX_Exontrol1:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" oDCOCX_Exontrol1:[DefaultLayer,exDefLayerRotateType] := 2 oDCOCX_Exontrol1:Layers:Count := 4 var_Layer := oDCOCX_Exontrol1:Layers:[Item,0] var_Layer:Background:Picture:Name := "vista_clock.png" var_Layer1 := oDCOCX_Exontrol1:Layers:[Item,1] var_Layer1:Position := 3 var_Layer1:Key := "sec" var_Layer1:OnDrag := exDoRotate var_Layer1:Selectable := false var_Layer1:Background:Picture:Name := "second-hand.png" var_Layer1:ValueToRotateAngle := "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 60 )) - floor(=:2) ) * 360" var_Layer1:RotateAngleToValue := "value / 360 / 24 / 60" var_Layer2 := oDCOCX_Exontrol1:Layers:[Item,2] var_Layer2:Position := 2 var_Layer2:Key := "min" var_Layer2:OnDrag := exDoRotate var_Layer2:Selectable := false var_Layer2:Background:Picture:Name := "Minute.png" var_Layer2:ValueToRotateAngle := "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 360" var_Layer2:RotateAngleToValue := "value / 360 / 24 / 60" var_Layer3 := oDCOCX_Exontrol1:Layers:[Item,3] var_Layer3:Position := 1 var_Layer3:Key := "hour" var_Layer3:OnDrag := exDoRotate var_Layer3:Selectable := false var_Layer3:Background:Picture:Name := "Hour.png" var_Layer3:ValueToRotateAngle := "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" var_Layer3:RotateAngleToValue := "value / 360 * 0.5" oDCOCX_Exontrol1:LayerOfValue := 3 oDCOCX_Exontrol1:Value := oDCOCX_Exontrol1:FormatABC("date(`now`)",nil,nil,nil) oDCOCX_Exontrol1:TimerInterval := 1000
PowerBuilder
/*begin event Change(long Layer) - Occurs when the layer's value is changed.*/ /* oGauge = ole_1.Object oGauge.Layers.Item("sec").Value = oGauge.Value oGauge.Layers.Item("min").Value = oGauge.Value oGauge.Layers.Item("hour").Value = oGauge.Value */ /*end event Change*/ /*begin event Timer(long TickCount) - Occurs when the interval elapses.*/ /* oGauge = ole_1.Object oGauge.Value = oGauge.FormatABC("value + 1/24/60/60",oGauge.Value) */ /*end event Timer*/ OleObject oGauge,var_Layer,var_Layer1,var_Layer2,var_Layer3 oGauge = ole_1.Object oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" oGauge.DefaultLayer(185,2) oGauge.Layers.Count = 4 var_Layer = oGauge.Layers.Item(0) var_Layer.Background.Picture.Name = "vista_clock.png" var_Layer1 = oGauge.Layers.Item(1) var_Layer1.Position = 3 var_Layer1.Key = "sec" var_Layer1.OnDrag = 2 var_Layer1.Selectable = false var_Layer1.Background.Picture.Name = "second-hand.png" var_Layer1.ValueToRotateAngle = "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 60 )) - floor(=:2) ) * 360" var_Layer1.RotateAngleToValue = "value / 360 / 24 / 60" var_Layer2 = oGauge.Layers.Item(2) var_Layer2.Position = 2 var_Layer2.Key = "min" var_Layer2.OnDrag = 2 var_Layer2.Selectable = false var_Layer2.Background.Picture.Name = "Minute.png" var_Layer2.ValueToRotateAngle = "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 360" var_Layer2.RotateAngleToValue = "value / 360 / 24 / 60" var_Layer3 = oGauge.Layers.Item(3) var_Layer3.Position = 1 var_Layer3.Key = "hour" var_Layer3.OnDrag = 2 var_Layer3.Selectable = false var_Layer3.Background.Picture.Name = "Hour.png" var_Layer3.ValueToRotateAngle = "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" var_Layer3.RotateAngleToValue = "value / 360 * 0.5" oGauge.LayerOfValue = 3 oGauge.Value = oGauge.FormatABC("date(`now`)") oGauge.TimerInterval = 1000
Visual DataFlex
// Occurs when the layer's value is changed. Procedure OnComChange Integer llLayer Forward Send OnComChange llLayer Variant voLayers Get ComLayers to voLayers Handle hoLayers Get Create (RefClass(cComLayers)) to hoLayers Set pvComObject of hoLayers to voLayers Variant voLayer Get ComItem of hoLayers "sec" to voLayer Handle hoLayer Get Create (RefClass(cComLayer)) to hoLayer Set pvComObject of hoLayer to voLayer Variant v Get ComValue to v Set ComValue of hoLayer to v Send Destroy to hoLayer Send Destroy to hoLayers Variant voLayers1 Get ComLayers to voLayers1 Handle hoLayers1 Get Create (RefClass(cComLayers)) to hoLayers1 Set pvComObject of hoLayers1 to voLayers1 Variant voLayer1 Get ComItem of hoLayers1 "min" to voLayer1 Handle hoLayer1 Get Create (RefClass(cComLayer)) to hoLayer1 Set pvComObject of hoLayer1 to voLayer1 Variant v1 Get ComValue to v1 Set ComValue of hoLayer1 to v1 Send Destroy to hoLayer1 Send Destroy to hoLayers1 Variant voLayers2 Get ComLayers to voLayers2 Handle hoLayers2 Get Create (RefClass(cComLayers)) to hoLayers2 Set pvComObject of hoLayers2 to voLayers2 Variant voLayer2 Get ComItem of hoLayers2 "hour" to voLayer2 Handle hoLayer2 Get Create (RefClass(cComLayer)) to hoLayer2 Set pvComObject of hoLayer2 to voLayer2 Variant v2 Get ComValue to v2 Set ComValue of hoLayer2 to v2 Send Destroy to hoLayer2 Send Destroy to hoLayers2 End_Procedure // Occurs when the interval elapses. Procedure OnComTimer Integer llTickCount Forward Send OnComTimer llTickCount Set ComValue to (ComFormatABC(Self,"value + 1/24/60/60",(ComValue(Self)),Nothing,Nothing)) End_Procedure Procedure OnCreate Forward Send OnCreate Set ComPicturesPath to "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" Set ComDefaultLayer OLEexDefLayerRotateType to 2 Variant voLayers3 Get ComLayers to voLayers3 Handle hoLayers3 Get Create (RefClass(cComLayers)) to hoLayers3 Set pvComObject of hoLayers3 to voLayers3 Set ComCount of hoLayers3 to 4 Send Destroy to hoLayers3 Variant voLayers4 Get ComLayers to voLayers4 Handle hoLayers4 Get Create (RefClass(cComLayers)) to hoLayers4 Set pvComObject of hoLayers4 to voLayers4 Variant voLayer3 Get ComItem of hoLayers4 0 to voLayer3 Handle hoLayer3 Get Create (RefClass(cComLayer)) to hoLayer3 Set pvComObject of hoLayer3 to voLayer3 Variant voBackground Get ComBackground of hoLayer3 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 ComName of hoPicture to "vista_clock.png" Send Destroy to hoPicture Send Destroy to hoBackground Send Destroy to hoLayer3 Send Destroy to hoLayers4 Variant voLayers5 Get ComLayers to voLayers5 Handle hoLayers5 Get Create (RefClass(cComLayers)) to hoLayers5 Set pvComObject of hoLayers5 to voLayers5 Variant voLayer4 Get ComItem of hoLayers5 1 to voLayer4 Handle hoLayer4 Get Create (RefClass(cComLayer)) to hoLayer4 Set pvComObject of hoLayer4 to voLayer4 Set ComPosition of hoLayer4 to 3 Set ComKey of hoLayer4 to "sec" Set ComOnDrag of hoLayer4 to OLEexDoRotate Set ComSelectable of hoLayer4 to False Variant voBackground1 Get ComBackground of hoLayer4 to voBackground1 Handle hoBackground1 Get Create (RefClass(cComBackground)) to hoBackground1 Set pvComObject of hoBackground1 to voBackground1 Variant voPicture1 Get ComPicture of hoBackground1 to voPicture1 Handle hoPicture1 Get Create (RefClass(cComPicture)) to hoPicture1 Set pvComObject of hoPicture1 to voPicture1 Set ComName of hoPicture1 to "second-hand.png" Send Destroy to hoPicture1 Send Destroy to hoBackground1 Set ComValueToRotateAngle of hoLayer4 to "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 60 )) - floor(=:2) ) * 360" Set ComRotateAngleToValue of hoLayer4 to "value / 360 / 24 / 60" Send Destroy to hoLayer4 Send Destroy to hoLayers5 Variant voLayers6 Get ComLayers to voLayers6 Handle hoLayers6 Get Create (RefClass(cComLayers)) to hoLayers6 Set pvComObject of hoLayers6 to voLayers6 Variant voLayer5 Get ComItem of hoLayers6 2 to voLayer5 Handle hoLayer5 Get Create (RefClass(cComLayer)) to hoLayer5 Set pvComObject of hoLayer5 to voLayer5 Set ComPosition of hoLayer5 to 2 Set ComKey of hoLayer5 to "min" Set ComOnDrag of hoLayer5 to OLEexDoRotate Set ComSelectable of hoLayer5 to False Variant voBackground2 Get ComBackground of hoLayer5 to voBackground2 Handle hoBackground2 Get Create (RefClass(cComBackground)) to hoBackground2 Set pvComObject of hoBackground2 to voBackground2 Variant voPicture2 Get ComPicture of hoBackground2 to voPicture2 Handle hoPicture2 Get Create (RefClass(cComPicture)) to hoPicture2 Set pvComObject of hoPicture2 to voPicture2 Set ComName of hoPicture2 to "Minute.png" Send Destroy to hoPicture2 Send Destroy to hoBackground2 Set ComValueToRotateAngle of hoLayer5 to "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 360" Set ComRotateAngleToValue of hoLayer5 to "value / 360 / 24 / 60" Send Destroy to hoLayer5 Send Destroy to hoLayers6 Variant voLayers7 Get ComLayers to voLayers7 Handle hoLayers7 Get Create (RefClass(cComLayers)) to hoLayers7 Set pvComObject of hoLayers7 to voLayers7 Variant voLayer6 Get ComItem of hoLayers7 3 to voLayer6 Handle hoLayer6 Get Create (RefClass(cComLayer)) to hoLayer6 Set pvComObject of hoLayer6 to voLayer6 Set ComPosition of hoLayer6 to 1 Set ComKey of hoLayer6 to "hour" Set ComOnDrag of hoLayer6 to OLEexDoRotate Set ComSelectable of hoLayer6 to False Variant voBackground3 Get ComBackground of hoLayer6 to voBackground3 Handle hoBackground3 Get Create (RefClass(cComBackground)) to hoBackground3 Set pvComObject of hoBackground3 to voBackground3 Variant voPicture3 Get ComPicture of hoBackground3 to voPicture3 Handle hoPicture3 Get Create (RefClass(cComPicture)) to hoPicture3 Set pvComObject of hoPicture3 to voPicture3 Set ComName of hoPicture3 to "Hour.png" Send Destroy to hoPicture3 Send Destroy to hoBackground3 Set ComValueToRotateAngle of hoLayer6 to "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" Set ComRotateAngleToValue of hoLayer6 to "value / 360 * 0.5" Send Destroy to hoLayer6 Send Destroy to hoLayers7 Set ComLayerOfValue to 3 Set ComValue to (ComFormatABC(Self,"date(`now`)",Nothing,Nothing,Nothing)) Set ComTimerInterval to 1000 End_Procedure
XBase++
PROCEDURE OnChange(oGauge,Layer) oGauge:Layers:Item("sec"):Value := oGauge:Value() oGauge:Layers:Item("min"):Value := oGauge:Value() oGauge:Layers:Item("hour"):Value := oGauge:Value() RETURN PROCEDURE OnTimer(oGauge,TickCount) oGauge:Value := oGauge:FormatABC("value + 1/24/60/60",oGauge:Value()) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGauge LOCAL oLayer,oLayer1,oLayer2,oLayer3 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:Change := {|Layer| OnChange(oGauge,Layer)} /*Occurs when the layer's value is changed.*/ oGauge:Timer := {|TickCount| OnTimer(oGauge,TickCount)} /*Occurs when the interval elapses.*/ oGauge:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Clock" oGauge:SetProperty("DefaultLayer",185/*exDefLayerRotateType*/,2) oGauge:Layers():Count := 4 oLayer := oGauge:Layers:Item(0) oLayer:Background():Picture():Name := "vista_clock.png" oLayer1 := oGauge:Layers:Item(1) oLayer1:Position := 3 oLayer1:Key := "sec" oLayer1:OnDrag := 2/*exDoRotate*/ oLayer1:Selectable := .F. oLayer1:Background():Picture():Name := "second-hand.png" oLayer1:ValueToRotateAngle := "((2:=(((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 60 )) - floor(=:2) ) * 360" oLayer1:RotateAngleToValue := "value / 360 / 24 / 60" oLayer2 := oGauge:Layers:Item(2) oLayer2:Position := 2 oLayer2:Key := "min" oLayer2:OnDrag := 2/*exDoRotate*/ oLayer2:Selectable := .F. oLayer2:Background():Picture():Name := "Minute.png" oLayer2:ValueToRotateAngle := "((1:=( ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) ) * 24 )) - floor(=:1)) * 360" oLayer2:RotateAngleToValue := "value / 360 / 24 / 60" oLayer3 := oGauge:Layers:Item(3) oLayer3:Position := 1 oLayer3:Key := "hour" oLayer3:OnDrag := 2/*exDoRotate*/ oLayer3:Selectable := .F. oLayer3:Background():Picture():Name := "Hour.png" oLayer3:ValueToRotateAngle := "2 * 360 * ( (0:=(value < 0 ? floor(value) + 1 - value : value - floor(value))) < 0.5 ? =:0 : (0:= (=:0 - 0.5)) )" oLayer3:RotateAngleToValue := "value / 360 * 0.5" oGauge:LayerOfValue := 3 oGauge:Value := oGauge:FormatABC("date(`now`)") oGauge:TimerInterval := 1000 oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN