[Gambas-user] A good idea?

B Bruen bbruen at ...2308...
Sun Sep 21 00:24:07 CEST 2014


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?

regards
Bruce
-- 
B Bruen <bbruen at ...2308...>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virtctls-0.0.5.tar.gz
Type: application/octet-stream
Size: 6921 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140921/825eae20/attachment.obj>


More information about the User mailing list