LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
leahmedwards

Default Style can be applied to controls and indicators created from SubVIs

Status: New

Background: We are in a situation where we have been supplied with a library of VIs we need call in our code, but they use silver controls. This means that in SubVIs that we write, if we have to create controls and indicators from these VIs, they are created as Silver. Our default control style is not silver so this looks very mismatched. We like our non-UI VIs to use system controls.

 

I am aware that one can create 'fresh' controls and indicators in another style matching the type and wire them up, or one can right click on the controls and indicators and replace them with a different style of the same type (although this isn't guaranteed to have the same appearance as dropping them fresh, as it may inherit modifications made to the control/indicator and other properties), but it would be handy to have a quick way of creating 'fresh' controls and indicators in the style chosen under Tools>Options>Front Panel>Control Style for New VIs

 

Example: when I convert a Silver waveform graph to modern I get the graph on the right, whereas the graph on the left is a 'fresh' modern waveform graph.

leahmedwards_6-1656684472965.png

 

 

So how could this 'default control' option be selected by the user?  I had a look to see if this has been suggested before, and indeed altenbach suggested it here. I like both suggestions (Maybe a "shift-right-click...create" or similar? Maybe a preference setting or LabVIEW.ini entry?), though because shift is for the tools menu, perhaps ctrl+right click is better .I am posting it here as I cannot find an existing Ideas Exchange entry.

 

I understand that this might be difficult to implement due to the way controls and indicators work under the hood, and the fact that not all control/indicator types are available in all styles. I guess this is already handled in the Control Style for New VIs setting so might not need too much extra thought. Custom clusters might be trickier though, not sure.

 

Current behaviour: 'create (all) controls and indicators' applied to a subVI creates them in the style of the subVI

 

leahmedwards_0-1656680864490.png

You can see that my 'silver' subVI creates silver controls on calling VI.

leahmedwards_1-1656681213331.png

 

Desired Behaviour - If ini key to modify existing behaviour is applied (e.g. CreatedControlsAndIndicatorsAreDefaultStyle=True), or the VI is selected with shift+right click, the 'create control', 'create indicator' and 'create all controls and indicators' will create using the default style.

e.g.

leahmedwards_8-1656684944851.png

I *think* when you have System selected, 'Error Out' drops down a Modern error control as there is no System error control, if I understand this correctly. It's worth thinking about cases like this.

 

 

When applied to my example above, if my default was modern, the subVI's 'Silver' style controls and indicators show as Modern style in the calling VI, and they are 'fresh' rather than converted :

leahmedwards_7-1656684689242.png

 

 

Optional: LabVIEW *could* modify the menu item when you access via ctrl+right click, but this is not essential. I don't think these options should be added to the menu permanently alongside existing options otherwise it gets too cluttered.

leahmedwards_4-1656684099808.pngleahmedwards_5-1656684134512.png

 

 

It would also be nice to have a quick drop shortcut similar to Ctrl+D with this behaviour. Ctrl+shift+D is already taken.

 

Final thought: I could live without this feature if my other suggestion Front Panel Object's Style is shown under its properties (with the ability to change styles) was implemented, but it avoids the extra step of creating the controls and indicators before converting.

3 Comments
Petru_Tarabuta
Active Participant

Hi Leah,

 

+1. It would be nice for LabVIEW to implement your idea. It would be a step towards improving the uniformity of front panel objects look and feel in medium to large applications.

One way to replace the look and feel of a control or indicator with that of a "fresh" one of a different style is to:

1. Start off with a control or indicator of a style that needs to be changed. Let this be front panel object A.

2. Drop a fresh control or indicator of the desired style on the front panel. Let this be object B.

3. Select object B and press Ctrl + C (copy) or Ctrl + X (cut)

4. Select object A and press Ctrl + V (paste)

5. Object A's style will have been replaced with Object B's style. If Ctrl + X was pressed object B disappeared.

 

This is the quickest way I know of of replacing an object's style, with the end-result looking "fresh".

 

Sorry if you already knew this. I only found it out recently from a reply of AristosQueue to my idea Front panel controls and indicators should be genuine after being replaced with control or indicator.... I've been finding it very useful and using it since. In that idea I used the word "genuine" to denote the same as the word "fresh" in this idea.

leahmedwards
Member

Hi Petru,

 

Thanks for the tip, I will certainly use that next time I need to do replacements. After posting, I too realised we were talking about the same concept with "fresh" and "genuine" controls/indicators. UI design in LabVIEW has been on my mind a lot recently!

 

Today I found the QuickDrop plugin which automates style replacement for the specific instance of non-silver to silver: Quick Drop Keyboard Shortcut - Silver Conversion Tool.  It makes a new silver control and copies the properties over to it. If I ever get time I might see if it's possible to edit it to make a version which converts any control to the default style instead of silver.

 

Best wishes,

 

Leah

Petru_Tarabuta
Active Participant

Hi Leah,

Thanks for recommending the Silver Conversion Tool QuickDrop keyboard shortcut. I wasn't aware of it, but have just tried it and it's great.

 

Yes, it'd be great if there was a more general tool that could covert to the default style, or to a style of the user's choice, instead of just to silver. I suppose implementing the more general tool would be a lot of work, but hopefully it'd be worth it.

 

Regards,
Petru