Re: potential high-value project -- margins

Aaron Lehmann (aaronl@vitelus.com)
Sat, 26 Jun 1999 09:40:29 +0000 ( )


I think it's time to implement some kind of view variable. Margins need to
be turned off in a Normal mode, but should be adjustable through widgets
in Page Layout mode.

I propose something like:

enum ViewMode
{
viewmode_PageLayout,
viewmode_Normal,
viewmode_Outline
};

(excuse my syntax, i haven't used enums in years.)

In the document class, under public: (or protected: if a GetViewMode ()
function is implemented publically):

ViewMode mDocMode;

this variable is linked to the set of menu items (that havent been
implemented yet) that select view mode.

This becomes usefull, for example, in the margin code:

mMarginSizeX = 0;
mMarginSizeY = 0;

if (mDocMode != viewmode_Normal)
{
mMarginSizeX = x;
mMarginSizeY = y;
// set up margin widgits ...
}

where x and y are #define'd constants with default margin size and
mMarginSizeX and Y are hypothetical member variables that define the size
of the margins.

I havent looked very much at the source, but this would make it way
easier to have alternative views.

On Fri, 25 Jun 1999, Paul Rohr wrote:

> I've noticed that we've had a few new coders recently looking for a good way
> to get introduced to the codebase (hi, Todd and Ove!), so here's a meaty
> little feature we've been getting a lot of requests for recently:
>
> Allow folks to change the margins.
>
> To begin with, take a look at how paragraph margins are currently
> manipulated, by grepping through the src/wp and src/text subtrees. (Or, you
> could look at the tabstop code, since they're quite similar.) Essentially,
> what happens is the user drags around a widget on the ruler, and under the
> hood we use that to adjust the corresponding block-level property
> ("margin-left", "margin-right", "tabstops", etc.).
>
> Currently, the top and left rulers display narrow gray bars at the document
> margins, which could also be dragged around to reset the corresponding
> section-level properties ("page-margin-left", "page-margin-top", etc.).
>
> This should be a fairly straightforward way to introduce yourself to some of
> the interactions between the UI and the underlying formatting logic. It's
> all XP code, so you'd have the instant gratification of getting the feature
> working on all three platforms simultaneously.
>
> Any takers?
>
> Paul
>



This archive was generated by hypermail 1.03b2.