From: boca4711 <boc...@us...> - 2004-11-21 14:18:45
|
Update of /cvsroot/anyedit/AnyEditToolkit/Samples/Gui_DevStudio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24055/Samples/Gui_DevStudio Modified Files: Gui_DevStudioView.cpp Gui_DevStudioView.h Log Message: Added call for mulit page print preview Index: Gui_DevStudioView.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditToolkit/Samples/Gui_DevStudio/Gui_DevStudioView.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Gui_DevStudioView.cpp 26 Sep 2004 16:16:23 -0000 1.1 --- Gui_DevStudioView.cpp 21 Nov 2004 14:17:15 -0000 1.2 *************** *** 120,124 **** } - void CGui_DevStudioView::OnContextMenu(CWnd* pWnd, CPoint point) { --- 120,123 ---- *************** *** 150,151 **** --- 149,182 ---- menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd()); } + + void CGui_DevStudioView::OnFilePrintPreview() + { + // replace the default print preview with ours! + + // In derived classes, implement special window handling here + // Be sure to Unhook Frame Window close if hooked. + + // must not create this on the frame. Must outlive this function + CPrintPreviewState* pState = new CPrintPreviewState; + + // DoPrintPreview's return value does not necessarily indicate that + // Print preview succeeded or failed, but rather what actions are necessary + // at this point. If DoPrintPreview returns TRUE, it means that + // OnEndPrintPreview will be (or has already been) called and the + // pState structure will be/has been deleted. + // If DoPrintPreview returns FALSE, it means that OnEndPrintPreview + // WILL NOT be called and that cleanup, including deleting pState + // must be done here. + + if (!DoPrintPreview(IDD_PREVIEW, this, RUNTIME_CLASS(CMultiPagePreviewView), + pState)) // note, put your class name in here + { + // In derived classes, reverse special window handling here for + // Preview failure case + + TRACE0("Error: DoPrintPreview failed.\n"); + AfxMessageBox(AFX_IDP_COMMAND_FAILURE); + delete pState; // preview failed to initialize, delete State now + pState = NULL; + } + } Index: Gui_DevStudioView.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditToolkit/Samples/Gui_DevStudio/Gui_DevStudioView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Gui_DevStudioView.h 26 Sep 2004 16:16:23 -0000 1.1 --- Gui_DevStudioView.h 21 Nov 2004 14:17:15 -0000 1.2 *************** *** 50,53 **** --- 50,54 ---- //{{AFX_MSG(CGui_DevStudioView) afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); + afx_msg void OnFilePrintPreview(); //}}AFX_MSG DECLARE_MESSAGE_MAP() |