Subject: RE: A Proposal (why we should have setBold(true))
From: sam th (firstname.lastname@example.org)
Date: Tue May 30 2000 - 12:55:50 CDT
-----BEGIN PGP SIGNED MESSAGE-----
On Tue, 30 May 2000, Bruce Pearson wrote:
> The problems you are having with this is the fact that classes for the
> editing and viewing are not separate. The view class not only represents a
> view of the document it also is responsible for editing the document. This
> means we cannot easily edit a document without having a view.
> The correct way of doing this is to have a DOCUMENT -- VIEW -- CONTROLLER
> The DOCUMENT holds the information.
> The VIEW display a current view of the document. (Toolbars and status bars
> are also views).
> The CONTROLLER controls the state of the document. (Toolbars call functions
> of controller eg. setBold)
> Structuring it this way we can create a controller to edit a document and
> call functions in the controller like setBold, etc to edit a document. This
> controller can then be used by the importer, scripting language, etc.
> A document should store a list of views. When a document is modified it then
> sends a message to the attached views telling the views that they need to
> update the view of the current document. Right now the view changes the
> document and then needs to work out how to change its own view of the
> The controller stores the current insertion point and also various
> information like selection start and end points. When this information
> changes (eg use presses left arrow) the controller does required operations
> and then tells the view to update its view of the insertion point. i.e. View
> is also a view of the controller.
> Implementing this at this stage may or may not be a huge job and may bring
> up a whole range of other implementation issues. Does any body have any
> comments. Is this something we need to do now or should other things be done
> before hand.
Well, you manage to discover the problems I reported exactly. However, I
don't think life is as bad as you think. If I had a way to get a
meaningful DocPosition out of the ptbl (as I described in my recent email)
I think my plan would work.
Currently, the view just does some string hackery and tells the ptbl what
to do. If I had a document position, I could just move all that string
hackery down into the ptbl, and then the state of the document could be
controlled from the ptbl (meaning from the document, without the view).
I'm waving over several sleepless nights of coding here, but I think it
would work. But first I *have* to have an insertion point. If that's not
possible, then it would have to be rewritten to get what I want, as you
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----
This archive was generated by hypermail 2b25 : Tue May 30 2000 - 12:55:59 CDT