[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Why do we have unused PredominantViewWindow() methods?
From: |
Greg Chicares |
Subject: |
Re: [lmi] Why do we have unused PredominantViewWindow() methods? |
Date: |
Sat, 28 Mar 2020 11:55:36 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 2020-03-27 00:47, Vadim Zeitlin wrote:
>
> It's my turn to wonder if I'm using something obvious: I'm looking at
> PredominantViewWindow() member of CensusDocument class and I can't find any
> place that would actually use it. In fact, it's even worse: a member with
> this name is defined for all document classes (gpt_document, mec_document,
> IllustrationDocument, TextEditDocument), but only seems to be actually used
> for one of them (TextEditDocument).
The motivation was to allow an open document to have multiple views,
one of which is "predominant" and permits changing the document's
contents, the others being simple observers that cannot change the
contents but would be updated in some way if the contents change.
In this example:
wxHtmlWindow& gpt_document::PredominantViewWindow() const
{
return ::PredominantViewWindow<gpt_view,wxHtmlWindow>
(*this
,&gpt_view::html_window_
);
}
that's the only part of class gpt_document that knows the type of
the "predominant" view (wxHtmlWindow in this case). It's at least
conceivable that we might someday want that information.
Although we've made little if any use of this concept so far, it's
there in case we ever want to use it, and the implementation of
this function is trivial. Retaining it, even for a replacement
CensusDocument class, costs so little that I'd rather just keep
it than think through the ramifications of removing it.
> Do the other methods exist just for consistency? It seems rather strange
> to define functions that are never used to me, but if their existence is
> intentional, should we also add such member to the new wxGrid-based
> CensusDocument class?
Yes, please, even if only for consistency.
> This is not a terribly important question, but if you have any thoughts
> about this, I'd like to hear them. FWIW I couldn't find anything relevant
> by searching for this function name in the list archives.
Perhaps it's an artifact of porting from the old "ihs" system that used
a different GUI framework, one that had powerful doc-view capabilities
that were similar but not identical to wx's. That port predated this
mailing list and even our institution of version control, so the history
is not readily accessible.