Commit: ap_Preview-Abi and other stuff.


Subject: Commit: ap_Preview-Abi and other stuff.
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Wed Apr 11 2001 - 22:12:40 CDT


New ap_Preview_Abi class. See src/wp/ap/xp/ap_Preview_Abi.cpp. Can now now
view abi documents in an arbitary graphics context.

Create it via:

m_pAbiPreview = new AP_Preview_Abi(gc,width,height,m_pFrame,PREVIEW_ZOOMED);

The last entry governs the type of preview you can have. The options are:

typedef enum
{
  PREVIEW_NONE,
  PREVIEW_ZOOMED,
  PREVIEW_ADJUSTED_PAGE,
  PREVIEW_CLIPPED,
  PREVIEW_ZOOMED_SCROLL,
  PREVIEW_ADJUSTED_PAGE_SCROLL,
  PREVIEW_CLIPPED_SCROLL
} PreViewMode;

PREVIEW_ZOOMED adjusts the zoom of the doicument to fit the width of the
graphics context.

PREVIEW_ADJUSTED_PAGE sets the page width of Abi to match the width of the
graphics context.

PREVIEW_CLIPPED just clips the observed document view to make it fit in
the graphics context.

The variants with "SCROLL" are the same except that scrollbars are added
to scroll horizontally and vertically. These require platform specifc code
with I haven't added yet.

The styles dialog uses PREVIEW_ZOOMED so that faithful representations
of the current style showing all the properties are displayed.

We can use this code for Document templates and for a preview of the
document about to be aloaded as well. In addition any of the dialogs
requiring a preview of protations of the document (Like the paragraph,
font and spell dialogs) should really use this class instead.

Once created as above the preview document can be add manipulated with all
the standard FV_View and PD_DOcument methods via:

AP_Preview_Abi::getView(void)
AP_PReview_Abi::getDoc(void)

methods.

So for example in the Styles dialog, the preview document used to display
the current style is populated via:

getLView()->cmdCharInsert(szString, len)

etc. etc.

Anyway, to see this in action, rebuild abi and press the "modify" button
on the styles dialog. Win32 developers should feel free to build a Styles
dialog so they can see this cool feature too :-)

Cheers!

Martin

PS. Also fixed some bugs in the List code that prevented multi-level
bullet type lists working properly.

 CVS:
----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: src/af/xap/xp/xap_Preview.cpp
CVS: src/text/fmt/xp/fb_LineBreaker.cpp
CVS: src/text/fmt/xp/fl_AutoNum.cpp
CVS: src/text/fmt/xp/fl_BlockLayout.cpp
CVS: src/text/fmt/xp/fl_DocLayout.cpp
CVS: src/text/fmt/xp/fl_DocListener.cpp
CVS: src/text/fmt/xp/fl_SectionLayout.cpp
CVS: src/text/fmt/xp/fp_Column.cpp src/text/fmt/xp/fp_Page.cpp
CVS: src/text/fmt/xp/fv_View.cpp src/text/fmt/xp/fv_View.h
CVS: src/text/ptbl/xp/pd_Document.cpp src/wp/ap/Makefile
CVS: src/wp/ap/unix/ap_UnixDialog_Styles.cpp
CVS: src/wp/ap/unix/ap_UnixDialog_Styles.h src/wp/ap/xp/Makefile
CVS: src/wp/ap/xp/ap_Dialog_Lists.cpp
CVS: src/wp/ap/xp/ap_Dialog_Styles.cpp
CVS: src/wp/ap/xp/ap_Dialog_Styles.h
CVS: src/wp/ap/xp/ap_EditMethods.cpp
CVS: Added Files:
CVS: src/wp/ap/xp/ap_Preview_Abi.cpp src/wp/ap/xp/ap_Preview_Abi.h
CVS:
----------------------------------------------------------------------



This archive was generated by hypermail 2b25 : Wed Apr 11 2001 - 22:12:53 CDT