[Gambas-devel] Toolbars
Robert Rowe
robert.c.rowe at ...176...
Thu Mar 27 01:06:16 CET 2008
I had already thought about the tie-in with the action property. Very
good idea.
My thoughts so far are:
1. Have a Tool object that can be one of the following types: Button,
MenuButton, Dropdown, Text, Label and Separator. This will likely be a
base class that these other classes inherit from.
2. The toolbar would let the developer create tools and add them to a
collection within the toolbar. This will eventually be from some GUI
setup but initially from code.
3. The developer would set the initial position and visibility of the
default tools.
4. A button (a small down arrow maybe) and possible a right click would
allow the user to access a form with two lists of tools: available and
current. They could then move the tools between the lists and up & down
to set their order.
5. I'd save this in a program specific (or default) config file in the
user's home directory.
This is how is I think that KDE does it. Right click the toolbar of a
KDE app and select "Configure Toolbars" to see what I mean.
Later I could make a new object (ToolbarManager) to manage multiple
toolbars and possibly control their dock edge. This manager could
probably allow the user to create entirely new toolbars since each
toolbar would be an object in the toolbars collection of the
ToolbarManager object. Adding one a runtime shouldn't be any harder that
adding one at design time.
I do have a couple of questions though. When a class inherits from
another class can the class instance be stored in a variable dim'd as
the parent class.
Ex. ToolButton inherits from Tool
Dim T as Tool
Dim TB as ToolButton
T = TB
if so would this also work
Dim TB2 as ToolButton
TB2 = T
Also is there something like .Net's CType?
I also noticed that when I compiled GridEditor that it appeared in the
list of components. I didn't do anything special except build an
executable of GridEditor. I'm assuming that this wrote an info file
somewhere but I couldn't find it. I was running as a normal user so it
had to be in my home directory somewhere.
Robert Rowe
Benoit Minisini wrote:
> On mercredi 26 mars 2008, Robert Rowe wrote:
>
>> The discussion about not added a button for collapse/uncollapse has
>> gotten me thinking that it would be really nice to have a user
>> configurable toolbar component. I'd like to try writing this unless
>> someone else is already working on something similar. I like the way
>> that KDE does this so I'd modeled that way. It would probably be better
>> to code it in C but I stink at C. I think that I read somewhere that
>> components can be written in Gambas.
>>
>> Robert Rowe
>>
>>
>
> Note that feature is directly related to my mail about action support in the
> IDE. A toolbar configuration dialog will take a list of actions directly from
> the Action class.
>
> Note that there are global actions and local ones. The local actions have a
> name that starts with a dot. They should act in their first embedded parent
> form. The global actions act in their first top-level form.
>
> Regards,
>
>
More information about the Devel
mailing list