Views (again)

Aaron Lehmann (aaronl@vitelus.com)
Fri, 16 Jul 1999 10:28:25 +0000 (GMT)


Hi,

I've been trying to implement menu items for view modes. I've followed
everything that I can find in the source, but it still doesn't seem to
work. So, it would be nice if someone who knows what they're doing
could put this at the beginning of the view menu:

Page Layout
Normal
Outline
<seperator>

Outline should be grayed out for now, but Normal and Page Layout should be
enabled and have a checkmark indicating which one is currently being used
in the document if that is possible. What should happen is that these
would set a variable inside the document class indicating the selection of
view mode, and then the FV_View should be destroyed and a new object
created in its place, for example FV_View_Normal, hopefully without losing
whatever data is stored in the FV_View class. (I wish this could be done
more cleanly! I designed my normal view to be a subclass of FV_View but
now I realize that switching modes while a document is already open is
going to be tough. Maybe I should redesign it so that it adds a
_draw_normal function to FV_View which would be called by _draw if it
realizes that the view is "normal"? That way we would be able to have a
menu item assign the value to the mViewType or whatever variable in the
FV_View and then redraw the FV_View.)

Hopefully, eventually margin & ruler code and the like will also look at
the variable in the document class (or FV_View if it ends up being a
generic class that can handle all of the view modes instead of having
subclasses to do everything other than page layout) indicating the view
type and adjust their behavior accordingly. For example, you don't want
top or bottom margins on pages in normal mode, and you want the ruler
to start at where the text starts rather than where the page starts.

I would sugest that this variable in FV_View or the document class be
something like this:

typedef enum
{
ViewType_PageLayout,
ViewType_Normal,
ViewType_Outline,
// additional types here
} ViewType;

Thanks...



This archive was generated by hypermail 1.03b2.