09-09-2013 02:44 AM
I've written a small XControl for a boolean counter (remains active for a user-chosen number of iterations then changes to false). Simple functionality really.
I have code in place to allow the user to modify the label being shown and thus re-size the container for the XControl. This all works fine and I'm happy with the control.
My only problem occurs during initialisation where I need to re-arrange the FP of the Facade VI due to the variable length of the label. This results in some visible changes in appearance of the control which is not optimal. I'd like to be able to perform the same re-arranging within the Init VI instead of the facade VI itself. While I can resize the container properly (Using the Refnum in the "Container State" cluster) I cannot cahnge the properties of any of the controls on the facade. Is there any way to get references to the controls ont he FP of the facade VI during initialisation?
Either that or should I just include the control resizing code in the "Exec State Changed" case of the event structure?
Shane
09-09-2013 07:48 AM
Looking at one of the XControls I used, I see that there is some init code in the facade VI, but it's called before the main loop. I have no idea how this actually relates to the call to the init VI and the loading of the control, but it seemed to work in that case.
09-09-2013 09:05 AM
In my case I do some re-organising of the items ont he FP depending on how the XControl is set up. The locations of the controls and indicators on the FP of the facade VI are NOT saved with the state of the XControl. This leads to some nervous re-organisation whenever a VI using the XControl is loaded.
The init itself works fine, but there's no way to get to the control locations in the Facade VI fromt he Init VI as far as I can tell.
Maybe I should just call the failure to save the layout of the FP for the facade VI in the XControl state a bug and see what happens.
Shane
09-09-2013 11:25 AM
I have run into this before and unfortunately the word is that there is reliable way to get a reference to the facade VI from the Init ability. You can however catch the panel resize event when the facade opens on the front panel - or when its resized. Is that of any help?
Mike...