Support Forums
Custom Widgets Opacy

I have made some custom widgets with several settings, digital- and analog tags. I now entered a problem. See the widget below:
5981ba30d87b8.png

I will animate the dash-bar to move up and down according to some analog value, this is no problem. But I want everything outside the dark box to be invisible.
Inserting the widget to a page makes it look like this:

5981ba80e465c.png

But I want it to look like this:
5981bafddc120.png

I have made some custom widgets with several settings, digital- and analog tags. I now entered a problem. See the widget below: ![5981ba30d87b8.png](serve/attachment&path=5981ba30d87b8.png) I will animate the dash-bar to move up and down according to some analog value, this is no problem. But I want everything outside the dark box to be invisible. Inserting the widget to a page makes it look like this: ![5981ba80e465c.png](serve/attachment&path=5981ba80e465c.png) But I want it to look like this: ![5981bafddc120.png](serve/attachment&path=5981bafddc120.png)

I added

(19, 70, 186, 18)

(The coordinates of the dark box)

to the top of the Sensor SRC, and imported it as a new Widget, it now looks OK in the widget view, but no difference when i put it on a page.

5981dd7e0cc34.png

I added ```` (19, 70, 186, 18) ```` (The coordinates of the dark box) to the top of the Sensor SRC, and imported it as a new Widget, it now looks OK in the widget view, but no difference when i put it on a page. ![5981dd7e0cc34.png](serve/attachment&path=5981dd7e0cc34.png)

Can you send me a ChangeSet file, please so I can see what you have?

Email it to support@trihedral.com.

Can you send me a ChangeSet file, please so I can see what you have? Email it to support@trihedral.com.

Doug Spurrell

edited Aug 2 '17 at 5:01 pm

We have taken this off line for now. It appears that this may be more of an image issue than an actual widget design issue in VTScada.

We have taken this off line for now. It appears that this may be more of an image issue than an actual widget design issue in VTScada.

Doug Spurrell

Thanks for the email, Doug. It seems like what I want to do is still unclear.

I want the Widget to act/look like this:
59846d52d5e9e.gif

But what I end up with, is this:
59846cc087810.gif

Which will look like this:

59846d7ee3ae5.png

I think what I am looking for is something like SetModuleRefBox or SetInstanceRefBox , but I cant make any of these work properly.

I also see no possibility to use neither ActiveOrange nor TransparentBlack .

