Jump to content
Francois Normandin

[CR] UI Tools addon: Control class

Recommended Posts

So now when you run the Control Generator program it always pops a File Dialog window asking to "Select a single PNG file or choose a source directory for batch processing", is this something needed for the new two image VISTA1 buttons, because otherwise the screen looks exactly the same as the older version I can't figure out how I'm supposed to add the second image?

The opening popup is set in the config.ini file as the source directory for the icons. It will always ask you which icon you want for the first control to be created. I assume you don't want to create the same icon as last time, so I made the program ask again everytime it opens. If that's annoying, that could be changed.

The Control Generator program is exactly the same. What I did was simply add the functionality to the class, not modify the Control Generator program.

You can use the Control.lvclass methods as shown in the piece of code attached to the same post (Create Different Decals for True False.vi). This VI allows you to automate your control creation but without help from the Tools menu. Not setting the "true state" icon will simply take the "false state" icon for both. That's the easiest way to add it to the class while maintaining the same functionality. The class can be found in the user.lib, under UI Tools palette.

You see, at the moment, I rely on the way the template is ordered to know which states are true/false/hoover. This is not satisfying to me, but a quick fix for your opening question. Let's say you take the Outlook style template, which has four different backgrounds (actually: true and false states + 2 x hoover states, one for true and one for false), so if you try the code I provided, it might mess up the true and false states and you'd end up with a true decal on your false hoover state (Haven't checked, but that's what I suspect might happen). I'll probably create a tag in the template or number them as part of the PNG naming convention for the templates to work correctly whatever the initial template style, that way I could modify the class to know which ones are true and false and that will stay transparent for the user. I still need to keep it compatible in case someone out there has already modified the provided templates and uses them. I don't want to break the code you created last year...

To make a long story short: until I have this functionality added in the class (and keep backward compatibility with the current versions), I will not make modifications to the Control Generator. (But you can if you wish, on your own copy... ;))

Hope this answers your questions,

Share this post


Link to post
Share on other sites

Hi Francois,

I have to admit I preferred the old style where it just opened up without the dialog box. I would then open up Windows File Explorer in View Thumbnails Mode and just drag and drop the PNG images I wanted directly into the Path Control of your program.

Oops I missed your example - yeah that's fine for what I want to do I'll also have a play around with the UI Tools_Controls palette, thanks so much for all your help

Chris.

Share this post


Link to post
Share on other sites

I have to admit I preferred the old style where it just opened up without the dialog box. I would then open up Windows File Explorer in View Thumbnails Mode and just drag and drop the PNG images I wanted directly into the Path Control of your program.

Thanks for the feedback. I'll make that a configurable option in the next version.

Share this post


Link to post
Share on other sites

Hi Francois,

Sorry but I'm afraid I'm back again...

Everything had been running great with the Control Generator Tool, but after having a lot of problems with VIPM getting through our corporate firewall I finally did get through (temporarily) and subsequently VIPM upgraded a whole heap of Packages.

However now when I try to run the Control Generator Tool, it goes off looking for VI's like the JKI State Machine Support VI's (Add and Parse State Queue) and appears with a broken run arrow.

In VIPM I had selected Refresh Palettes and Mass Compile so I'm not quite sure what I've done wrong.

The current versions for UI Tools Addon I have installed are:

Control Class = 1.1.0.3

Control Class (System) = 1.1.0.3

jki_lib_state_machine = 2.0.0-1

Should I just re-install the previous version (1.1.0.1 or 1.0.15-1)?

Chris

Share this post


Link to post
Share on other sites

In VIPM I had selected Refresh Palettes and Mass Compile so I'm not quite sure what I've done wrong.

The current versions for UI Tools Addon I have installed are:

Control Class = 1.1.0.3

Control Class (System) = 1.1.0.3

jki_lib_state_machine = 2.0.0-1

Should I just re-install the previous version (1.1.0.1 or 1.0.15-1)?

Hi Chris,

Sorry for the late reply, I've been on vacation last week.

This package is an opg file dating back to vipm 3. I had to deal with post-install and pre-uninstall VIs myself. I might have made a mistake in the code and there's a messing up during upgrading.

