Re: Anything like this for Delphi?



I don't know or use the JVCL docking library personally, but I believe
there's no need to use a datamodule /just/ to avoid using the form's
unit. You simply need to write a little bit of code to create a layer
of indirection:

#1. Create a new unit with a singleton class, and give it a new
read/write property of type TJvDockStyle.

#2. Use this unit from the main form's and the client forms' units.

#3. In main form's constructor, assign the JvDockStyle to the
singleton's property.

#4. In client forms' constructors read the singleton's property
and assign it to the appropriate property of the JvDockClient.

This way, MainFormUnit.pas and ClientFormUnit.pas don't use each other,
but they both use StyleSingleton.pas.

If you want to, you can make this more elegant by declaring and
implementing two interfaces in the singleton - one for read access and
one for write access to the singleton's property.
The latter would then only be accessible to the main form, and the
former only to client forms.

--
Regards,
Aleksander Oven
.



Relevant Pages

  • Re: breaking changes from ATL 7.0 to 7.1 ? Problem with GetMessage()
    ... few lines of code to the FinalConstruct Function: ... With 7.1 nothing happens until you launch a client app (for ... Is this dialog behavior also related to the Singleton Class ... In VC7.1, singleton class factory creates the object lazily, ...
    (microsoft.public.vc.atl)
  • Problems with Activated and Well-known objects
    ... <client url="http://header"</a>;> ... ("header" defined at the DNS) ... comes from the constructor with parameters. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Remote object with arguments?
    ... Server-activated objects require a default constructor. ... "Server Activation" ... Singleton, however, is not client-activated. ... "Client Activation" ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Inherited Methods and such
    ... It is a constructor, because the initializer list is part of T::T. ... else you are talking about another type: struct. ... You move the mess onto the client, ... Human has subclasses Child and Adult. ...
    (comp.lang.ada)
  • Re: Inherited Methods and such
    ... Forget dynamic dispatch where you are in the constructor. ... else you are talking about another type: struct. ... The client doesn't even see the object before it's fully ... The exception is when the pointer to not-yet-constructed object is ...
    (comp.lang.ada)