home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // File : OutputView.h
- // Project : MsgTrace
- // Component : MsgTracer
- //---------------------------------------------------------------------------
- // Description : output view for MsgTracer
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // SourceSafe Strings. Do not change.
- //---------------------------------------------------------------------------
- // $Author: jeskes $
- // $Date: $
- // $Revision: $
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #ifndef OUTPUTVIEW_H
- #define OUTPUTVIEW_H
-
- /////////////////////////////////////////////////////////////////////////////
-
- class COutputDoc;
- class CColoredFont;
-
- /////////////////////////////////////////////////////////////////////////////
-
- class COutputView : public CScrollView
- {
- DECLARE_DYNCREATE( COutputView )
- //---------------------------------------------------------------------------
- // construction
- //---------------------------------------------------------------------------
- public:
- COutputView();
- virtual ~COutputView();
-
- //---------------------------------------------------------------------------
- // associated document
- //---------------------------------------------------------------------------
- public:
- COutputDoc* GetDocument();
-
- protected:
- virtual void OnInitialUpdate();
- virtual void OnUpdate( CView*, LPARAM, CObject* );
-
- //---------------------------------------------------------------------------
- // colored font
- //---------------------------------------------------------------------------
- protected:
- CColoredFont* m_pColoredFont;
- public:
- CColoredFont* ColoredFontGet() const;
-
- //---------------------------------------------------------------------------
- // track menu
- //---------------------------------------------------------------------------
- protected:
- CMenu* m_pTrackMenu;
-
- //---------------------------------------------------------------------------
- // current caret position and selection
- //---------------------------------------------------------------------------
- protected:
- BOOL m_bWhileSelecting;
-
- int m_nCurCol;
- int m_nCurRow;
-
- void SetCurPos( int nCol, int nRow, BOOL bMoveCaret = TRUE, BOOL bClearSelection = TRUE );
- void SetCurPos( CPoint pt, BOOL bMoveCaret = TRUE, BOOL bClearSelection = TRUE );
-
- void MoveCaretToCurPos();
-
- int GetCurCol() const;
- int GetCurRow() const;
-
- int m_nSelCol;
- int m_nSelRow;
-
- BOOL GetSelForRow( int nRow, int& nStartCol, int& nEndCol ) const;
-
- void CharCoordsFromVirtPoint( CPoint pt, int& nCol, int& nRow );
- CPoint VirtCharPosFromCoords( int nCol, int nRow );
- void AdjustScrollToVirtPoint( CPoint pt );
-
- void InvalidateSelRange();
- void InvalidateNewRange( int nCol, int nRow );
- void InvalidateRange( int nStartCol, int nStartRow, int nEndCol, int nEndRow );
-
- public:
- void GetSelectedText( CString& strResult );
-
- BOOL GetSelRange( int& nSelStartCol,
- int& nSelStartRow,
- int& nSelEndCol,
- int& nSelEndRow ) const;
-
- CString GetCurRowAsString();
-
- //---------------------------------------------------------------------------
- // own capture mechanism
- //---------------------------------------------------------------------------
- protected:
- UINT m_nIDCaptureTimer;
-
- public:
- void SetCapture();
- void ReleaseCapture();
-
- //---------------------------------------------------------------------------
- // attributes
- //---------------------------------------------------------------------------
- private:
- int m_nMaxVisibleLines;
- // max number of visible lines in window
-
- int m_nRowWidth;
- // max width of ever displayed rows
-
- int m_nRowHeight;
- // height of any displayed row
-
- public:
- int GetMaxVisibleLines() const;
-
- //---------------------------------------------------------------------------
- // drawing
- //---------------------------------------------------------------------------
- protected:
- virtual void OnPrepareDC( CDC* pDC, CPrintInfo* pInfo = NULL );
- virtual void OnDraw(CDC* pDC);
- virtual void OnDrawLine( CDC*, int, int, BOOL );
- virtual void UpdateScrollSizes();
-
- void RectToRange( const CRect& rect, int& nFirst, int& nLast );
-
- //---------------------------------------------------------------------------
- // printing
- //---------------------------------------------------------------------------
- protected:
- HFONT m_hPrinterFont;
- int m_nPrintRowHeight;
- int m_nPrintLinesPerPage;
-
- virtual BOOL OnPreparePrinting( CPrintInfo* pInfo );
- virtual void OnBeginPrinting( CDC* pDC, CPrintInfo* pInfo );
- virtual void OnPrint( CDC* pDC, CPrintInfo* pInfo );
- virtual void OnEndPrinting( CDC* pDC, CPrintInfo* pInfo );
-
- //---------------------------------------------------------------------------
- // message map
- //---------------------------------------------------------------------------
- protected:
- //{{AFX_MSG(COutputView)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnViewFont();
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnEditCopy();
- afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- friend class CMainFrame;
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- inline CColoredFont* COutputView::ColoredFontGet() const
- {
- return( m_pColoredFont );
- }
-
- inline int COutputView::GetMaxVisibleLines() const
- {
- return( m_nMaxVisibleLines );
- }
-
- inline int COutputView::GetCurCol() const
- {
- return( m_nCurCol );
- }
-
- inline int COutputView::GetCurRow() const
- {
- return( m_nCurRow );
- }
-
- /////////////////////////////////////////////////////////////////////////////
- #endif
-