afxcmn.h 35 KB

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