[Gambas-user] A good idea?
B Bruen
bbruen at ...2308...
Sun Sep 21 01:18:27 CEST 2014
On Sun, 21 Sep 2014 00:57:55 +0200
Tobias Boege <taboege at ...626...> wrote:
> On Sun, 21 Sep 2014, B Bruen wrote:
> > As some will know, we use a lot of third-party (i.e. developed by us) components and libraries in our projects.
> > Some of these are re-usable pop-up forms to provide common features across our gui apps. Things like "AboutMe" and "SysInfos" forms that we need to place in all our client applications.
> >
> > Each of these requires that we include the component in the project properties, create a menu item in the relevant form and an event handler for that menu item. All these handlers essentially do is create an instance of the pop-up and ShowModal it.
> >
> > The other day I had an idea. I created a virtual control "wrapper" class that takes care of the above by itself. All the coder need do is to place the virtual control on the relevant form in form design mode.
> >
> > Anyway, this seems to work! I cant see any problems and I am now looking at more complex uses of this approach. Perhaps it might be a way to implement the IDE add-ins mentioned recently?
> >
> > Here is a project that mocks up this approach in that it is totally self contained (i.e. doesn't use components or libraries). If you would take a look you'll see that the main form, i.e. the "client", has no code at all for managing the pop-up (but does have a handler for an event raised by the pop-up).
> >
> > What do you think?
> >
>
> Veeeery nice idea! It looks a bit like an hack, though, because it's not
> obvious (from the IDE form editor or otherwise) what the virtual control
> does. I like it anyway.
>
Very much a hack at the moment! In fact more of a proof of concept at this stage.
> I think you could even have a "MenuMaker" class which is your VControl.class
> minus the menu-specific things. You would derive "HelpMaker" from that class
> which provides the necessary names, like "mnuHelp", etc. and a real MakeMenu
> method (or event handler?).
>
Yes, that's what I was alluding to as the "more complex" matters.
> For the others: there is an error "Component not found: genutil". You can
> either fix this yourselves or apply the attached patch. It seemed to be safe
> to just remove that component (?).
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
Oops! I just stuck that GenUtil reference in to get at the help for it while responding to another thread. It is immaterial to this thread - so yes just remove it.
Thanks for the feedback.
B
--
B Bruen <bbruen at ...2308...>
More information about the User
mailing list