Hi El Martes, 23 de febrero, 2016 21:00:06, Tobias Boege <tabo...@gmail.com> escribió: On Tue, 23 Feb 2016, Matias De lellis wrote: > > So, what I read out of your mail is that you have one object Firmata1 which > > has a certain configuration. You now want to add controls dynamically to the > > Form which should inherit Firmata1's configuration by obtaining a reference > > to the Firmata1 object. > > > Not completely dynamic.. After completing write the controls the idea is just > change the list of properties of the controls placed on the form. (Not > writing a single line of code more after design forms) > > > > 2. Can't you pass the Firmata1 object to the constructors of the > > > controls? > > > > Would be ideal, but I do not see how. Justly my idea was to add a property > > representing the instance name, and get the instance itself from that. > > http://gambaswiki.org/wiki/comp/gb/class/instance seems ideal but not work > > here.. > > > > Class["Name"].Instance returns the auto-instance of an auto-creatable (i.e. > Create Static[0]) class. Unless you class is Create Static, this will not > give you any object at all.
Then I found this explanation but not want to do it static... > > > 3. (A refinement of 2.) Make the Firmata class a Container object and > > > create the controls inside the container Firmata1. This way, the > > > controls can access their parent Firmata1 and its configuration > > > directly. This is how the DataSource control from gb.db.form works, > > > if you are familiar with that. > > > > > > I will investigate this option..> > > > > If you don't need to create controls at runtime, i.e. the layout of your > form is complete at compile time, then this would be the way to go. I attach > a small project which shows how it's done. Thanks you!. It's a very interesting way, but then dismiss it because restrict me in the construction of graphical user interface.. Or to make rich user interfaces, would have to write many new controls.. I think not worth it .. :( Attach a "sketch" of what I intend to do.. Lack entire deployment serial port, and simulated events using a timer to Raise events. To continue the development, momentarily, I do dependency injection (See FTest.class:12 and DigitalSwitch.class:39). This is exactly what I wanted to avoid, but at the moment allow me to continue.. Of course, for the user, it is a single line of code, but want to do it editable graphically.. Regards, Matias
Firmata-0.2.1.tar.gz
Description: application/gzipped-tar
------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user