[Gambas-devel] Creating a Control

John Leake jleake at ...741...
Mon Sep 8 13:35:48 CEST 2014


Hi All,

Many thanks for your responses.  I am posting this in the devel list
because I am prepared to spend the time improving the IDE.

So for directions I go to http://www.gambasdoc.org/help/dev/gambas?v3

Lets say I just want to create a ToggleButton of my own that is
unchanged from that which exists already Except for the name of course.

Start
-----
1) create a new project and set its project type to 'Graphical
application' and check the option 'Component programming'.

2) Select the parent directory (my work is in ~/dev/Gambas3).

3) Give the project a name and title of 'MyToggleButton'.

4) Drop a toggle button onto 'FTest' and run. All good so far.

The docs say:-

"Only the _IsControl and the _Properties constants are mandatory."

and

"These hidden constants are inherited like any other constant. So you
don't have to actually declare them in each control, as soon as there is
some inheritance relationships between them. "

So there is not much more to do since I do not want to change any
behaviour or control properties.  Just get the control to show up in the
control toolbox and allow users to design with it just like the original
ToggleButton.

5) From the docs "Each control must have an icon that will be displayed
in the IDE control tool box.".  I was hoping that I would inherit these
also. There are already two png files in
'~/dev/gambas3/MyToggleButton/.hidden/control' so I change the images so
I can distinguish them from the originals.

The docs say "The IDE can make binary packages of your component, as it
does for any other normal projects." so

6)  Project/Make/Executable - good no errors.

7) Close and save the project and create a new one that should show
'MyToggleButton' in the 'Form/Controls' tab but alas it is not there !

End
---

This may be a naive point of view but shouldn’t it just work like this if ?

Best regards,
John Leake




More information about the Devel mailing list