[Gambas-user] create code option in form designer

Ron Onstenk ronstk at ...239...
Wed Jun 11 11:58:58 CEST 2008


On Wednesday 11 June 2008, Ron wrote:
> Benoit Minisini schreef:
> > On mardi 10 juin 2008, Ron wrote:
> >   
> >> Question.
> >>
> >> Is there a way to generate the code for an object you designed in the gui.
> >> If not wouldn't it be a nice feature?
> >>
> >> Let say you created a window and dragged a frame in it, and set the size
> >> etc etc, would be nice if you could see/save the lines of code you would
> >> need to create the objects without using the gui.
> >>
> >> As for a learning experience, and if you want to let your code generate
> >> similar content at runtime.
> >>
> >> I know you can see the dimensions etc already in the form created if you
> >> peek into the file itself.
> >>
> >> Regards,
> >> Ron.
> >>
> >>     
> >
> > The code is generated entirely from the contents of the *.form file. It is 
> > just the instanciation of a control inside its container followed by a method 
> > call (Move or MoveScaled) and property assignments.
> >
> > The only trick is when you put a "virtual" control inside a form. There is a 
> > mark that tells the compiler that this is not a true control, and that it 
> > must not pass the container as argument to the control constructor.
> >
> > In other words, I don't find that feature really useful, but if you can really 
> > persuade me to it, I will have to modify the compiler so that it can give you 
> > the generated code from a form file. :-)
> >   
> 
> Maybe we can vote for it, if i'm the only one who want it's, you win. ;-)
> And for the learning part it's a matter of time, I have to look in the 
> docs less and less... ;)
> 
> Regards,
> Ron the 2nd
> 

My point of interest is to be able to construct the form under
programs control. Special to have a main form where a bunch of
controls are involved, placed in series of i.e.text boxes where 
the amount of how many changes during runtime and depends on
external parameters  unknown at design time.

The minor part of creating the form is the time involved for to
build the form.
A pro is to have the exact code to add controls on the form the 
right way the compiler undrstands and prevent mistakes.

Ron the 2nd is not the only one however I do understand we belong
not to the general major group. 
I vote for 'please add=yes' and ask if you will spend some time on it.


Regards, 
Ron the 1st

(Are all those Ron's ... and Dutch. What accident happens here?)

P.S. Ik vind het wel grappig Ron de zoveelste :)




More information about the User mailing list