Jump to content

[CR] Class Iconizer


Recommended Posts

index.php?automodule=downloads&req=display&code=sst&id=20

File Name: Class Iconizer

File Submitter: jimi

File Submitted: 4 Sep 2006

File Updated: 22 Oct 2006

File Category: LabVIEW OOP (GOOP)

This tool allows user to apply new icon templates to LabVIEW classes. New template is applied to each item inside the class. User can define which parts of the template is transparent so that the template can be overlaid on top of the existing icons.

Click here to download this file

Download File:post-4014-1157146666.vi

Link to comment

Beautiful! "Save a bug report! Write it yourself!"

[*]You can also define the number of lines from the top of the template to always copy to method VI icons (this allows you to use mask color in the header)

I had a hard time understanding "number of lines." Is this "number of rows of pixels" or "number of lines of text"? [Yeah, I could drill into the VI and puzzle it out, but it is easier to ask.]

Link to comment
Beautiful! "Save a bug report! Write it yourself!"

I had a hard time understanding "number of lines." Is this "number of rows of pixels" or "number of lines of text"? [Yeah, I could drill into the VI and puzzle it out, but it is easier to ask.]

It means number of rows of pixels. If your mask color is white and you use white text in icon header, then the header text wouldn't be copied. Therefore you can define the header height in number of rows of pixels, so that the complete header is always applied. In addition all the pixels that are not of the mask color will be copied from everywhere else except header.

Asking is defenitely easier, the code is really ugly. I coded it in a hurry and for just one purpose only. Perhaps later I'll add some more features later on and clarify the code:

  • Inheriting overloaded VI icon from parent class VI
  • Automatically generate color16 and monochrome icons from color icon
  • Automatically applying color for the frame surrounding icon; red for private and blue for protected (user defineable colors)
  • Allow user to select library items to include / exclude
  • Store settings to file

Link to comment
It means number of rows of pixels. If your mask color is white and you use white text in icon header, then the header text wouldn't be copied. Therefore you can define the header height in number of rows of pixels, so that the complete header is always applied. In addition all the pixels that are not of the mask color will be copied from everywhere else except header.

Asking is defenitely easier, the code is really ugly. I coded it in a hurry and for just one purpose only. Perhaps later I'll add some more features later on and clarify the code:

  • Inheriting overloaded VI icon from parent class VI
  • Automatically generate color16 and monochrome icons from color icon
  • Automatically applying color for the frame surrounding icon; red for private and blue for protected (user defineable colors)
  • Allow user to select library items to include / exclude
  • Store settings to file

Since you're playing with the icons, you should know that the initial icons for the private data control and the library are both set by VIs in <labview>\resource\plugins\ directory. The VIs are named something with "icon" in the name... I don't recall off hand. You can rewrite those VIs if you want different initial icons (or even create a walk through wizard for establishing those initial icons).

Link to comment

Hi folks,

I decided to rewrite the whole program. There are only few new features. The biggest change is that I cleaned up the code very very much. I have encapsulated everything inside classes so that all components should be somehow reusable and intuitive. I also use extendible factory (design pattern) to create new objects so that support for new decendent classes can be added without touching the present classes. This was more or less a kind of an excercise to get aquinted with LabVOOP. The package may also be good to check out for LabVOOP newbies to get acquiainted with LabVOOP and OOP in general.

The few changes are listed below

  • All icons are automatically derived from 256 color icon, so it's enough to edit the color icon
  • There is a new button which clears all icons (owerwrites icons with template icon)

Since you're playing with the icons, you should know that the initial icons for the private data control and the library are both set by VIs in <labview>\resource\plugins\ directory. The VIs are named something with "icon" in the name... I don't recall off hand. You can rewrite those VIs if you want different initial icons (or even create a walk through wizard for establishing those initial icons).

Hmmm... Interesting. Could I use those VIs not only to create custom class icons, but to create a custom class wizard, that is executed when ever a class is created? This could allow me to define a set of predefined project items I could select to add to the library and, well everything. So the question probably is if I can anyhow get access to the referense of the class library being created. Can I?

Edit: I forgot the ZIP

Download File:post-4014-1157220204.zip

Link to comment
Hmmm... Interesting. Could I use those VIs not only to create custom class icons, but to create a custom class wizard, that is executed when ever a class is created? This could allow me to define a set of predefined project items I could select to add to the library and, well everything. So the question probably is if I can anyhow get access to the referense of the class library being created. Can I?

Nope. That VI only controls the icons. It takes an icon set in and outputs an icon set. That being said, the functions for "add to library" etc are all available. Take a look at the VI Server meths/properties available for LVClass library files.

Link to comment
Nope. That VI only controls the icons. It takes an icon set in and outputs an icon set. That being said, the functions for "add to library" etc are all available. Take a look at the VI Server meths/properties available for LVClass library files.

I already noticed that I can create and open projects, libraries and classes using invoke nodes. But to create the classes at the position I'd like, requires either that I write a project tree control of my own and let user to select the position. Alternatively if I could somehow add a new item to the right-click menu of the project browser which I could catch in an event case of a process running in background. The first alternative is laborous and the second alternative isn't there as far as I understand. My main duty is not to write class wizards but scientific software, so I probably need to stick with what others can provide.

p.s. When I was walking outside, I noticed that I made a bug in the latest version class iconizer, the mask is computed incorrectly so that practically the color mask doesn't count. I'll post later the corrected version to the Code Repository as Michael_Aivaliotis suggested.

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.