Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Toolbar button names
Message
De
26/11/1997 18:58:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00062207
Message ID:
00062506
Vues:
32
>>>You are correct. These are custom buttons. Guess it was just wishful thinking on my part. Is there no other way create a custom toolbar without the drag and drop way? I would like to do it code and place it in my custom class. I have yet to figure out how to put in a separator during the customization process.
>>
>>Of course you can do it in code. The ToolBar control is just a control! :) So, you can use it as you use anyother control, you can define toolbars in prgs, etc, etc.
>>
>>To see a code sample, define visually a toolbar class and use the ClassBrowser to see the equiv code.
>>
>>Was this your question? :)
>>
>>Vlad
>
>Yse this is my question, but to define a toolbar and add the toolbar buttons you have to know the names of those buttons (Cut, Copy, Paste, etc.; sepl is the Separator) I have used the class browser to try creating a custom tool bar, but the usual toolbar buttons are not available to add to the class. The only thing available are the Form Designer toolbar contols. What am I missing?

Just to clarify a little. You can create a toolbar class in 2 ways:
1. Visually, using the Class Designer. You can add custom buttons and separators using the Form Controls toolbar.
2. In a prg, using the DEFINE CLASS command. You can also add custom buttons and separators. I see no advantage to do it in a prg, but it's doable.

If you create it using the Class Designer, you will have a VCX file. This VCX can be opened in the Class Browser. The Class Browser has a button (with the "View Class Code" tooltip) that will generate the prg code equivalent to the vcx. This is good if you want to save it as prg (Copy&Paste) or if you want to see what's the equiv. code.

Probably you already know that. :)

About the buttons in the VFP toolbars: I have no idea on how you can use them in your toolbars and I never heard of it. Obviously, this doesn't mean that is not possible. :) In fact, I would like to how to do it if it can be done! :)

In the sample you found: the buttons are custom buttons and their behavior is set by adding code in the Click method. So, they are not the buttons from VFP's toolbar and their names are not something internal to VFP. You can change the names of the buttons in that example and you'll have the same result.

AFAI understood you need to have a toolbar with Edit, Cut and Paste buttons. I think the easiest way is to add 3 buttons to a toolbar and in the Click method to call the SYS(1500) VFP function for the corresponding menu options. Ie: you need to know the internal names of the menu options and not of the toolbar buttons.

See you,
Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform