home *** CD-ROM | disk | FTP | other *** search
- // tooltvw.cpp : implementation of the CTooltestView class
- //
-
- #include "stdafx.h"
- #include "tooltest.h"
-
- #include "tooltdoc.h"
- #include "tooltvw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CTooltestView
-
- IMPLEMENT_DYNCREATE(CTooltestView, CView)
-
- BEGIN_MESSAGE_MAP(CTooltestView, CView)
- //{{AFX_MSG_MAP(CTooltestView)
- //}}AFX_MSG_MAP
- // Standard printing commands
- ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CTooltestView construction/destruction
-
- CTooltestView::CTooltestView()
- {
- // TODO: add construction code here
- }
-
- CTooltestView::~CTooltestView()
- {
- }
-
- void CTooltestView::OnInitialUpdate()
- {
- CView::OnInitialUpdate();
- //
- // I want all child windows to use up the whole client area on the screen
- //
- ((CMDIChildWnd *) GetParentFrame())->MDIMaximize();
- }
- /////////////////////////////////////////////////////////////////////////////
- // CTooltestView drawing
-
- char *Msg[] = {
- "TOOLTEST Demonstration Program:",
- " This is a test program that demonstrates the Tool Tips functions.",
- "",
- " Tool Tips is FREEWARE and Contains Lots of Features Including:",
- " Automatic Popup Tip Windows With Very Easy Setup",
- " Automatically Gets Tips From Corresponding Menu or String Table Item",
- " Support For Custom Toolbar Controls Like Combo Boxes",
- " Standard Square, Rounded, or 3D Styles",
- " Standard Small or System Fonts",
- " Functions to Set Status Line Messages, Popup Hints, and Wait Time",
- " Very Little Code Space Required",
- " Complete Source Code Included",
- "",
- "Sample Popup Windows:",
- " Move the mouse cursor over one of the tool bar buttons at the top of the screen to see a",
- " sample popup tip window. When you move the mouse cursor away from the toolbar window",
- " the popup tip window automatically disappears.",
- "",
- "Changing Options:",
- " To change the Tool Tips options use the View/Toolbar Options dialog. Select the set of",
- " options you would like to see and notice that the changes take effect immediately.",
- "",
- "See File: TOOLTIPS.WRI For Complete Details...",
- NULL
- };
-
- void CTooltestView::OnDraw(CDC* pDC)
- {
- CTooltestDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-
- CClientDC dc(this);
- TEXTMETRIC tm;
- dc.GetTextMetrics(&tm);
-
- for (int line = 0; Msg[line] != NULL; ++line)
- dc.TextOut(5,line*tm.tmHeight,Msg[line]);
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CTooltestView printing
-
- BOOL CTooltestView::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
-
- void CTooltestView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
-
- void CTooltestView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CTooltestView diagnostics
-
- #ifdef _DEBUG
- void CTooltestView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CTooltestView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CTooltestDoc* CTooltestView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTooltestDoc)));
- return (CTooltestDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CTooltestView message handlers
-
-