[Gambas-user] create code option in form designer

Ron ron at ...1740...
Wed Jun 11 00:05:52 CEST 2008


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






More information about the User mailing list