Thanks for the email, Doug. It seems like what I want to do is still unclear. I want the Widget to act/look like this: ![59846d52d5e9e.gif](serve/attachment&path=59846d52d5e9e.gif) But what I end up with, is this: ![59846cc087810.gif](serve/attachment&path=59846cc087810.gif) Which will look like this: ![59846d7ee3ae5.png](serve/attachment&path=59846d7ee3ae5.png) I think what I am looking for is something like [SetModuleRefBox](https://www.trihedral.com/help/Content/Pro_Functions/SetModuleRefBox.htm?Highlight=%20box%20set "SetModuleRefBox") or [SetInstanceRefBox](https://www.trihedral.com/help/Content/Pro_Functions/SetInstanceRefBox.htm "SetInstanceRefBox") , but I cant make any of these work properly. I also see no possibility to use neither [ActiveOrange](https://www.trihedral.com/help/Content/D_Tools/D_ActiveOrange.htm?Highlight=orange "ActiveOrange") nor [TransparentBlack](https://www.trihedral.com/help/Content/D_Tools/D_TransparentBlack.htm "TransparentBlack") .

The problem is that your rollbar.png is larger than the black box portion of the widget. You cannot turn off part of graphic. I think you need to re-draw the topbar.png so it fists inside the black box. I will pass this along to our development people to see if they have any other ideas.

The problem is that your rollbar.png is larger than the black box portion of the widget. You cannot turn off part of graphic. I think you need to re-draw the topbar.png so it fists inside the black box. I will pass this along to our development people to see if they have any other ideas.

Doug Spurrell

From 11-2 Programmers Guide - SetModuleRefBox

A module's reference box defines an area that will exactly
enclose all active graphics (graphics currently displayed) in
the module before any rotations and trajectories have been
applied. A module reference box, or MRB as it is sometimes
called, is not a clipping region and objects can and
often will extend outside of their MRB as a result of applied
rotations or trajectories.
When a module is transformed, the transform is based on
the size of the module as determined by its reference box.
If the module switches states, the active graphics will
change, thereby changing the MRB for that module. The
result is that the transform will change such that graphic
objects will grow or shrink, so that the module's reference
box will always exactly fill the reference box of the transform.
In the case of graphics that have had a rotation or trajectory
applied to them, the graphics will be transformed
correctly, but the MRB may no longer contain the objects
in their modified positions.
This statement allows the user to set the reference box of a
module to a constant size, so that as graphics become active
and inactive, the transform will not cause the graphic
objects to grow and shrink - since the transform is based
on the module's reference box, and this is now fixed, the
transform will be similarly fixed.

5981dd7e0cc34.png

This is pretty much exactly what I want. But the effect is only on the Widget View, as seen above on the Sensor_Widget_test

From 11-2 Programmers Guide - SetModuleRefBox > A module's reference box defines an area that will exactly enclose all active graphics (graphics currently displayed) in the module before any rotations and trajectories have been applied. A module reference box, or MRB as it is sometimes called, is not a clipping region and objects can and often will extend outside of their MRB as a result of applied rotations or trajectories. When a module is transformed, the transform is based on the size of the module as determined by its reference box. If the module switches states, the active graphics will change, thereby changing the MRB for that module. The result is that the transform will change such that graphic objects will grow or shrink, so that the module's reference box will always exactly fill the reference box of the transform. In the case of graphics that have had a rotation or trajectory applied to them, the graphics will be transformed correctly, but the MRB may no longer contain the objects in their modified positions. This statement allows the user to set the reference box of a module to a constant size, so that as graphics become active and inactive, the transform will not cause the graphic objects to grow and shrink - since the transform is based on the module's reference box, and this is now fixed, the transform will be similarly fixed. > ![5981dd7e0cc34.png](serve/attachment&path=5981dd7e0cc34.png) This is pretty much exactly what I want. But the effect is only on the Widget **View**, as seen above on the _Sensor_Widget_test_

For anyone interested, I ended up with this:

598d64a78894c.gif

For anyone interested, I ended up with this: ![598d64a78894c.gif](serve/attachment&path=598d64a78894c.gif)

Can you send me a current changeset again, please? I would like to bounce this off development to see if we can make this easier.

Can you send me a current changeset again, please? I would like to bounce this off development to see if we can make this easier.

Doug Spurrell

And a suggestion from one of our developer's -

If the bar they want to move up and down is a bitmap, which it sounds like it might be going by the references to rollbar.png and topbar.png, I think it would be possible to do this by using Crop:

https://www.trihedral.com/help/Content/Pro_Functions/Crop.htm

With a little bit of script code to work out where to crop so the correct bit of the bitmap is visible depending on how far the bars are slid up or down if that makes sense.

If they're drawing the bars using GUIPolygon() etc then I'm not aware of a way to clip them.
They're also some pretty nice looking graphics!

And a suggestion from one of our developer's - If the bar they want to move up and down is a bitmap, which it sounds like it might be going by the references to rollbar.png and topbar.png, I think it would be possible to do this by using Crop: https://www.trihedral.com/help/Content/Pro_Functions/Crop.htm With a little bit of script code to work out where to crop so the correct bit of the bitmap is visible depending on how far the bars are slid up or down if that makes sense. If they're drawing the bars using GUIPolygon() etc then I'm not aware of a way to clip them. They're also some pretty nice looking graphics!

Doug Spurrell

263
10
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft