home *** CD-ROM | disk | FTP | other *** search
- <<[H]TWindowView [[TWindowView]]
- ##{hheader.snp}
- #include <owl/docview.h>
-
- ##<<TApplication QUERY_FILENAME_CPP [[Filename]]
- #include "[[Filename]].rh" // Definition of all resources.
-
-
- //{{TWindowView = [[TWindowView]]}}
- class [[TWindowView]] : public TWindowView {
- public:
- [[TWindowView]](TDocument& doc, TWindow* parent = 0);
- virtual ~[[TWindowView]]();
- ##--BEGIN-- @OPT_APPL_PRINTING
-
- //{{[[TWindowView]]VIRTUAL_BEGIN}}
- public:
- virtual void Paint(TDC& dc, bool erase, TRect& rect);
- ##:DBVirtual(\\"[[TWindowView]]", "Paint")
- //{{[[TWindowView]]VIRTUAL_END}}
- //{{[[TWindowView]]RSP_TBL_BEGIN}}
- protected:
- void EvGetMinMaxInfo(MINMAXINFO far& minmaxinfo);
- //{{[[TWindowView]]RSP_TBL_END}}
- DECLARE_RESPONSE_TABLE([[TWindowView]]);
- ##--END-- @OPT_APPL_PRINTING
- }; //{{[[TWindowView]]}}
- ##{hfooter.snp}
- >>[H]TWindowView [[TWindowView]]
-
-
- <<[CPP]TWindowView [[TWindowView]]
- ##{cheader.snp}
- #include <owl/pch.h>
-
- ##<<TApplication QUERY_FILE_H [[FileName]]
- #include "[[FileName]]"
- ##QUERY_FILE_H [[FileName]]
- #include "[[FileName]]"
-
- #include <stdio.h>
-
-
- //{{[[TWindowView]] Implementation}}
-
-
- ##--BEGIN-- @OPT_APPL_PRINTING
- ##@QUERY_APPL_COMMENT == VALUE_VERBOSE 4
- //
- // Build a response table for all messages/commands handled
- // by [[TWindowView]] derived from TWindowView.
- //
- DEFINE_RESPONSE_TABLE1([[TWindowView]], TWindowView)
- //{{[[TWindowView]]RSP_TBL_BEGIN}}
- ##:DBResponse(\\"[[TWindowView]]", "", "", "WM_GETMINMAXINFO", "")
- EV_WM_GETMINMAXINFO,
- //{{[[TWindowView]]RSP_TBL_END}}
- END_RESPONSE_TABLE;
-
-
- ##--END-- @OPT_APPL_PRINTING
- ##--BEGIN-- @QUERY_APPL_COMMENT == VALUE_VERBOSE
- //--------------------------------------------------------
- // [[TWindowView]]
- // ~~~~~~~~~~
- // Construction/Destruction handling.
- //
- ##--END-- @QUERY_APPL_COMMENT == VALUE_VERBOSE
- [[TWindowView]]::[[TWindowView]](TDocument& doc, TWindow* parent)
- :
- TWindowView(doc, parent)
- {
- ##QUERY_WIND_STYLE [[StyleAttributes]]
- ##StyleAttributes != "" 3
- // Override the default window style for TWindowView.
- [[StyleAttributes]]
-
- ##{wndbkgd.snp}
- // INSERT>> Your constructor code here.
-
- }
-
-
- [[TWindowView]]::~[[TWindowView]]()
- {
- // INSERT>> Your destructor code here.
-
- }
- ##--BEGIN-- @OPT_APPL_PRINTING == TRUE
-
-
- ##@QUERY_APPL_COMMENT == VALUE_VERBOSE 3
- //
- // Paint routine for Window, Printer, and PrintPreview for a TWindowView client.
- //
- void [[TWindowView]]::Paint(TDC&, bool, TRect& rect)
- {
- ##<<TApplication QUERY_CLASS_NAME [[TApplication]]
- [[TApplication]]* theApp = TYPESAFE_DOWNCAST(GetApplication(), [[TApplication]]);
- if (theApp) {
- ##:@QUERY_APPL_COMMENT == VALUE_VERBOSE 2
- // Only paint if we're printing and we have something to paint, otherwise do nothing.
- //
- if (theApp->Printing && theApp->Printer && !rect.IsEmpty()) {
- ##:@QUERY_APPL_COMMENT == VALUE_VERBOSE 3
- // Use pageSize to get the size of the window to render into. For a Window it's the client area,
- // for a printer it's the printer DC dimensions and for print preview it's the layout window.
- //
- TSize pageSize(rect.right - rect.left, rect.bottom - rect.top);
-
- TPrintDialog::TData& printerData = theApp->Printer->GetSetup();
-
- ##:@QUERY_APPL_COMMENT == VALUE_VERBOSE 2
- // Compute the number of pages to print.
- //
- printerData.MinPage = 1;
- printerData.MaxPage = 1;
-
- // INSERT>> Special printing code goes here.
-
- }
- else {
- // INSERT>> Normal painting code goes here.
-
- }
- }
- }
-
-
- void [[TWindowView]]::EvGetMinMaxInfo(MINMAXINFO far& minmaxinfo)
- {
- ##<<TApplication QUERY_CLASS_NAME [[TApplication]]
- [[TApplication]]* theApp = TYPESAFE_DOWNCAST(GetApplication(), [[TApplication]]);
- if (theApp) {
- if (theApp->Printing) {
- minmaxinfo.ptMaxSize = TPoint(32000, 32000);
- minmaxinfo.ptMaxTrackSize = TPoint(32000, 32000);
- return;
- }
- }
- TWindowView::EvGetMinMaxInfo(minmaxinfo);
- }
- ##--END-- @OPT_APPL_PRINTING == TRUE
- >>[CPP]TWindowView [[TWindowView]]
-