[Gambas-user] Re: gambas2-1.9.4, Component creation

Benoit Minisini gambas at ...1...
Tue Mar 29 16:25:49 CEST 2005


On Tuesday 29 March 2005 12:11, Christian Faure wrote:
> El Martes, 29 de Marzo de 2005 05:31, Benoit Minisini escribió:
> > On Friday 25 March 2005 19:55, Christian Faure wrote:
> > > Hi Benoît,
> > > Create component from a class works ok!
> > >
> > > how to create a component from an inherited qt class?
> >
> > It should work. I didn't test it yet, I want to make an example of an
> > extended TextBox or ComboBox in the next release.
>
> Thanks Benoit,
> Attached file gb_comp1 is a component with an inherited text box.
>
> > > how to create a component from a form?
> >
> > I'm not sure to understand the question.
>
> Excuse my very bad english,
> I want create a visible component with one label and one textbox,
> to use like this:
> MyComp.Description="MyFieldX" ' assign to label.text
> MyComp.Value="MyValueX" ' assign to textbox.text
> In attached file gb_comp2 is an example of this "component"
> i want convert FContainer (a Form) to gb_comp2 (a Component )
> Possible?
>
> > > i get this error message when loading my component with form or
> > > inherits:
> > >
> > > CClassInfo._new.25
> > > Not an object
> >
> > Send your project...
>
> Regards,
> Christian

A form can't be a "component". A component is a set of classes. A form is one 
of this classes, so I don't understand what you want to do exactly. If you 
want to use a form like a control of your component, of course you can: after 
all, Form inherits Windows that inherits Container that inherits Control. But 
as Form is its own event observer, it won't behave like a normal control, and 
so the user will be disappointed. You should inherits a container instead, 
and fill it with what you got in your form. Or you can use a form, but attach 
it to its parent to cancel the "own event observer" thing.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list