Source code of Windows XP (NT5)
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.

356 lines
7.3 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. dlgctrl.h
  5. Abstract:
  6. This module contains predefines and prototypes for the dialog box control
  7. for the commoon UI
  8. Author:
  9. 28-Aug-1995 Mon 12:14:51 created -by- Daniel Chou (danielc)
  10. [Environment:]
  11. NT Windows - Common Printer Driver UI DLL.
  12. [Notes:]
  13. Revision History:
  14. --*/
  15. #define CTRLS_FIRST 0x80
  16. #define CTRLS_RADIO 0x80
  17. #define CTRLS_UDARROW 0x81
  18. #define CTRLS_UDARROW_EDIT 0x82
  19. #define CTRLS_TRACKBAR 0x83
  20. #define CTRLS_HSCROLL 0x84
  21. #define CTRLS_VSCROLL 0x85
  22. #define CTRLS_LISTBOX 0x86
  23. #define CTRLS_COMBOBOX 0x87
  24. #define CTRLS_EDITBOX 0x88
  25. #define CTRLS_PUSHBUTTON 0x89
  26. #define CTRLS_CHKBOX 0x8a
  27. #define CTRLS_EXTCHKBOX 0x8b
  28. #define CTRLS_EXTPUSH 0x8c
  29. #define CTRLS_TV_WND 0x8d
  30. #define CTRLS_TV_STATIC 0x8e
  31. #define CTRLS_PROPPAGE_STATIC 0x8f
  32. #define CTRLS_PROPPAGE_ICON 0x90
  33. #define CTRLS_ECBICON 0x91
  34. #define CTRLS_NOINPUT 0x92
  35. #define CTRLS_LAST 0x92
  36. #define INITCF_ENABLE 0x0001
  37. #define INITCF_INIT 0x0002
  38. #define INITCF_SETCTRLDATA 0x0004
  39. #define INITCF_ADDSELPOSTFIX 0x0008
  40. #define INITCF_ICON_NOTIFY 0x0010
  41. #define INITCF_HAS_EXT 0x0020
  42. #define INITCF_TVDLG 0x0040
  43. #define CTRLDATA_ITEMIDX_ADD 11
  44. #define SETCTRLDATA(hCtrl, CtrlStyle, CtrlData) \
  45. { \
  46. SetWindowLongPtr((hCtrl), \
  47. GWLP_USERDATA, \
  48. (LPARAM)MAKELONG(MAKEWORD((CtrlData),(CtrlStyle)), \
  49. (InitItemIdx+CTRLDATA_ITEMIDX_ADD))); \
  50. }
  51. #define HCTRL_SETCTRLDATA(hCtrl, CtrlStyle, CtrlData) \
  52. { \
  53. if ((hCtrl) && (InitFlags & INITCF_SETCTRLDATA)) { \
  54. \
  55. SETCTRLDATA(hCtrl, CtrlStyle, CtrlData); \
  56. } \
  57. }
  58. #define GETCTRLITEMIDX(dw) (HIWORD(dw)-CTRLDATA_ITEMIDX_ADD)
  59. #define GETCTRLDATA(dw,i,s,d) (i)=GETCTRLITEMIDX(dw); \
  60. (d)=LOBYTE(LOWORD(dw));(s)=HIBYTE(LOWORD(dw))
  61. #define REAL_ECB_CHECKED(pItem, pECB) \
  62. (BOOL)(((pECB) = (pItem)->pExtChkBox) && \
  63. (((pItem)->Flags & (OPTIF_EXT_HIDE | OPTIF_EXT_IS_EXTPUSH | \
  64. OPTIF_ECB_CHECKED)) == OPTIF_ECB_CHECKED))
  65. #define INIT_EXTENDED(pTVWnd,hDlg,pItem,ecbID,epID,IconID,Idx,InitFlags) \
  66. ((pItem->Flags & OPTIF_EXT_IS_EXTPUSH) ? \
  67. InitExtPush(pTVWnd,hDlg,pItem,ecbID,epID,IconID,Idx,InitFlags) : \
  68. InitExtChkBox(pTVWnd,hDlg,pItem,ecbID,epID,IconID,Idx,InitFlags))
  69. typedef struct _DLGIDINFO {
  70. HWND hDlg;
  71. DWORD CurID;
  72. } DLGIDINFO, *PDLGIDINFO;
  73. //
  74. // Prototypes
  75. //
  76. VOID
  77. SetUniqChildID(
  78. HWND hDlg
  79. );
  80. BOOL
  81. hCtrlrcWnd(
  82. HWND hDlg,
  83. HWND hCtrl,
  84. RECT *prc
  85. );
  86. HWND
  87. CtrlIDrcWnd(
  88. HWND hDlg,
  89. UINT CtrlID,
  90. RECT *prc
  91. );
  92. BOOL
  93. ChkEditKEYDOWN(
  94. HWND hWnd,
  95. WPARAM VKey
  96. );
  97. BOOL
  98. ChkhWndEdit0KEYDOWN(
  99. HWND hWnd,
  100. WPARAM VKey
  101. );
  102. DWORD
  103. ReCreateLBCB(
  104. HWND hDlg,
  105. UINT CtrlID,
  106. BOOL IsLB
  107. );
  108. HWND
  109. CreateTrackBar(
  110. HWND hDlg,
  111. UINT TrackBarID
  112. );
  113. HWND
  114. CreateUDArrow(
  115. HWND hDlg,
  116. UINT EditBoxID,
  117. UINT UDArrowID,
  118. LONG RangeL,
  119. LONG RangeH,
  120. LONG Pos
  121. );
  122. BOOL
  123. SetDlgPageItemName(
  124. HWND hDlg,
  125. PTVWND pTVWnd,
  126. POPTITEM pItem,
  127. UINT InitFlags,
  128. UINT UDArrowHelpID
  129. );
  130. BOOL
  131. InitExtPush(
  132. PTVWND pTVWnd,
  133. HWND hDlg,
  134. POPTITEM pItem,
  135. UINT ExtChkBoxID,
  136. UINT ExtPushID,
  137. UINT ExtIconID,
  138. WORD InitItemIdx,
  139. WORD InitFlags
  140. );
  141. BOOL
  142. InitExtChkBox(
  143. PTVWND pTVWnd,
  144. HWND hDlg,
  145. POPTITEM pItem,
  146. UINT ExtChkBoxID,
  147. UINT ExtPushID,
  148. UINT ExtIconID,
  149. WORD InitItemIdx,
  150. WORD InitFlags
  151. );
  152. UINT
  153. InitStates(
  154. PTVWND pTVWnd,
  155. HWND hDlg,
  156. POPTITEM pItem,
  157. POPTTYPE pOptType,
  158. UINT IDState1,
  159. WORD InitItemIdx,
  160. LONG NewSel,
  161. WORD InitFlags
  162. );
  163. LONG
  164. InitUDArrow(
  165. PTVWND pTVWnd,
  166. HWND hDlg,
  167. POPTITEM pItem,
  168. POPTPARAM pOptParam,
  169. UINT UDArrowID,
  170. UINT EditBoxID,
  171. UINT PostfixID,
  172. UINT HelpID,
  173. WORD InitItemIdx,
  174. LONG NewPos,
  175. WORD InitFlags
  176. );
  177. VOID
  178. InitTBSB(
  179. PTVWND pTVWnd,
  180. HWND hDlg,
  181. POPTITEM pItem,
  182. HWND hTBSB,
  183. POPTTYPE pOptType,
  184. UINT PostfixID,
  185. UINT RangeLID,
  186. UINT RangeHID,
  187. WORD InitItemIdx,
  188. LONG NewPos,
  189. WORD InitFlags
  190. );
  191. VOID
  192. InitLBCB(
  193. PTVWND pTVWnd,
  194. HWND hDlg,
  195. POPTITEM pItem,
  196. UINT idLBCB,
  197. UINT SetCurSelID,
  198. POPTTYPE pOptType,
  199. WORD InitItemIdx,
  200. LONG NewSel,
  201. WORD InitFlags,
  202. UINT cyLBCBMax
  203. );
  204. VOID
  205. InitEditBox(
  206. PTVWND pTVWnd,
  207. HWND hDlg,
  208. POPTITEM pItem,
  209. POPTPARAM pOptParam,
  210. UINT EditBoxID,
  211. UINT PostfixID,
  212. UINT HelpID,
  213. WORD InitItemIdx,
  214. LPTSTR pCurText,
  215. WORD InitFlags
  216. );
  217. VOID
  218. InitPushButton(
  219. PTVWND pTVWnd,
  220. HWND hDlg,
  221. POPTITEM pItem,
  222. WORD PushID,
  223. WORD InitItemIdx,
  224. WORD InitFlags
  225. );
  226. VOID
  227. InitChkBox(
  228. PTVWND pTVWnd,
  229. HWND hDlg,
  230. POPTITEM pItem,
  231. UINT ChkBoxID,
  232. LPTSTR pTitle,
  233. WORD InitItemIdx,
  234. BOOL Checked,
  235. WORD InitFlags
  236. );
  237. LONG
  238. DoCallBack(
  239. HWND hDlg,
  240. PTVWND pTVWnd,
  241. POPTITEM pItem,
  242. LPVOID pOldSel,
  243. _CPSUICALLBACK pfnCallBack,
  244. HANDLE hDlgTemplate,
  245. WORD DlgTemplateID,
  246. WORD Reason
  247. );
  248. POPTITEM
  249. pItemFromhWnd(
  250. HWND hDlg,
  251. PTVWND pTVWnd,
  252. HWND hCtrl,
  253. LONG MousePos
  254. );
  255. VOID
  256. DoContextMenu(
  257. PTVWND pTVWnd,
  258. HWND hDlg,
  259. POPTITEM pItem,
  260. LPARAM Pos
  261. );
  262. UINT
  263. UpdateInternalDMPUB(
  264. HWND hDlg,
  265. PTVWND pTVWnd,
  266. POPTITEM pItem
  267. );
  268. VOID
  269. UpdateOptTypeIcon16(
  270. POPTTYPE pOptType
  271. );
  272. BOOL
  273. DrawLBCBItem(
  274. PTVWND pTVWnd,
  275. LPDRAWITEMSTRUCT pdis
  276. );
  277. POPTITEM
  278. DlgHScrollCommand(
  279. HWND hDlg,
  280. PTVWND pTVWnd,
  281. HWND hCtrl,
  282. WPARAM wParam
  283. );
  284. LONG
  285. UpdateCallBackChanges(
  286. HWND hDlg,
  287. PTVWND pTVWnd,
  288. BOOL ReInit
  289. );
  290. BOOL
  291. DoAbout(
  292. HWND hDlg,
  293. PTVWND pTVWnd,
  294. POPTITEM pItemRoot
  295. );