Index: abi/src/af/xap/qnx/xap_QNXDlg_Zoom.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/qnx/xap_QNXDlg_Zoom.cpp,v retrieving revision 1.10 diff -u -r1.10 xap_QNXDlg_Zoom.cpp --- abi/src/af/xap/qnx/xap_QNXDlg_Zoom.cpp 2000/07/25 20:40:05 1.10 +++ abi/src/af/xap/qnx/xap_QNXDlg_Zoom.cpp 2000/10/24 07:43:07 @@ -587,7 +587,7 @@ { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(item->data))) { - m_zoomType = (XAP_Dialog_Zoom::zoomType) + m_zoomType = (XAP_Frame::tZoomType) GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(item->data), WIDGET_ID_TAG_KEY)); break; } Index: abi/src/af/xap/unix/xap_UnixDlg_Zoom.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/unix/xap_UnixDlg_Zoom.cpp,v retrieving revision 1.10 diff -u -r1.10 xap_UnixDlg_Zoom.cpp --- abi/src/af/xap/unix/xap_UnixDlg_Zoom.cpp 2000/10/20 22:35:30 1.10 +++ abi/src/af/xap/unix/xap_UnixDlg_Zoom.cpp 2000/10/24 07:43:10 @@ -577,7 +577,7 @@ { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(item->data))) { - m_zoomType = (XAP_Dialog_Zoom::zoomType) + m_zoomType = (XAP_Frame::tZoomType) GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(item->data), WIDGET_ID_TAG_KEY)); break; } Index: abi/src/af/xap/win/xap_Win32Dlg_Zoom.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/win/xap_Win32Dlg_Zoom.cpp,v retrieving revision 1.6 diff -u -r1.6 xap_Win32Dlg_Zoom.cpp --- abi/src/af/xap/win/xap_Win32Dlg_Zoom.cpp 1999/10/12 00:43:57 1.6 +++ abi/src/af/xap/win/xap_Win32Dlg_Zoom.cpp 2000/10/24 07:43:13 @@ -277,7 +277,7 @@ n = _getRBOffset(hWnd, XAP_RID_DIALOG_ZOOM_RADIO_200, XAP_RID_DIALOG_ZOOM_RADIO_PCT); UT_ASSERT(n >= 0); - m_zoomType = (XAP_Dialog_Zoom::zoomType) n; + m_zoomType = (XAP_Frame::tZoomType) n; if (_getValueFromEditPct(hWnd,&newValue)) m_zoomPercent = newValue; Index: abi/src/af/xap/win/xap_Win32Frame.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/win/xap_Win32Frame.cpp,v retrieving revision 1.63 diff -u -r1.63 xap_Win32Frame.cpp --- abi/src/af/xap/win/xap_Win32Frame.cpp 2000/09/25 22:17:47 1.63 +++ abi/src/af/xap/win/xap_Win32Frame.cpp 2000/10/24 07:43:16 @@ -36,6 +36,8 @@ #include "xav_View.h" #include "xad_Document.h" +#include "fv_View.h" + #pragma warning(disable:4355) /*****************************************************************/ @@ -351,6 +353,8 @@ pView = f->m_pView; + FV_View* pfView = static_cast(pView); + if(iMsg == f->m_mouseWheelMessage) { wParam = MAKEWPARAM(0, (short)(int)wParam); @@ -541,6 +545,25 @@ f->m_iSizeWidth = nWidth; f->m_iSizeHeight = nHeight; + + + UT_uint32 newZoom = 0; + + switch(f->getZoomType()) + { +// // special cases + case XAP_Frame::z_PAGEWIDTH: + newZoom = pfView->calculateZoomPercentForPageWidth(); + f->setZoomPercentage(newZoom); + + break; + case XAP_Frame::z_WHOLEPAGE: + newZoom = pfView->calculateZoomPercentForWholePage(); + f->setZoomPercentage(newZoom); + break; + default: + ; + } return 0; } Index: abi/src/af/xap/xp/xap_Dlg_Zoom.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/xp/xap_Dlg_Zoom.cpp,v retrieving revision 1.4 diff -u -r1.4 xap_Dlg_Zoom.cpp --- abi/src/af/xap/xp/xap_Dlg_Zoom.cpp 1999/10/07 08:29:14 1.4 +++ abi/src/af/xap/xp/xap_Dlg_Zoom.cpp 2000/10/24 07:43:17 @@ -63,24 +63,24 @@ switch(zoom) { case 200: - m_zoomType = XAP_Dialog_Zoom::z_200; + m_zoomType = XAP_Frame::z_200; break; case 100: - m_zoomType = XAP_Dialog_Zoom::z_100; + m_zoomType = XAP_Frame::z_100; break; case 75: - m_zoomType = XAP_Dialog_Zoom::z_75; + m_zoomType = XAP_Frame::z_75; break; // can't detect PageWidth and WholePage default: - m_zoomType = XAP_Dialog_Zoom::z_PERCENT; + m_zoomType = XAP_Frame::z_PERCENT; } // store the percentage m_zoomPercent = zoom; } -XAP_Dialog_Zoom::zoomType XAP_Dialog_Zoom::getZoomType(void) +XAP_Frame::tZoomType XAP_Dialog_Zoom::getZoomType(void) { return m_zoomType; } @@ -90,20 +90,20 @@ // we deliver based on special cases first, then the custom percentage switch(m_zoomType) { - case XAP_Dialog_Zoom::z_200: + case XAP_Frame::z_200: return 200; - case XAP_Dialog_Zoom::z_100: + case XAP_Frame::z_100: return 100; - case XAP_Dialog_Zoom::z_75: + case XAP_Frame::z_75: return 75; // we can't really do anything with these, // since it's up to the application to query for these two // types and do something special with them - case XAP_Dialog_Zoom::z_PAGEWIDTH: + case XAP_Frame::z_PAGEWIDTH: return 0; - case XAP_Dialog_Zoom::z_WHOLEPAGE: + case XAP_Frame::z_WHOLEPAGE: return 0; - case XAP_Dialog_Zoom::z_PERCENT: + case XAP_Frame::z_PERCENT: // fall through default: if (m_zoomPercent > 1) Index: abi/src/af/xap/xp/xap_Dlg_Zoom.h =================================================================== RCS file: /cvsroot/abi/src/af/xap/xp/xap_Dlg_Zoom.h,v retrieving revision 1.4 diff -u -r1.4 xap_Dlg_Zoom.h --- abi/src/af/xap/xp/xap_Dlg_Zoom.h 1999/10/10 04:23:24 1.4 +++ abi/src/af/xap/xp/xap_Dlg_Zoom.h 2000/10/24 07:43:17 @@ -40,7 +40,7 @@ virtual void runModal(XAP_Frame * pFrame) = 0; typedef enum { a_OK, a_CANCEL } tAnswer; - typedef enum { z_200, z_100, z_75, z_PAGEWIDTH, z_WHOLEPAGE, z_PERCENT } zoomType; +// typedef enum { z_200, z_100, z_75, z_PAGEWIDTH, z_WHOLEPAGE, z_PERCENT } zoomType; XAP_Dialog_Zoom::tAnswer getAnswer(void) const; @@ -48,7 +48,7 @@ void setZoomPercent(UT_uint32 zoom); // read these back - XAP_Dialog_Zoom::zoomType getZoomType(void); + XAP_Frame::tZoomType getZoomType(void); UT_uint32 getZoomPercent(void); protected: @@ -63,7 +63,7 @@ XAP_Preview_Zoom * m_zoomPreview; - XAP_Dialog_Zoom::zoomType m_zoomType; + XAP_Frame::tZoomType m_zoomType; UT_uint32 m_zoomPercent; XAP_Dialog_Zoom::tAnswer m_answer; Index: abi/src/af/xap/xp/xap_Frame.h =================================================================== RCS file: /cvsroot/abi/src/af/xap/xp/xap_Frame.h,v retrieving revision 1.42 diff -u -r1.42 xap_Frame.h --- abi/src/af/xap/xp/xap_Frame.h 2000/07/25 21:10:50 1.42 +++ abi/src/af/xap/xp/xap_Frame.h 2000/10/24 07:43:19 @@ -18,8 +18,8 @@ */ -#ifndef XAP_FRAME_H -#define XAP_FRAME_H +#ifndef XAP_Frame_H +#define XAP_Frame_H #include "ut_types.h" #include "ut_vector.h" @@ -122,9 +122,14 @@ virtual UT_Bool runModalContextMenu(AV_View * pView, const char * szMenuName, UT_sint32 x, UT_sint32 y) = 0; + typedef enum { z_200, z_100, z_75, z_PAGEWIDTH, z_WHOLEPAGE, z_PERCENT } tZoomType; virtual void setZoomPercentage(UT_uint32 iZoom); virtual UT_uint32 getZoomPercentage(void); + void setZoomType(XAP_Frame::tZoomType z_Type){ m_zoomType = z_Type; } + XAP_Frame::tZoomType getZoomType(void) { return m_zoomType; } + + virtual void setStatusMessage(const char * szMsg) = 0; virtual void toggleRuler(UT_Bool /*bRulerOn*/) { } // @@ -173,6 +178,7 @@ EV_Keyboard * m_pKeyboard; ap_Scrollbar_ViewListener * m_pScrollbarViewListener; AV_ListenerId m_lidScrollbarViewListener; + XAP_Frame::tZoomType m_zoomType; void * m_pData; /* app-specific frame data */ @@ -187,4 +193,4 @@ static int s_iUntitled; }; -#endif /* XAP_FRAME_H */ +#endif /* XAP_Frame_H */ Index: abi/src/wp/ap/xp/ap_EditMethods.cpp =================================================================== RCS file: /cvsroot/abi/src/wp/ap/xp/ap_EditMethods.cpp,v retrieving revision 1.243 diff -u -r1.243 ap_EditMethods.cpp --- abi/src/wp/ap/xp/ap_EditMethods.cpp 2000/10/17 00:25:59 1.243 +++ abi/src/wp/ap/xp/ap_EditMethods.cpp 2000/10/24 07:43:42 @@ -33,7 +33,7 @@ #include "pd_Document.h" #include "gr_Graphics.h" #include "xap_App.h" -#include "xap_Frame.h" +#include "XAP_Frame.h" #include "xap_EditMethods.h" #include "xap_Menu_Layouts.h" #include "xap_Prefs.h" @@ -3760,13 +3760,14 @@ if (bOK) { UT_uint32 newZoom = pFrame->getZoomPercentage(); + pFrame->setZoomType(pDialog->getZoomType()); switch(pDialog->getZoomType()) { // special cases - case XAP_Dialog_Zoom::z_PAGEWIDTH: + case XAP_Frame::z_PAGEWIDTH: newZoom = pView->calculateZoomPercentForPageWidth(); break; - case XAP_Dialog_Zoom::z_WHOLEPAGE: + case XAP_Frame::z_WHOLEPAGE: newZoom = pView->calculateZoomPercentForWholePage(); break; default: