Jump to content

Create Custom Controls


Recommended Posts

I'm always disappointed, when I compare the frontpanel possibilities of LV and other languages like Delphi or so.

In text based languages you find a huge ammount of different controls and combination of controls extending the features and possibilities of your program. One can rewrite the code or add code to an existing control it he need it.

In LV one is restricted to the controls that NI permit the programmer to use.

A first step towards custom control is made with the custom probe and subpanels. It would be nice to have these features implemented in controls.

Features of custom controls should be:

- having code behind your control

- possibility to create events on the control

- redirect standard events of the control to modify its behaviour

- possibilities to combine controls (e.g. build a data navigator with "first","previous","next",... buttons

- possibility to disable/extend context menu on controls (e.g. disable the ability to autoscale a graph or remove buttons on tool palette)

Didier

Link to comment

It's a poor substitute, but you can use ActiveX controls under Windows- either existing ones or ones you've created yourself in a different language. Before NI supplied a treeview control, for instance, I was using the standard Windows one via ActiveX.

Obviously many drawbacks over a native G implimentation, but it does have uses.

Link to comment

I know about ActiveX and already used it several times.

The problem there is, that properties and methods often require "strange" structs, instances, pointers to variables of whatever type, ...

The great advantage of LV is, that data property is default and not hidden in a sub-sub-...-class :wacko: of the control like the ActiveX ones.

When I use ActiveX controls I often use more time to "decipher" the control than for wiring the whole rest of the program.

Didier

Link to comment
In LV one is restricted to the controls that NI permit the programmer to use.

A first step towards custom control is made with the custom probe and subpanels. It would be nice to have these features implemented in controls.

Features of custom controls should be:

- having code behind your control

- possibility to create events on the control

- redirect standard events of the control to modify its behaviour

- possibilities to combine controls (e.g. build a data navigator with "first","previous","next",... buttons

- possibility to disable/extend context menu on controls (e.g. disable the ability to autoscale a graph or remove buttons on tool palette)

I guess it might be true that having customisable controls may seem to limit labview but I believe most of what you have requested has already been handled by others without these features.

From personal experience I have just started devolving NI's teststand ActiveX controls and cannot get the $&*(%^*(& stuff to create reports; their "button" (itself an ActriveX control) seems to limit me from gaining any insight into how the code should be constructed to make it work. Callbacks - yuk!!! <gripe> This is supposed to be dataflow!! </gripe> I shudder to think of the mess if dropping a control on your FP added code that you didn't know about ;-)

"having code behind your control" - open a reference to your control, pass that reference to a subvi - as much code as you can ever want or handle can happen within the subvi.

"possibility to create events on the control" is this not available from 6.1 onwards. From 7 onwards you can create your won events and link these to a control via a reference and subvi as noted above.

"redirect standard events of the control to modify its behaviour" available from 6.1 or have I missed something?

"possibilities to combine controls" combine controls with the customise control option from the menu. There is a great article in LTR on creating complicated controls from the standard LV ones. I have also seen lovely coloured graphic equaliser looking controls created with the standard labview controls customised appropraitely.

"to disable/extend context menu on controls" also in LTR, there is an article on creating your own context menus. Perhaps not as good as the real thing but it only took me an hour to write my own from scratch having read this article and it works really great.

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
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.