Jump to content

System button with image


graastein

Recommended Posts

One thing I don't understand: the system boolean has 6 states (also for hovering over it), but the pushbutton only has four. How do you add these two extra states to the push button?

My system button doesn't have 6 states, only 4. I did this work in LV 7. But 8 and 8.2 may have six states. I think NI added the highlight when mouseover occurs to LV 8+ system controls...

BTW, I tried to see if I could modify the button's icon via scripting, but didn't find anything. Of course I could have missed it, since I have never tried any scripting before this...

Michael, any idea if this work can be done with scripting?

Link to comment
One thing I don't understand: the system boolean has 6 states (also for hovering over it), but the pushbutton only has four. How do you add these two extra states to the push button?
Hmm, I have not created one from scratch in 8.x. I too did the work originally in 7.x. They seemed to inherit the other states by just upgrading to 8.x.
Michael, any idea if this work can be done with scripting?
I know the process can be automated because i've seen it done. I can't recall how at the moment. :unsure:
Link to comment
My system button doesn't have 6 states, only 4. I did this work in LV 7. But 8 and 8.2 may have six states. I think NI added the highlight when mouseover occurs to LV 8+ system controls...

BTW, I tried to see if I could modify the button's icon via scripting, but didn't find anything. Of course I could have missed it, since I have never tried any scripting before this...

Michael, any idea if this work can be done with scripting?

As far as I know (and I have investigated the issue), this can't be done with scripting. One thing though, I have not check in LV 8.2.

PJM

Link to comment

Hi!

Use .NET components from the windows framework.

I built a very simple example, which switches the buttons image all 500ms.

You have to install the .NET Framework 2.0 to use my sample program.

This is much easier than creating for each button with image a new control. Another advantage is, that you can

easily switch the images, create an backgroundimage and so on.

Download File:post-6148-1159112955.zip

If you want to use this in your application, you have to catch the users mouse click with an simple callback VI.

Tell me your experiences!

Greets from Austria

Joachim

Link to comment
Hi!

Use .NET components from the windows framework.

I built a very simple example, which switches the buttons image all 500ms.

You have to install the .NET Framework 2.0 to use my sample program.

This is much easier than creating for each button with image a new control. Another advantage is, that you can

easily switch the images, create an backgroundimage and so on.

Download File:post-6148-1159112955.zip

If you want to use this in your application, you have to catch the users mouse click with an simple callback VI.

Tell me your experiences!

Greets from Austria

Joachim

Create the controls is more complex but done once....NET implementation more simple but makes code more complex every time you use it...I guess it depends on your goals...

Link to comment

Could someone give there procedure and tools used to import a transparent image on the button?

Could someone give there procedure and tools used to import a transparent image on the button?

I believe i found the answer...

from the LV Help :book: :

Importing Graphics on Windows

You can import an image from a graphics application, drag and drop an image file into LabVIEW, or use the Edit

Link to comment
Hi!

Use .NET components from the windows framework.

I built a very simple example, which switches the buttons image all 500ms.

You have to install the .NET Framework 2.0 to use my sample program.

This is much easier than creating for each button with image a new control. Another advantage is, that you can

easily switch the images, create an backgroundimage and so on.

Download File:post-6148-1159112955.zip

If you want to use this in your application, you have to catch the users mouse click with an simple callback VI.

Tell me your experiences!

Greets from Austria

Joachim

Using the .net controls also removes the possibility of taking advantage of the cross-platform capabilities in LabView. Since it didn't take me 5 minutes to create this button, I think I would create or "borrow" buttons when I need to rather than using the .net implimentation.

Link to comment
Note If you import an image by copying and pasting it, the image loses any transparency.

I have not seen this (well actually I have seen transparency after a copy/paste action) In that case I had a .wmf file opened in MS Word, edited the tranparency and then copy/paste this kept the tranparency in the button.

Ton

Link to comment
  • 1 month later...