When I downgraded to 1.0.15 in LV2010, I got the same problem you have. (missing jki files with uitools namespace)

I downloaded 1.0.14 and downgraded it one more step and it worked. But I couldn't get version 1.0.15 or 1.1.0 working. It seems the error is also with the Bitman dependencies.

I'll try and put up a package 1.2 in *.vip format.

In the meantime, you can use 1.0.14. Let me know if that's a workable solution in the meantime.

Share this post


Link to post
Share on other sites

Hi Francis,

That's odd I didn't get an e-mail notification to your reply - luckily I was still monitoring it and even luckier that you just came back from holiday - perhaps I should go and buy a lotto ticket :P

How do I install version 1.0.14, since VIPM will only let me downgrade to 1.0.15-1?

It's not really a problem if it's too difficult though, since I can wait for your new version 1.2 - thanks for doing this.

Chris

Share this post


Link to post
Share on other sites

How do I install version 1.0.14, since VIPM will only let me downgrade to 1.0.15-1?

You can download previous versions in the CR. Links are on the right side of the page.

http://screencast.com/t/p6K4XBous

Quick link:

http://lavag.org/index.php?app=downloads&module=display&section=download&do=version_download&id=196

Share this post


Link to post
Share on other sites

Excellent work Francois and so quick. :worshippy:

Downloaded the VIP package, installed it, and the Control Generator worked first time - thanks so much.

Chris

Share this post


Link to post
Share on other sites

Looks like a great tool. I got it working with 2010, but 2012 and 2013 generates corrupt ctl-files. Any plans on updating support for newer LabVIEW versions?

Share this post


Link to post
Share on other sites

Hi Thols, 

 

I've just verified that it works on my system in LV2012 on Win8.

I don't know why the control templates would be corrupted. Which versions of UI Tools and UI Tools addon: Control Class are you using?

 

Before I make a new package, can you test this for me on your system and tell me if it solves it?

In your User Document folder, please replace the content of your "LabVIEW DataLAVAControl Templates" folder with the content of this zip file:  

 

Control Templates.zip

 

This will restore the controls to the default LV8.6 ctl files. If they have been corrupted, this should solve it and point me in the right direction to correct the problem.

Share this post


Link to post
Share on other sites
Sorry for my very late reply. Forgot to check the topic and had not set up to receive emails for replies. 
 
Your zip file works. I don't remember now if there was any control templates installed in the package. Should there have been? I downloaded some templates but I don't remember them containing any "pdn" files. Perhaps that was the problem. Sorry that I don't remember anymore and cannot be of more help right now. I will surely check out your tool a bit more now. 

Share this post


Link to post
Share on other sites
I tried creating a control, but no matter what I do, state 2 and 4 is not scaled. Those pictures are only offset. It seems like they are correctly offset to handle a scaling, but the scaling is not done. I tried reinstalling the Controls addon and Bitman, but the problem persists. I tried on LV 2010, -11, -13. 
 
Any ideas? 
 

post-2740-0-65940100-1381680772.png

Share this post


Link to post
Share on other sites

Hi Thols, 

 

sorry for missing your post, because of the spam bots, it was on my page 3 and missed it for a few days.

 

This definitely comes from Control Class addon, not BitMan. 

Which version of the Control Class do you have installed? I assume it's 1.2.1.9. 

Share this post


Link to post
Share on other sites

I reproduced the bug.

 

Issue is with "Write Scale Icon.vi" located under "<LabVIEW>user.lib_LavaCRUI Tools_Control_classProperties".

In an earlier version, support for different True-False state images was added. The rescaling of the button image was not done for the even states (True).

 

Quick fix: Add the True Decal scaling factor to the bundler of "Write Scale Icon.vi".

 

10.19.2013-20.32.png

 

This will be fixed in the next version.

Share this post


Link to post
Share on other sites

New version uploaded. (1.3.0.12)

The previous one was reported to be broken.

Since it is a version I did not intend to modify before I revisited the API and its integration with UI Tools base package on LVTN, I changed the package filename and moved all files into LabVIEW folder to where I intend the future package to be. This package is not using "system files" anymore, which was the cause of some problems when installing on x64 systems.

 

