RE: A Proposal (why we should have setBold(true))


Subject: RE: A Proposal (why we should have setBold(true))
From: Bruce Pearson (BruceP@wn.com.au)
Date: Tue May 30 2000 - 12:30:24 CDT


Sam,

        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
pattern.

        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
document.

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.

Bruce.

-----Original Message-----
From: owner-abiword-dev@abisource.com
[mailto:owner-abiword-dev@abisource.com]On Behalf Of sam th
Sent: 27 May 2000 11:09
To: abiword developer list
Subject: A Proposal (why we should have setBold(true))

Therefore, I propose:

Adding to PD_Document methods such as the following:

UT_Bool setBold(UT_Bool newVal);
UT_Bool setItalic(UT_Bool newVal);
UT_Bool setFont(XML_Char * newFont);

UT_Bool isBold();
// things that can't be toggled (such as fonts) won't need the same
// accessor functions.
etc..

I think this will result in minimal added overhead, and greatly improve
the usablility of the ptbl.

well, what do you think?



This archive was generated by hypermail 2b25 : Tue May 30 2000 - 12:29:18 CDT