Jump to content

Xcontrol Size


orko

Recommended Posts

I'm currently involved with a project that involves displaying numerous indicators with differing values, but changing appearance (colors, flashing, bold, etc) according to the value received. It sounded like a good excuse to pursue Xcontrols, which up until now I've not found much use in my applications for. I can do this manually, but with >50 indicators refreshing as fast as possible I thought Xcontrols would be more efficient.

My problem (and it may be a silly problem but I've expended much energy on Google and LAVA to no avail) is that I'm trying to get a numeric Xcontrol indicator that takes up about 60x24 pixels, but the windows operating system seems to not want to allow resizing the front panel below 120 wide? Messing with the "Window Bounds" property of the VI seems only to temporarily solves the issue...unless I have to programmatically set up the position/size/bounds of the Xcontrol in the Init VI (which I just tried to do but must have done wrong since I crashed LV). I've tried making my Xcontrol facade big and resizing it down once on the main app's FP, but it didn't seem to work as expected. Even checking the "Maintain proportions of window" and "Scale all objects on front panel as the window resizes" options in the VI Properties of the Fa

Link to comment
Basically I'm trying to put a bunch of these identically processed Xcontrols into arrays for display to the user, so I can't have any "empty space" around the indicator when I drop it down onto my main app's FP or things get messy real quick.

This won't work, you can't place an XControl inside an array....

You should make the array inside the XControl, or just use them apart

Ton

Link to comment
This won't work, you can't place an XControl inside an array....

Oh yeah, I didn't catch that. :rolleyes: Thanks for pointing that out, tcplomp

---

orko,

As near as I can tell, one cannot give array elements different properties (e.g, color, font style).

One possible (almost-)solution is to build an array of numeric indicators in front of an array of color indicators and set the color values based on your conditionals. I have built a small vi (with a big name) that demonstrates my suggestion.

I hope that helps,

--H

Download File:post-3343-1169221347.vi

Link to comment
This won't work, you can't place an XControl inside an array....
Well that sucks!

You can, however, place them inside a cluster. With some programmatic trickery, you can position them automatically and you can get an array of references where you can set properties (color, etc) to a specific element. Cluster to array and array to cluster primitives help here. i think this type of thing was also on the CLA test. :)

Link to comment

Michael_Aivaliotis--> Thanks for the steps you provided. They do provide a way to resize the Xcontrol's numeric indicator, but the "container" that is dropped onto the blank VI's FP ends up still being bigger than the indicator, which means that putting say 30 of the indicators on the FP and trying to align them all up with the compression/alignment tools gets real messy. You end up doing the alignment by hand (in my case it's about 50 indicators).

tcplomp--> Argh. Not being able to put these into arrays is hampering my style... :angry: Thanks for the very timely advice.

Doon--> Good point about not being able to change the properties of elements of an array individually. Another lesson I've relearned... Your VI is very....colorful :unsure: but it does illustrate a possible way I can go with this. The problem here is aligning the two arrays and all their elements perfectly so there's no "ghosting" of colors into adjoining elements.

Michael_Aivaliotis--> Yes, it does suck that you cannot have Xcontrols in arrays... but I understand what you are saying about using clusters and getting references into an array to do the coloring/blinking/etc by element positioning.

One question... Will the cluster to array primitive *always* index the resulting array corresponding to the cluster control orderring? If so, I could use this approach...

Edit: A little RTFM and yes, the cluster to array primitive does always index using the cluster order. :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.