home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 17.ddi / MFC / INCLUDE / AFXEXT.H_ / AFXEXT.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  33.9 KB  |  1,117 lines

  1. // Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992 Microsoft Corporation,
  3. // All rights reserved.
  4.  
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and Microsoft
  7. // QuickHelp and/or WinHelp documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #ifndef __AFXEXT_H__
  12. #define __AFXEXT_H__
  13.  
  14. #ifndef __AFXWIN_H__
  15. #include "afxwin.h"
  16. #endif
  17. #ifndef __AFXDLGS_H__
  18. #include "afxdlgs.h"
  19. #endif
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. // AFXEXT - MFC Advanced Extensions and Advanced Customizable classes
  23.  
  24. // Classes declared in this file
  25.  
  26. //CObject
  27.     //CCmdTarget;
  28.         //CWnd
  29.             //CButton
  30.                 class CBitmapButton;     // Bitmap button (self-draw)
  31.  
  32.             class CControlBar;           // control bar
  33.                 class CStatusBar;        // status bar
  34.                 class CToolBar;          // toolbar
  35.                 class CDialogBar;        // dialog as control bar
  36.  
  37.             class CSplitterWnd;          // splitter manager
  38.  
  39.             //CView
  40.                 //CScrollView
  41.                 class CFormView;         // view with a dialog template
  42.                 class CEditView;         // simple text editor view
  43.  
  44.             class CVBControl;            // VBX control
  45.  
  46.     //CDC
  47.         class CMetaFileDC;               // a metafile with proxy
  48.  
  49.  
  50. // information structures
  51. struct CPrintInfo;          // Printing context
  52. struct CPrintPreviewState;  // Print Preview context/state
  53. struct CCreateContext;      // Creation context
  54.  
  55. // AFXDLL support
  56. #undef AFXAPP_DATA
  57. #define AFXAPP_DATA     AFXAPI_DATA
  58.  
  59. /////////////////////////////////////////////////////////////////////////////
  60. // Simple bitmap button
  61.  
  62. // CBitmapButton - push-button with 1->4 bitmap images
  63. class CBitmapButton : public CButton
  64. {
  65.     DECLARE_DYNAMIC(CBitmapButton)
  66. public:
  67. // Construction
  68.     CBitmapButton();
  69.  
  70.     BOOL LoadBitmaps(LPCSTR lpszBitmapResource,
  71.             LPCSTR lpszBitmapResourceSel = NULL,
  72.             LPCSTR lpszBitmapResourceFocus = NULL,
  73.             LPCSTR lpszBitmapResourceDisabled = NULL);
  74.     BOOL AutoLoad(UINT nID, CWnd* pParent);
  75.  
  76. // Operations
  77.     void SizeToContent();
  78.  
  79. // Implementation:
  80. public:
  81. #ifdef _DEBUG
  82.     virtual void AssertValid() const;
  83.     virtual void Dump(CDumpContext& dc) const;
  84. #endif
  85. protected:
  86.     // all bitmaps must be the same size
  87.     CBitmap m_bitmap;           // normal image (REQUIRED)
  88.     CBitmap m_bitmapSel;        // selected image (OPTIONAL)
  89.     CBitmap m_bitmapFocus;      // focused but not selected (OPTIONAL)
  90.     CBitmap m_bitmapDisabled;   // disabled bitmap (OPTIONAL)
  91.  
  92.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
  93. };
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // Control Bars
  97.  
  98. class CControlBar : public CWnd
  99. {
  100.     DECLARE_DYNAMIC(CControlBar)
  101. // Construction
  102. protected:
  103.     CControlBar();
  104.  
  105. // Attributes
  106. public:
  107.     int GetCount() const;
  108.  
  109.     BOOL m_bAutoDelete;
  110.  
  111. // Implementation
  112. public:
  113.     virtual ~CControlBar();
  114. #ifdef _DEBUG
  115.     virtual void AssertValid() const;
  116.     virtual void Dump(CDumpContext& dc) const;
  117. #endif
  118.  
  119. protected:
  120.     // info about bar (for status bar and toolbar)
  121.     int m_cxLeftBorder;
  122.     int m_cyTopBorder, m_cyBottomBorder;
  123.     int m_cxDefaultGap;     // default gap value
  124.     CSize m_sizeFixedLayout; // fixed layout size
  125.  
  126.     // array of elements
  127.     int m_nCount;
  128.     void* m_pData;        // m_nCount elements - type depends on derived class
  129.  
  130.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  131.     virtual void DoPaint(CDC* pDC);
  132.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) = 0;
  133.     virtual void PostNcDestroy();
  134.  
  135.     BOOL AllocElements(int nElements, int cbElement);    // one time only
  136.     LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
  137.     void CalcInsideRect(CRect& rect) const; // adjusts borders etc
  138.  
  139.     //{{AFX_MSG(CControlBar)
  140.     afx_msg void OnPaint();
  141.     afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  142.     afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam);
  143.     afx_msg int OnCreate(LPCREATESTRUCT lpcs);
  144.     afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam);
  145.     afx_msg void OnInitialUpdate();
  146.     afx_msg LRESULT OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam);
  147.     //}}AFX_MSG
  148.     DECLARE_MESSAGE_MAP()
  149. };
  150.  
  151. ////////////////////////////////////////////
  152. // CStatusBar control
  153.  
  154. struct AFX_STATUSPANE;      // private to implementation
  155.  
  156. class CStatusBar : public CControlBar
  157. {
  158.     DECLARE_DYNAMIC(CStatusBar)
  159. // Construction
  160. public:
  161.     CStatusBar();
  162.     BOOL Create(CWnd* pParentWnd,
  163.             DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
  164.             UINT nID = AFX_IDW_STATUS_BAR);
  165.     BOOL SetIndicators(const UINT FAR* lpIDArray, int nIDCount);
  166.  
  167. // Attributes
  168. public: // standard control bar things
  169.     int CommandToIndex(UINT nIDFind) const;
  170.     UINT GetItemID(int nIndex) const;
  171.     void GetItemRect(int nIndex, LPRECT lpRect) const;
  172. public:
  173.     void GetPaneText(int nIndex, CString& s) const;
  174.     BOOL SetPaneText(int nIndex, LPCSTR lpszNewText, BOOL bUpdate = TRUE);
  175.     void GetPaneInfo(int nIndex, UINT& nID, UINT& nStyle, int& cxWidth) const;
  176.     void SetPaneInfo(int nIndex, UINT nID, UINT nStyle, int cxWidth);
  177.  
  178. // Implementation
  179. public:
  180.     virtual ~CStatusBar();
  181.     inline UINT _GetPaneStyle(int nIndex) const;
  182.     void _SetPaneStyle(int nIndex, UINT nStyle);
  183.  
  184. #ifdef _DEBUG
  185.     virtual void AssertValid() const;
  186.     virtual void Dump(CDumpContext& dc) const;
  187. #endif
  188.  
  189. protected:
  190.     HFONT m_hFont;
  191.     int m_cxRightBorder;    // right borders (panes get clipped)
  192.  
  193.     inline AFX_STATUSPANE* _GetPanePtr(int nIndex) const;
  194.     static void PASCAL DrawStatusText(HDC hDC, CRect const& rect,
  195.             LPCSTR lpszText, UINT nStyle);
  196.     virtual void DoPaint(CDC* pDC);
  197.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  198.     //{{AFX_MSG(CStatusBar)
  199.     afx_msg void OnSize(UINT nType, int cx, int cy);
  200.     afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  201.     afx_msg LRESULT OnGetFont(WPARAM wParam, LPARAM lParam);
  202.     afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
  203.     afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam);
  204.     afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam);
  205.     //}}AFX_MSG
  206.     DECLARE_MESSAGE_MAP()
  207. };
  208.  
  209. // Styles for status bar panes
  210. #define SBPS_NORMAL     0x0000
  211. #define SBPS_NOBORDERS  0x0100
  212. #define SBPS_POPOUT     0x0200
  213. #define SBPS_DISABLED   0x0400
  214. #define SBPS_STRETCH    0x0800  // stretch to fill status bar - 1st pane only
  215.  
  216. ////////////////////////////////////////////
  217. // CToolBar control
  218.  
  219. struct AFX_TBBUTTON;        // private to implementation
  220.  
  221. HBITMAP AFXAPI AfxLoadSysColorBitmap(HINSTANCE hInst, HRSRC hRsrc);
  222.  
  223. class CToolBar : public CControlBar
  224. {
  225.     DECLARE_DYNAMIC(CToolBar)
  226. // Construction
  227. public:
  228.     CToolBar();
  229.     BOOL Create(CWnd* pParentWnd,
  230.             DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,
  231.             UINT nID = AFX_IDW_TOOLBAR);
  232.  
  233.     void SetSizes(SIZE sizeButton, SIZE sizeImage);
  234.                 // button size should be bigger than image
  235.     void SetHeight(int cyHeight);
  236.                 // call after SetSizes, height overrides bitmap size
  237.     BOOL LoadBitmap(LPCSTR lpszResourceName);
  238.     BOOL LoadBitmap(UINT nIDResource);
  239.     BOOL SetButtons(const UINT FAR* lpIDArray, int nIDCount);
  240.                 // lpIDArray can be NULL to allocate empty buttons
  241.  
  242. // Attributes
  243. public: // standard control bar things
  244.     int CommandToIndex(UINT nIDFind) const;
  245.     UINT GetItemID(int nIndex) const;
  246.     virtual void GetItemRect(int nIndex, LPRECT lpRect) const;
  247.  
  248. public:
  249.     // for changing button info
  250.     void GetButtonInfo(int nIndex, UINT& nID, UINT& nStyle, int& iImage) const;
  251.     void SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage);
  252.  
  253. // Implementation
  254. public:
  255.     virtual ~CToolBar();
  256.     inline UINT _GetButtonStyle(int nIndex) const;
  257.     void _SetButtonStyle(int nIndex, UINT nStyle);
  258.  
  259. #ifdef _DEBUG
  260.     virtual void AssertValid() const;
  261.     virtual void Dump(CDumpContext& dc) const;
  262. #endif
  263.  
  264. protected:
  265.     inline AFX_TBBUTTON* _GetButtonPtr(int nIndex) const;
  266.     void InvalidateButton(int nIndex);
  267.     void CreateMask(int iImage, CPoint offset,
  268.          BOOL bHilite, BOOL bHiliteShadow);
  269.  
  270.     // for custom drawing
  271.     struct DrawState
  272.     {
  273.         HBITMAP hbmMono;
  274.         HBITMAP hbmMonoOld;
  275.         HBITMAP hbmOldGlyphs;
  276.     };
  277.     BOOL PrepareDrawButton(DrawState& ds);
  278.     BOOL DrawButton(HDC hdC, int x, int y, int iImage, UINT nStyle);
  279.     void EndDrawButton(DrawState& ds);
  280.  
  281. protected:
  282.     CSize m_sizeButton;       // size of button
  283.     CSize m_sizeImage;        // size of glyph
  284.     HBITMAP m_hbmImageWell;     // glyphs only
  285.     int m_iButtonCapture;   // index of button with capture (-1 => none)
  286.     HRSRC m_hRsrcImageWell; // handle to loaded resource for image well
  287.     HINSTANCE m_hInstImageWell; // instance handle to load image well from
  288.  
  289.     virtual void DoPaint(CDC* pDC);
  290.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  291.     virtual int HitTest(CPoint point);
  292.  
  293.     //{{AFX_MSG(CToolBar)
  294.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  295.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  296.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  297.     afx_msg void OnCancelMode();
  298.     afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam);
  299.     afx_msg void OnSysColorChange();
  300.     //}}AFX_MSG
  301.     DECLARE_MESSAGE_MAP()
  302. };
  303.  
  304. // Styles for toolbar buttons
  305. #define TBBS_BUTTON     0x00    // this entry is button
  306. #define TBBS_SEPARATOR  0x01    // this entry is a separator
  307. #define TBBS_CHECKBOX   0x02    // this is an auto check/radio button
  308.  
  309. // styles for display states
  310. #define TBBS_CHECKED        0x0100  // button is checked/down
  311. #define TBBS_INDETERMINATE  0x0200  // third state
  312. #define TBBS_DISABLED       0x0400  // element is disabled
  313. #define TBBS_PRESSED        0x0800  // button is being depressed - mouse down
  314.  
  315. ////////////////////////////////////////////
  316. // CDialogBar control
  317. // This is a control bar built from a dialog template. It is a modeless
  318. // dialog that delegates all control notifications to the parent window
  319. // of the control bar [the grandparent of the control]
  320.  
  321. class CDialogBar : public CControlBar
  322. {
  323.     DECLARE_DYNAMIC(CDialogBar)
  324. // Construction
  325. public:
  326.     CDialogBar();
  327.     BOOL Create(CWnd* pParentWnd, LPCSTR lpszTemplateName,
  328.             UINT nStyle, UINT nID);
  329.     BOOL Create(CWnd* pParentWnd, UINT nIDTemplate,
  330.             UINT nStyle, UINT nID);
  331.  
  332. // Implementation
  333. public:
  334.     virtual ~CDialogBar();
  335. #ifdef _DEBUG
  336.     virtual void AssertValid() const;
  337.     virtual void Dump(CDumpContext& dc) const;
  338. #endif
  339. protected:
  340.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  341.     virtual WNDPROC* GetSuperWndProcAddr();
  342. };
  343.  
  344.  
  345. /////////////////////////////////////////////////////////////////////////////
  346. // Splitter Wnd
  347.  
  348. #define SPLS_DYNAMIC_SPLIT  0x0001
  349.  
  350. class CSplitterWnd : public CWnd
  351. {
  352.     DECLARE_DYNAMIC(CSplitterWnd)
  353.  
  354. // Construction
  355. public:
  356.     CSplitterWnd();
  357.     // Create a single view type splitter with multiple splits
  358.     BOOL Create(CWnd* pParentWnd,
  359.                 int nMaxRows, int nMaxCols, SIZE sizeMin,
  360.                 CCreateContext* pContext,
  361.                 DWORD dwStyle = WS_CHILD | WS_VISIBLE |
  362.                     WS_HSCROLL | WS_VSCROLL | SPLS_DYNAMIC_SPLIT,
  363.                 UINT nID = AFX_IDW_PANE_FIRST);
  364.  
  365.     // Create a multiple view type splitter with static layout
  366.     BOOL CreateStatic(CWnd* pParentWnd,
  367.                 int nRows, int nCols,
  368.                 DWORD dwStyle = WS_CHILD | WS_VISIBLE,
  369.                 UINT nID = AFX_IDW_PANE_FIRST);
  370.  
  371.     virtual BOOL CreateView(int row, int col, CRuntimeClass* pViewClass,
  372.             SIZE sizeInit, CCreateContext* pContext);
  373.  
  374. // Attributes
  375. public:
  376.     int GetRowCount() const;
  377.     int GetColumnCount() const;
  378.  
  379.     // information about a specific row or column
  380.     void GetRowInfo(int row, int& cyCur, int& cyMin) const;
  381.     void SetRowInfo(int row, int cyIdeal, int cyMin);
  382.     void GetColumnInfo(int col, int& cxCur, int& cxMin) const;
  383.     void SetColumnInfo(int col, int cxIdeal, int cxMin);
  384.  
  385.     // views inside the splitter
  386.     CWnd* GetPane(int row, int col) const;
  387.     BOOL IsChildPane(CWnd* pWnd, int& row, int& col);
  388.     int IdFromRowCol(int row, int col) const;
  389.  
  390. // Operations
  391. public:
  392.     void RecalcLayout();    // call after changing sizes
  393.  
  394. // Implementation Overridables
  395. protected:
  396.     // to customize the drawing
  397.     enum ESplitType { splitBox, splitBar, splitIntersection };
  398.     virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rect);
  399.     virtual void OnInvertTracker(const CRect& rect);
  400.  
  401.     // for customizing scrollbar regions
  402.     virtual BOOL CreateScrollBarCtrl(DWORD dwStyle, UINT nID);
  403.  
  404.     // for customizing DYNAMIC_SPLIT behavior
  405.     virtual void DeleteView(int row, int col);
  406.     virtual BOOL SplitRow(int cyBefore);
  407.     virtual BOOL SplitColumn(int cxBefore);
  408.     virtual void DeleteRow(int row);
  409.     virtual void DeleteColumn(int row);
  410.  
  411. // Implementation
  412. public:
  413.     virtual ~CSplitterWnd();
  414. #ifdef _DEBUG
  415.     virtual void AssertValid() const;
  416.     virtual void Dump(CDumpContext& dc) const;
  417. #endif
  418.  
  419.     // high level command operations - called by default view implementation
  420.     virtual BOOL CanActivateNext(BOOL bPrev = FALSE);
  421.     virtual void ActivateNext(BOOL bPrev = FALSE);
  422.     virtual BOOL DoKeyboardSplit();
  423.  
  424.     // implementation structure
  425.     struct CRowColInfo
  426.     {
  427.         int nMinSize;       // below that try not to show
  428.         int nIdealSize;     // user set size
  429.         // variable depending on the available size layout
  430.         int nCurSize;       // 0 => invisible, -1 => nonexistant
  431.     };
  432.  
  433. protected:
  434.     // customizable implementation attributes (set by constructor or Create)
  435.     CRuntimeClass* m_pDynamicViewClass;
  436.     int m_nMaxRows, m_nMaxCols;
  437.     int m_cxSplitter, m_cySplitter;     // size of box or splitter bar
  438.  
  439.     // current state information
  440.     int m_nRows, m_nCols;
  441.     BOOL m_bHasHScroll, m_bHasVScroll;
  442.     CRowColInfo* m_pColInfo;
  443.     CRowColInfo* m_pRowInfo;
  444.  
  445.     // Tracking info - only valid when 'm_bTracking' is set
  446.     BOOL m_bTracking, m_bTracking2;
  447.     CPoint m_ptTrackOffset;
  448.     CRect m_rectLimit;
  449.     CRect m_rectTracker, m_rectTracker2;
  450.     int m_htTrack;
  451.  
  452.     // implementation routines
  453.     BOOL CreateCommon(CWnd* pParentWnd, SIZE sizeMin, DWORD dwStyle, UINT nID);
  454.     void StartTracking(int ht);
  455.     void StopTracking(BOOL bAccept);
  456.     int HitTest(CPoint pt) const;
  457.     void GetInsideRect(CRect& rect) const;
  458.     void GetHitRect(int ht, CRect& rect);
  459.     void TrackRowSize(int y, int row);
  460.     void TrackColumnSize(int x, int col);
  461.     void DrawAllSplitBars(CDC* pDC, int cxInside, int cyInside);
  462.  
  463.     //{{AFX_MSG(CSplitterWnd)
  464.     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  465.     afx_msg void OnMouseMove(UINT nFlags, CPoint pt);
  466.     afx_msg int OnCreate(LPCREATESTRUCT lpcs);
  467.     afx_msg void OnPaint();
  468.     afx_msg void OnLButtonDown(UINT nFlags, CPoint pt);
  469.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint pt);
  470.     afx_msg void OnLButtonUp(UINT nFlags, CPoint pt);
  471.     afx_msg void OnCancelMode();
  472.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  473.     afx_msg void OnSize(UINT nType, int cx, int cy);
  474.     afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  475.     afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  476.     //}}AFX_MSG
  477.  
  478.     DECLARE_MESSAGE_MAP()
  479. };
  480.  
  481.  
  482. /////////////////////////////////////////////////////////////////////////////
  483. // CFormView - generic view constructed from a dialog template
  484.  
  485. class CFormView : public CScrollView
  486. {
  487.     DECLARE_DYNAMIC(CFormView)
  488. // Construction
  489. protected:      // must derive your own class
  490.     CFormView(LPCSTR lpszTemplateName);
  491.     CFormView(UINT nIDTemplate);
  492.  
  493. // Implementation
  494. public:
  495. #ifdef _DEBUG
  496.     virtual void AssertValid() const;
  497.     virtual void Dump(CDumpContext& dc) const;
  498. #endif
  499.  
  500. protected:
  501.     LPCSTR m_lpszTemplateName;
  502.     CCreateContext* m_pCreateContext;
  503.  
  504.     virtual void OnDraw(CDC* pDC);      // default does nothing
  505.     virtual void OnInitialUpdate();
  506.     // special case override of child window creation
  507.     virtual BOOL Create(LPCSTR, LPCSTR, DWORD,
  508.         const RECT&, CWnd*, UINT, CCreateContext*);
  509.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  510.     virtual WNDPROC* GetSuperWndProcAddr();
  511.  
  512.     //{{AFX_MSG(CFormView)
  513.     afx_msg int OnCreate(LPCREATESTRUCT lpcs);
  514.     //}}AFX_MSG
  515.     DECLARE_MESSAGE_MAP()
  516. };
  517.  
  518.  
  519. /////////////////////////////////////////////////////////////////////////////
  520. // CEditView - simple text editor view
  521.  
  522. class CEditView : public CView
  523. {
  524.     DECLARE_DYNCREATE(CEditView)
  525.  
  526. // Construction
  527. public:
  528.     CEditView();
  529.     static const DWORD dwStyleDefault;
  530.  
  531. // Attributes
  532. public:
  533.     // CEdit control access
  534.     CEdit& GetEditCtrl() const;
  535.  
  536.     // presentation attributes
  537.     CFont* GetPrinterFont() const;
  538.     void SetPrinterFont(CFont* pFont);
  539.     void SetTabStops(int nTabStops);
  540.  
  541.     // other attributes
  542.     void GetSelectedText(CString& strResult) const;
  543.  
  544. // Operations
  545. public:
  546.     BOOL FindText(LPCSTR lpszFind, BOOL bNext = TRUE, BOOL bCase = TRUE);
  547.     void SerializeRaw(CArchive& ar);
  548.     UINT PrintInsideRect(CDC* pDC, RECT& rectLayout, UINT nIndexStart,
  549.         UINT nIndexStop);
  550.  
  551. // Overrideables
  552. protected:
  553.     virtual void OnFindNext(LPCSTR lpszFind, BOOL bNext, BOOL bCase);
  554.     virtual void OnReplaceSel(LPCSTR lpszFind, BOOL bNext, BOOL bCase,
  555.         LPCSTR lpszReplace);
  556.     virtual void OnReplaceAll(LPCSTR lpszFind, LPCSTR lpszReplace,
  557.         BOOL bCase);
  558.     virtual void OnTextNotFound(LPCSTR lpszFind);
  559.  
  560. // Implementation
  561. public:
  562.     virtual ~CEditView();
  563. #ifdef _DEBUG
  564.     virtual void AssertValid() const;
  565.     virtual void Dump(CDumpContext& dc) const;
  566. #endif
  567.     virtual void OnDraw(CDC* pDC);
  568.     virtual void Serialize(CArchive& ar);
  569.     virtual void DeleteContents();
  570.     void ReadFromArchive(CArchive& ar, UINT nLen);
  571.     void WriteToArchive(CArchive& ar);
  572.  
  573.     static const UINT nMaxSize; // maximum number of characters supported
  574.  
  575. protected:
  576.     UINT m_segText;             // global segment for edit control data
  577.     int m_nTabStops;            // tab stops in dialog units
  578.  
  579.     CUIntArray m_aPageStart;    // array of starting pages
  580.     HFONT m_hPrinterFont;       // if NULL, mirror display font
  581.     HFONT m_hMirrorFont;        // font object used when mirroring
  582.  
  583.     // construction
  584.     WNDPROC* GetSuperWndProcAddr();
  585.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  586.     virtual void CalcWindowRect(LPRECT lpClientRect);
  587.  
  588.     // printing support
  589.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  590.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  591.     virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo);
  592.     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  593.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo = NULL);
  594.     BOOL PaginateTo(CDC* pDC, CPrintInfo* pInfo);
  595.  
  596.     // find & replace support
  597.     void OnEditFindReplace(BOOL bFindOnly);
  598.     BOOL InitializeReplace();
  599.     BOOL SameAsSelected(LPCSTR lpszCompare, BOOL bCase);
  600.  
  601.     // buffer access
  602.     LPCSTR LockBuffer() const;
  603.     void UnlockBuffer() const;
  604.     UINT GetBufferLength() const;
  605.  
  606.     //{{AFX_MSG(CEditView)
  607.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  608.     afx_msg void OnPaint();
  609.     afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  610.     afx_msg void OnUpdateNeedSel(CCmdUI* pCmdUI);
  611.     afx_msg void OnUpdateNeedClip(CCmdUI* pCmdUI);
  612.     afx_msg void OnUpdateNeedText(CCmdUI* pCmdUI);
  613.     afx_msg void OnUpdateNeedFind(CCmdUI* pCmdUI);
  614.     afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  615.     afx_msg void OnEditChange();
  616.     afx_msg void OnEditCut();
  617.     afx_msg void OnEditCopy();
  618.     afx_msg void OnEditPaste();
  619.     afx_msg void OnEditClear();
  620.     afx_msg void OnEditUndo();
  621.     afx_msg void OnEditSelectAll();
  622.     afx_msg void OnEditFind();
  623.     afx_msg void OnEditReplace();
  624.     afx_msg void OnEditRepeat();
  625.     afx_msg LRESULT OnFindReplaceCmd(WPARAM wParam, LPARAM lParam);
  626.     //}}AFX_MSG
  627.  
  628.     DECLARE_MESSAGE_MAP()
  629. };
  630.  
  631. /////////////////////////////////////////////////////////////////////////////
  632. // VBX control support
  633.  
  634. #ifndef NO_VBX_SUPPORT
  635.  
  636. // Implementation classes
  637. class CVBControlModel;      // VBX Control Model Implementation
  638. typedef LPVOID HCTL;        // Handle to a VBX Custom Control
  639.  
  640. // Implementation declarations
  641. typedef char _based((_segment)_self) *BPSTR;
  642. typedef BPSTR FAR*  HSZ;            // Long handle to a string
  643.  
  644. // definitions required by CVBControl
  645. DECLARE_HANDLE(HPIC);       // Handle to a PIC structure
  646.  
  647. // DDX control aliasing - stores a pointer to true C++ object
  648. void AFXAPI DDX_VBControl(CDataExchange* pDX, int nIDC, CVBControl*& rpControl);
  649.     // Special DDX for subclassing since we don't permit 2 C++ windows !
  650.  
  651. // DDX for VB control properties
  652. void AFXAPI DDX_VBText(CDataExchange* pDX, int nIDC, int nPropIndex,
  653.     CString& value);
  654. void AFXAPI DDX_VBBool(CDataExchange* pDX, int nIDC, int nPropIndex,
  655.     BOOL& value);
  656. void AFXAPI DDX_VBInt(CDataExchange* pDX, int nIDC, int nPropIndex,
  657.     int& value);
  658. void AFXAPI DDX_VBLong(CDataExchange* pDX, int nIDC, int nPropIndex,
  659.     LONG& value);
  660. void AFXAPI DDX_VBColor(CDataExchange* pDX, int nIDC, int nPropIndex,
  661.     COLORREF& value);
  662. void AFXAPI DDX_VBFloat(CDataExchange* pDX, int nIDC, int nPropIndex,
  663.     float& value);
  664.  
  665. // DDX for VB read-only properties
  666. void AFXAPI DDX_VBTextRO(CDataExchange* pDX, int nIDC, int nPropIndex,
  667.     CString& value);
  668. void AFXAPI DDX_VBBoolRO(CDataExchange* pDX, int nIDC, int nPropIndex,
  669.     BOOL& value);
  670. void AFXAPI DDX_VBIntRO(CDataExchange* pDX, int nIDC, int nPropIndex,
  671.     int& value);
  672. void AFXAPI DDX_VBLongRO(CDataExchange* pDX, int nIDC, int nPropIndex,
  673.     LONG& value);
  674. void AFXAPI DDX_VBColorRO(CDataExchange* pDX, int nIDC, int nPropIndex,
  675.     COLORREF& value);
  676. void AFXAPI DDX_VBFloatRO(CDataExchange* pDX, int nIDC, int nPropIndex,
  677.     float& value);
  678.  
  679. /////////////////////////////////////////////////////////////////////////////
  680.  
  681. class CVBControl : public CWnd
  682. {
  683.     DECLARE_DYNAMIC(CVBControl)
  684. // Constructors
  685. public:
  686.     CVBControl();
  687.  
  688.     BOOL Create(LPCSTR lpszWindowName, DWORD dwStyle,
  689.         const RECT& rect, CWnd* pParentWnd, UINT nID,
  690.         CFile* pFile = NULL, BOOL bAutoDelete = FALSE);
  691.  
  692.  
  693. // Attributes
  694.     // Property Access Routines
  695.     BOOL SetNumProperty(int nPropIndex, LONG lValue, int index = 0);
  696.     BOOL SetNumProperty(LPCSTR lpszPropName, LONG lValue, int index = 0);
  697.  
  698.     BOOL SetFloatProperty(int nPropIndex, float value, int index = 0);
  699.     BOOL SetFloatProperty(LPCSTR lpszPropName, float value, int index = 0);
  700.  
  701.     BOOL SetStrProperty(int nPropIndex, LPCSTR lpszValue, int index = 0);
  702.     BOOL SetStrProperty(LPCSTR lpszPropName, LPCSTR lpszValue, int index = 0);
  703.  
  704.     BOOL SetPictureProperty(int nPropIndex, HPIC hPic, int index = 0);
  705.     BOOL SetPictureProperty(LPCSTR lpszPropName, HPIC hPic, int index = 0);
  706.  
  707.     LONG GetNumProperty(int nPropIndex, int index = 0);
  708.     LONG GetNumProperty(LPCSTR lpszPropName, int index = 0);
  709.  
  710.     float GetFloatProperty(int nPropIndex, int index = 0);
  711.     float GetFloatProperty(LPCSTR lpszPropName, int index = 0);
  712.  
  713.     CString GetStrProperty(int nPropIndex, int index = 0);
  714.     CString GetStrProperty(LPCSTR lpszPropName, int index = 0);
  715.  
  716.     HPIC GetPictureProperty(int nPropIndex, int index = 0);
  717.     HPIC GetPictureProperty(LPCSTR lpszPropName, int index = 0);
  718.  
  719.     // Get the index of a property
  720.     int GetPropIndex(LPCSTR lpszPropName) const;
  721.     LPCSTR GetPropName(int nIndex) const;
  722.  
  723.     // Get the index of an Event
  724.     int GetEventIndex(LPCSTR lpszEventName) const;
  725.     LPCSTR GetEventName(int nIndex) const;
  726.  
  727.     // Class name of control
  728.     LPCSTR GetVBXClass() const;
  729.  
  730.     // Class information
  731.     int GetNumProps() const;
  732.     int GetNumEvents() const;
  733.     BOOL IsPropArray(int nIndex) const;
  734.  
  735.     UINT GetPropType(int nIndex) const;
  736.     DWORD GetPropFlags(int nIndex) const;
  737.  
  738.     // Error reporting variable
  739.     // Contains the VB error code returned by a control
  740.     int m_nError;
  741.  
  742. // Operations
  743.     // BASIC file number (channel) to CFile association
  744.  
  745.     static void PASCAL OpenChannel(CFile* pFile, WORD wChannel);
  746.     static BOOL PASCAL CloseChannel(WORD wChannel);
  747.     static CFile* PASCAL GetChannel(WORD wChannel);
  748.     static void BeginNewVBHeap();
  749.  
  750.     void AddItem(LPCSTR lpszItem, LONG lIndex);
  751.     void RemoveItem(LONG lIndex);
  752.     void Refresh();
  753.     void Move(RECT& rect);
  754.  
  755.  
  756. // Implementation
  757. public:
  758.     virtual ~CVBControl();
  759. #ifdef _DEBUG
  760.     virtual void AssertValid() const;
  761.     virtual void Dump(CDumpContext& dc) const;
  762. #endif
  763.  
  764.     DWORD GetModelFlags();
  765.     DWORD GetModelStyles();
  766.     void ReferenceFile(BOOL bReference);
  767.     static void EnableVBXFloat();
  768.  
  769.     static BOOL ParseWindowText(LPCSTR lpszWindowName, CString& strFileName,
  770.                                 CString& strClassName, CString& strCaption);
  771.  
  772.     HCTL GetHCTL();
  773.  
  774.     // Control Defined Structure -- Dangerous to use directly
  775.     BYTE FAR* GetUserSpace();
  776.  
  777.     struct CRecreateStruct  // Implementation structure
  778.     {
  779.         char* pText;
  780.         DWORD dwStyle;
  781.         CRect rect;
  782.         HWND hWndParent;
  783.         UINT nControlID;
  784.     };
  785.  
  786.     enum
  787.     {
  788.         TYPE_FROMVBX,           // Coming from VBX, assume proper type
  789.         TYPE_INTEGER,           // int or LONG
  790.         TYPE_REAL,              // float
  791.         TYPE_STRING,
  792.         TYPE_PICTURE
  793.     };
  794.  
  795.     virtual LRESULT DefControlProc(UINT message, WPARAM wParam, LPARAM lParam);
  796.     void Recreate(CRecreateStruct& rs);
  797.     CVBControlModel* GetModel();
  798.  
  799. public:
  800.     int GetStdPropIndex(int nStdID) const;
  801.     BOOL SetPropertyWithType(int nPropIndex, WORD wType,
  802.                                     LONG lValue, int index);
  803.     LONG GetNumPropertyWithType(int nPropIndex, UINT nType, int index);
  804.     HSZ GetStrProperty(int nPropIndex, int index, BOOL& bTemp);
  805.     CString m_ctlName;          // Read only at run-time
  806.  
  807.     // Trace routine to allow one library version
  808.     static void CDECL Trace(BOOL bFatal, UINT nFormatIndex, ...);
  809.     void VBXAssertValid() const;    // non-virtual helper
  810.  
  811.     static BOOL EnableMemoryTracking(BOOL bTracking);
  812.  
  813. protected:
  814.  
  815.     static CVBControl* NEW();
  816.     void DELETE();
  817.  
  818.     virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
  819.     LRESULT CallControlProc(UINT message, WPARAM wParam, LPARAM lParam);
  820.  
  821.     BOOL CommonInit();
  822.     void SetDefaultValue(int nPropIndex, BOOL bPreHwnd);
  823.  
  824.     BOOL SetStdProp(WORD wPropId, WORD wType, LONG lValue);
  825.     LONG GetStdNumProp(WORD wPropId);
  826.     CString GetStdStrProp(WORD wPropId);
  827.  
  828.     BOOL SetFontProperty(WORD wPropId, LONG lData);
  829.     void BuildCurFont(HDC hDC, HFONT hCurFont, LOGFONT& logFont);
  830.     LONG GetNumFontProperty(WORD wPropId);
  831.     WORD GetCharSet(HDC hDC, LPCSTR lpFaceName);
  832.  
  833.     virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  834.     virtual void PostNcDestroy();
  835.  
  836.     void FireMouseEvent(WORD event, WORD wButton, WPARAM wParam, LPARAM lParam);
  837.     BOOL CreateAndSetFont(LPLOGFONT lplf);
  838.  
  839.     BOOL LoadProperties(CFile* pFile, BOOL bPreHwnd);
  840.     BOOL LoadProp(int nPropIndex, CFile* pFile);
  841.     BOOL LoadPropData(int nPropIndex, CFile* pFile);
  842.  
  843.     BOOL IsPropDefault(int nPropIndex);
  844.  
  845.     CVBControlModel* LoadControl(LPCSTR lpszFileName, LPCSTR lpszControlName);
  846.     afx_msg void OnVBXLoaded();
  847.  
  848.     void AllocateHCTL(size_t nSize);
  849.     void DeallocateHCTL();
  850.  
  851.     static int ConvertFontSizeToTwips(LONG lFontSize);
  852.     // This actually returns a float masquerading as a long
  853.     static LONG ConvertTwipsToFontSize(int nTwips);
  854.  
  855. protected:
  856.     CVBControlModel* m_pModel;
  857.  
  858.     BOOL m_bRecreating;         // Do not destroy on this NCDestroy
  859.     BOOL m_bAutoDelete;         // TRUE if automatically created
  860.     BOOL m_bInPostNcDestroy;    // TRUE if deleting from Destroy
  861.     BOOL m_bLoading;            // TRUE if loading properties from formfile
  862.     int m_nCursorID;
  863.  
  864.     // variables for stack overrun protection
  865.     UINT m_nInitialStack;       // SP when control recieved first message
  866.     UINT m_nRecursionLevel;     // Level of control proc recursion
  867.     BOOL m_bStackFault;         // TRUE if stack fault hit
  868.     UINT m_nFaultRecurse;       // level at which stack faulted
  869.  
  870.     HBRUSH m_hbrBkgnd;            // brush used in WM_CTLCOLOR
  871.     HFONT m_hFontCreated;              // Font created by control
  872.     HCURSOR m_hcurMouse;
  873.     HCTL m_hCtl;                // Control handle
  874.     COLORREF m_clrBkgnd;
  875.     COLORREF m_clrFore;
  876.     CRect m_rectCreate;         // Created Size
  877.     CString m_strTag;
  878.  
  879.     friend LRESULT CALLBACK AFX_EXPORT _AfxVBWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  880.     friend LRESULT CALLBACK AFX_EXPORT _AfxVBProxyProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  881.     friend WORD CALLBACK AFX_EXPORT _AfxVBFireEvent(HCTL hControl, WORD idEvent, LPVOID lpParams);
  882.     friend WORD CALLBACK AFX_EXPORT _AfxVBRecreateControlHwnd(HCTL hControl);
  883.  
  884.     // Friends required for VB API access
  885.  
  886.     //{{AFX_MSG(CVBControl)
  887.     //}}AFX_MSG
  888.     DECLARE_MESSAGE_MAP()
  889.  
  890.     /////////////////////
  891.     // Implementation
  892.     // These APIs can not be referenced by applications
  893. public:
  894.     DWORD Save(CFile* pFile);
  895.     BOOL Load(CFile* pData);
  896.  
  897. protected:
  898.     BOOL m_bCreatedInDesignMode;
  899.     BOOL m_bVisible;
  900.  
  901.     friend class CVBPopupWnd;
  902.  
  903.     BOOL SaveProperties(CFile* pFile, BOOL bPreHwnd);
  904.     BOOL SaveProp(int nPropIndex, CFile* pFile);
  905.     BOOL SavePropData(int nPropIndex, CFile* pFile);
  906.     LONG InitPropPopup(WPARAM wParam, LPARAM lParam);
  907.     void DoPictureDlg(int m_nPropId);
  908.     void DoColorDlg(int m_nPropId);
  909.     void DoFontDlg(int m_nPropId);
  910.     void FillList(CListBox* pLB, LPCSTR lpszEnumList);
  911. };
  912.  
  913. UINT AFXAPI AfxRegisterVBEvent(LPCSTR lpszEventName);
  914.  
  915. // Values for VBX Property Types
  916.  
  917. #define DT_HSZ        0x01
  918. #define DT_SHORT      0x02
  919. #define DT_LONG       0x03
  920. #define DT_BOOL       0x04
  921. #define DT_COLOR      0x05
  922. #define DT_ENUM       0x06
  923. #define DT_REAL       0x07
  924. #define DT_XPOS       0x08  // Scaled from float to long twips
  925. #define DT_XSIZE      0x09  //   _SIZE scales without origin
  926. #define DT_YPOS       0x0A  //   _POS subtracts origin
  927. #define DT_YSIZE      0x0B  // uses parent's scale properties
  928. #define DT_PICTURE    0x0C
  929.  
  930. #define COLOR_SYSCOLOR  0x80000000L // defines a System color for a property
  931. #define MAKESYSCOLOR(iColor)    ((COLORREF)(iColor + COLOR_SYSCOLOR))
  932.  
  933.  
  934.  
  935. /////////////////////////////////////////////////////////////////////////////
  936. // VBX HPIC Functions
  937.  
  938. /////////////////////////////////////////////////////////////////////////////
  939. // Picture structure
  940. // This structure is taken from the VB Code and used to be compatible
  941. // with that code
  942.  
  943. //NOTE:  This structure MUST be packed.
  944. #pragma pack(1)
  945. struct NEAR PIC
  946. {
  947.     BYTE    picType;
  948.     union
  949.     {
  950.         struct
  951.         {
  952.             HBITMAP   hbitmap;      // bitmap
  953.         } bmp;
  954.         struct
  955.         {
  956.             HMETAFILE hmeta;        // Metafile
  957.             int     xExt, yExt;     // extent
  958.         } wmf;
  959.         struct
  960.         {
  961.             HICON     hicon;        // Icon
  962.         } icon;
  963.     } picData;
  964.  
  965.     // Implementation
  966.     WORD    nRefCount;
  967.     BYTE    picReserved[2];
  968. };
  969. #pragma pack()
  970.  
  971. typedef PIC FAR* LPPIC;
  972.  
  973. #define PICTYPE_NONE        0
  974. #define PICTYPE_BITMAP      1
  975. #define PICTYPE_METAFILE    2
  976. #define PICTYPE_ICON        3
  977.  
  978. #define HPIC_INVALID        ((HPIC)0xFFFF)
  979.  
  980. HPIC AFXAPI AfxSetPict(HPIC hPic, const PIC FAR* lpPic);
  981. void AFXAPI AfxGetPict(HPIC hPic, LPPIC lpPic);
  982. void AFXAPI AfxReferencePict(HPIC hPic, BOOL bReference);
  983.  
  984. #endif //!NO_VBX_SUPPORT
  985.  
  986. /////////////////////////////////////////////////////////////////////////////
  987.  
  988. class CMetaFileDC : public CDC
  989. {
  990.     DECLARE_DYNAMIC(CMetaFileDC)
  991.  
  992. // Constructors
  993. public:
  994.     CMetaFileDC();
  995.     BOOL Create(LPCSTR lpszFilename = NULL);
  996.  
  997. // Operations
  998.     HMETAFILE Close();
  999.  
  1000. // Implementation
  1001. public:
  1002. #ifdef _DEBUG
  1003.     virtual void AssertValid() const;
  1004.     virtual void Dump(CDumpContext& dc) const;
  1005. #endif
  1006.  
  1007.     virtual void SetAttribDC(HDC hDC);  // Set the Attribute DC
  1008.  
  1009. protected:
  1010.     virtual void SetOutputDC(HDC hDC);  // Set the Output DC -- Not allowed
  1011.     virtual void ReleaseOutputDC();     // Release the Output DC -- Not allowed
  1012.  
  1013. public:
  1014.     virtual ~CMetaFileDC();
  1015.  
  1016. // Clipping Functions (use the Attribute DC's clip region)
  1017.     virtual int GetClipBox(LPRECT lpRect) const;
  1018.     virtual BOOL PtVisible(int x, int y) const;
  1019.     virtual BOOL RectVisible(LPRECT lpRect) const;
  1020.  
  1021. // Text Functions
  1022.     virtual BOOL TextOut(int x, int y, LPCSTR lpszString, int nCount);
  1023.     virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPRECT lpRect,
  1024.                 LPCSTR lpszString, UINT nCount, LPINT lpDxWidths);
  1025.     virtual CSize TabbedTextOut(int x, int y, LPCSTR lpszString, int nCount,
  1026.                 int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin);
  1027.     virtual int DrawText(LPCSTR lpszString, int nCount, LPRECT lpRect,
  1028.                 UINT nFormat);
  1029.  
  1030. // Printer Escape Functions
  1031.     virtual int Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData);
  1032.  
  1033. // Implementation
  1034. protected:
  1035.     void AdjustCP(int cx);
  1036. };
  1037.  
  1038. /////////////////////////////////////////////////////////////////////////////
  1039. // Informational data structures
  1040.  
  1041. struct CPrintInfo // Printing information structure
  1042. {
  1043.     CPrintInfo();
  1044.     ~CPrintInfo();
  1045.  
  1046.     CPrintDialog* m_pPD;     // pointer to print dialog
  1047.  
  1048.     BOOL m_bPreview;         // TRUE if in preview mode
  1049.     BOOL m_bContinuePrinting;// set to FALSE to prematurely end printing
  1050.     UINT m_nCurPage;         // Current page
  1051.     UINT m_nNumPreviewPages; // Desired number of preview pages
  1052.     CString m_strPageDesc;   // Format string for page number display
  1053.     LPVOID m_lpUserData;     // pointer to user created struct
  1054.     CRect m_rectDraw;        // rectangle defining current usable page area
  1055.  
  1056.     void SetMinPage(UINT nMinPage);
  1057.     void SetMaxPage(UINT nMaxPage);
  1058.     UINT GetMinPage() const;
  1059.     UINT GetMaxPage() const;
  1060.     UINT GetFromPage() const;
  1061.     UINT GetToPage() const;
  1062. };
  1063.  
  1064. struct CPrintPreviewState   // Print Preview context/state
  1065. {
  1066.     UINT nIDMainPane;          // main pane ID to hide
  1067.     HMENU hMenu;               // saved hMenu
  1068.     DWORD dwStates;            // Control Bar Visible states (bit map)
  1069.     CView* pViewActiveOld;     // save old active view during preview
  1070.     BOOL (CALLBACK* lpfnCloseProc)(CFrameWnd* pFrameWnd);
  1071.     HACCEL hAccelTable;       // saved accelerator table
  1072.  
  1073. // Implementation
  1074.     CPrintPreviewState();
  1075. };
  1076.  
  1077. struct CCreateContext   // Creation information structure
  1078.     // All fields are optional and may be NULL
  1079. {
  1080.     // for creating new views
  1081.     CRuntimeClass* m_pNewViewClass; // runtime class of view to create or NULL
  1082.     CDocument* m_pCurrentDoc;
  1083.  
  1084.     // for creating MDI children (CMDIChildWnd::LoadFrame)
  1085.     CDocTemplate* m_pNewDocTemplate;
  1086.  
  1087.     // for sharing view/frame state from the original view/frame
  1088.     CView* m_pLastView;
  1089.     CFrameWnd* m_pCurrentFrame;
  1090.  
  1091. // Implementation
  1092.     CCreateContext();
  1093. };
  1094.  
  1095. /////////////////////////////////////////////////////////////////////////////
  1096. // VB inlines must ALWAYS be inlined if included at all
  1097.  
  1098. #ifndef NO_VBX_SUPPORT
  1099. #define _AFXVBX_INLINE inline
  1100. #include "afxext.inl"
  1101. #undef _AFXVBX_INLINE
  1102. #endif
  1103.  
  1104. /////////////////////////////////////////////////////////////////////////////
  1105. // Inline function declarations
  1106.  
  1107. #ifdef _AFX_ENABLE_INLINES
  1108. #define _AFXEXT_INLINE inline
  1109. #include "afxext.inl"
  1110. #endif
  1111.  
  1112. #undef AFXAPP_DATA
  1113. #define AFXAPP_DATA     NEAR
  1114.  
  1115. /////////////////////////////////////////////////////////////////////////////
  1116. #endif //__AFXEXT_H__
  1117.