Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1134 lines
37 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 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 related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #ifndef __AFXEXT_H__
  11. #define __AFXEXT_H__
  12. #ifndef __AFXWIN_H__
  13. #include <afxwin.h>
  14. #endif
  15. #ifndef __AFXDLGS_H__
  16. #include <afxdlgs.h>
  17. #endif
  18. #ifdef _AFX_MINREBUILD
  19. #pragma component(minrebuild, off)
  20. #endif
  21. #ifndef _AFX_FULLTYPEINFO
  22. #pragma component(mintypeinfo, on)
  23. #endif
  24. #ifdef _AFX_PACKING
  25. #pragma pack(push, _AFX_PACKING)
  26. #endif
  27. /////////////////////////////////////////////////////////////////////////////
  28. // AFXEXT - MFC Advanced Extensions and Advanced Customizable classes
  29. // Classes declared in this file
  30. //CObject
  31. //CCmdTarget;
  32. //CWnd
  33. //CButton
  34. class CBitmapButton; // Bitmap button (self-draw)
  35. class CControlBar; // control bar
  36. class CStatusBar; // status bar
  37. class CToolBar; // toolbar
  38. class CDialogBar; // dialog as control bar
  39. #if _MFC_VER >= 0x0600
  40. class CReBar; // ie40 dock bar
  41. #endif
  42. class CSplitterWnd; // splitter manager
  43. //CView
  44. //CScrollView
  45. class CFormView; // view with a dialog template
  46. class CEditView; // simple text editor view
  47. //CDC
  48. class CMetaFileDC; // a metafile with proxy
  49. class CRectTracker; // tracker for rectangle objects
  50. // information structures
  51. struct CPrintInfo; // Printing context
  52. struct CPrintPreviewState; // Print Preview context/state
  53. struct CCreateContext; // Creation context
  54. #undef AFX_DATA
  55. #define AFX_DATA AFX_CORE_DATA
  56. /////////////////////////////////////////////////////////////////////////////
  57. // Simple bitmap button
  58. // CBitmapButton - push-button with 1->4 bitmap images
  59. class CBitmapButton : public CButton
  60. {
  61. DECLARE_DYNAMIC(CBitmapButton)
  62. public:
  63. // Construction
  64. CBitmapButton();
  65. BOOL LoadBitmaps(LPCTSTR lpszBitmapResource,
  66. LPCTSTR lpszBitmapResourceSel = NULL,
  67. LPCTSTR lpszBitmapResourceFocus = NULL,
  68. LPCTSTR lpszBitmapResourceDisabled = NULL);
  69. BOOL LoadBitmaps(UINT nIDBitmapResource,
  70. UINT nIDBitmapResourceSel = 0,
  71. UINT nIDBitmapResourceFocus = 0,
  72. UINT nIDBitmapResourceDisabled = 0);
  73. BOOL AutoLoad(UINT nID, CWnd* pParent);
  74. // Operations
  75. void SizeToContent();
  76. // Implementation:
  77. public:
  78. #ifdef _DEBUG
  79. virtual void AssertValid() const;
  80. virtual void Dump(CDumpContext& dc) const;
  81. #endif
  82. protected:
  83. // all bitmaps must be the same size
  84. CBitmap m_bitmap; // normal image (REQUIRED)
  85. CBitmap m_bitmapSel; // selected image (OPTIONAL)
  86. CBitmap m_bitmapFocus; // focused but not selected (OPTIONAL)
  87. CBitmap m_bitmapDisabled; // disabled bitmap (OPTIONAL)
  88. virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
  89. };
  90. /////////////////////////////////////////////////////////////////////////////
  91. // Control Bars
  92. // forward declarations (private to implementation)
  93. class CDockBar;
  94. class CDockContext;
  95. class CControlBarInfo;
  96. struct AFX_SIZEPARENTPARAMS;
  97. // Layout Modes for CalcDynamicLayout
  98. #define LM_STRETCH 0x01 // same meaning as bStretch in CalcFixedLayout. If set, ignores nLength
  99. // and returns dimensions based on LM_HORZ state, otherwise LM_HORZ is used
  100. // to determine if nLength is the desired horizontal or vertical length
  101. // and dimensions are returned based on nLength
  102. #define LM_HORZ 0x02 // same as bHorz in CalcFixedLayout
  103. #define LM_MRUWIDTH 0x04 // Most Recently Used Dynamic Width
  104. #define LM_HORZDOCK 0x08 // Horizontal Docked Dimensions
  105. #define LM_VERTDOCK 0x10 // Vertical Docked Dimensions
  106. #define LM_LENGTHY 0x20 // Set if nLength is a Height instead of a Width
  107. #define LM_COMMIT 0x40 // Remember MRUWidth
  108. #ifdef _AFXDLL
  109. class CControlBar : public CWnd
  110. #else
  111. class AFX_NOVTABLE CControlBar : public CWnd
  112. #endif
  113. {
  114. DECLARE_DYNAMIC(CControlBar)
  115. // Construction
  116. protected:
  117. CControlBar();
  118. // Attributes
  119. public:
  120. int GetCount() const;
  121. // for styles specific to CControlBar
  122. DWORD GetBarStyle();
  123. void SetBarStyle(DWORD dwStyle);
  124. BOOL m_bAutoDelete;
  125. #if _MFC_VER >= 0x0600
  126. // getting and setting border space
  127. void SetBorders(LPCRECT lpRect);
  128. void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
  129. CRect GetBorders() const;
  130. #endif
  131. CFrameWnd* GetDockingFrame() const;
  132. BOOL IsFloating() const;
  133. virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  134. virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
  135. // Operations
  136. void EnableDocking(DWORD dwDockStyle);
  137. // Overridables
  138. virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) = 0;
  139. // Implementation
  140. public:
  141. virtual ~CControlBar();
  142. #ifdef _DEBUG
  143. virtual void AssertValid() const;
  144. virtual void Dump(CDumpContext& dc) const;
  145. #endif
  146. virtual void DelayShow(BOOL bShow);
  147. virtual BOOL IsVisible() const;
  148. virtual DWORD RecalcDelayShow(AFX_SIZEPARENTPARAMS* lpLayout);
  149. virtual BOOL IsDockBar() const;
  150. virtual BOOL DestroyWindow();
  151. virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle);
  152. // info about bar (for status bar and toolbar)
  153. int m_cxLeftBorder, m_cxRightBorder;
  154. int m_cyTopBorder, m_cyBottomBorder;
  155. int m_cxDefaultGap; // default gap value
  156. UINT m_nMRUWidth; // For dynamic resizing.
  157. // array of elements
  158. int m_nCount;
  159. void* m_pData; // m_nCount elements - type depends on derived class
  160. // support for delayed hide/show
  161. enum StateFlags
  162. { delayHide = 1, delayShow = 2, tempHide = 4, statusSet = 8 };
  163. UINT m_nStateFlags;
  164. // support for docking
  165. DWORD m_dwStyle; // creation style (used for layout)
  166. DWORD m_dwDockStyle;// indicates how bar can be docked
  167. CFrameWnd* m_pDockSite; // current dock site, if dockable
  168. CDockBar* m_pDockBar; // current dock bar, if dockable
  169. CDockContext* m_pDockContext; // used during dragging
  170. virtual BOOL PreTranslateMessage(MSG* pMsg);
  171. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  172. virtual void PostNcDestroy();
  173. virtual void DoPaint(CDC* pDC);
  174. void DrawBorders(CDC* pDC, CRect& rect);
  175. #if _MFC_VER >= 0x0600
  176. void DrawGripper(CDC* pDC, const CRect& rect);
  177. #endif
  178. // implementation helpers
  179. virtual LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
  180. void CalcInsideRect(CRect& rect, BOOL bHorz) const; // adjusts borders etc
  181. BOOL AllocElements(int nElements, int cbElement);
  182. virtual BOOL SetStatusText(int nHit);
  183. void ResetTimer(UINT nEvent, UINT nTime);
  184. void EraseNonClient();
  185. void GetBarInfo(CControlBarInfo* pInfo);
  186. void SetBarInfo(CControlBarInfo* pInfo, CFrameWnd* pFrameWnd);
  187. //{{AFX_MSG(CControlBar)
  188. afx_msg void OnTimer(UINT_PTR nIDEvent);
  189. afx_msg int OnCreate(LPCREATESTRUCT lpcs);
  190. afx_msg void OnDestroy();
  191. afx_msg void OnPaint();
  192. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  193. afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos);
  194. afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam);
  195. afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam);
  196. afx_msg void OnInitialUpdate();
  197. afx_msg LRESULT OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam);
  198. afx_msg void OnLButtonDown(UINT nFlags, CPoint pt );
  199. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint pt);
  200. afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT nMsg);
  201. //}}AFX_MSG
  202. DECLARE_MESSAGE_MAP()
  203. friend class CFrameWnd;
  204. friend class CDockBar;
  205. };
  206. /////////////////////////////////////////////////////////////////////////////
  207. // CStatusBar control
  208. class CStatusBarCtrl; // forward reference (see afxcmn.h for definition)
  209. struct AFX_STATUSPANE; // private to implementation
  210. class CStatusBar : public CControlBar
  211. {
  212. DECLARE_DYNAMIC(CStatusBar)
  213. // Construction
  214. public:
  215. CStatusBar();
  216. BOOL Create(CWnd* pParentWnd,
  217. DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
  218. UINT nID = AFX_IDW_STATUS_BAR);
  219. #if _MFC_VER >= 0x0600
  220. BOOL CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle = 0,
  221. DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
  222. UINT nID = AFX_IDW_STATUS_BAR);
  223. #endif
  224. BOOL SetIndicators(const UINT* lpIDArray, int nIDCount);
  225. // Attributes
  226. public:
  227. #if _MFC_VER >= 0x0600
  228. void SetBorders(LPCRECT lpRect);
  229. void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
  230. #endif
  231. // standard control bar things
  232. int CommandToIndex(UINT nIDFind) const;
  233. UINT GetItemID(int nIndex) const;
  234. void GetItemRect(int nIndex, LPRECT lpRect) const;
  235. // specific to CStatusBar
  236. void GetPaneText(int nIndex, CString& rString) const;
  237. CString GetPaneText(int nIndex) const;
  238. BOOL SetPaneText(int nIndex, LPCTSTR lpszNewText, BOOL bUpdate = TRUE);
  239. void GetPaneInfo(int nIndex, UINT& nID, UINT& nStyle, int& cxWidth) const;
  240. void SetPaneInfo(int nIndex, UINT nID, UINT nStyle, int cxWidth);
  241. UINT GetPaneStyle(int nIndex) const;
  242. void SetPaneStyle(int nIndex, UINT nStyle);
  243. // for direct access to the underlying common control
  244. CStatusBarCtrl& GetStatusBarCtrl() const;
  245. // Overridables
  246. virtual void DrawItem(LPDRAWITEMSTRUCT);
  247. // Implementation
  248. public:
  249. virtual ~CStatusBar();
  250. virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  251. BOOL PreCreateWindow(CREATESTRUCT& cs);
  252. BOOL AllocElements(int nElements, int cbElement);
  253. void CalcInsideRect(CRect& rect, BOOL bHorz) const;
  254. virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle);
  255. #ifdef _DEBUG
  256. virtual void AssertValid() const;
  257. virtual void Dump(CDumpContext& dc) const;
  258. void EnableDocking(DWORD dwDockStyle);
  259. #endif
  260. virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  261. protected:
  262. int m_nMinHeight;
  263. AFX_STATUSPANE* _GetPanePtr(int nIndex) const;
  264. void UpdateAllPanes(BOOL bUpdateRects, BOOL bUpdateText);
  265. virtual BOOL OnChildNotify(UINT message, WPARAM, LPARAM, LRESULT*);
  266. //{{AFX_MSG(CStatusBar)
  267. afx_msg UINT OnNcHitTest(CPoint);
  268. afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*);
  269. afx_msg void OnNcPaint();
  270. afx_msg void OnPaint();
  271. afx_msg void OnSize(UINT nType, int cx, int cy);
  272. afx_msg void OnWindowPosChanging(LPWINDOWPOS);
  273. afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
  274. afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam);
  275. afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam);
  276. afx_msg LRESULT OnSetMinHeight(WPARAM wParam, LPARAM lParam);
  277. //}}AFX_MSG
  278. DECLARE_MESSAGE_MAP()
  279. };
  280. // Styles for status bar panes
  281. #define SBPS_NORMAL 0x0000
  282. #define SBPS_NOBORDERS SBT_NOBORDERS
  283. #define SBPS_POPOUT SBT_POPOUT
  284. #define SBPS_OWNERDRAW SBT_OWNERDRAW
  285. #define SBPS_DISABLED 0x04000000
  286. #define SBPS_STRETCH 0x08000000 // stretch to fill status bar
  287. /////////////////////////////////////////////////////////////////////////////
  288. // CToolBar control
  289. HBITMAP AFXAPI AfxLoadSysColorBitmap(HINSTANCE hInst, HRSRC hRsrc, BOOL bMono = FALSE);
  290. class CToolBarCtrl; // forward reference (see afxcmn.h for definition)
  291. class CToolBar : public CControlBar
  292. {
  293. DECLARE_DYNAMIC(CToolBar)
  294. // Construction
  295. public:
  296. CToolBar();
  297. BOOL Create(CWnd* pParentWnd,
  298. DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,
  299. UINT nID = AFX_IDW_TOOLBAR);
  300. #if _MFC_VER >= 0x0600
  301. BOOL CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle = TBSTYLE_FLAT,
  302. DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP,
  303. CRect rcBorders = CRect(0, 0, 0, 0),
  304. UINT nID = AFX_IDW_TOOLBAR);
  305. #endif
  306. void SetSizes(SIZE sizeButton, SIZE sizeImage);
  307. // button size should be bigger than image
  308. void SetHeight(int cyHeight);
  309. // call after SetSizes, height overrides bitmap size
  310. BOOL LoadToolBar(LPCTSTR lpszResourceName);
  311. BOOL LoadToolBar(UINT nIDResource);
  312. BOOL LoadBitmap(LPCTSTR lpszResourceName);
  313. BOOL LoadBitmap(UINT nIDResource);
  314. BOOL SetBitmap(HBITMAP hbmImageWell);
  315. BOOL SetButtons(const UINT* lpIDArray, int nIDCount);
  316. // lpIDArray can be NULL to allocate empty buttons
  317. // Attributes
  318. public:
  319. // standard control bar things
  320. int CommandToIndex(UINT nIDFind) const;
  321. UINT GetItemID(int nIndex) const;
  322. virtual void GetItemRect(int nIndex, LPRECT lpRect) const;
  323. UINT GetButtonStyle(int nIndex) const;
  324. void SetButtonStyle(int nIndex, UINT nStyle);
  325. // for changing button info
  326. void GetButtonInfo(int nIndex, UINT& nID, UINT& nStyle, int& iImage) const;
  327. void SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage);
  328. BOOL SetButtonText(int nIndex, LPCTSTR lpszText);
  329. CString GetButtonText(int nIndex) const;
  330. void GetButtonText(int nIndex, CString& rString) const;
  331. // for direct access to the underlying common control
  332. CToolBarCtrl& GetToolBarCtrl() const;
  333. // Implementation
  334. public:
  335. virtual ~CToolBar();
  336. virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  337. virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
  338. virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
  339. virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  340. void SetOwner(CWnd* pOwnerWnd);
  341. BOOL AddReplaceBitmap(HBITMAP hbmImageWell);
  342. virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle);
  343. #ifdef _DEBUG
  344. virtual void AssertValid() const;
  345. virtual void Dump(CDumpContext& dc) const;
  346. #endif
  347. protected:
  348. HRSRC m_hRsrcImageWell; // handle to loaded resource for image well
  349. HINSTANCE m_hInstImageWell; // instance handle to load image well from
  350. HBITMAP m_hbmImageWell; // contains color mapped button images
  351. BOOL m_bDelayedButtonLayout; // used to manage when button layout should be done
  352. CSize m_sizeImage; // current image size
  353. CSize m_sizeButton; // current button size
  354. CMapStringToPtr* m_pStringMap; // used as CMapStringToUInt
  355. // implementation helpers
  356. void _GetButton(int nIndex, TBBUTTON* pButton) const;
  357. void _SetButton(int nIndex, TBBUTTON* pButton);
  358. CSize CalcLayout(DWORD nMode, int nLength = -1);
  359. CSize CalcSize(TBBUTTON* pData, int nCount);
  360. int WrapToolBar(TBBUTTON* pData, int nCount, int nWidth);
  361. void SizeToolBar(TBBUTTON* pData, int nCount, int nLength, BOOL bVert = FALSE);
  362. #if _MFC_VER >= 0x0600
  363. void Layout(); // called for for delayed button layout
  364. #endif
  365. //{{AFX_MSG(CToolBar)
  366. afx_msg UINT OnNcHitTest(CPoint);
  367. afx_msg void OnNcPaint();
  368. afx_msg void OnPaint();
  369. afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*);
  370. afx_msg void OnWindowPosChanging(LPWINDOWPOS);
  371. afx_msg void OnSysColorChange();
  372. afx_msg LRESULT OnSetButtonSize(WPARAM, LPARAM);
  373. afx_msg LRESULT OnSetBitmapSize(WPARAM, LPARAM);
  374. #if _MFC_VER >= 0x0600
  375. afx_msg LRESULT OnPreserveZeroBorderHelper(WPARAM, LPARAM);
  376. #endif
  377. afx_msg BOOL OnNcCreate(LPCREATESTRUCT);
  378. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  379. //}}AFX_MSG
  380. DECLARE_MESSAGE_MAP()
  381. #if _MFC_VER >= 0x0600
  382. LRESULT OnSetSizeHelper(CSize& size, LPARAM lParam);
  383. #endif
  384. };
  385. // Styles for toolbar buttons
  386. #define TBBS_BUTTON MAKELONG(TBSTYLE_BUTTON, 0) // this entry is button
  387. #define TBBS_SEPARATOR MAKELONG(TBSTYLE_SEP, 0) // this entry is a separator
  388. #define TBBS_CHECKBOX MAKELONG(TBSTYLE_CHECK, 0) // this is an auto check button
  389. #define TBBS_GROUP MAKELONG(TBSTYLE_GROUP, 0) // marks the start of a group
  390. #define TBBS_CHECKGROUP (TBBS_GROUP|TBBS_CHECKBOX) // normal use of TBBS_GROUP
  391. #if _MFC_VER >= 0x0600
  392. #define TBBS_DROPDOWN MAKELONG(TBSTYLE_DROPDOWN, 0) // drop down style
  393. #define TBBS_AUTOSIZE MAKELONG(TBSTYLE_AUTOSIZE, 0) // autocalc button width
  394. #define TBBS_NOPREFIX MAKELONG(TBSTYLE_NOPREFIX, 0) // no accel prefix for this button
  395. #endif
  396. // styles for display states
  397. #define TBBS_CHECKED MAKELONG(0, TBSTATE_CHECKED) // button is checked/down
  398. #define TBBS_PRESSED MAKELONG(0, TBSTATE_PRESSED) // button is being depressed
  399. #define TBBS_DISABLED MAKELONG(0, TBSTATE_ENABLED) // button is disabled
  400. #define TBBS_INDETERMINATE MAKELONG(0, TBSTATE_INDETERMINATE) // third state
  401. #define TBBS_HIDDEN MAKELONG(0, TBSTATE_HIDDEN) // button is hidden
  402. #define TBBS_WRAPPED MAKELONG(0, TBSTATE_WRAP) // button is wrapped at this point
  403. #if _MFC_VER >= 0x0600
  404. #define TBBS_ELLIPSES MAKELONG(0, TBSTATE_ELIPSES)
  405. #define TBBS_MARKED MAKELONG(0, TBSTATE_MARKED)
  406. #endif
  407. ////////////////////////////////////////////
  408. // CDialogBar control
  409. // This is a control bar built from a dialog template. It is a modeless
  410. // dialog that delegates all control notifications to the parent window
  411. // of the control bar [the grandparent of the control]
  412. class CDialogBar : public CControlBar
  413. {
  414. DECLARE_DYNAMIC(CDialogBar)
  415. // Construction
  416. public:
  417. CDialogBar();
  418. BOOL Create(CWnd* pParentWnd, LPCTSTR lpszTemplateName,
  419. UINT nStyle, UINT nID);
  420. BOOL Create(CWnd* pParentWnd, UINT nIDTemplate,
  421. UINT nStyle, UINT nID);
  422. // Implementation
  423. public:
  424. virtual ~CDialogBar();
  425. virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  426. CSize m_sizeDefault;
  427. virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  428. protected:
  429. #ifndef _AFX_NO_OCC_SUPPORT
  430. // data and functions necessary for OLE control containment
  431. _AFX_OCC_DIALOG_INFO* m_pOccDialogInfo;
  432. LPCTSTR m_lpszTemplateName;
  433. virtual BOOL SetOccDialogInfo(_AFX_OCC_DIALOG_INFO* pOccDialogInfo);
  434. //{{AFX_MSG(CDialogBar)
  435. DECLARE_MESSAGE_MAP()
  436. //}}AFX_MSG
  437. afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM);
  438. #endif
  439. };
  440. #if _MFC_VER >= 0x0600
  441. ////////////////////////////////////////////
  442. // CReBar control
  443. class CReBarCtrl;
  444. class CReBar : public CControlBar
  445. {
  446. DECLARE_DYNAMIC(CReBar)
  447. // Construction
  448. public:
  449. CReBar();
  450. BOOL Create(CWnd* pParentWnd, DWORD dwCtrlStyle = RBS_BANDBORDERS,
  451. DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_TOP,
  452. UINT nID = AFX_IDW_REBAR);
  453. // Attributes
  454. public:
  455. // for direct access to the underlying common control
  456. CReBarCtrl& GetReBarCtrl() const;
  457. // Operations
  458. public:
  459. BOOL AddBar(CWnd* pBar, LPCTSTR pszText = NULL, CBitmap* pbmp = NULL,
  460. DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP);
  461. BOOL AddBar(CWnd* pBar, COLORREF clrFore, COLORREF clrBack,
  462. LPCTSTR pszText = NULL, DWORD dwStyle = RBBS_GRIPPERALWAYS);
  463. // Implementation
  464. virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  465. virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
  466. virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  467. virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
  468. #ifdef _DEBUG
  469. void EnableDocking(DWORD dwDockStyle);
  470. #endif
  471. protected:
  472. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  473. BOOL _AddBar(CWnd* pBar, REBARBANDINFO* pRBBI);
  474. //{{AFX_MSG(CReBar)
  475. afx_msg BOOL OnNcCreate(LPCREATESTRUCT);
  476. afx_msg void OnPaint();
  477. afx_msg void OnHeightChange(NMHDR* pNMHDR, LRESULT* pResult);
  478. afx_msg void OnNcPaint();
  479. afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*);
  480. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  481. afx_msg LRESULT OnShowBand(WPARAM wParam, LPARAM lParam);
  482. afx_msg void OnRecalcParent();
  483. //}}AFX_MSG
  484. DECLARE_MESSAGE_MAP()
  485. };
  486. #endif
  487. /////////////////////////////////////////////////////////////////////////////
  488. // Splitter Window
  489. #define SPLS_DYNAMIC_SPLIT 0x0001
  490. #define SPLS_INVERT_TRACKER 0x0002 // obsolete (now ignored)
  491. class CSplitterWnd : public CWnd
  492. {
  493. DECLARE_DYNAMIC(CSplitterWnd)
  494. // Construction
  495. public:
  496. CSplitterWnd();
  497. // Create a single view type splitter with multiple splits
  498. BOOL Create(CWnd* pParentWnd,
  499. int nMaxRows, int nMaxCols, SIZE sizeMin,
  500. CCreateContext* pContext,
  501. DWORD dwStyle = WS_CHILD | WS_VISIBLE |
  502. WS_HSCROLL | WS_VSCROLL | SPLS_DYNAMIC_SPLIT,
  503. UINT nID = AFX_IDW_PANE_FIRST);
  504. // Create a multiple view type splitter with static layout
  505. BOOL CreateStatic(CWnd* pParentWnd,
  506. int nRows, int nCols,
  507. DWORD dwStyle = WS_CHILD | WS_VISIBLE,
  508. UINT nID = AFX_IDW_PANE_FIRST);
  509. virtual BOOL CreateView(int row, int col, CRuntimeClass* pViewClass,
  510. SIZE sizeInit, CCreateContext* pContext);
  511. // Attributes
  512. public:
  513. int GetRowCount() const;
  514. int GetColumnCount() const;
  515. // information about a specific row or column
  516. void GetRowInfo(int row, int& cyCur, int& cyMin) const;
  517. void SetRowInfo(int row, int cyIdeal, int cyMin);
  518. void GetColumnInfo(int col, int& cxCur, int& cxMin) const;
  519. void SetColumnInfo(int col, int cxIdeal, int cxMin);
  520. // for setting and getting shared scroll bar style
  521. DWORD GetScrollStyle() const;
  522. void SetScrollStyle(DWORD dwStyle);
  523. // views inside the splitter
  524. CWnd* GetPane(int row, int col) const;
  525. BOOL IsChildPane(CWnd* pWnd, int* pRow, int* pCol);
  526. BOOL IsChildPane(CWnd* pWnd, int& row, int& col); // obsolete
  527. int IdFromRowCol(int row, int col) const;
  528. BOOL IsTracking(); // TRUE during split operation
  529. // Operations
  530. public:
  531. virtual void RecalcLayout(); // call after changing sizes
  532. // Overridables
  533. protected:
  534. // to customize the drawing
  535. enum ESplitType { splitBox, splitBar, splitIntersection, splitBorder };
  536. virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rect);
  537. virtual void OnInvertTracker(const CRect& rect);
  538. public:
  539. // for customizing scrollbar regions
  540. virtual BOOL CreateScrollBarCtrl(DWORD dwStyle, UINT nID);
  541. // for customizing DYNAMIC_SPLIT behavior
  542. virtual void DeleteView(int row, int col);
  543. virtual BOOL SplitRow(int cyBefore);
  544. virtual BOOL SplitColumn(int cxBefore);
  545. virtual void DeleteRow(int rowDelete);
  546. virtual void DeleteColumn(int colDelete);
  547. // determining active pane from focus or active view in frame
  548. virtual CWnd* GetActivePane(int* pRow = NULL, int* pCol = NULL);
  549. virtual void SetActivePane(int row, int col, CWnd* pWnd = NULL);
  550. protected:
  551. CWnd* GetActivePane(int& row, int& col); // obsolete
  552. public:
  553. // high level command operations - called by default view implementation
  554. virtual BOOL CanActivateNext(BOOL bPrev = FALSE);
  555. virtual void ActivateNext(BOOL bPrev = FALSE);
  556. virtual BOOL DoKeyboardSplit();
  557. // synchronized scrolling
  558. virtual BOOL DoScroll(CView* pViewFrom, UINT nScrollCode,
  559. BOOL bDoScroll = TRUE);
  560. virtual BOOL DoScrollBy(CView* pViewFrom, CSize sizeScroll,
  561. BOOL bDoScroll = TRUE);
  562. // Implementation
  563. public:
  564. virtual ~CSplitterWnd();
  565. #ifdef _DEBUG
  566. virtual void AssertValid() const;
  567. virtual void Dump(CDumpContext& dc) const;
  568. #endif
  569. // implementation structure
  570. struct CRowColInfo
  571. {
  572. int nMinSize; // below that try not to show
  573. int nIdealSize; // user set size
  574. // variable depending on the available size layout
  575. int nCurSize; // 0 => invisible, -1 => nonexistant
  576. };
  577. protected:
  578. // customizable implementation attributes (set by constructor or Create)
  579. CRuntimeClass* m_pDynamicViewClass;
  580. int m_nMaxRows, m_nMaxCols;
  581. // implementation attributes which control layout of the splitter
  582. int m_cxSplitter, m_cySplitter; // size of splitter bar
  583. int m_cxBorderShare, m_cyBorderShare; // space on either side of splitter
  584. int m_cxSplitterGap, m_cySplitterGap; // amount of space between panes
  585. int m_cxBorder, m_cyBorder; // borders in client area
  586. // current state information
  587. int m_nRows, m_nCols;
  588. BOOL m_bHasHScroll, m_bHasVScroll;
  589. CRowColInfo* m_pColInfo;
  590. CRowColInfo* m_pRowInfo;
  591. // Tracking info - only valid when 'm_bTracking' is set
  592. BOOL m_bTracking, m_bTracking2;
  593. CPoint m_ptTrackOffset;
  594. CRect m_rectLimit;
  595. CRect m_rectTracker, m_rectTracker2;
  596. int m_htTrack;
  597. // implementation routines
  598. BOOL CreateCommon(CWnd* pParentWnd, SIZE sizeMin, DWORD dwStyle, UINT nID);
  599. virtual int HitTest(CPoint pt) const;
  600. virtual void GetInsideRect(CRect& rect) const;
  601. virtual void GetHitRect(int ht, CRect& rect);
  602. virtual void TrackRowSize(int y, int row);
  603. virtual void TrackColumnSize(int x, int col);
  604. virtual void DrawAllSplitBars(CDC* pDC, int cxInside, int cyInside);
  605. virtual void SetSplitCursor(int ht);
  606. CWnd* GetSizingParent();
  607. // starting and stopping tracking
  608. virtual void StartTracking(int ht);
  609. virtual void StopTracking(BOOL bAccept);
  610. // special command routing to frame
  611. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  612. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  613. //{{AFX_MSG(CSplitterWnd)
  614. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  615. afx_msg void OnMouseMove(UINT nFlags, CPoint pt);
  616. afx_msg void OnPaint();
  617. afx_msg void OnLButtonDown(UINT nFlags, CPoint pt);
  618. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint pt);
  619. afx_msg void OnLButtonUp(UINT nFlags, CPoint pt);
  620. afx_msg void OnCancelMode();
  621. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  622. afx_msg void OnSize(UINT nType, int cx, int cy);
  623. afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  624. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  625. afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
  626. afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpcs);
  627. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  628. afx_msg void OnDisplayChange();
  629. //}}AFX_MSG
  630. DECLARE_MESSAGE_MAP()
  631. };
  632. /////////////////////////////////////////////////////////////////////////////
  633. // CFormView - generic view constructed from a dialog template
  634. class CFormView : public CScrollView
  635. {
  636. DECLARE_DYNAMIC(CFormView)
  637. // Construction
  638. protected: // must derive your own class
  639. CFormView(LPCTSTR lpszTemplateName);
  640. CFormView(UINT nIDTemplate);
  641. // Implementation
  642. public:
  643. #ifdef _DEBUG
  644. virtual void AssertValid() const;
  645. virtual void Dump(CDumpContext& dc) const;
  646. #endif
  647. virtual void OnInitialUpdate();
  648. protected:
  649. LPCTSTR m_lpszTemplateName;
  650. CCreateContext* m_pCreateContext;
  651. HWND m_hWndFocus; // last window to have focus
  652. virtual void OnDraw(CDC* pDC); // default does nothing
  653. // special case override of child window creation
  654. virtual BOOL Create(LPCTSTR, LPCTSTR, DWORD,
  655. const RECT&, CWnd*, UINT, CCreateContext*);
  656. virtual BOOL PreTranslateMessage(MSG* pMsg);
  657. virtual void OnActivateView(BOOL, CView*, CView*);
  658. virtual void OnActivateFrame(UINT, CFrameWnd*);
  659. BOOL SaveFocusControl(); // updates m_hWndFocus
  660. #ifndef _AFX_NO_OCC_SUPPORT
  661. // data and functions necessary for OLE control containment
  662. _AFX_OCC_DIALOG_INFO* m_pOccDialogInfo;
  663. virtual BOOL SetOccDialogInfo(_AFX_OCC_DIALOG_INFO* pOccDialogInfo);
  664. afx_msg LRESULT HandleInitDialog(WPARAM, LPARAM);
  665. #endif
  666. //{{AFX_MSG(CFormView)
  667. afx_msg int OnCreate(LPCREATESTRUCT lpcs);
  668. afx_msg void OnSetFocus(CWnd* pOldWnd);
  669. //}}AFX_MSG
  670. DECLARE_MESSAGE_MAP()
  671. };
  672. /////////////////////////////////////////////////////////////////////////////
  673. // CEditView - simple text editor view
  674. class CEditView : public CCtrlView
  675. {
  676. DECLARE_DYNCREATE(CEditView)
  677. // Construction
  678. public:
  679. CEditView();
  680. // Attributes
  681. public:
  682. static AFX_DATA const DWORD dwStyleDefault;
  683. // CEdit control access
  684. CEdit& GetEditCtrl() const;
  685. // presentation attributes
  686. CFont* GetPrinterFont() const;
  687. void SetPrinterFont(CFont* pFont);
  688. void SetTabStops(int nTabStops);
  689. // other attributes
  690. void GetSelectedText(CString& strResult) const;
  691. // buffer access
  692. LPCTSTR LockBuffer() const;
  693. void UnlockBuffer() const;
  694. UINT GetBufferLength() const;
  695. // Operations
  696. public:
  697. BOOL FindText(LPCTSTR lpszFind, BOOL bNext = TRUE, BOOL bCase = TRUE);
  698. void SerializeRaw(CArchive& ar);
  699. UINT PrintInsideRect(CDC* pDC, RECT& rectLayout, UINT nIndexStart,
  700. UINT nIndexStop);
  701. // Overrideables
  702. protected:
  703. virtual void OnFindNext(LPCTSTR lpszFind, BOOL bNext, BOOL bCase);
  704. virtual void OnReplaceSel(LPCTSTR lpszFind, BOOL bNext, BOOL bCase,
  705. LPCTSTR lpszReplace);
  706. virtual void OnReplaceAll(LPCTSTR lpszFind, LPCTSTR lpszReplace,
  707. BOOL bCase);
  708. virtual void OnTextNotFound(LPCTSTR lpszFind);
  709. // Implementation
  710. public:
  711. virtual ~CEditView();
  712. #ifdef _DEBUG
  713. virtual void AssertValid() const;
  714. virtual void Dump(CDumpContext& dc) const;
  715. #endif
  716. virtual void Serialize(CArchive& ar);
  717. virtual void DeleteContents();
  718. void ReadFromArchive(CArchive& ar, UINT nLen);
  719. void WriteToArchive(CArchive& ar);
  720. virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo);
  721. static AFX_DATA const UINT nMaxSize;
  722. // maximum number of characters supported
  723. protected:
  724. int m_nTabStops; // tab stops in dialog units
  725. LPTSTR m_pShadowBuffer; // special shadow buffer only used in Win32s
  726. UINT m_nShadowSize;
  727. CUIntArray m_aPageStart; // array of starting pages
  728. HFONT m_hPrinterFont; // if NULL, mirror display font
  729. HFONT m_hMirrorFont; // font object used when mirroring
  730. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  731. // printing support
  732. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  733. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  734. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  735. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo = NULL);
  736. BOOL PaginateTo(CDC* pDC, CPrintInfo* pInfo);
  737. // find & replace support
  738. void OnEditFindReplace(BOOL bFindOnly);
  739. BOOL InitializeReplace();
  740. BOOL SameAsSelected(LPCTSTR lpszCompare, BOOL bCase);
  741. // special overrides for implementation
  742. virtual void CalcWindowRect(LPRECT lpClientRect,
  743. UINT nAdjustType = adjustBorder);
  744. //{{AFX_MSG(CEditView)
  745. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  746. afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  747. afx_msg void OnUpdateNeedSel(CCmdUI* pCmdUI);
  748. afx_msg void OnUpdateNeedClip(CCmdUI* pCmdUI);
  749. afx_msg void OnUpdateNeedText(CCmdUI* pCmdUI);
  750. afx_msg void OnUpdateNeedFind(CCmdUI* pCmdUI);
  751. afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  752. afx_msg BOOL OnEditChange();
  753. afx_msg void OnEditCut();
  754. afx_msg void OnEditCopy();
  755. afx_msg void OnEditPaste();
  756. afx_msg void OnEditClear();
  757. afx_msg void OnEditUndo();
  758. afx_msg void OnEditSelectAll();
  759. afx_msg void OnEditFind();
  760. afx_msg void OnEditReplace();
  761. afx_msg void OnEditRepeat();
  762. afx_msg LRESULT OnFindReplaceCmd(WPARAM wParam, LPARAM lParam);
  763. afx_msg void OnDestroy();
  764. //}}AFX_MSG
  765. DECLARE_MESSAGE_MAP()
  766. };
  767. /////////////////////////////////////////////////////////////////////////////
  768. // CMetaFileDC
  769. class CMetaFileDC : public CDC
  770. {
  771. DECLARE_DYNAMIC(CMetaFileDC)
  772. // Constructors
  773. public:
  774. CMetaFileDC();
  775. BOOL Create(LPCTSTR lpszFilename = NULL);
  776. BOOL CreateEnhanced(CDC* pDCRef, LPCTSTR lpszFileName,
  777. LPCRECT lpBounds, LPCTSTR lpszDescription);
  778. // Operations
  779. HMETAFILE Close();
  780. HENHMETAFILE CloseEnhanced();
  781. // Implementation
  782. public:
  783. virtual void SetAttribDC(HDC hDC); // Set the Attribute DC
  784. protected:
  785. virtual void SetOutputDC(HDC hDC); // Set the Output DC -- Not allowed
  786. virtual void ReleaseOutputDC(); // Release the Output DC -- Not allowed
  787. public:
  788. virtual ~CMetaFileDC();
  789. // Clipping Functions (use the Attribute DC's clip region)
  790. virtual int GetClipBox(LPRECT lpRect) const;
  791. virtual BOOL PtVisible(int x, int y) const;
  792. BOOL PtVisible(POINT point) const;
  793. virtual BOOL RectVisible(LPCRECT lpRect) const;
  794. // Text Functions
  795. virtual BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount);
  796. BOOL TextOut(int x, int y, const CString& str);
  797. virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
  798. LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths);
  799. BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
  800. const CString& str, LPINT lpDxWidths);
  801. virtual CSize TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount,
  802. int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin);
  803. CSize TabbedTextOut(int x, int y, const CString& str,
  804. int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin);
  805. virtual int DrawText(LPCTSTR lpszString, int nCount, LPRECT lpRect,
  806. UINT nFormat);
  807. int DrawText(const CString& str, LPRECT lpRect, UINT nFormat);
  808. // Printer Escape Functions
  809. virtual int Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData);
  810. // Viewport Functions
  811. virtual CPoint SetViewportOrg(int x, int y);
  812. CPoint SetViewportOrg(POINT point);
  813. virtual CPoint OffsetViewportOrg(int nWidth, int nHeight);
  814. virtual CSize SetViewportExt(int x, int y);
  815. CSize SetViewportExt(SIZE size);
  816. virtual CSize ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom);
  817. protected:
  818. void AdjustCP(int cx);
  819. };
  820. /////////////////////////////////////////////////////////////////////////////
  821. // CRectTracker - simple rectangular tracking rectangle w/resize handles
  822. class CRectTracker
  823. {
  824. public:
  825. // Constructors
  826. CRectTracker();
  827. CRectTracker(LPCRECT lpSrcRect, UINT nStyle);
  828. // Style Flags
  829. enum StyleFlags
  830. {
  831. solidLine = 1, dottedLine = 2, hatchedBorder = 4,
  832. resizeInside = 8, resizeOutside = 16, hatchInside = 32,
  833. };
  834. // Hit-Test codes
  835. enum TrackerHit
  836. {
  837. hitNothing = -1,
  838. hitTopLeft = 0, hitTopRight = 1, hitBottomRight = 2, hitBottomLeft = 3,
  839. hitTop = 4, hitRight = 5, hitBottom = 6, hitLeft = 7, hitMiddle = 8
  840. };
  841. // Attributes
  842. UINT m_nStyle; // current state
  843. CRect m_rect; // current position (always in pixels)
  844. CSize m_sizeMin; // minimum X and Y size during track operation
  845. int m_nHandleSize; // size of resize handles (default from WIN.INI)
  846. // Operations
  847. void Draw(CDC* pDC) const;
  848. void GetTrueRect(LPRECT lpTrueRect) const;
  849. BOOL SetCursor(CWnd* pWnd, UINT nHitTest) const;
  850. BOOL Track(CWnd* pWnd, CPoint point, BOOL bAllowInvert = FALSE,
  851. CWnd* pWndClipTo = NULL);
  852. BOOL TrackRubberBand(CWnd* pWnd, CPoint point, BOOL bAllowInvert = TRUE);
  853. int HitTest(CPoint point) const;
  854. int NormalizeHit(int nHandle) const;
  855. // Overridables
  856. virtual void DrawTrackerRect(LPCRECT lpRect, CWnd* pWndClipTo,
  857. CDC* pDC, CWnd* pWnd);
  858. virtual void AdjustRect(int nHandle, LPRECT lpRect);
  859. virtual void OnChangedRect(const CRect& rectOld);
  860. virtual UINT GetHandleMask() const;
  861. // Implementation
  862. public:
  863. virtual ~CRectTracker();
  864. protected:
  865. BOOL m_bAllowInvert; // flag passed to Track or TrackRubberBand
  866. CRect m_rectLast;
  867. CSize m_sizeLast;
  868. BOOL m_bErase; // TRUE if DrawTrackerRect is called for erasing
  869. BOOL m_bFinalErase; // TRUE if DragTrackerRect called for final erase
  870. // implementation helpers
  871. int HitTestHandles(CPoint point) const;
  872. void GetHandleRect(int nHandle, CRect* pHandleRect) const;
  873. void GetModifyPointers(int nHandle, int**ppx, int**ppy, int* px, int*py);
  874. virtual int GetHandleSize(LPCRECT lpRect = NULL) const;
  875. BOOL TrackHandle(int nHandle, CWnd* pWnd, CPoint point, CWnd* pWndClipTo);
  876. void Construct();
  877. };
  878. /////////////////////////////////////////////////////////////////////////////
  879. // Informational data structures
  880. struct CPrintInfo // Printing information structure
  881. {
  882. CPrintInfo();
  883. ~CPrintInfo();
  884. CPrintDialog* m_pPD; // pointer to print dialog
  885. BOOL m_bDocObject; // TRUE if printing by IPrint interface
  886. BOOL m_bPreview; // TRUE if in preview mode
  887. BOOL m_bDirect; // TRUE if bypassing Print Dialog
  888. BOOL m_bContinuePrinting;// set to FALSE to prematurely end printing
  889. UINT m_nCurPage; // Current page
  890. UINT m_nNumPreviewPages; // Desired number of preview pages
  891. CString m_strPageDesc; // Format string for page number display
  892. LPVOID m_lpUserData; // pointer to user created struct
  893. CRect m_rectDraw; // rectangle defining current usable page area
  894. // these only valid if m_bDocObject
  895. UINT m_nOffsetPage; // offset of first page in combined IPrint job
  896. DWORD m_dwFlags; // flags passed to IPrint::Print
  897. void SetMinPage(UINT nMinPage);
  898. void SetMaxPage(UINT nMaxPage);
  899. UINT GetMinPage() const;
  900. UINT GetMaxPage() const;
  901. UINT GetFromPage() const;
  902. UINT GetToPage() const;
  903. UINT GetOffsetPage() const;
  904. };
  905. struct CPrintPreviewState // Print Preview context/state
  906. {
  907. UINT nIDMainPane; // main pane ID to hide
  908. HMENU hMenu; // saved hMenu
  909. DWORD dwStates; // Control Bar Visible states (bit map)
  910. CView* pViewActiveOld; // save old active view during preview
  911. BOOL (CALLBACK* lpfnCloseProc)(CFrameWnd* pFrameWnd);
  912. HACCEL hAccelTable; // saved accelerator table
  913. // Implementation
  914. CPrintPreviewState();
  915. };
  916. struct CCreateContext // Creation information structure
  917. // All fields are optional and may be NULL
  918. {
  919. // for creating new views
  920. CRuntimeClass* m_pNewViewClass; // runtime class of view to create or NULL
  921. CDocument* m_pCurrentDoc;
  922. // for creating MDI children (CMDIChildWnd::LoadFrame)
  923. CDocTemplate* m_pNewDocTemplate;
  924. // for sharing view/frame state from the original view/frame
  925. CView* m_pLastView;
  926. CFrameWnd* m_pCurrentFrame;
  927. // Implementation
  928. CCreateContext();
  929. };
  930. /////////////////////////////////////////////////////////////////////////////
  931. // Inline function declarations
  932. #ifdef _AFX_PACKING
  933. #pragma pack(pop)
  934. #endif
  935. #ifdef _AFX_ENABLE_INLINES
  936. #define _AFXEXT_INLINE AFX_INLINE
  937. #include <afxext.inl>
  938. #endif
  939. #undef AFX_DATA
  940. #define AFX_DATA
  941. #ifdef _AFX_MINREBUILD
  942. #pragma component(minrebuild, on)
  943. #endif
  944. #ifndef _AFX_FULLTYPEINFO
  945. #pragma component(mintypeinfo, off)
  946. #endif
  947. #endif //__AFXEXT_H__
  948. /////////////////////////////////////////////////////////////////////////////