lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() +


From: Greg Chicares
Subject: Re: [lmi] a less trivial patch: don't use deprecated MakeDefaultName() + refactoring
Date: Mon, 02 Jun 2008 01:52:36 +0000
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

On 2008-06-01 19:14Z, Vadim Zeitlin wrote:
> On Mon, 26 May 2008 13:22:21 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> It seems to create an anomaly. Try the commands here:
> GC>   https://savannah.nongnu.org/support/?104485
> GC> with and without this patch. See also:
> GC>   http://lists.nongnu.org/archive/html/lmi/2008-03/msg00038.html
[...]
>  Unfortunately this means that there is no really simple way to change this
> to work without using this LMI_WX_CHILD_DOCUMENT flag as wxDocument has no
> way to pass the "is phony" information to the view directly. The only way
> to do it that I can see is to switch the document template (which is used
> for the new views creation) in IllustrationDocument::OnCreate() temporarily
> if LMI_WX_CHILD_DOCUMENT is specified to some ChildDocumentTemplate which
> would create child views instead of the normal ones.
> 
>  This doesn't look very elegant but I see no other solution. It also would
> take (much) more time to implement than what I thought initially so I'd
> like to ask if you still think it's worth doing this or if we should
> finally better leave the current code using LMI_WX_CHILD_DOCUMENT alone?

The underlying problem has two aspects:

(A) Child documents need to be distinguished from documents that
have no parent. In lmi, empty child documents are common, and
we need a way to prevent users from trying to edit them (because
they're empty). That's what LMI_WX_CHILD_DOCUMENT is intended to
help with, though there seem to be implementation issues:
  https://savannah.nongnu.org/support/?104430

(B) "If your parent closes, then you close" semantics are wanted
for child documents. This isn't implemented at all in lmi today,
and its absence is a usability issue:
  https://savannah.nongnu.org/support/?104485

Now we're discussing three proposals:

(1) Do nothing: keep LMI_WX_CHILD_DOCUMENT. This addresses only
aspect (A) of the problem, and in a fragile way. A future version
of wx might use the style bit that LMI_WX_CHILD_DOCUMENT has
appropriated, or assert that "unused" bits are clear.

(2) "switch the document template...to some ChildDocumentTemplate"
as above, which "doesn't look very elegant". This addresses only
aspect (A) of the problem. I agree that (1) is preferable to (2)
in light of the effort that (2) would require.

(3) Use wxDocument::m_documentParent, present since v 1.1:
  
http://cvs.wxwidgets.org/viewcvs.cgi/wxWindows/include/wx/docview.h?annotate=1.1
This can address both aspects of the problem, replacing the
LMI_WX_CHILD_DOCUMENT kludge.

Though this member seems never to have been used in any way,
I believe that
  "pointer to the parent wxDocument of the current wxDocument"
is the only meaning that Julian can ever have intended (that's
how OWL's 'TDocument* TDocument::ParentDoc' member worked).

Here's a rough sketch of a proposal
  http://lists.nongnu.org/archive/html/lmi/2008-03/msg00038.html
to make wxDocument::m_documentParent actually useful. Is there
any objection to that in principle? Would it help if I prepared
a well-tested patch?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]