This new version is a temporary version that I intend to revamp later on. However, I will do so as to not change the new template folder structure and this version (>= 1.3) will be backward compatible with the future version when it arrives. However, I have marked it as "Incompatible" with previous versions <=1.2.

 

It is my intent to modify the way the controls are generated to make them less static in nature. Stay tuned.

 

Thanks for the latest feedback by David and the previous users.

Share this post


Link to post
Share on other sites

Current version (Downloaded on 22.October 2014) has an error in the filenames for the 6-state button PNGs.  I had to rename the PNGs to get it to work properly.  The preview of the button states doesn't find any images and produces an incorrect image preview.

Share this post


Link to post
Share on other sites

I like this toolkit but as with so much software, after peeking under the hood, there are some other things I'd love to be able to do with it.....

 

We want to be able to autocreate buttons with decorations for the frame so that scaling can be maintained.  I presume the trick lies in the Resource_Load and Resource_Save files which read and write the actual control file data.  One of these references must be for a decal whereas others must be for the vector graphic frame.  I would be very interested if anyone knows these indices and / or the format with which the frames are saved.  We would (in an ideal world full of chocolate) love to be able to modify the frame slightly to have a smaller radius.

 

Wishful thinking perhaps but it would be nice.

Share this post


Link to post
Share on other sites

Hi Shoneill, 

 

Indeed, there would be a lot to do would we have an API for easily manipulating the controls properties as we can do from the editor.

I've briefly looked into it but gave up for lack of time (and will) to reverse-engineer it. I wasn't able to quickly whip up the positioning of a decal programmatically, so I didn't go further with scalable graphics and all.

 

Therefore, the Controls addon package still only replaces a non-scalable graphic (PNG) by another one created on the fly, "mimicking" a static decal of your choosing, so it is definitely not good for anything that rescales or grows with a pane. 

 

One bit of information that is quite useful for designing new buttons is this LabVIEW ini key:  enableSecretPopups=True

which exposes plenty of new things in the editor.

 

10.23.2014-08.01.png

 

You are absolutely right that the Resource Manager methods are the key here. All items are stored in chunks. All image strings (decal included) are their own chunks. The "FPHb" chunk is the one that changes when you move things around. Find the prototype for this chunk and you can probably automate it. Changing a decal changes the MNGI chunk (containing the PNG string) and a buunch of other chunks (history, size and position, etc.)

Hope this help a bit. 

Share this post


Link to post
Share on other sites

Hi Francois,

I have upgraded to VIPM 2014 and installed the latest UI Tools (1.3.0.70) and UI Tools Controls Addon (1.3.0.12) packages - all good.

 

However in VIPM the four expansionpacks [Vistastyle (1.0.1-1), systemstyle (1.0.4-1), outlookstyle (1.0.3-1) and glasswebstyle (1.0.1-1)] are indicated as having a missing dependency (which they don't) or a dependency conflict.

 

They don't appear in my Addons -> LAVA -> UI Tools Palette - I just get the silver_cancel and silver_exit buttons.

 

I noticed all these packages are the *.ogp version.

 

Is there anyway to get the controls back into my palettes?

 

Chris

Share this post


Link to post
Share on other sites

Sorry, this is long overdue...

 

- Migrated to VIP file and moved the controls to vi.lib.

- Removed dependencies on base package.

- The controls will now be located under "User Controls" palette.

 

Glassweb Style:

https://lavag.org/files/file/124-ui-tools-expansion-pack-glassweb-style/

 

System Style:

https://lavag.org/files/file/121-ui-tools-expansion-pack-system-style/

 

Outlook and Vista style packages to be updated tomorrow...

  • Like 1

Share this post


Link to post
Share on other sites

I just installed the control addon v1.3.0.12 (I had never installed any previous version) and I get this conflict:

 

This Package Conflicts with these other packages:

lava_lib_ui_tools_control_class_addon >= 1.0.0.0
 
Do you know what this means and how to fix it?
 
Thanks

Share this post


Link to post
Share on other sites

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.