checkbox.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. //*****************************************************************************
  2. //
  3. // checkbox.h - Prototypes for the check box widget.
  4. //
  5. // Copyright (c) 2008-2010 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 6288 of the Stellaris Graphics Library.
  22. //
  23. //*****************************************************************************
  24. #ifndef __CHECKBOX_H__
  25. #define __CHECKBOX_H__
  26. //*****************************************************************************
  27. //
  28. //! \addtogroup checkbox_api
  29. //! @{
  30. //
  31. //*****************************************************************************
  32. //*****************************************************************************
  33. //
  34. // If building with a C++ compiler, make all of the definitions in this header
  35. // have a C binding.
  36. //
  37. //*****************************************************************************
  38. #ifdef __cplusplus
  39. extern "C"
  40. {
  41. #endif
  42. //*****************************************************************************
  43. //
  44. //! The structure that describes a check box widget.
  45. //
  46. //*****************************************************************************
  47. typedef struct
  48. {
  49. //
  50. //! The generic widget information.
  51. //
  52. tWidget sBase;
  53. //
  54. //! The style for this check box. This is a set of flags defined by
  55. //! CB_STYLE_xxx.
  56. //
  57. unsigned short usStyle;
  58. //
  59. //! The size of the check box itself, not including the text and/or image
  60. //! that accompanies it (in other words, the size of the actual box that is
  61. //! checked or unchecked).
  62. //
  63. unsigned short usBoxSize;
  64. //
  65. //! The 24-bit RGB color used to fill this check box, if CB_STYLE_FILL is
  66. //! selected, and to use as the background color if CB_STYLE_TEXT_OPAQUE is
  67. //! selected.
  68. //
  69. unsigned int ulFillColor;
  70. //
  71. //! The 24-bit RGB color used to outline this check box, if
  72. //! CB_STYLE_OUTLINE is selected.
  73. //
  74. unsigned int ulOutlineColor;
  75. //
  76. //! The 24-bit RGB color used to draw text on this check box, if
  77. //! CB_STYLE_TEXT is selected.
  78. //
  79. unsigned int ulTextColor;
  80. //
  81. //! The font used to draw the check box text, if CB_STYLE_TEXT is selected.
  82. //
  83. const tFont *pFont;
  84. //
  85. //! A pointer to the text to draw on this check box, if CB_STYLE_TEXT is
  86. //! selected.
  87. //
  88. const char *pcText;
  89. //
  90. //! A pointer to the image to be drawn onto this check box, if CB_STYLE_IMG
  91. //! is selected.
  92. //
  93. const unsigned char *pucImage;
  94. //
  95. //! A pointer to the function to be called when the check box is pressed.
  96. //! This function is called when the state of the check box is changed.
  97. //
  98. void (*pfnOnChange)(tWidget *pWidget, unsigned int bSelected);
  99. }
  100. tCheckBoxWidget;
  101. //*****************************************************************************
  102. //
  103. //! This flag indicates that the check box should be outlined.
  104. //
  105. //*****************************************************************************
  106. #define CB_STYLE_OUTLINE 0x0001
  107. //*****************************************************************************
  108. //
  109. //! This flag indicates that the check box should be filled.
  110. //
  111. //*****************************************************************************
  112. #define CB_STYLE_FILL 0x0002
  113. //*****************************************************************************
  114. //
  115. //! This flag indicates that the check box should have text drawn on it.
  116. //
  117. //*****************************************************************************
  118. #define CB_STYLE_TEXT 0x0004
  119. //*****************************************************************************
  120. //
  121. //! This flag indicates that the check box should have an image drawn on it.
  122. //
  123. //*****************************************************************************
  124. #define CB_STYLE_IMG 0x0008
  125. //*****************************************************************************
  126. //
  127. //! This flag indicates that the check box text should be drawn opaque (in
  128. //! other words, drawing the background pixels as well as the foreground
  129. //! pixels).
  130. //
  131. //*****************************************************************************
  132. #define CB_STYLE_TEXT_OPAQUE 0x0010
  133. //*****************************************************************************
  134. //
  135. //! This flag indicates that the check box is selected.
  136. //
  137. //*****************************************************************************
  138. #define CB_STYLE_SELECTED 0x0020
  139. //*****************************************************************************
  140. //
  141. //! Declares an initialized check box widget data structure.
  142. //!
  143. //! \param pParent is a pointer to the parent widget.
  144. //! \param pNext is a pointer to the sibling widget.
  145. //! \param pChild is a pointer to the first child widget.
  146. //! \param pDisplay is a pointer to the display on which to draw the check box.
  147. //! \param lX is the X coordinate of the upper left corner of the check box.
  148. //! \param lY is the Y coordinate of the upper left corner of the check box.
  149. //! \param lWidth is the width of the check box.
  150. //! \param lHeight is the height of the check box.
  151. //! \param usStyle is the style to be applied to this check box.
  152. //! \param usBoxSize is the size of the box that is checked.
  153. //! \param ulFillColor is the color used to fill in the check box.
  154. //! \param ulOutlineColor is the color used to outline the check box.
  155. //! \param ulTextColor is the color used to draw text on the check box.
  156. //! \param pFont is a pointer to the font to be used to draw text on the check
  157. //! box.
  158. //! \param pcText is a pointer to the text to draw on this check box.
  159. //! \param pucImage is a pointer to the image to draw on this check box.
  160. //! \param pfnOnChange is a pointer to the function that is called when the
  161. //! check box is pressed.
  162. //!
  163. //! This macro provides an initialized check box widget data structure, which
  164. //! can be used to construct the widget tree at compile time in global
  165. //! variables (as opposed to run-time via function calls). This must be
  166. //! assigned to a variable, such as:
  167. //!
  168. //! \verbatim
  169. //! tCheckBoxWidget g_sCheckBox = CheckBoxStruct(...);
  170. //! \endverbatim
  171. //!
  172. //! Or, in an array of variables:
  173. //!
  174. //! \verbatim
  175. //! tCheckBoxWidget g_psCheckBoxes[] =
  176. //! {
  177. //! CheckBoxStruct(...),
  178. //! CheckBoxStruct(...)
  179. //! };
  180. //! \endverbatim
  181. //!
  182. //! \e usStyle is the logical OR of the following:
  183. //!
  184. //! - \b #CB_STYLE_OUTLINE to indicate that the check box should be outlined.
  185. //! - \b #CB_STYLE_FILL to indicate that the check box should be filled.
  186. //! - \b #CB_STYLE_TEXT to indicate that the check box should have text drawn
  187. //! on it (using \e pFont and \e pcText).
  188. //! - \b #CB_STYLE_IMG to indicate that the check box should have an image
  189. //! drawn on it (using \e pucImage).
  190. //! - \b #CB_STYLE_TEXT_OPAQUE to indicate that the check box text should be
  191. //! drawn opaque (in other words, drawing the background pixels).
  192. //! - \b #CB_STYLE_SELECTED to indicate that the check box is selected.
  193. //!
  194. //! \return Nothing; this is not a function.
  195. //
  196. //*****************************************************************************
  197. #define CheckBoxStruct(pParent, pNext, pChild, pDisplay, lX, lY, lWidth, \
  198. lHeight, usStyle, usBoxSize, ulFillColor, \
  199. ulOutlineColor, ulTextColor, pFont, pcText, pucImage, \
  200. pfnOnChange) \
  201. { \
  202. { \
  203. sizeof(tCheckBoxWidget), \
  204. (tWidget *)(pParent), \
  205. (tWidget *)(pNext), \
  206. (tWidget *)(pChild), \
  207. pDisplay, \
  208. { \
  209. lX, \
  210. lY, \
  211. (lX) + (lWidth) - 1, \
  212. (lY) + (lHeight) - 1 \
  213. }, \
  214. CheckBoxMsgProc \
  215. }, \
  216. usStyle, \
  217. usBoxSize, \
  218. ulFillColor, \
  219. ulOutlineColor, \
  220. ulTextColor, \
  221. pFont, \
  222. pcText, \
  223. pucImage, \
  224. pfnOnChange \
  225. }
  226. //*****************************************************************************
  227. //
  228. //! Declares an initialized variable containing a check box widget data
  229. //! structure.
  230. //!
  231. //! \param sName is the name of the variable to be declared.
  232. //! \param pParent is a pointer to the parent widget.
  233. //! \param pNext is a pointer to the sibling widget.
  234. //! \param pChild is a pointer to the first child widget.
  235. //! \param pDisplay is a pointer to the display on which to draw the check box.
  236. //! \param lX is the X coordinate of the upper left corner of the check box.
  237. //! \param lY is the Y coordinate of the upper left corner of the check box.
  238. //! \param lWidth is the width of the check box.
  239. //! \param lHeight is the height of the check box.
  240. //! \param usStyle is the style to be applied to this check box.
  241. //! \param usBoxSize is the size of the box that is checked.
  242. //! \param ulFillColor is the color used to fill in the check box.
  243. //! \param ulOutlineColor is the color used to outline the check box.
  244. //! \param ulTextColor is the color used to draw text on the check box.
  245. //! \param pFont is a pointer to the font to be used to draw text on the check
  246. //! box.
  247. //! \param pcText is a pointer to the text to draw on this check box.
  248. //! \param pucImage is a pointer to the image to draw on this check box.
  249. //! \param pfnOnChange is a pointer to the function that is called when the
  250. //! check box is pressed.
  251. //!
  252. //! This macro provides an initialized check box widget data structure, which
  253. //! can be used to construct the widget tree at compile time in global
  254. //! variables (as opposed to run-time via function calls).
  255. //!
  256. //! \e usStyle is the logical OR of the following:
  257. //!
  258. //! - \b #CB_STYLE_OUTLINE to indicate that the check box should be outlined.
  259. //! - \b #CB_STYLE_FILL to indicate that the check box should be filled.
  260. //! - \b #CB_STYLE_TEXT to indicate that the check box should have text drawn
  261. //! on it (using \e pFont and \e pcText).
  262. //! - \b #CB_STYLE_IMG to indicate that the check box should have an image
  263. //! drawn on it (using \e pucImage).
  264. //! - \b #CB_STYLE_TEXT_OPAQUE to indicate that the check box text should be
  265. //! drawn opaque (in other words, drawing the background pixels).
  266. //! - \b #CB_STYLE_SELECTED to indicate that the check box is selected.
  267. //!
  268. //! \return Nothing; this is not a function.
  269. //
  270. //*****************************************************************************
  271. #define CheckBox(sName, pParent, pNext, pChild, pDisplay, lX, lY, lWidth, \
  272. lHeight, usStyle, usBoxSize, ulFillColor, ulOutlineColor, \
  273. ulTextColor, pFont, pcText, pucImage, pfnOnChange) \
  274. tCheckBoxWidget sName = \
  275. CheckBoxStruct(pParent, pNext, pChild, pDisplay, lX, lY, lWidth, \
  276. lHeight, usStyle, usBoxSize, ulFillColor, \
  277. ulOutlineColor, ulTextColor, pFont, pcText, \
  278. pucImage, pfnOnChange)
  279. //*****************************************************************************
  280. //
  281. //! Sets size of the box to be checked.
  282. //!
  283. //! \param pWidget is a pointer to the check box widget to modify.
  284. //! \param usSize is the size of the box, in pixels.
  285. //!
  286. //! This function sets the size of the box that is drawn as part of the check
  287. //! box.
  288. //!
  289. //! \return None.
  290. //
  291. //*****************************************************************************
  292. #define CheckBoxBoxSizeSet(pWidget, usSize) \
  293. do \
  294. { \
  295. tCheckBoxWidget *pW = pWidget; \
  296. pW->usBoxSize = usSize; \
  297. } \
  298. while(0)
  299. //*****************************************************************************
  300. //
  301. //! Sets the function to call when this check box widget is toggled.
  302. //!
  303. //! \param pWidget is a pointer to the check box widget to modify.
  304. //! \param pfnOnChg is a pointer to the function to call.
  305. //!
  306. //! This function sets the function to be called when this check box is
  307. //! toggled.
  308. //!
  309. //! \return None.
  310. //
  311. //*****************************************************************************
  312. #define CheckBoxCallbackSet(pWidget, pfnOnChg) \
  313. do \
  314. { \
  315. tCheckBoxWidget *pW = pWidget; \
  316. pW->pfnOnChange = pfnOnChg; \
  317. } \
  318. while(0)
  319. //*****************************************************************************
  320. //
  321. //! Sets the fill color of a check box widget.
  322. //!
  323. //! \param pWidget is a pointer to the check box widget to be modified.
  324. //! \param ulColor is the 24-bit RGB color to use to fill the check box.
  325. //!
  326. //! This function changes the color used to fill the check box on the display.
  327. //! The display is not updated until the next paint request.
  328. //!
  329. //! \return None.
  330. //
  331. //*****************************************************************************
  332. #define CheckBoxFillColorSet(pWidget, ulColor) \
  333. do \
  334. { \
  335. tCheckBoxWidget *pW = pWidget; \
  336. pW->ulFillColor = ulColor; \
  337. } \
  338. while(0)
  339. //*****************************************************************************
  340. //
  341. //! Disables filling of a check box widget.
  342. //!
  343. //! \param pWidget is a pointer to the check box widget to modify.
  344. //!
  345. //! This function disables the filling of a check box widget. The display is
  346. //! not updated until the next paint request.
  347. //!
  348. //! \return None.
  349. //
  350. //*****************************************************************************
  351. #define CheckBoxFillOff(pWidget) \
  352. do \
  353. { \
  354. tCheckBoxWidget *pW = pWidget; \
  355. pW->usStyle &= ~(CB_STYLE_FILL); \
  356. } \
  357. while(0)
  358. //*****************************************************************************
  359. //
  360. //! Enables filling of a check box widget.
  361. //!
  362. //! \param pWidget is a pointer to the check box widget to modify.
  363. //!
  364. //! This function enables the filling of a check box widget. The display is
  365. //! not updated until the next paint request.
  366. //!
  367. //! \return None.
  368. //
  369. //*****************************************************************************
  370. #define CheckBoxFillOn(pWidget) \
  371. do \
  372. { \
  373. tCheckBoxWidget *pW = pWidget; \
  374. pW->usStyle |= CB_STYLE_FILL; \
  375. } \
  376. while(0)
  377. //*****************************************************************************
  378. //
  379. //! Sets the font for a check box widget.
  380. //!
  381. //! \param pWidget is a pointer to the check box widget to modify.
  382. //! \param pFnt is a pointer to the font to use to draw text on the check box.
  383. //!
  384. //! This function changes the font used to draw text on the check box. The
  385. //! display is not updated until the next paint request.
  386. //!
  387. //! \return None.
  388. //
  389. //*****************************************************************************
  390. #define CheckBoxFontSet(pWidget, pFnt) \
  391. do \
  392. { \
  393. tCheckBoxWidget *pW = pWidget; \
  394. const tFont *pF = pFnt; \
  395. pW->pFont = pF; \
  396. } \
  397. while(0)
  398. //*****************************************************************************
  399. //
  400. //! Changes the image drawn on a check box widget.
  401. //!
  402. //! \param pWidget is a pointer to the check box widget to be modified.
  403. //! \param pImg is a pointer to the image to draw onto the check box.
  404. //!
  405. //! This function changes the image that is drawn onto the check box. The
  406. //! display is not updated until the next paint request.
  407. //!
  408. //! \return None.
  409. //
  410. //*****************************************************************************
  411. #define CheckBoxImageSet(pWidget, pImg) \
  412. do \
  413. { \
  414. tCheckBoxWidget *pW = pWidget; \
  415. const unsigned char *pI = pImg; \
  416. pW->pucImage = pI; \
  417. } \
  418. while(0)
  419. //*****************************************************************************
  420. //
  421. //! Disables the image on a check box widget.
  422. //!
  423. //! \param pWidget is a pointer to the check box widget to modify.
  424. //!
  425. //! This function disables the drawing of an image on a check box widget. The
  426. //! display is not updated until the next paint request.
  427. //!
  428. //! \return None.
  429. //
  430. //*****************************************************************************
  431. #define CheckBoxImageOff(pWidget) \
  432. do \
  433. { \
  434. tCheckBoxWidget *pW = pWidget; \
  435. pW->usStyle &= ~(CB_STYLE_IMG); \
  436. } \
  437. while(0)
  438. //*****************************************************************************
  439. //
  440. //! Enables the image on a check box widget.
  441. //!
  442. //! \param pWidget is a pointer to the check box widget to modify.
  443. //!
  444. //! This function enables the drawing of an image on a check box widget. The
  445. //! display is not updated until the next paint request.
  446. //!
  447. //! \return None.
  448. //
  449. //*****************************************************************************
  450. #define CheckBoxImageOn(pWidget) \
  451. do \
  452. { \
  453. tCheckBoxWidget *pW = pWidget; \
  454. pW->usStyle |= CB_STYLE_IMG; \
  455. } \
  456. while(0)
  457. //*****************************************************************************
  458. //
  459. //! Sets the outline color of a check box widget.
  460. //!
  461. //! \param pWidget is a pointer to the check box widget to be modified.
  462. //! \param ulColor is the 24-bit RGB color to use to outline the check box.
  463. //!
  464. //! This function changes the color used to outline the check box on the
  465. //! display. The display is not updated until the next paint request.
  466. //!
  467. //! \return None.
  468. //
  469. //*****************************************************************************
  470. #define CheckBoxOutlineColorSet(pWidget, ulColor) \
  471. do \
  472. { \
  473. tCheckBoxWidget *pW = pWidget; \
  474. pW->ulOutlineColor = ulColor; \
  475. } \
  476. while(0)
  477. //*****************************************************************************
  478. //
  479. //! Disables outlining of a check box widget.
  480. //!
  481. //! \param pWidget is a pointer to the check box widget to modify.
  482. //!
  483. //! This function disables the outlining of a check box widget. The display is
  484. //! not updated until the next paint request.
  485. //!
  486. //! \return None.
  487. //
  488. //*****************************************************************************
  489. #define CheckBoxOutlineOff(pWidget) \
  490. do \
  491. { \
  492. tCheckBoxWidget *pW = pWidget; \
  493. pW->usStyle &= ~(CB_STYLE_OUTLINE); \
  494. } \
  495. while(0)
  496. //*****************************************************************************
  497. //
  498. //! Enables outlining of a check box widget.
  499. //!
  500. //! \param pWidget is a pointer to the check box widget to modify.
  501. //!
  502. //! This function enables the outlining of a check box widget. The display is
  503. //! not updated until the next paint request.
  504. //!
  505. //! \return None.
  506. //
  507. //*****************************************************************************
  508. #define CheckBoxOutlineOn(pWidget) \
  509. do \
  510. { \
  511. tCheckBoxWidget *pW = pWidget; \
  512. pW->usStyle |= CB_STYLE_OUTLINE; \
  513. } \
  514. while(0)
  515. //*****************************************************************************
  516. //
  517. //! Sets the text color of a check box widget.
  518. //!
  519. //! \param pWidget is a pointer to the check box widget to be modified.
  520. //! \param ulColor is the 24-bit RGB color to use to draw text on the check
  521. //! box.
  522. //!
  523. //! This function changes the color used to draw text on the check box on the
  524. //! display. The display is not updated until the next paint request.
  525. //!
  526. //! \return None.
  527. //
  528. //*****************************************************************************
  529. #define CheckBoxTextColorSet(pWidget, ulColor) \
  530. do \
  531. { \
  532. tCheckBoxWidget *pW = pWidget; \
  533. pW->ulTextColor = ulColor; \
  534. } \
  535. while(0)
  536. //*****************************************************************************
  537. //
  538. //! Disables the text on a check box widget.
  539. //!
  540. //! \param pWidget is a pointer to the check box widget to modify.
  541. //!
  542. //! This function disables the drawing of text on a check box widget. The
  543. //! display is not updated until the next paint request.
  544. //!
  545. //! \return None.
  546. //
  547. //*****************************************************************************
  548. #define CheckBoxTextOff(pWidget) \
  549. do \
  550. { \
  551. tCheckBoxWidget *pW = pWidget; \
  552. pW->usStyle &= ~(CB_STYLE_TEXT); \
  553. } \
  554. while(0)
  555. //*****************************************************************************
  556. //
  557. //! Enables the text on a check box widget.
  558. //!
  559. //! \param pWidget is a pointer to the check box widget to modify.
  560. //!
  561. //! This function enables the drawing of text on a check box widget. The
  562. //! display is not updated until the next paint request.
  563. //!
  564. //! \return None.
  565. //
  566. //*****************************************************************************
  567. #define CheckBoxTextOn(pWidget) \
  568. do \
  569. { \
  570. tCheckBoxWidget *pW = pWidget; \
  571. pW->usStyle |= CB_STYLE_TEXT; \
  572. } \
  573. while(0)
  574. //*****************************************************************************
  575. //
  576. //! Disables opaque text on a check box widget.
  577. //!
  578. //! \param pWidget is a pointer to the check box widget to modify.
  579. //!
  580. //! This function disables the use of opaque text on this check box. When not
  581. //! using opaque text, only the foreground pixels of the text are drawn on the
  582. //! screen, allowing the previously drawn pixels (such as the check box image)
  583. //! to show through the text.
  584. //!
  585. //! \return None.
  586. //
  587. //*****************************************************************************
  588. #define CheckBoxTextOpaqueOff(pWidget) \
  589. do \
  590. { \
  591. tCheckBoxWidget *pW = pWidget; \
  592. pW->usStyle &= ~(CB_STYLE_TEXT_OPAQUE); \
  593. } \
  594. while(0)
  595. //*****************************************************************************
  596. //
  597. //! Enables opaque text on a check box widget.
  598. //!
  599. //! \param pWidget is a pointer to the check box widget to modify.
  600. //!
  601. //! This function enables the use of opaque text on this check box. When using
  602. //! opaque text, both the foreground and background pixels of the text are
  603. //! drawn on the screen, blocking out the previously drawn pixels.
  604. //!
  605. //! \return None.
  606. //
  607. //*****************************************************************************
  608. #define CheckBoxTextOpaqueOn(pWidget) \
  609. do \
  610. { \
  611. tCheckBoxWidget *pW = pWidget; \
  612. pW->usStyle |= CB_STYLE_TEXT_OPAQUE; \
  613. } \
  614. while(0)
  615. //*****************************************************************************
  616. //
  617. //! Changes the text drawn on a check box widget.
  618. //!
  619. //! \param pWidget is a pointer to the check box widget to be modified.
  620. //! \param pcTxt is a pointer to the text to draw onto the check box.
  621. //!
  622. //! This function changes the text that is drawn onto the check box. The
  623. //! display is not updated until the next paint request.
  624. //!
  625. //! \return None.
  626. //
  627. //*****************************************************************************
  628. #define CheckBoxTextSet(pWidget, pcTxt) \
  629. do \
  630. { \
  631. tCheckBoxWidget *pW = pWidget; \
  632. const char *pcT = pcTxt; \
  633. pW->pcText = pcT; \
  634. } \
  635. while(0)
  636. //*****************************************************************************
  637. //
  638. // Prototypes for the check box widget APIs.
  639. //
  640. //*****************************************************************************
  641. extern int CheckBoxMsgProc(tWidget *pWidget, unsigned int ulMsg,
  642. unsigned int ulParam1, unsigned int ulParam2);
  643. extern void CheckBoxInit(tCheckBoxWidget *pWidget, const tDisplay *pDisplay,
  644. int lX, int lY, int lWidth, int lHeight);
  645. //*****************************************************************************
  646. //
  647. // Mark the end of the C bindings section for C++ compilers.
  648. //
  649. //*****************************************************************************
  650. #ifdef __cplusplus
  651. }
  652. #endif
  653. //*****************************************************************************
  654. //
  655. // Close the Doxygen group.
  656. //! @}
  657. //
  658. //*****************************************************************************
  659. #endif // __CHECKBOX_H__