Not to give a step by step, but you can do some fun things with the lighted pushbutton, vs the system.

post-45-1162587552.png?width=400

When you get into the parts window you note that the light and background graphics are independent of the main button and can be independently edited.

post-45-1162587648.png?width=400

Have fun :D

I have not seen this (well actually I have seen transparency after a copy/paste action) In that case I had a .wmf file opened in MS Word, edited the tranparency and then copy/paste this kept the tranparency in the button.

If you use an enhanced metafile (*.emf) you keep the transparency and benefit from scalable vector graphics as well.

Link to comment

You can save the image from within you graphics program to a file format that supports transparancy (I usually save as *.png).

Then, from the control editor (or you front panel), choose Edit > Import picture to clipboard.

For controls, open the control, switch to customize mode, right click on the control, select the picture item you want to change and choose 'import picture from clipboard'

I have not seen this (well actually I have seen transparency after a copy/paste action) In that case I had a .wmf file opened in MS Word, edited the tranparency and then copy/paste this kept the tranparency in the button.

Ton

Link to comment
Well I do like a challenge. At first I didn't care that the image didn't shift. But you threw down the guantlet... As others have mentioned you do start out with a new push button control. Open it in the control editor, then save it. Create another new control editor to put a system button into. Copy each picture item state from the system button to the push button. Then create a picture that you want to serve as part of your button, with a true and a false state. Copy to the clipboard the false state, then import it into the light part of the former push button. Import the true state into the true state of the light part of the push button and vola! you have a system control that also has an icon.

One thing I don't understand: the system boolean has 6 states (also for hovering over it), but the pushbutton only has four. How do you add these two extra states to the push button?
I have made 3 buttons with this technique. A save, open and new button.

This is made in LabVIEW 8

Hi, all!

Somebody can explain again how to make system buttons(6 states, with for hovering over states) with picktures, using LabView 8.x?

How to add two extra states to the push button?

The technique written here does not work...

Link to comment
  • 8 months later...
  • 1 month later...

QUOTE(LV Punk @ Aug 24 2007, 07:49 PM)

Michael has http://forums.jkisoft.com/index.php?showtopic=490' target="_blank">a very detailed video located here explaining how to create the buttons. It helps if youv'e got both LV Versions 7 and 8 available.

Yes, I just seen it. I want an answer to my question: how to make it under lv 8.x only???

Eugen

Link to comment
  • 1 year later...

QUOTE (Fakir @ Nov 8 2006, 02:30 AM)

Hi, all!

Somebody can explain again how to make system buttons(6 states, with for hovering over states) with picktures, using LabView 8.x?

How to add two extra states to the push button?

The technique written here does not work...

You do not add extra states to the push button. This is impossible as it would require you to change the logic of the C coded button implementation in LabVIEW.

What you can do is changing the appearance of the system button to look like a push button.

Rolf Kalbermatter

Link to comment
  • 5 months later...

Hi all,

I'm looking for a old (but not so old...a 2009 post) post about the nice 6 states button.

I'm quite lost since the lava website has changed...

I remember that the guy in question made some Vista styled button, with the 6 states (see attached image), in different colors, all put in a front panel to share them.

Can you help me ?

Thanks,

Vista button

Link to comment

Hi all,

I'm looking for a old (but not so old...a 2009 post) post about the nice 6 states button.

I'm quite lost since the lava website has changed...

I remember that the guy in question made some Vista styled button, with the 6 states (see attached image), in different colors, all put in a front panel to share them.

Can you help me ?

Thanks,

Vista button

I'm not sure those are the ones you're referring to. These are Nuvola-style.

UI Tools

If not, perhaps you've seen them on the NI forums?

Link to comment

As a side question to LAVA, is there an "control or indication repository"? I have made a bunch of common ribbon-type buttons that might be nice to give to the community. Stuff like a Exit button, Save, Busy, the sort of thing that makes an application look more stylish and modern without being too flashy.

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.