Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Icons for controls in the Form Controls Toolbar

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I am designing a set of controls (initially copies of the base controls, Text box &c). I have a few slightly different versions of the same control and would like them to show up differently on the toolbar - without having to wait for the Tooltip to kick in. I know that I can assign icons to these. Does anyone have a convenient set of icons to use? I suppose that I could acquire an icon designer, but if someone else has been there before. . .

And, as a minor point, why do the base form classes (which I have included in the same .vcx file) show up on the toolbar? I cannot use them to place on a form I am designing, and am not aware of any circumstances in which I can make use of these form classes from the toolbar.

Thanks. Andrew
 
Well, the toolbar just shows every class of a vcx, you can drag a form to a formset, so it is usable.

Overall, I once also thought about setting up icons to depict control variants, but a) there's not much room and b) there are two better ways to select controls:

1. have the project manager open aside of a form/formclass designer and drag the control classes from the classlib section to the form. This means you select by the controlname, much more convinient than picking from a toolbar.

2. Use the Toolbox and put your controls in there. You can also have text scraps (eg a comment header) and other things in there you can easily pick from and drag to your code or editor windows.

Double clicking a control in the toolbox, for example, puts it to the active class designer at (0,0) position.

Bye, Olaf.

The controls toolbar has no more use for me.

Bye, Olaf.
 
Andrew,

First, don't spend any time looking for free icons. They are thousands of sites where you can donwload them, but it will take you a huge amount of time to sort through them and find a set that is suitable, especially as most of the sites don't let you preview the icons before downloading them.

Better to acquire a basic icon editor (I can't imagine anyone doing serious VFP development without one). Then, take the icons that come with VFP, and make a small modification to each to indicate that it's a custom class. Often, just adding a little mark such as a dot or plus sign will do the trick.

That said, I never actually do this myself. I find it much more convenient not to bother with a form controls toolbar. Instead, I drag the controls I need from the project manager. Not only does this save having to worry about icons, but it has the advantage that you can see the classes in all your VCXs at the same time, rather than having to open and close toolbars.

Alternatively, follow Olaf's suggestion and use the toolbox. It takes slightly more effort to set that up, but it gives you a lot of flexibility. Once you've taken the trouble to start using it, you'll find it has a lot of other good uses.

Finally, you ask why your base classes show up in the toolbar along with your custom classes. The simple answer is that VFP doesn't know they are your base classes. They're just like all the other classes in the VCX. The obvious solution is to keep the base classes in a separate VCX (which also has the advantage of making them more portable).

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thank you, Olaf, Mike & Tamar. I stand corrected on the matter of forms and formsets (I hadn't used them), so I will probably follow the suggestion and put my own forms into a different .vcx.

Have downloaded the Greenfish (free) icon designer. It is not entirely intuitive, but I have been able to create 32x32 icons with it, so that is good.

Thanks for the advice about the Toolbox, which I am investigating. Can I get my own controls (in ... \andrew\baseclasses.vcx) to show up as "My Base Classes"? That option on the Toolbox is still showing the VFP base classes, even though I have specified, via the Form Controls Toolbar, that my class library is indeed ... \andrew\baseclasses.vcx

Thanks again.
 
The vcx name doesn't mean anything to VFP, the VFP baseclasses are the set of base classes and that's it, Your base classes are already inheriting from them (you know you can only start from at least one of the VFP base classes, and therefore are not base classes in the strict sense of the word.

But: You can extend the Toolbox to have any other category. Right Click on it, "Add Category", name it "Andrews Base Classes", if you don't like the category "My Base Classes" is already prefilled with VFP base classes. And there you go, right click "Add Class Library" and add your vcx.

Tamar's PDF tells this in the section "Working with Categories".

Bye, Olaf.
 
In addition to creating your own categories, you can set up different filters for different projects. (I didn't talk about this ability in that paper.) Each filter can include whichever categories you want.

Since I work on projects for several different clients, I create a filter for each client/project and name all the relevant categories using an abbreviation for the client. So my filter for project ABC would include categories like 'ABC base classes', 'ABC forms', 'ABC controls', etc. Any category can appear with any filter, so I keep Text Scraps available in all my filters.

Tamar

 
Thanks Tamar.

I can see that filters will be useful for different projects, and plan to make use of them.

However, I am pretty much at first base on the use of the Toolbox - still trying to work out how to get my own controls (which are simple subclasses of the base VFP classes) onto the Toolbox.

I appreciate that I cannot use category “My base controls” for this purpose because that is already taken. Would it be correct to set up a new category “My base controls (2)” within the toolbox and then add my classes into it?

Or would it be acceptable to remove the existing “My base classes” category and then recreate that category. But in that case, would the classes which have been set up in "My base controls" still be needed for some purposes?

Finally, if I have made a mess of the toolbox, am I able to start with the original toolbox, as issued, and start again !

Thanks again. Andrew
 
Andrew,

I don't want to discourage you from using the toolbox. On the contrary, it is a very handy component, and worth getting to know.

But to go back to your original question ....

If you are in a hurry, and just want an easy way to access you classes from within the form designer, keep in mind that the project manager provides a very simple way of doing that. Just add your various VCX files to the project, and you will be able to drag from there right onto your form.

It's not a replacement for the toolbox, but it might be worth considering in the short term. You can always come back to the toolbox once your original problem is solved.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Don't worry about the toolbox. The "my base controls" are merely pointing to _base.vcx of ffc classes.

If VFP doesn't find a toolbox.dbf you can simply create a new one from scratch, which will be initiated as the original Toolbox is.

I also second Mike, in the short term it's much easier to pull a class from the expanded tree of vcxes of your project onto forms etc.

Bye, Olaf.
 
You have several choices for getting your own base classes into the Toolbox.

1) Right-click and choose Customize Toolbox. In the dialog that opens, find the My Base Classes category in the left pane and click it. Then, click the Remove Item button in the right pane and confirm that you want to remove that classlib. Once that's done, use the Add Item button to choose your base class library.

2) As you suggested, add a new category and then add your base class library to it.

All that said, even if you have a single base class library that all your customer/project-specific classes are subclassed from, do you really want that library showing in the Toolbox? Within any project, aren't you going to only use the project-specific "base classes"?


Tamar
 
Thank you, Tamar, Olaf & Mike.

You have patiently answered my questions, and I see that I can tailor the Toolbox to the requirement of the project. I shall also check out using controls from the project window.

Andrew Mozley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top