<<[H]TWindow [[TWindow]] ##{hheader.snp} #include #pragma hdrstop ##<>[H]TWindow [[TWindow]] <<[CPP]TWindow [[TWindow]] ##{cheader.snp} #include #pragma hdrstop ##< //{{[[TWindow]] Implementation}} ##--BEGIN-- @OPT_APPL_PRINTING ##--BEGIN-- @QUERY_APPL_COMMENT == VALUE_VERBOSE // // Build a response table for all messages/commands handled // by [[TWindow]] derived from TWindow. // ##--END-- @QUERY_APPL_COMMENT == VALUE_VERBOSE DEFINE_RESPONSE_TABLE1([[TWindow]], TWindow) //{{[[TWindow]]RSP_TBL_BEGIN}} ##:DBResponse(\\"[[TWindow]]", "", "", "WM_GETMINMAXINFO", "") EV_WM_GETMINMAXINFO, //{{[[TWindow]]RSP_TBL_END}} END_RESPONSE_TABLE; ##--END-- @OPT_APPL_PRINTING ##--BEGIN-- @QUERY_APPL_COMMENT == VALUE_VERBOSE ////////////////////////////////////////////////////////// // [[TWindow]] // ========== // Construction/Destruction handling. ##--END-- @QUERY_APPL_COMMENT == VALUE_VERBOSE [[TWindow]]::[[TWindow]] (TWindow* parent, const char far* title, TModule* module) : TWindow(parent, title, module) { ##QUERY_WIND_STYLE [[StyleAttributes]] ##StyleAttributes != "" 3 // Override the default window style for TWindow. [[StyleAttributes]] ##QUERY_WIND_BACKGRND [[BackgroundColor]] ##BackgroundColor != "" 3 // Change the window's background color SetBkgndColor([[BackgroundColor]]); // INSERT>> Your constructor code here. } [[TWindow]]::~[[TWindow]] () { Destroy(); // INSERT>> Your destructor code here. } ##--BEGIN-- @OPT_APPL_PRINTING == TRUE ##--BEGIN-- @QUERY_APPL_COMMENT == VALUE_VERBOSE // // Paint routine for Window, Printer, and PrintPreview for an TWindow client. // ##--END-- @QUERY_APPL_COMMENT == VALUE_VERBOSE void [[TWindow]]::Paint (TDC&, bool, TRect& rect) { ##<Printing && theApp->Printer && !rect.IsEmpty()) { ##:@QUERY_APPL_COMMENT == VALUE_VERBOSE 2 // 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 // 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 [[TWindow]]::EvGetMinMaxInfo (MINMAXINFO far& minmaxinfo) { ##<Printing) { minmaxinfo.ptMaxSize = TPoint(32000, 32000); minmaxinfo.ptMaxTrackSize = TPoint(32000, 32000); return; } } TWindow::EvGetMinMaxInfo(minmaxinfo); } ##--END-- @OPT_APPL_PRINTING == TRUE >>[CPP]TWindow [[TWindow]]