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.

1223 lines
36 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 __AFXCMN_H__
  11. #define __AFXCMN_H__
  12. #ifdef _AFX_NO_AFXCMN_SUPPORT
  13. #error Windows Common Control classes not supported in this library variant.
  14. #endif
  15. #ifndef __AFXWIN_H__
  16. #include <afxwin.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. #ifndef IMAGE_BITMAP
  25. #define IMAGE_BITMAP 0
  26. #endif
  27. /////////////////////////////////////////////////////////////////////////////
  28. #ifdef _AFX_PACKING
  29. #pragma pack(push, _AFX_PACKING)
  30. #endif
  31. #ifndef _AFX_NO_RICHEDIT_SUPPORT
  32. #ifndef _RICHEDIT_
  33. #include <richedit.h>
  34. #endif
  35. #ifdef __AFXOLE_H__ // only include richole if OLE support is included
  36. #ifndef _RICHOLE_
  37. #include <richole.h>
  38. #define _RICHOLE_
  39. #endif
  40. #else
  41. struct IRichEditOle;
  42. struct IRichEditOleCallback;
  43. #endif
  44. #endif
  45. /////////////////////////////////////////////////////////////////////////////
  46. // AFXCMN - MFC COMCTL32 Control Classes
  47. // Classes declared in this file
  48. //TOOLINFO
  49. class CToolInfo;
  50. //CObject
  51. class CImageList;
  52. //CCmdTarget;
  53. //CWnd
  54. // class CListBox;
  55. class CDragListBox;
  56. class CListCtrl;
  57. class CTreeCtrl;
  58. class CSpinButtonCtrl;
  59. class CHeaderCtrl;
  60. class CSliderCtrl;
  61. class CProgressCtrl;
  62. #if _MFC_VER >= 0x0600
  63. // class CComboBox;
  64. class CComboBoxEx;
  65. #endif
  66. class CHotKeyCtrl;
  67. class CToolTipCtrl;
  68. class CTabCtrl;
  69. class CAnimateCtrl;
  70. class CToolBarCtrl;
  71. class CStatusBarCtrl;
  72. class CRichEditCtrl;
  73. #if _MFC_VER >= 0x0600
  74. class CIPAddressCtrl;
  75. #endif
  76. #undef AFX_DATA
  77. #define AFX_DATA AFX_CORE_DATA
  78. /////////////////////////////////////////////////////////////////////////////
  79. // CToolInfo
  80. #ifdef _UNICODE
  81. class CToolInfo : public tagTOOLINFOW
  82. #else
  83. class CToolInfo : public tagTOOLINFOA
  84. #endif
  85. {
  86. public:
  87. TCHAR szText[256];
  88. };
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CDragListBox
  91. class CDragListBox : public CListBox
  92. {
  93. DECLARE_DYNAMIC(CDragListBox)
  94. // Constructors
  95. public:
  96. CDragListBox();
  97. // Attributes
  98. int ItemFromPt(CPoint pt, BOOL bAutoScroll = TRUE) const;
  99. // Operations
  100. virtual void DrawInsert(int nItem);
  101. // Overridables
  102. virtual BOOL BeginDrag(CPoint pt);
  103. virtual void CancelDrag(CPoint pt);
  104. virtual UINT Dragging(CPoint pt);
  105. virtual void Dropped(int nSrcIndex, CPoint pt);
  106. // Implementation
  107. public:
  108. int m_nLast;
  109. void DrawSingle(int nIndex);
  110. virtual void PreSubclassWindow();
  111. virtual ~CDragListBox();
  112. protected:
  113. virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
  114. };
  115. /////////////////////////////////////////////////////////////////////////////
  116. // CStatusBarCtrl
  117. class CStatusBarCtrl : public CWnd
  118. {
  119. DECLARE_DYNAMIC(CStatusBarCtrl)
  120. // Constructors
  121. public:
  122. CStatusBarCtrl();
  123. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  124. // Attributes
  125. BOOL SetText(LPCTSTR lpszText, int nPane, int nType);
  126. CString GetText(int nPane, int* pType = NULL) const;
  127. int GetText(LPCTSTR lpszText, int nPane, int* pType = NULL) const;
  128. int GetTextLength(int nPane, int* pType = NULL) const;
  129. BOOL SetParts(int nParts, int* pWidths);
  130. int GetParts(int nParts, int* pParts) const;
  131. BOOL GetBorders(int* pBorders) const;
  132. BOOL GetBorders(int& nHorz, int& nVert, int& nSpacing) const;
  133. void SetMinHeight(int nMin);
  134. BOOL SetSimple(BOOL bSimple = TRUE);
  135. BOOL GetRect(int nPane, LPRECT lpRect) const;
  136. #if _MFC_VER >= 0x0600
  137. BOOL IsSimple() const;
  138. CString GetTipText(int nPane) const;
  139. void SetTipText(int nPane, LPCTSTR pszTipText);
  140. COLORREF SetBkColor(COLORREF cr);
  141. BOOL SetIcon(int nPane, HICON hIcon);
  142. #endif
  143. // Overridables
  144. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  145. // Implementation
  146. public:
  147. virtual ~CStatusBarCtrl();
  148. protected:
  149. virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
  150. };
  151. /////////////////////////////////////////////////////////////////////////////
  152. // CListCtrl
  153. class CListCtrl : public CWnd
  154. {
  155. DECLARE_DYNAMIC(CListCtrl)
  156. // Constructors
  157. public:
  158. CListCtrl();
  159. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  160. // Attributes
  161. COLORREF GetBkColor() const;
  162. BOOL SetBkColor(COLORREF cr);
  163. CImageList* GetImageList(int nImageList) const;
  164. CImageList* SetImageList(CImageList* pImageList, int nImageListType);
  165. int GetItemCount() const;
  166. BOOL GetItem(LVITEM* pItem) const;
  167. BOOL SetItem(const LVITEM* pItem);
  168. BOOL SetItem(int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem,
  169. int nImage, UINT nState, UINT nStateMask, LPARAM lParam);
  170. UINT GetCallbackMask() const;
  171. BOOL SetCallbackMask(UINT nMask);
  172. int GetNextItem(int nItem, int nFlags) const;
  173. #if _MFC_VER >= 0x0600
  174. POSITION GetFirstSelectedItemPosition() const;
  175. int GetNextSelectedItem(POSITION& pos) const;
  176. #endif
  177. BOOL GetItemRect(int nItem, LPRECT lpRect, UINT nCode) const;
  178. BOOL SetItemPosition(int nItem, POINT pt);
  179. BOOL GetItemPosition(int nItem, LPPOINT lpPoint) const;
  180. int GetStringWidth(LPCTSTR lpsz) const;
  181. CEdit* GetEditControl() const;
  182. BOOL GetColumn(int nCol, LVCOLUMN* pColumn) const;
  183. BOOL SetColumn(int nCol, const LVCOLUMN* pColumn);
  184. int GetColumnWidth(int nCol) const;
  185. BOOL SetColumnWidth(int nCol, int cx);
  186. BOOL GetViewRect(LPRECT lpRect) const;
  187. COLORREF GetTextColor() const;
  188. BOOL SetTextColor(COLORREF cr);
  189. COLORREF GetTextBkColor() const;
  190. BOOL SetTextBkColor(COLORREF cr);
  191. int GetTopIndex() const;
  192. int GetCountPerPage() const;
  193. BOOL GetOrigin(LPPOINT lpPoint) const;
  194. BOOL SetItemState(int nItem, LVITEM* pItem);
  195. BOOL SetItemState(int nItem, UINT nState, UINT nMask);
  196. UINT GetItemState(int nItem, UINT nMask) const;
  197. CString GetItemText(int nItem, int nSubItem) const;
  198. int GetItemText(int nItem, int nSubItem, LPTSTR lpszText, int nLen) const;
  199. BOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText);
  200. void SetItemCount(int nItems);
  201. BOOL SetItemData(int nItem, DWORD_PTR dwData);
  202. DWORD_PTR GetItemData(int nItem) const;
  203. UINT GetSelectedCount() const;
  204. #if _MFC_VER >= 0x0600
  205. BOOL SetColumnOrderArray(int iCount, LPINT piArray);
  206. BOOL GetColumnOrderArray(LPINT piArray, int iCount = -1);
  207. CSize SetIconSpacing(CSize size);
  208. CSize SetIconSpacing(int cx, int cy);
  209. CHeaderCtrl* GetHeaderCtrl();
  210. HCURSOR GetHotCursor();
  211. HCURSOR SetHotCursor(HCURSOR hc);
  212. BOOL GetSubItemRect(int iItem, int iSubItem, int nArea, CRect& ref);
  213. int GetHotItem();
  214. int SetHotItem(int iIndex);
  215. int GetSelectionMark();
  216. int SetSelectionMark(int iIndex);
  217. DWORD GetExtendedStyle();
  218. DWORD SetExtendedStyle(DWORD dwNewStyle);
  219. int SubItemHitTest(LPLVHITTESTINFO pInfo);
  220. void SetWorkAreas(int nWorkAreas, LPRECT lpRect);
  221. BOOL SetItemCountEx(int iCount, DWORD dwFlags = LVSICF_NOINVALIDATEALL);
  222. CSize ApproximateViewRect(CSize sz = CSize(-1, -1), int iCount = -1) const;
  223. BOOL GetBkImage(LVBKIMAGE* plvbkImage) const;
  224. DWORD GetHoverTime() const;
  225. void GetWorkAreas(int nWorkAreas, LPRECT prc) const;
  226. BOOL SetBkImage(HBITMAP hbm, BOOL fTile = TRUE, int xOffsetPercent = 0, int yOffsetPercent = 0);
  227. BOOL SetBkImage(LPTSTR pszUrl, BOOL fTile = TRUE, int xOffsetPercent = 0, int yOffsetPercent = 0);
  228. BOOL SetBkImage(LVBKIMAGE* plvbkImage);
  229. DWORD SetHoverTime(DWORD dwHoverTime = (DWORD)-1);
  230. UINT GetNumberOfWorkAreas() const;
  231. BOOL GetCheck(int nItem) const;
  232. BOOL SetCheck(int nItem, BOOL fCheck = TRUE);
  233. #endif
  234. // Operations
  235. int InsertItem(const LVITEM* pItem);
  236. int InsertItem(int nItem, LPCTSTR lpszItem);
  237. int InsertItem(int nItem, LPCTSTR lpszItem, int nImage);
  238. BOOL DeleteItem(int nItem);
  239. BOOL DeleteAllItems();
  240. int FindItem(LVFINDINFO* pFindInfo, int nStart = -1) const;
  241. int HitTest(LVHITTESTINFO* pHitTestInfo) const;
  242. int HitTest(CPoint pt, UINT* pFlags = NULL) const;
  243. BOOL EnsureVisible(int nItem, BOOL bPartialOK);
  244. BOOL Scroll(CSize size);
  245. BOOL RedrawItems(int nFirst, int nLast);
  246. BOOL Arrange(UINT nCode);
  247. CEdit* EditLabel(int nItem);
  248. int InsertColumn(int nCol, const LVCOLUMN* pColumn);
  249. int InsertColumn(int nCol, LPCTSTR lpszColumnHeading,
  250. int nFormat = LVCFMT_LEFT, int nWidth = -1, int nSubItem = -1);
  251. BOOL DeleteColumn(int nCol);
  252. CImageList* CreateDragImage(int nItem, LPPOINT lpPoint);
  253. BOOL Update(int nItem);
  254. BOOL SortItems(PFNLVCOMPARE pfnCompare, DWORD_PTR dwData);
  255. // Overridables
  256. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  257. // Implementation
  258. public:
  259. int InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem, UINT nState,
  260. UINT nStateMask, int nImage, LPARAM lParam);
  261. virtual ~CListCtrl();
  262. protected:
  263. void RemoveImageList(int nImageList);
  264. virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
  265. protected:
  266. //{{AFX_MSG(CListCtrl)
  267. afx_msg void OnNcDestroy();
  268. //}}AFX_MSG
  269. DECLARE_MESSAGE_MAP()
  270. };
  271. /////////////////////////////////////////////////////////////////////////////
  272. // CTreeCtrl
  273. class CTreeCtrl : public CWnd
  274. {
  275. DECLARE_DYNAMIC(CTreeCtrl)
  276. // Constructors
  277. public:
  278. CTreeCtrl();
  279. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  280. // Attributes
  281. BOOL GetItemRect(HTREEITEM hItem, LPRECT lpRect, BOOL bTextOnly) const;
  282. UINT GetCount() const;
  283. UINT GetIndent() const;
  284. void SetIndent(UINT nIndent);
  285. CImageList* GetImageList(UINT nImageList) const;
  286. CImageList* SetImageList(CImageList* pImageList, int nImageListType);
  287. HTREEITEM GetNextItem(HTREEITEM hItem, UINT nCode) const;
  288. HTREEITEM GetChildItem(HTREEITEM hItem) const;
  289. HTREEITEM GetNextSiblingItem(HTREEITEM hItem) const;
  290. HTREEITEM GetPrevSiblingItem(HTREEITEM hItem) const;
  291. HTREEITEM GetParentItem(HTREEITEM hItem) const;
  292. HTREEITEM GetFirstVisibleItem() const;
  293. HTREEITEM GetNextVisibleItem(HTREEITEM hItem) const;
  294. HTREEITEM GetPrevVisibleItem(HTREEITEM hItem) const;
  295. HTREEITEM GetSelectedItem() const;
  296. HTREEITEM GetDropHilightItem() const;
  297. HTREEITEM GetRootItem() const;
  298. BOOL GetItem(TVITEM* pItem) const;
  299. CString GetItemText(HTREEITEM hItem) const;
  300. BOOL GetItemImage(HTREEITEM hItem, int& nImage, int& nSelectedImage) const;
  301. UINT GetItemState(HTREEITEM hItem, UINT nStateMask) const;
  302. DWORD_PTR GetItemData(HTREEITEM hItem) const;
  303. BOOL SetItem(TVITEM* pItem);
  304. BOOL SetItem(HTREEITEM hItem, UINT nMask, LPCTSTR lpszItem, int nImage,
  305. int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam);
  306. BOOL SetItemText(HTREEITEM hItem, LPCTSTR lpszItem);
  307. BOOL SetItemImage(HTREEITEM hItem, int nImage, int nSelectedImage);
  308. BOOL SetItemState(HTREEITEM hItem, UINT nState, UINT nStateMask);
  309. BOOL SetItemData(HTREEITEM hItem, DWORD_PTR dwData);
  310. BOOL ItemHasChildren(HTREEITEM hItem) const;
  311. CEdit* GetEditControl() const;
  312. UINT GetVisibleCount() const;
  313. #if _MFC_VER >= 0x0600
  314. CToolTipCtrl* GetToolTips() const;
  315. CToolTipCtrl* SetToolTips(CToolTipCtrl* pWndTip);
  316. COLORREF GetBkColor() const;
  317. COLORREF SetBkColor(COLORREF clr);
  318. SHORT GetItemHeight() const;
  319. SHORT SetItemHeight(SHORT cyHeight);
  320. COLORREF GetTextColor() const;
  321. COLORREF SetTextColor(COLORREF clr);
  322. BOOL SetInsertMark(HTREEITEM hItem, BOOL fAfter = TRUE);
  323. BOOL GetCheck(HTREEITEM hItem) const;
  324. BOOL SetCheck(HTREEITEM hItem, BOOL fCheck = TRUE);
  325. COLORREF GetInsertMarkColor() const;
  326. COLORREF SetInsertMarkColor(COLORREF clrNew);
  327. #endif
  328. // Operations
  329. HTREEITEM InsertItem(LPTVINSERTSTRUCT lpInsertStruct);
  330. HTREEITEM InsertItem(UINT nMask, LPCTSTR lpszItem, int nImage,
  331. int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam,
  332. HTREEITEM hParent, HTREEITEM hInsertAfter);
  333. HTREEITEM InsertItem(LPCTSTR lpszItem, HTREEITEM hParent = TVI_ROOT,
  334. HTREEITEM hInsertAfter = TVI_LAST);
  335. HTREEITEM InsertItem(LPCTSTR lpszItem, int nImage, int nSelectedImage,
  336. HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST);
  337. BOOL DeleteItem(HTREEITEM hItem);
  338. BOOL DeleteAllItems();
  339. BOOL Expand(HTREEITEM hItem, UINT nCode);
  340. BOOL Select(HTREEITEM hItem, UINT nCode);
  341. BOOL SelectItem(HTREEITEM hItem);
  342. BOOL SelectDropTarget(HTREEITEM hItem);
  343. BOOL SelectSetFirstVisible(HTREEITEM hItem);
  344. CEdit* EditLabel(HTREEITEM hItem);
  345. HTREEITEM HitTest(CPoint pt, UINT* pFlags = NULL) const;
  346. HTREEITEM HitTest(TVHITTESTINFO* pHitTestInfo) const;
  347. CImageList* CreateDragImage(HTREEITEM hItem);
  348. BOOL SortChildren(HTREEITEM hItem);
  349. BOOL EnsureVisible(HTREEITEM hItem);
  350. BOOL SortChildrenCB(LPTVSORTCB pSort);
  351. // Implementation
  352. protected:
  353. void RemoveImageList(int nImageList);
  354. public:
  355. virtual ~CTreeCtrl();
  356. //{{AFX_MSG(CTreeCtrl)
  357. afx_msg void OnDestroy();
  358. //}}AFX_MSG
  359. DECLARE_MESSAGE_MAP()
  360. };
  361. /////////////////////////////////////////////////////////////////////////////
  362. // CSpinButtonCtrl
  363. class CSpinButtonCtrl : public CWnd
  364. {
  365. DECLARE_DYNAMIC(CSpinButtonCtrl)
  366. // Constructors
  367. public:
  368. CSpinButtonCtrl();
  369. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  370. // Attributes
  371. BOOL SetAccel(int nAccel, UDACCEL* pAccel);
  372. UINT GetAccel(int nAccel, UDACCEL* pAccel) const;
  373. int SetBase(int nBase);
  374. UINT GetBase() const;
  375. CWnd* SetBuddy(CWnd* pWndBuddy);
  376. CWnd* GetBuddy() const;
  377. int SetPos(int nPos);
  378. int GetPos() const;
  379. void SetRange(int nLower, int nUpper);
  380. #if _MFC_VER >= 0x0600
  381. void SetRange32(int nLower, int nUpper);
  382. #endif
  383. DWORD GetRange() const;
  384. void GetRange(int &lower, int& upper) const;
  385. #if _MFC_VER >= 0x0600
  386. void GetRange32(int &lower, int& upper) const;
  387. #endif
  388. // Implementation
  389. public:
  390. virtual ~CSpinButtonCtrl();
  391. };
  392. /////////////////////////////////////////////////////////////////////////////
  393. // CSliderCtrl
  394. class CSliderCtrl : public CWnd
  395. {
  396. DECLARE_DYNAMIC(CSliderCtrl)
  397. // Constructors
  398. public:
  399. CSliderCtrl();
  400. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  401. // Attributes
  402. int GetLineSize() const;
  403. int SetLineSize(int nSize);
  404. int GetPageSize() const;
  405. int SetPageSize(int nSize);
  406. int GetRangeMax() const;
  407. int GetRangeMin() const;
  408. void GetRange(int& nMin, int& nMax) const;
  409. void SetRangeMin(int nMin, BOOL bRedraw = FALSE);
  410. void SetRangeMax(int nMax, BOOL bRedraw = FALSE);
  411. void SetRange(int nMin, int nMax, BOOL bRedraw = FALSE);
  412. void GetSelection(int& nMin, int& nMax) const;
  413. void SetSelection(int nMin, int nMax);
  414. void GetChannelRect(LPRECT lprc) const;
  415. void GetThumbRect(LPRECT lprc) const;
  416. int GetPos() const;
  417. void SetPos(int nPos);
  418. UINT GetNumTics() const;
  419. DWORD* GetTicArray() const;
  420. int GetTic(int nTic) const;
  421. int GetTicPos(int nTic) const;
  422. BOOL SetTic(int nTic);
  423. void SetTicFreq(int nFreq);
  424. #if _MFC_VER >= 0x0600
  425. CWnd* GetBuddy(BOOL fLocation = TRUE) const;
  426. CWnd* SetBuddy(CWnd* pWndBuddy, BOOL fLocation = TRUE);
  427. CToolTipCtrl* GetToolTips() const;
  428. void SetToolTips(CToolTipCtrl* pWndTip);
  429. int SetTipSide(int nLocation);
  430. #endif
  431. // Operations
  432. void ClearSel(BOOL bRedraw = FALSE);
  433. void VerifyPos();
  434. void ClearTics(BOOL bRedraw = FALSE);
  435. // Implementation
  436. public:
  437. virtual ~CSliderCtrl();
  438. };
  439. /////////////////////////////////////////////////////////////////////////////
  440. // CProgressCtrl
  441. class CProgressCtrl : public CWnd
  442. {
  443. DECLARE_DYNAMIC(CProgressCtrl)
  444. // Constructors
  445. public:
  446. CProgressCtrl();
  447. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  448. // Attributes
  449. #if _MFC_VER >= 0x0600
  450. void SetRange(short nLower, short nUpper);
  451. void SetRange32(int nLower, int nUpper);
  452. void GetRange(int& nLower, int& nUpper);
  453. int GetPos();
  454. #else
  455. void SetRange(int nLower, int nUpper);
  456. #endif
  457. int SetPos(int nPos);
  458. int OffsetPos(int nPos);
  459. int SetStep(int nStep);
  460. // Operations
  461. int StepIt();
  462. // Implementation
  463. public:
  464. virtual ~CProgressCtrl();
  465. };
  466. #if _MFC_VER >= 0x0600
  467. /////////////////////////////////////////////////////////////////////////////
  468. // CComboBoxEx
  469. class CComboBoxEx : public CComboBox
  470. {
  471. DECLARE_DYNAMIC(CComboBoxEx)
  472. // Constructors
  473. public:
  474. CComboBoxEx();
  475. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  476. // Operations
  477. int DeleteItem(int iIndex);
  478. BOOL GetItem(COMBOBOXEXITEM* pCBItem);
  479. int InsertItem(const COMBOBOXEXITEM* pCBItem);
  480. BOOL SetItem(const COMBOBOXEXITEM* pCBItem);
  481. // Attributes
  482. BOOL HasEditChanged();
  483. DWORD GetExtendedStyle() const;
  484. DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles);
  485. CEdit* GetEditCtrl();
  486. CComboBox* GetComboBoxCtrl();
  487. CImageList* GetImageList() const;
  488. CImageList* SetImageList(CImageList* pImageList);
  489. // These functions are supported by the Windows ComboBox control,
  490. // but not supported by the Windows ComboBoxEx control.
  491. int Dir(UINT attr, LPCTSTR lpszWildCard);
  492. int FindString(int nIndexStart, LPCTSTR lpszFind) const;
  493. int AddString(LPCTSTR lpszString);
  494. BOOL SetEditSel(int nStartChar, int nEndChar);
  495. int InsertString(int nIndex, LPCTSTR lpszString);
  496. // Implementation
  497. public:
  498. virtual ~CComboBoxEx();
  499. };
  500. #endif
  501. /////////////////////////////////////////////////////////////////////////////
  502. // CHeaderCtrl
  503. class CHeaderCtrl : public CWnd
  504. {
  505. DECLARE_DYNAMIC(CHeaderCtrl)
  506. // Constructors
  507. public:
  508. CHeaderCtrl();
  509. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  510. // Attributes
  511. int GetItemCount() const;
  512. BOOL GetItem(int nPos, HDITEM* pHeaderItem) const;
  513. BOOL SetItem(int nPos, HDITEM* pHeaderItem);
  514. #if _MFC_VER >= 0x0600
  515. CImageList* GetImageList() const;
  516. CImageList* SetImageList(CImageList* pImageList);
  517. BOOL GetItemRect(int nIndex, LPRECT lpRect) const;
  518. BOOL GetOrderArray(LPINT piArray, int iCount = -1);
  519. BOOL SetOrderArray(int iCount, LPINT piArray);
  520. int OrderToIndex(int nOrder) const;
  521. #endif
  522. // Operations
  523. int InsertItem(int nPos, HDITEM* phdi);
  524. BOOL DeleteItem(int nPos);
  525. BOOL Layout(HDLAYOUT* pHeaderLayout);
  526. #if _MFC_VER >= 0x0600
  527. CImageList* CreateDragImage(int nIndex);
  528. int SetHotDivider(CPoint pt);
  529. int SetHotDivider(int nIndex);
  530. #endif
  531. // Overridables
  532. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  533. // Implementation
  534. public:
  535. virtual ~CHeaderCtrl();
  536. protected:
  537. virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
  538. };
  539. /////////////////////////////////////////////////////////////////////////////
  540. // CHotKeyCtrl
  541. class CHotKeyCtrl : public CWnd
  542. {
  543. DECLARE_DYNAMIC(CHotKeyCtrl)
  544. // Constructors
  545. public:
  546. CHotKeyCtrl();
  547. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  548. // Attributes
  549. void SetHotKey(WORD wVirtualKeyCode, WORD wModifiers);
  550. DWORD GetHotKey() const;
  551. void GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers) const;
  552. // Operations
  553. void SetRules(WORD wInvalidComb, WORD wModifiers);
  554. // Implementation
  555. public:
  556. virtual ~CHotKeyCtrl();
  557. };
  558. /////////////////////////////////////////////////////////////////////////////
  559. // CToolTipCtrl
  560. #define _TTC_ID UINT_PTR
  561. class CToolTipCtrl : public CWnd
  562. {
  563. DECLARE_DYNAMIC(CToolTipCtrl)
  564. // Constructors
  565. public:
  566. CToolTipCtrl();
  567. BOOL Create(CWnd* pParentWnd, DWORD dwStyle = 0);
  568. // Attributes
  569. void GetText(CString& str, CWnd* pWnd, _TTC_ID nIDTool = 0) const;
  570. BOOL GetToolInfo(CToolInfo& ToolInfo, CWnd* pWnd, _TTC_ID nIDTool = 0) const;
  571. void SetToolInfo(LPTOOLINFO lpToolInfo);
  572. void SetToolRect(CWnd* pWnd, _TTC_ID nIDTool, LPCRECT lpRect);
  573. int GetToolCount() const;
  574. #if _MFC_VER >= 0x0600
  575. int GetDelayTime(DWORD dwDuration) const;
  576. void SetDelayTime(DWORD dwDuration, int iTime);
  577. void GetMargin(LPRECT lprc) const;
  578. void SetMargin(LPRECT lprc);
  579. int GetMaxTipWidth() const;
  580. int SetMaxTipWidth(int iWidth);
  581. COLORREF GetTipBkColor() const;
  582. void SetTipBkColor(COLORREF clr);
  583. COLORREF GetTipTextColor() const;
  584. void SetTipTextColor(COLORREF clr);
  585. #endif
  586. // Operations
  587. void Activate(BOOL bActivate);
  588. BOOL AddTool(CWnd* pWnd, UINT nIDText, LPCRECT lpRectTool = NULL,
  589. _TTC_ID nIDTool = 0);
  590. BOOL AddTool(CWnd* pWnd, LPCTSTR lpszText = LPSTR_TEXTCALLBACK,
  591. LPCRECT lpRectTool = NULL, _TTC_ID nIDTool = 0);
  592. void DelTool(CWnd* pWnd, _TTC_ID nIDTool = 0);
  593. BOOL HitTest(CWnd* pWnd, CPoint pt, LPTOOLINFO lpToolInfo) const;
  594. void RelayEvent(LPMSG lpMsg);
  595. void SetDelayTime(UINT nDelay);
  596. void UpdateTipText(LPCTSTR lpszText, CWnd* pWnd, _TTC_ID nIDTool = 0);
  597. void UpdateTipText(UINT nIDText, CWnd* pWnd, _TTC_ID nIDTool = 0);
  598. #if _MFC_VER >= 0x0600
  599. void Update();
  600. void Pop();
  601. #endif
  602. // Implementation
  603. public:
  604. void FillInToolInfo(TOOLINFO& ti, CWnd* pWnd, UINT_PTR nIDTool) const;
  605. virtual ~CToolTipCtrl();
  606. #if _MFC_VER >= 0x0600
  607. #ifndef _AFXDLL
  608. virtual BOOL DestroyToolTipCtrl();
  609. #else
  610. BOOL DestroyToolTipCtrl();
  611. #endif
  612. #else
  613. BOOL DestroyToolTipCtrl();
  614. #endif
  615. protected:
  616. //{{AFX_MSG(CToolTipCtrl)
  617. afx_msg LRESULT OnDisableModal(WPARAM, LPARAM);
  618. afx_msg LRESULT OnWindowFromPoint(WPARAM, LPARAM);
  619. afx_msg LRESULT OnAddTool(WPARAM, LPARAM);
  620. #if _MFC_VER >= 0x0600
  621. afx_msg void OnEnable(BOOL bEnable);
  622. #endif
  623. //}}AFX_MSG
  624. DECLARE_MESSAGE_MAP()
  625. CMapStringToPtr m_mapString;
  626. friend class CWnd;
  627. friend class CToolBar;
  628. };
  629. /////////////////////////////////////////////////////////////////////////////
  630. // CTabCtrl
  631. class CTabCtrl : public CWnd
  632. {
  633. DECLARE_DYNAMIC(CTabCtrl)
  634. // Constructors
  635. public:
  636. CTabCtrl();
  637. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  638. // Attributes
  639. CImageList* GetImageList() const;
  640. CImageList* SetImageList(CImageList* pImageList);
  641. int GetItemCount() const;
  642. BOOL GetItem(int nItem, TCITEM* pTabCtrlItem) const;
  643. BOOL SetItem(int nItem, TCITEM* pTabCtrlItem);
  644. #if _MFC_VER >= 0x0600
  645. BOOL SetItemExtra(int nBytes);
  646. #endif
  647. BOOL GetItemRect(int nItem, LPRECT lpRect) const;
  648. int GetCurSel() const;
  649. int SetCurSel(int nItem);
  650. #if _MFC_VER >= 0x0600
  651. void SetCurFocus(int nItem);
  652. #endif
  653. CSize SetItemSize(CSize size);
  654. void SetPadding(CSize size);
  655. int GetRowCount() const;
  656. #if _MFC_VER >= 0x0600
  657. CToolTipCtrl* GetToolTips() const;
  658. void SetToolTips(CToolTipCtrl* pWndTip);
  659. #else
  660. CToolTipCtrl* GetTooltips() const;
  661. void SetTooltips(CToolTipCtrl* pWndTip);
  662. #endif
  663. int GetCurFocus() const;
  664. #if _MFC_VER >= 0x0600
  665. int SetMinTabWidth(int cx);
  666. DWORD GetExtendedStyle();
  667. DWORD SetExtendedStyle(DWORD dwNewStyle, DWORD dwExMask = 0);
  668. DWORD GetItemState(int nItem, DWORD dwMask) const;
  669. BOOL SetItemState(int nItem, DWORD dwMask, DWORD dwState);
  670. #endif
  671. // Operations
  672. BOOL InsertItem(int nItem, TCITEM* pTabCtrlItem);
  673. #if _MFC_VER >= 0x0600
  674. BOOL InsertItem(int nItem, LPCTSTR lpszItem);
  675. BOOL InsertItem(int nItem, LPCTSTR lpszItem, int nImage);
  676. BOOL InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem,
  677. int nImage, LPARAM lParam);
  678. BOOL InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem,
  679. int nImage, LPARAM lParam, DWORD dwState, DWORD dwStateMask);
  680. #endif
  681. BOOL DeleteItem(int nItem);
  682. BOOL DeleteAllItems();
  683. void AdjustRect(BOOL bLarger, LPRECT lpRect);
  684. void RemoveImage(int nImage);
  685. int HitTest(TCHITTESTINFO* pHitTestInfo) const;
  686. #if _MFC_VER >= 0x0600
  687. void DeselectAll(BOOL fExcludeFocus);
  688. BOOL HighlightItem(int idItem, BOOL fHighlight = TRUE);
  689. #endif
  690. // Overridables
  691. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  692. // Implementation
  693. public:
  694. virtual ~CTabCtrl();
  695. protected:
  696. virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
  697. //{{AFX_MSG(CTabCtrl)
  698. afx_msg void OnDestroy();
  699. //}}AFX_MSG
  700. DECLARE_MESSAGE_MAP()
  701. };
  702. /////////////////////////////////////////////////////////////////////////////
  703. // CAnimateCtrl
  704. class CAnimateCtrl : public CWnd
  705. {
  706. DECLARE_DYNAMIC(CAnimateCtrl)
  707. // Constructors
  708. public:
  709. CAnimateCtrl();
  710. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  711. // Operations
  712. BOOL Open(LPCTSTR lpszFileName);
  713. BOOL Open(UINT nID);
  714. BOOL Play(UINT nFrom, UINT nTo, UINT nRep);
  715. BOOL Stop();
  716. BOOL Close();
  717. BOOL Seek(UINT nTo);
  718. // Implementation
  719. public:
  720. virtual ~CAnimateCtrl();
  721. };
  722. /////////////////////////////////////////////////////////////////////////////
  723. // CImageList
  724. class CImageList : public CObject
  725. {
  726. DECLARE_DYNCREATE(CImageList)
  727. // Constructors
  728. public:
  729. CImageList();
  730. BOOL Create(int cx, int cy, UINT nFlags, int nInitial, int nGrow);
  731. BOOL Create(UINT nBitmapID, int cx, int nGrow, COLORREF crMask);
  732. BOOL Create(LPCTSTR lpszBitmapID, int cx, int nGrow, COLORREF crMask);
  733. BOOL Create(CImageList& imagelist1, int nImage1, CImageList& imagelist2,
  734. int nImage2, int dx, int dy);
  735. #if _MFC_VER >= 0x0600
  736. BOOL Create(CImageList* pImageList);
  737. #endif
  738. // Attributes
  739. HIMAGELIST m_hImageList; // must be first data member
  740. operator HIMAGELIST() const;
  741. HIMAGELIST GetSafeHandle() const;
  742. static CImageList* PASCAL FromHandle(HIMAGELIST hImageList);
  743. static CImageList* PASCAL FromHandlePermanent(HIMAGELIST hImageList);
  744. static void PASCAL DeleteTempMap();
  745. BOOL Attach(HIMAGELIST hImageList);
  746. HIMAGELIST Detach();
  747. int GetImageCount() const;
  748. COLORREF SetBkColor(COLORREF cr);
  749. COLORREF GetBkColor() const;
  750. BOOL GetImageInfo(int nImage, IMAGEINFO* pImageInfo) const;
  751. // Operations
  752. BOOL DeleteImageList();
  753. #if _MFC_VER >= 0x0600
  754. BOOL SetImageCount(UINT uNewCount);
  755. #endif
  756. int Add(CBitmap* pbmImage, CBitmap* pbmMask);
  757. int Add(CBitmap* pbmImage, COLORREF crMask);
  758. BOOL Remove(int nImage);
  759. BOOL Replace(int nImage, CBitmap* pbmImage, CBitmap* pbmMask);
  760. int Add(HICON hIcon);
  761. int Replace(int nImage, HICON hIcon);
  762. HICON ExtractIcon(int nImage);
  763. BOOL Draw(CDC* pDC, int nImage, POINT pt, UINT nStyle);
  764. BOOL SetOverlayImage(int nImage, int nOverlay);
  765. #if _MFC_VER >= 0x0600
  766. BOOL Copy(int iDst, int iSrc, UINT uFlags = ILCF_MOVE);
  767. BOOL Copy(int iDst, CImageList* pSrc, int iSrc, UINT uFlags = ILCF_MOVE);
  768. BOOL DrawIndirect(IMAGELISTDRAWPARAMS* pimldp);
  769. BOOL DrawIndirect(CDC* pDC, int nImage, POINT pt, SIZE sz, POINT ptOrigin,
  770. UINT fStyle = ILD_NORMAL, DWORD dwRop = SRCCOPY,
  771. COLORREF rgbBack = CLR_DEFAULT, COLORREF rgbFore = CLR_DEFAULT);
  772. #endif
  773. #ifndef _AFX_NO_OLE_SUPPORT
  774. BOOL Read(CArchive* pArchive);
  775. BOOL Write(CArchive* pArchive);
  776. #endif
  777. // Drag APIs
  778. BOOL BeginDrag(int nImage, CPoint ptHotSpot);
  779. static void PASCAL EndDrag();
  780. static BOOL PASCAL DragMove(CPoint pt);
  781. BOOL SetDragCursorImage(int nDrag, CPoint ptHotSpot);
  782. static BOOL PASCAL DragShowNolock(BOOL bShow);
  783. static CImageList* PASCAL GetDragImage(LPPOINT lpPoint, LPPOINT lpPointHotSpot);
  784. static BOOL PASCAL DragEnter(CWnd* pWndLock, CPoint point);
  785. static BOOL PASCAL DragLeave(CWnd* pWndLock);
  786. // Implementation
  787. public:
  788. virtual ~CImageList();
  789. #ifdef _DEBUG
  790. virtual void Dump(CDumpContext& dc) const;
  791. virtual void AssertValid() const;
  792. #endif
  793. };
  794. /////////////////////////////////////////////////////////////////////////////
  795. // CToolBarCtrl
  796. struct IDropTarget; // forward declaration
  797. class CToolBarCtrl : public CWnd
  798. {
  799. DECLARE_DYNAMIC(CToolBarCtrl)
  800. // Construction
  801. public:
  802. CToolBarCtrl();
  803. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  804. // Attributes
  805. public:
  806. BOOL IsButtonEnabled(int nID) const;
  807. BOOL IsButtonChecked(int nID) const;
  808. BOOL IsButtonPressed(int nID) const;
  809. BOOL IsButtonHidden(int nID) const;
  810. BOOL IsButtonIndeterminate(int nID) const;
  811. BOOL SetState(int nID, UINT nState);
  812. int GetState(int nID) const;
  813. BOOL GetButton(int nIndex, LPTBBUTTON lpButton) const;
  814. int GetButtonCount() const;
  815. BOOL GetItemRect(int nIndex, LPRECT lpRect) const;
  816. #if _MFC_VER >= 0x0600
  817. BOOL GetRect(int nID, LPRECT lpRect) const;
  818. #endif
  819. void SetButtonStructSize(int nSize);
  820. #if _MFC_VER >= 0x0600
  821. DWORD GetButtonSize() const;
  822. #endif
  823. BOOL SetButtonSize(CSize size);
  824. BOOL SetBitmapSize(CSize size);
  825. CToolTipCtrl* GetToolTips() const;
  826. void SetToolTips(CToolTipCtrl* pTip);
  827. void SetOwner(CWnd* pWnd);
  828. void SetRows(int nRows, BOOL bLarger, LPRECT lpRect);
  829. int GetRows() const;
  830. BOOL SetCmdID(int nIndex, UINT nID);
  831. UINT GetBitmapFlags() const;
  832. #if _MFC_VER >= 0x0600
  833. CImageList* GetDisabledImageList() const;
  834. CImageList* GetHotImageList() const;
  835. CImageList* GetImageList() const;
  836. DWORD GetStyle() const;
  837. int GetMaxTextRows() const;
  838. BOOL IsButtonHighlighted(int nID) const;
  839. BOOL SetButtonWidth(int cxMin, int cxMax);
  840. CImageList* SetDisabledImageList(CImageList* pImageList);
  841. CImageList* SetHotImageList(CImageList* pImageList);
  842. CImageList* SetImageList(CImageList* pImageList);
  843. HRESULT GetDropTarget(IDropTarget** ppDropTarget) const;
  844. BOOL SetIndent(int iIndent);
  845. BOOL SetMaxTextRows(int iMaxRows);
  846. void SetStyle(DWORD dwStyle);
  847. BOOL GetButtonInfo(int nID, TBBUTTONINFO* ptbbi) const;
  848. BOOL SetButtonInfo(int nID, TBBUTTONINFO* ptbbi);
  849. DWORD SetDrawTextFlags(DWORD dwMask, DWORD dwDTFlags);
  850. BOOL GetAnchorHighlight() const;
  851. BOOL SetAnchorHighlight(BOOL fAnchor = TRUE);
  852. int GetHotItem() const;
  853. int SetHotItem(int nHot);
  854. void GetInsertMark(TBINSERTMARK* ptbim) const;
  855. void SetInsertMark(TBINSERTMARK* ptbim);
  856. BOOL GetMaxSize(LPSIZE pSize) const;
  857. BOOL InsertMarkHitTest(LPPOINT ppt, LPTBINSERTMARK ptbim) const;
  858. DWORD GetExtendedStyle() const;
  859. DWORD SetExtendedStyle(DWORD dwExStyle);
  860. COLORREF GetInsertMarkColor() const;
  861. COLORREF SetInsertMarkColor(COLORREF clrNew);
  862. #endif
  863. // Operations
  864. public:
  865. BOOL EnableButton(int nID, BOOL bEnable = TRUE);
  866. BOOL CheckButton(int nID, BOOL bCheck = TRUE);
  867. BOOL PressButton(int nID, BOOL bPress = TRUE);
  868. BOOL HideButton(int nID, BOOL bHide = TRUE);
  869. BOOL Indeterminate(int nID, BOOL bIndeterminate = TRUE);
  870. int AddBitmap(int nNumButtons, UINT nBitmapID);
  871. int AddBitmap(int nNumButtons, CBitmap* pBitmap);
  872. BOOL AddButtons(int nNumButtons, LPTBBUTTON lpButtons);
  873. BOOL InsertButton(int nIndex, LPTBBUTTON lpButton);
  874. BOOL DeleteButton(int nIndex);
  875. UINT CommandToIndex(UINT nID) const;
  876. void SaveState(HKEY hKeyRoot, LPCTSTR lpszSubKey,
  877. LPCTSTR lpszValueName);
  878. void RestoreState(HKEY hKeyRoot, LPCTSTR lpszSubKey,
  879. LPCTSTR lpszValueName);
  880. #if _MFC_VER >= 0x0600
  881. void LoadImages(int iBitmapID, HINSTANCE hinst);
  882. BOOL MapAccelerator(TCHAR chAccel, UINT* pIDBtn);
  883. BOOL MarkButton(int nID, BOOL fHighlight = TRUE);
  884. BOOL MoveButton(UINT nOldPos, UINT nNewPos);
  885. int HitTest(LPPOINT ppt) const;
  886. #endif
  887. void Customize();
  888. int AddString(UINT nStringID);
  889. int AddStrings(LPCTSTR lpszStrings);
  890. void AutoSize();
  891. // Implementation
  892. public:
  893. virtual ~CToolBarCtrl();
  894. protected:
  895. //{{AFX_MSG(CToolBarCtrl)
  896. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  897. //}}AFX_MSG
  898. DECLARE_MESSAGE_MAP()
  899. };
  900. #if _MFC_VER >= 0x0600
  901. class CReBarCtrl : public CWnd
  902. {
  903. DECLARE_DYNAMIC(CReBarCtrl)
  904. // Construction
  905. public:
  906. CReBarCtrl();
  907. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  908. // Attributes
  909. public:
  910. UINT GetBandCount() const;
  911. BOOL GetBandInfo(UINT uBand, REBARBANDINFO* prbbi) const;
  912. UINT GetBarHeight() const;
  913. BOOL GetBarInfo(REBARINFO* prbi) const;
  914. COLORREF GetBkColor() const;
  915. IDropTarget* GetDropTarget() const;
  916. BOOL GetRect(UINT uBand, LPRECT prc) const;
  917. UINT GetRowCount() const;
  918. UINT GetRowHeight(UINT uRow) const;
  919. COLORREF GetTextColor() const;
  920. CToolTipCtrl* GetToolTips() const;
  921. int IDToIndex(UINT uBandID) const;
  922. BOOL SetBandInfo(UINT uBand, REBARBANDINFO* prbbi);
  923. BOOL SetBarInfo(REBARINFO* prbi);
  924. COLORREF SetBkColor(COLORREF clr);
  925. CWnd* SetOwner(CWnd* pWnd);
  926. COLORREF SetTextColor(COLORREF clr);
  927. void SetToolTips(CToolTipCtrl* pToolTip);
  928. CImageList* GetImageList() const;
  929. BOOL SetImageList(CImageList* pImageList);
  930. void GetBandBorders(UINT uBand, LPRECT prc) const;
  931. CPalette* GetPalette() const;
  932. CPalette* SetPalette(HPALETTE hPal);
  933. BOOL GetColorScheme(COLORSCHEME* lpcs);
  934. void SetColorScheme(const COLORSCHEME* lpcs);
  935. // Operations
  936. public:
  937. void BeginDrag(UINT uBand, DWORD dwPos = (DWORD)-1);
  938. BOOL DeleteBand(UINT uBand);
  939. void DragMove(DWORD dwPos = (DWORD)-1);
  940. void EndDrag();
  941. int HitTest(RBHITTESTINFO* prbht);
  942. BOOL InsertBand(UINT uIndex, REBARBANDINFO* prbbi);
  943. void MaximizeBand(UINT uBand);
  944. void MinimizeBand(UINT uBand);
  945. BOOL ShowBand(UINT uBand, BOOL fShow = TRUE);
  946. BOOL SizeToRect(CRect& rect);
  947. BOOL MoveBand(UINT uFrom, UINT uTo);
  948. };
  949. #endif
  950. #ifndef _AFX_NO_RICHEDIT_SUPPORT
  951. /////////////////////////////////////////////////////////////////////////////
  952. // CRichEditCtrl
  953. class CRichEditCtrl : public CWnd
  954. {
  955. DECLARE_DYNAMIC(CRichEditCtrl)
  956. // Constructors
  957. public:
  958. CRichEditCtrl();
  959. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  960. // Attributes
  961. BOOL CanUndo() const;
  962. int GetLineCount() const;
  963. BOOL GetModify() const;
  964. void SetModify(BOOL bModified = TRUE);
  965. void GetRect(LPRECT lpRect) const;
  966. CPoint GetCharPos(long lChar) const;
  967. void SetOptions(WORD wOp, DWORD dwFlags);
  968. // NOTE: first word in lpszBuffer must contain the size of the buffer!
  969. int GetLine(int nIndex, LPTSTR lpszBuffer) const;
  970. int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const;
  971. BOOL CanPaste(UINT nFormat = 0) const;
  972. void GetSel(long& nStartChar, long& nEndChar) const;
  973. void GetSel(CHARRANGE &cr) const;
  974. void LimitText(long nChars = 0);
  975. long LineFromChar(long nIndex) const;
  976. void SetSel(long nStartChar, long nEndChar);
  977. void SetSel(CHARRANGE &cr);
  978. DWORD GetDefaultCharFormat(CHARFORMAT &cf) const;
  979. DWORD GetSelectionCharFormat(CHARFORMAT &cf) const;
  980. long GetEventMask() const;
  981. long GetLimitText() const;
  982. DWORD GetParaFormat(PARAFORMAT &pf) const;
  983. // richedit EM_GETSELTEXT is ANSI
  984. long GetSelText(LPSTR lpBuf) const;
  985. CString GetSelText() const;
  986. WORD GetSelectionType() const;
  987. COLORREF SetBackgroundColor(BOOL bSysColor, COLORREF cr);
  988. BOOL SetDefaultCharFormat(CHARFORMAT &cf);
  989. BOOL SetSelectionCharFormat(CHARFORMAT &cf);
  990. BOOL SetWordCharFormat(CHARFORMAT &cf);
  991. DWORD SetEventMask(DWORD dwEventMask);
  992. BOOL SetParaFormat(PARAFORMAT &pf);
  993. BOOL SetTargetDevice(HDC hDC, long lLineWidth);
  994. BOOL SetTargetDevice(CDC &dc, long lLineWidth);
  995. long GetTextLength() const;
  996. BOOL SetReadOnly(BOOL bReadOnly = TRUE);
  997. int GetFirstVisibleLine() const;
  998. // Operations
  999. void EmptyUndoBuffer();
  1000. int LineIndex(int nLine = -1) const;
  1001. int LineLength(int nLine = -1) const;
  1002. void LineScroll(int nLines, int nChars = 0);
  1003. void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE);
  1004. void SetRect(LPCRECT lpRect);
  1005. BOOL DisplayBand(LPRECT pDisplayRect);
  1006. long FindText(DWORD dwFlags, FINDTEXTEX* pFindText) const;
  1007. long FormatRange(FORMATRANGE* pfr, BOOL bDisplay = TRUE);
  1008. void HideSelection(BOOL bHide, BOOL bPerm);
  1009. void PasteSpecial(UINT nClipFormat, DWORD dvAspect = 0, HMETAFILE hMF = 0);
  1010. void RequestResize();
  1011. long StreamIn(int nFormat, EDITSTREAM &es);
  1012. long StreamOut(int nFormat, EDITSTREAM &es);
  1013. // Clipboard operations
  1014. BOOL Undo();
  1015. void Clear();
  1016. void Copy();
  1017. void Cut();
  1018. void Paste();
  1019. // OLE support
  1020. IRichEditOle* GetIRichEditOle() const;
  1021. BOOL SetOLECallback(IRichEditOleCallback* pCallback);
  1022. // Implementation
  1023. public:
  1024. virtual ~CRichEditCtrl();
  1025. };
  1026. #endif //!_AFX_NO_RICHEDIT_SUPPORT
  1027. #if _MFC_VER >= 0x0600
  1028. /////////////////////////////////////////////////////////////////////////////
  1029. // CIPAddressCtrl
  1030. class CIPAddressCtrl : public CWnd
  1031. {
  1032. DECLARE_DYNAMIC(CIPAddressCtrl)
  1033. // Constructors
  1034. CIPAddressCtrl();
  1035. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  1036. // Attributes
  1037. BOOL IsBlank() const;
  1038. void ClearAddress();
  1039. int GetAddress(BYTE& nField0, BYTE& nField1, BYTE& nField2, BYTE& nField3);
  1040. int GetAddress(DWORD& dwAddress);
  1041. void SetAddress(DWORD dwAddress); //TODO: return value?
  1042. void SetAddress(BYTE nField0, BYTE nField1, BYTE nField2, BYTE nField3); //TODO: return value?
  1043. void SetFieldFocus(WORD nField); //TODO: return value?
  1044. void SetFieldRange(int nField, BYTE nLower, BYTE nUpper); //TODO: return value?
  1045. // Implementation
  1046. public:
  1047. virtual ~CIPAddressCtrl();
  1048. };
  1049. #endif
  1050. /////////////////////////////////////////////////////////////////////////////
  1051. // Inline function declarations
  1052. #ifdef _AFX_PACKING
  1053. #pragma pack(pop)
  1054. #endif
  1055. #ifdef _AFX_ENABLE_INLINES
  1056. #define _AFXCMN_INLINE AFX_INLINE
  1057. #include <afxcmn.inl>
  1058. #if _MFC_VER >= 0x0600
  1059. #include <afxcmn2.inl>
  1060. #endif
  1061. #undef _AFXCMN_INLINE
  1062. #endif
  1063. #undef AFX_DATA
  1064. #define AFX_DATA
  1065. #ifdef _AFX_MINREBUILD
  1066. #pragma component(minrebuild, on)
  1067. #endif
  1068. #ifndef _AFX_FULLTYPEINFO
  1069. #pragma component(mintypeinfo, off)
  1070. #endif
  1071. #endif //__AFXCMN_H__
  1072. /////////////////////////////////////////////////////////////////////////////