[Gambas-user] What does ... in a menu name signify?

Benoît Minisini gambas at ...1...
Wed Jan 15 03:56:53 CET 2014


Le 15/01/2014 01:20, Bruce a écrit :
> For example, in the IDE menu there are lot's of
> them, like File|New Project...
>
> The reason I ask is that the form definition for those types is
> "different" - e.g.
>    {  Menu5 Menu
>       Text = ("Menu5") & "..."
>    }
>
> I first thought that it was simply to remove the "..." from the
> translation strings but I keep thinking why go to all that trouble.
>
> tia
> Bruce
>
> p.s. In our new project someone slipped a conformance clause into the
> requirements without me noticing.  Things like "all toolbuttons shall
> have a tooltip" etc.  I thought that it was going to take days to go
> through all the forms and check nearly every control for conformance.
> Then I had a "good idea" (HAH!) to write a utility to parse the form
> definition file and show all the conformance items, tooltips, shortcuts
> etc. I thought that may take a few hours to build - HAH!  Three days
> later I am still only part way there.
> Essentially it's turning the IDE Properties tab around 90 degrees, i.e.
> a list of the properties of interest for all the controls, menus etc in
> the form. A couple of shots attached.
> Originally I thought it would be possible to add editors to "fix" the
> form definition files directly, avoiding the IDE. HAH! The complexity of
> those files is astonishing!  Is there a defined grammar for it?
>
>

This is a well-known GUI convention. "..." after a menu or button label 
means that clicking on it will not have an immediate effect, but will 
open a dialog instead.

I don't want to document the form file format, because I want to be able 
to change it freely. But here are a few tips...

The format of the form file is extremely simple. The simplest I could 
actually. :-)

Each line of a form file is more or less translated to Gambas code by 
the compiler.

`{ <name> <class>` --> `<name> = New <class>(<parent>)`

Note: <parent> is the parent object defined by the embedding { ... }

`<property> = <expression>` --> `<name>.<property> = <expression>`

Note: <expression> is a Gambas expression.

Note: if the property starts with a '#', it is a "virtual" property. It 
is just for the IDE, it won't generate any code.

At the end of the form file, you will find the description of all 
"actions" defined in the form (through the Action property), and the 
description of all toolbars with their default arrangment.

If you want all the information, everything is in the 
`/main/gbc/gbc_form.c` source file.

Hope it helped...

Regards,

-- 
Benoît Minisini




More information about the User mailing list