Infragistic ultragauge

Posted by thomas.rothlisberger on 08-Jan-2014 00:54

Hi

I am trying to use the ultragauge but cannot find how to set the needle programmatically. I can change it from the designer but not from my code.

Anybody has an example to share?

Kind regards

Thomas Rothlisberger

Posted by olivier.dunemann on 08-Jan-2014 02:38

This article should help: www.infragistics.com/.../75775.aspx

Posted by thomas.rothlisberger on 09-Jan-2014 17:10

HI Mike

Thank you for your help. What I had to do was include 'infragistics.ultragauge.resources.radialgauge' in the cast and then it worked.

Here is the full code:

radialGauge1 = CAST (ultraGauge1:Gauges[0], infragistics.ultragauge.resources.RadialGauge) .

       radialGaugeScale1 = cast (RadialGauge1:Scales[0], Infragistics.UltraGauge.Resources.RadialGaugeScale).

       radialGaugeNeedle1 = cast (RadialGaugeScale1:Markers[0], Infragistics.UltraGauge.Resources.RadialGaugeNeedle).

       RadialGaugeNeedle1:Value = 70.

Cheers

Thomas

All Replies

Posted by olivier.dunemann on 08-Jan-2014 02:38

This article should help: www.infragistics.com/.../75775.aspx

Posted by Jean Richert on 08-Jan-2014 06:34

Thanks Olivier for helping Thomas.

Posted by thomas.rothlisberger on 08-Jan-2014 19:35

Hi Olivier

Thanks for your suggestion, however I tried the example in your link and I get a compatability message.

"Incompatible data type in expression or assignment on the line 'radialGauge1 = ultraGauge1:Gauges[0].'

Here is my code:

CONSTRUCTOR PUBLIC gauge (  ):

       SUPER().

       InitializeComponent().

       THIS-OBJECT:ComponentsCollection:ADD(THIS-OBJECT:components).

       DEFINE VARIABLE radialGauge1 AS Infragistics.UltraGauge.Resources.RadialGauge NO-UNDO.

       DEFINE VARIABLE radialGaugeScale1 AS Infragistics.UltraGauge.Resources.RadialGaugeScale NO-UNDO.

       DEFINE VARIABLE radialGaugeNeedle1 AS Infragistics.UltraGauge.Resources.RadialGaugeNeedle NO-UNDO.

       radialGauge1 = ultraGauge1:Gauges[0].

       radialGaugeScale1 = RadialGauge1:Scales[0].

       radialGaugeNeedle1 = RadialGaugeScale1:Markers[0].

       RadialGaugeNeedle1:Value = 70.

       CATCH e AS Progress.Lang.Error:

           UNDO, THROW e.

       END CATCH.

END CONSTRUCTOR.

I am sure I am missing just a small thing but can't figure it out.

Kind regards

Thomas Rothlisberger

Posted by Mike Fechner on 08-Jan-2014 23:51

The Gauges collection of the UltraGauge Control returns objects of type "Gauge" - which is the base type of the "RadialGauge". The Markers of the Scales returns

Try: radialGauge1 = CAST (ultraGauge1:Gauges[0], RadialGauge) .

In the referenced Infragistics Thread, the line:

RadialGaugeNeedle RadialGaugeNeedle4 = ((RadialGauge)ultraGauge1.Gauges[0]).Scales[0].Markers[0] as RadialGaugeNeedle

should translate to:

DEFINE VARIABLE RadialGaugeNeedle4 AS RadialGaugeNeedle NO-UNDO.

RadialGaugeNeedle4 = CAST (CAST (ultraGauge1:Gauges[0], RadialGauge):Scales[0]:Markers[0], RadialGaugeNeedle).

Posted by thomas.rothlisberger on 09-Jan-2014 17:10

HI Mike

Thank you for your help. What I had to do was include 'infragistics.ultragauge.resources.radialgauge' in the cast and then it worked.

Here is the full code:

radialGauge1 = CAST (ultraGauge1:Gauges[0], infragistics.ultragauge.resources.RadialGauge) .

       radialGaugeScale1 = cast (RadialGauge1:Scales[0], Infragistics.UltraGauge.Resources.RadialGaugeScale).

       radialGaugeNeedle1 = cast (RadialGaugeScale1:Markers[0], Infragistics.UltraGauge.Resources.RadialGaugeNeedle).

       RadialGaugeNeedle1:Value = 70.

Cheers

Thomas

This thread is closed