Pier
Another approach is to use TActionList...
DH...
"Pier" <pi...@ramm.co.za> a écrit dans le message de news:
4794759e$1...@newsgroups.borland.com...
I would only override a control if I wanted to change its
functionality and reuse it. I would break the form up into individual
frames, each handling a group of controls. You can add events and
methods to the frame which your main form can call.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Sorry for the terrible format (long lines).
I was cheated by ThunderBird that it wrapped the lines virutally
instead of inserting a new line break.
Some suggestions,
I created a number of frames, but I find that some event handlers in the
frames do not get called. I have to add events to the frames via the main
form. I want the event handlers in the frame units to be called, since I
have now put the event handlers that were in the main form in their own
frames.
Pier
"Marc Rohloff [TeamB]" <ma...@nospam.marcrohloff.com> wrote in message
news:ij7ivno5...@dlg.marcrohloff.com...
A very nice (and quick) way of minimizing code in Forms is to use the
MGM (Module-GUI-Mediator) design pattern. MGM fits nicely between MVC
(Module-View-Controller) and MVP (Model-View-Presenter), but I think
it's the easiest one to implement and fits very nice with today's modern
GUI frameworks without having to create custom components or register
new components in the component palette. I have used MGM successfully
with 3 GUI toolkits - VCL/CLX, LCL and fpGUI.
I have implemented MGM using RTTI and created generic mediators. This is
a more complex implementation, but a much more simplified implementation
with a couple lines of code is also possible.
For more details on MGM. See the the following:
http://www.atug.com/andypatterns/mgm.htm
My my MGM implementation using RTTI is the tiOPF project on SourceForge.
https://tiopf.svn.sourceforge.net/svnroot/tiopf/tiOPF2/Trunk/GUI
Units of interrest:
tiGenericEditMediators, tiGenericListMediators,
tiGenericTreeviewMediator and tiCompositeMediators
Regards,
- Graeme -
_______________________________________________________
fpGUI - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/