Jump to content

Custom Control Scripting


Recommended Posts

There are some limitations. I don't remeber the details now but you can't create a control on a ctl file. It must be a VI file. In LabVIEW 7 I once attempt to create/modify a typedef and realized after making all the hard work, it was not possible to make that on a ctl....

Link to comment

Well gents, good news.

I started down the path and I am going along ok.

I was able to create a ref to the .ctl file just like a .vi

Open a ref to the FP then the [controls] and then typecast the single ctl ref to the correct one for the typedef. So far so good, but what I'm looking to do now is create a decoration of an image. But I can't seem to find the right combination of style & object class to create the new object.

So far I have been able to create other decorations like flat boxes, labels, chisled lines.

:question: Here's the code challenge of the day.

What is the correct combination to create a picture decoration?

On your marks, get set, go :!:

Link to comment

Norm,

I think trying to generate a picture decoration will be difficult. It would require programmatically accessing edit>inport picture from file. From there you can use copy and paste from clipboard scripting function. The difficulty reside in getting that picture in the clipboard (as I dont think they are any valid setting of style & object class that can be use with the new VI object primitive).

It is possible to have a VI open the target image file and to display it in a picture indicator, but if you copy this to the clipboard using LV scripting funtion, you do not only copy the image, but all the attributes of the picture control and you end up pasting a picture control in your target VI. One possible way to do it, would be to create a separate exe file (in labview) that will be called from the development environement. That program will open a image file, diaplay it in a picture control then script copy to cipboard then exit. Back in labview you *might* end up with just the image and not the attribute and you can then script the paste to your target control.

This is a convoluted solution that rely on executable, so I am not too excited about it. May be someone will come up with a better idea.

PJM

Link to comment

:thumbup: I'm working on the programming interface that allows this to happen a little easier.

All that is necessary is that the user have a VI with only the image that they want placed on the front panel.

From that point, w/ the scripting tools, we can open the vi, select all, copy selected, and then paste selected into the appropriate owner (FP, page, etc) ;)

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.