radiobutton.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. //*****************************************************************************
  2. //
  3. // radiobutton.h - Prototypes for the radio button 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 __RADIOBUTTON_H__
  25. #define __RADIOBUTTON_H__
  26. //*****************************************************************************
  27. //
  28. //! \addtogroup radiobutton_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 radio button widget.
  45. //
  46. //*****************************************************************************
  47. typedef struct
  48. {
  49. //
  50. //! The generic widget information.
  51. //
  52. tWidget sBase;
  53. //
  54. //! The style for this radio button. This is a set of flags defined by
  55. //! RB_STYLE_xxx.
  56. //
  57. unsigned short usStyle;
  58. //
  59. //! The size of the radio button itself, not including the text and/or
  60. //! image that accompanies it (in other words, the size of the actual
  61. //! circle that is filled or unfilled).
  62. //
  63. unsigned short usCircleSize;
  64. //
  65. //! The 24-bit RGB color used to fill this radio button, if RB_STYLE_FILL
  66. //! is selected, and to use as the background color if RB_STYLE_TEXT_OPAQUE
  67. //! is selected.
  68. //
  69. unsigned int ulFillColor;
  70. //
  71. //! The 24-bit RGB color used to outline this radio button, if
  72. //! RB_STYLE_OUTLINE is selected.
  73. //
  74. unsigned int ulOutlineColor;
  75. //
  76. //! The 24-bit RGB color used to draw text on this radio button, if
  77. //! RB_STYLE_TEXT is selected.
  78. //
  79. unsigned int ulTextColor;
  80. //
  81. //! The font used to draw the radio button text, if RB_STYLE_TEXT is
  82. //! selected.
  83. //
  84. const tFont *pFont;
  85. //
  86. //! A pointer to the text to draw on this radio button, if RB_STYLE_TEXT is
  87. //! selected.
  88. //
  89. const char *pcText;
  90. //
  91. //! A pointer to the image to be drawn onto this radio button, if
  92. //! RB_STYLE_IMG is selected.
  93. //
  94. const unsigned char *pucImage;
  95. //
  96. //! A pointer to the function to be called when the radio button is
  97. //! pressed. This function is called when the state of the radio button is
  98. //! changed.
  99. //
  100. void (*pfnOnChange)(tWidget *pWidget, unsigned int bSelected);
  101. }
  102. tRadioButtonWidget;
  103. //*****************************************************************************
  104. //
  105. //! This flag indicates that the radio button should be outlined.
  106. //
  107. //*****************************************************************************
  108. #define RB_STYLE_OUTLINE 0x0001
  109. //*****************************************************************************
  110. //
  111. //! This flag indicates that the radio button should be filled.
  112. //
  113. //*****************************************************************************
  114. #define RB_STYLE_FILL 0x0002
  115. //*****************************************************************************
  116. //
  117. //! This flag indicates that the radio button should have text drawn on it.
  118. //
  119. //*****************************************************************************
  120. #define RB_STYLE_TEXT 0x0004
  121. //*****************************************************************************
  122. //
  123. //! This flag indicates that the radio button should have an image drawn on it.
  124. //
  125. //*****************************************************************************
  126. #define RB_STYLE_IMG 0x0008
  127. //*****************************************************************************
  128. //
  129. //! This flag indicates that the radio button text should be drawn opaque (in
  130. //! other words, drawing the background pixels as well as the foreground
  131. //! pixels).
  132. //
  133. //*****************************************************************************
  134. #define RB_STYLE_TEXT_OPAQUE 0x0010
  135. //*****************************************************************************
  136. //
  137. //! This flag indicates that the radio button is selected.
  138. //
  139. //*****************************************************************************
  140. #define RB_STYLE_SELECTED 0x0020
  141. //*****************************************************************************
  142. //
  143. //! Declares an initialized radio button widget data structure.
  144. //!
  145. //! \param pParent is a pointer to the parent widget.
  146. //! \param pNext is a pointer to the sibling widget.
  147. //! \param pChild is a pointer to the first child widget.
  148. //! \param pDisplay is a pointer to the display on which to draw the radio
  149. //! button.
  150. //! \param lX is the X coordinate of the upper left corner of the radio button.
  151. //! \param lY is the Y coordinate of the upper left corner of the radio button.
  152. //! \param lWidth is the width of the radio button.
  153. //! \param lHeight is the height of the radio button.
  154. //! \param usStyle is the style to be applied to this radio button.
  155. //! \param usCircleSize is the size of the circle that is filled.
  156. //! \param ulFillColor is the color used to fill in the radio button.
  157. //! \param ulOutlineColor is the color used to outline the radio button.
  158. //! \param ulTextColor is the color used to draw text on the radio button.
  159. //! \param pFont is a pointer to the font to be used to draw text on the radio
  160. //! button.
  161. //! \param pcText is a pointer to the text to draw on this radio button.
  162. //! \param pucImage is a pointer to the image to draw on this radio button.
  163. //! \param pfnOnChange is a pointer to the function that is called when the
  164. //! radio button is pressed.
  165. //!
  166. //! This macro provides an initialized radio button widget data structure,
  167. //! which can be used to construct the widget tree at compile time in global
  168. //! variables (as opposed to run-time via function calls). This must be
  169. //! assigned to a variable, such as:
  170. //!
  171. //! \verbatim
  172. //! tRadioButtonWidget g_sRadioButton = RadioButtonStruct(...);
  173. //! \endverbatim
  174. //!
  175. //! Or, in an array of variables:
  176. //!
  177. //! \verbatim
  178. //! tRadioButtonWidget g_psRadioButtons[] =
  179. //! {
  180. //! RadioButtonStruct(...),
  181. //! RadioButtonStruct(...)
  182. //! };
  183. //! \endverbatim
  184. //!
  185. //! \e usStyle is the logical OR of the following:
  186. //!
  187. //! - \b #RB_STYLE_OUTLINE to indicate that the radio button should be
  188. //! outlined.
  189. //! - \b #RB_STYLE_FILL to indicate that the radio button should be filled.
  190. //! - \b #RB_STYLE_TEXT to indicate that the radio button should have text
  191. //! drawn on it (using \e pFont and \e pcText).
  192. //! - \b #RB_STYLE_IMG to indicate that the radio button should have an image
  193. //! drawn on it (using \e pucImage).
  194. //! - \b #RB_STYLE_TEXT_OPAQUE to indicate that the radio button text should be
  195. //! drawn opaque (in other words, drawing the background pixels).
  196. //! - \b #RB_STYLE_SELECTED to indicate that the radio button is selected.
  197. //!
  198. //! \return Nothing; this is not a function.
  199. //
  200. //*****************************************************************************
  201. #define RadioButtonStruct(pParent, pNext, pChild, pDisplay, lX, lY, lWidth, \
  202. lHeight, usStyle, usCircleSize, ulFillColor, \
  203. ulOutlineColor, ulTextColor, pFont, pcText, \
  204. pucImage, pfnOnChange) \
  205. { \
  206. { \
  207. sizeof(tRadioButtonWidget), \
  208. (tWidget *)(pParent), \
  209. (tWidget *)(pNext), \
  210. (tWidget *)(pChild), \
  211. pDisplay, \
  212. { \
  213. lX, \
  214. lY, \
  215. (lX) + (lWidth) - 1, \
  216. (lY) + (lHeight) - 1 \
  217. }, \
  218. RadioButtonMsgProc \
  219. }, \
  220. usStyle, \
  221. usCircleSize, \
  222. ulFillColor, \
  223. ulOutlineColor, \
  224. ulTextColor, \
  225. pFont, \
  226. pcText, \
  227. pucImage, \
  228. pfnOnChange \
  229. }
  230. //*****************************************************************************
  231. //
  232. //! Declares an initialized variable containing a radio button widget data
  233. //! structure.
  234. //!
  235. //! \param sName is the name of the variable to be declared.
  236. //! \param pParent is a pointer to the parent widget.
  237. //! \param pNext is a pointer to the sibling widget.
  238. //! \param pChild is a pointer to the first child widget.
  239. //! \param pDisplay is a pointer to the display on which to draw the radio
  240. //! button.
  241. //! \param lX is the X coordinate of the upper left corner of the radio button.
  242. //! \param lY is the Y coordinate of the upper left corner of the radio button.
  243. //! \param lWidth is the width of the radio button.
  244. //! \param lHeight is the height of the radio button.
  245. //! \param usStyle is the style to be applied to this radio button.
  246. //! \param usCircleSize is the size of the circle that is filled.
  247. //! \param ulFillColor is the color used to fill in the radio button.
  248. //! \param ulOutlineColor is the color used to outline the radio button.
  249. //! \param ulTextColor is the color used to draw text on the radio button.
  250. //! \param pFont is a pointer to the font to be used to draw text on the radio
  251. //! button.
  252. //! \param pcText is a pointer to the text to draw on this radio button.
  253. //! \param pucImage is a pointer to the image to draw on this radio button.
  254. //! \param pfnOnChange is a pointer to the function that is called when the
  255. //! radio button is pressed.
  256. //!
  257. //! This macro provides an initialized radio button widget data structure,
  258. //! which can be used to construct the widget tree at compile time in global
  259. //! variables (as opposed to run-time via function calls).
  260. //!
  261. //! \e usStyle is the logical OR of the following:
  262. //!
  263. //! - \b #RB_STYLE_OUTLINE to indicate that the radio button should be
  264. //! outlined.
  265. //! - \b #RB_STYLE_FILL to indicate that the radio button should be filled.
  266. //! - \b #RB_STYLE_TEXT to indicate that the radio button should have text
  267. //! drawn on it (using \e pFont and \e pcText).
  268. //! - \b #RB_STYLE_IMG to indicate that the radio button should have an image
  269. //! drawn on it (using \e pucImage).
  270. //! - \b #RB_STYLE_TEXT_OPAQUE to indicate that the radio button text should be
  271. //! drawn opaque (in other words, drawing the background pixels).
  272. //! - \b #RB_STYLE_SELECTED to indicate that the radio button is selected.
  273. //!
  274. //! \return Nothing; this is not a function.
  275. //
  276. //*****************************************************************************
  277. #define RadioButton(sName, pParent, pNext, pChild, pDisplay, lX, lY, lWidth, \
  278. lHeight, usStyle, usCircleSize, ulFillColor, \
  279. ulOutlineColor, ulTextColor, pFont, pcText, pucImage, \
  280. pfnOnChange) \
  281. tRadioButtonWidget sName = \
  282. RadioButtonStruct(pParent, pNext, pChild, pDisplay, lX, lY, \
  283. lWidth, lHeight, usStyle, usCircleSize, \
  284. ulFillColor, ulOutlineColor, ulTextColor, \
  285. pFont, pcText, pucImage, pfnOnChange)
  286. //*****************************************************************************
  287. //
  288. //! Sets size of the circle to be filled.
  289. //!
  290. //! \param pWidget is a pointer to the radio button widget to modify.
  291. //! \param usSize is the size of the circle, in pixels.
  292. //!
  293. //! This function sets the size of the circle that is drawn as part of the
  294. //! radio button.
  295. //!
  296. //! \return None.
  297. //
  298. //*****************************************************************************
  299. #define RadioButtonCircleSizeSet(pWidget, usSize) \
  300. do \
  301. { \
  302. tRadioButtonWidget *pW = pWidget; \
  303. pW->usCircleSize = usSize; \
  304. } \
  305. while(0)
  306. //*****************************************************************************
  307. //
  308. //! Sets the function to call when this radio button widget is toggled.
  309. //!
  310. //! \param pWidget is a pointer to the radio button widget to modify.
  311. //! \param pfnOnChg is a pointer to the function to call.
  312. //!
  313. //! This function sets the function to be called when this radio button is
  314. //! toggled.
  315. //!
  316. //! \return None.
  317. //
  318. //*****************************************************************************
  319. #define RadioButtonCallbackSet(pWidget, pfnOnChg) \
  320. do \
  321. { \
  322. tRadioButtonWidget *pW = pWidget; \
  323. pW->pfnOnChange = pfnOnChg; \
  324. } \
  325. while(0)
  326. //*****************************************************************************
  327. //
  328. //! Sets the fill color of a radio button widget.
  329. //!
  330. //! \param pWidget is a pointer to the radio button widget to be modified.
  331. //! \param ulColor is the 24-bit RGB color to use to fill the radio button.
  332. //!
  333. //! This function changes the color used to fill the radio button on the
  334. //! display. The display is not updated until the next paint request.
  335. //!
  336. //! \return None.
  337. //
  338. //*****************************************************************************
  339. #define RadioButtonFillColorSet(pWidget, ulColor) \
  340. do \
  341. { \
  342. tRadioButtonWidget *pW = pWidget; \
  343. pW->ulFillColor = ulColor; \
  344. } \
  345. while(0)
  346. //*****************************************************************************
  347. //
  348. //! Disables filling of a radio button widget.
  349. //!
  350. //! \param pWidget is a pointer to the radio button widget to modify.
  351. //!
  352. //! This function disables the filling of a radio button widget. The display
  353. //! is not updated until the next paint request.
  354. //!
  355. //! \return None.
  356. //
  357. //*****************************************************************************
  358. #define RadioButtonFillOff(pWidget) \
  359. do \
  360. { \
  361. tRadioButtonWidget *pW = pWidget; \
  362. pW->usStyle &= ~(RB_STYLE_FILL); \
  363. } \
  364. while(0)
  365. //*****************************************************************************
  366. //
  367. //! Enables filling of a radio button widget.
  368. //!
  369. //! \param pWidget is a pointer to the radio button widget to modify.
  370. //!
  371. //! This function enables the filling of a radio button widget. The display is
  372. //! not updated until the next paint request.
  373. //!
  374. //! \return None.
  375. //
  376. //*****************************************************************************
  377. #define RadioButtonFillOn(pWidget) \
  378. do \
  379. { \
  380. tRadioButtonWidget *pW = pWidget; \
  381. pW->usStyle |= RB_STYLE_FILL; \
  382. } \
  383. while(0)
  384. //*****************************************************************************
  385. //
  386. //! Sets the font for a radio button widget.
  387. //!
  388. //! \param pWidget is a pointer to the radio button widget to modify.
  389. //! \param pFnt is a pointer to the font to use to draw text on the radio
  390. //! button.
  391. //!
  392. //! This function changes the font used to draw text on the radio button. The
  393. //! display is not updated until the next paint request.
  394. //!
  395. //! \return None.
  396. //
  397. //*****************************************************************************
  398. #define RadioButtonFontSet(pWidget, pFnt) \
  399. do \
  400. { \
  401. tRadioButtonWidget *pW = pWidget; \
  402. const tFont *pF = pFnt; \
  403. pW->pFont = pF; \
  404. } \
  405. while(0)
  406. //*****************************************************************************
  407. //
  408. //! Changes the image drawn on a radio button widget.
  409. //!
  410. //! \param pWidget is a pointer to the radio button widget to be modified.
  411. //! \param pImg is a pointer to the image to draw onto the radio button.
  412. //!
  413. //! This function changes the image that is drawn onto the radio button. The
  414. //! display is not updated until the next paint request.
  415. //!
  416. //! \return None.
  417. //
  418. //*****************************************************************************
  419. #define RadioButtonImageSet(pWidget, pImg) \
  420. do \
  421. { \
  422. tRadioButtonWidget *pW = pWidget; \
  423. const unsigned char *pI = pImg; \
  424. pW->pucImage = pI; \
  425. } \
  426. while(0)
  427. //*****************************************************************************
  428. //
  429. //! Disables the image on a radio button widget.
  430. //!
  431. //! \param pWidget is a pointer to the radio button widget to modify.
  432. //!
  433. //! This function disables the drawing of an image on a radio button widget.
  434. //! The display is not updated until the next paint request.
  435. //!
  436. //! \return None.
  437. //
  438. //*****************************************************************************
  439. #define RadioButtonImageOff(pWidget) \
  440. do \
  441. { \
  442. tRadioButtonWidget *pW = pWidget; \
  443. pW->usStyle &= ~(RB_STYLE_IMG); \
  444. } \
  445. while(0)
  446. //*****************************************************************************
  447. //
  448. //! Enables the image on a radio button widget.
  449. //!
  450. //! \param pWidget is a pointer to the radio button widget to modify.
  451. //!
  452. //! This function enables the drawing of an image on a radio button widget.
  453. //! The display is not updated until the next paint request.
  454. //!
  455. //! \return None.
  456. //
  457. //*****************************************************************************
  458. #define RadioButtonImageOn(pWidget) \
  459. do \
  460. { \
  461. tRadioButtonWidget *pW = pWidget; \
  462. pW->usStyle |= RB_STYLE_IMG; \
  463. } \
  464. while(0)
  465. //*****************************************************************************
  466. //
  467. //! Sets the outline color of a radio button widget.
  468. //!
  469. //! \param pWidget is a pointer to the radio button widget to be modified.
  470. //! \param ulColor is the 24-bit RGB color to use to outline the radio button.
  471. //!
  472. //! This function changes the color used to outline the radio button on the
  473. //! display. The display is not updated until the next paint request.
  474. //!
  475. //! \return None.
  476. //
  477. //*****************************************************************************
  478. #define RadioButtonOutlineColorSet(pWidget, ulColor) \
  479. do \
  480. { \
  481. tRadioButtonWidget *pW = pWidget; \
  482. pW->ulOutlineColor = ulColor; \
  483. } \
  484. while(0)
  485. //*****************************************************************************
  486. //
  487. //! Disables outlining of a radio button widget.
  488. //!
  489. //! \param pWidget is a pointer to the radio button widget to modify.
  490. //!
  491. //! This function disables the outlining of a radio button widget. The display
  492. //! is not updated until the next paint request.
  493. //!
  494. //! \return None.
  495. //
  496. //*****************************************************************************
  497. #define RadioButtonOutlineOff(pWidget) \
  498. do \
  499. { \
  500. tRadioButtonWidget *pW = pWidget; \
  501. pW->usStyle &= ~(RB_STYLE_OUTLINE); \
  502. } \
  503. while(0)
  504. //*****************************************************************************
  505. //
  506. //! Enables outlining of a radio button widget.
  507. //!
  508. //! \param pWidget is a pointer to the radio button widget to modify.
  509. //!
  510. //! This function enables the outlining of a radio button widget. The display
  511. //! is not updated until the next paint request.
  512. //!
  513. //! \return None.
  514. //
  515. //*****************************************************************************
  516. #define RadioButtonOutlineOn(pWidget) \
  517. do \
  518. { \
  519. tRadioButtonWidget *pW = pWidget; \
  520. pW->usStyle |= RB_STYLE_OUTLINE; \
  521. } \
  522. while(0)
  523. //*****************************************************************************
  524. //
  525. //! Sets the text color of a radio button widget.
  526. //!
  527. //! \param pWidget is a pointer to the radio button widget to be modified.
  528. //! \param ulColor is the 24-bit RGB color to use to draw text on the radio
  529. //! button.
  530. //!
  531. //! This function changes the color used to draw text on the radio button on
  532. //! the display. The display is not updated until the next paint request.
  533. //!
  534. //! \return None.
  535. //
  536. //*****************************************************************************
  537. #define RadioButtonTextColorSet(pWidget, ulColor) \
  538. do \
  539. { \
  540. tRadioButtonWidget *pW = pWidget; \
  541. pW->ulTextColor = ulColor; \
  542. } \
  543. while(0)
  544. //*****************************************************************************
  545. //
  546. //! Disables the text on a radio button widget.
  547. //!
  548. //! \param pWidget is a pointer to the radio button widget to modify.
  549. //!
  550. //! This function disables the drawing of text on a radio button widget. The
  551. //! display is not updated until the next paint request.
  552. //!
  553. //! \return None.
  554. //
  555. //*****************************************************************************
  556. #define RadioButtonTextOff(pWidget) \
  557. do \
  558. { \
  559. tRadioButtonWidget *pW = pWidget; \
  560. pW->usStyle &= ~(RB_STYLE_TEXT); \
  561. } \
  562. while(0)
  563. //*****************************************************************************
  564. //
  565. //! Enables the text on a radio button widget.
  566. //!
  567. //! \param pWidget is a pointer to the radio button widget to modify.
  568. //!
  569. //! This function enables the drawing of text on a radio button widget. The
  570. //! display is not updated until the next paint request.
  571. //!
  572. //! \return None.
  573. //
  574. //*****************************************************************************
  575. #define RadioButtonTextOn(pWidget) \
  576. do \
  577. { \
  578. tRadioButtonWidget *pW = pWidget; \
  579. pW->usStyle |= RB_STYLE_TEXT; \
  580. } \
  581. while(0)
  582. //*****************************************************************************
  583. //
  584. //! Disables opaque text on a radio button widget.
  585. //!
  586. //! \param pWidget is a pointer to the radio button widget to modify.
  587. //!
  588. //! This function disables the use of opaque text on this radio button. When
  589. //! not using opaque text, only the foreground pixels of the text are drawn on
  590. //! the screen, allowing the previously drawn pixels (such as the radio button
  591. //! image) to show through the text.
  592. //!
  593. //! \return None.
  594. //
  595. //*****************************************************************************
  596. #define RadioButtonTextOpaqueOff(pWidget) \
  597. do \
  598. { \
  599. tRadioButtonWidget *pW = pWidget; \
  600. pW->usStyle &= ~(RB_STYLE_TEXT_OPAQUE); \
  601. } \
  602. while(0)
  603. //*****************************************************************************
  604. //
  605. //! Enables opaque text on a radio button widget.
  606. //!
  607. //! \param pWidget is a pointer to the radio button widget to modify.
  608. //!
  609. //! This function enables the use of opaque text on this radio button. When
  610. //! using opaque text, both the foreground and background pixels of the text
  611. //! are drawn on the screen, blocking out the previously drawn pixels.
  612. //!
  613. //! \return None.
  614. //
  615. //*****************************************************************************
  616. #define RadioButtonTextOpaqueOn(pWidget) \
  617. do \
  618. { \
  619. tRadioButtonWidget *pW = pWidget; \
  620. pW->usStyle |= RB_STYLE_TEXT_OPAQUE; \
  621. } \
  622. while(0)
  623. //*****************************************************************************
  624. //
  625. //! Changes the text drawn on a radio button widget.
  626. //!
  627. //! \param pWidget is a pointer to the radio button widget to be modified.
  628. //! \param pcTxt is a pointer to the text to draw onto the radio button.
  629. //!
  630. //! This function changes the text that is drawn onto the radio button. The
  631. //! display is not updated until the next paint request.
  632. //!
  633. //! \return None.
  634. //
  635. //*****************************************************************************
  636. #define RadioButtonTextSet(pWidget, pcTxt) \
  637. do \
  638. { \
  639. tRadioButtonWidget *pW = pWidget; \
  640. const char *pcT = pcTxt; \
  641. pW->pcText = pcT; \
  642. } \
  643. while(0)
  644. //*****************************************************************************
  645. //
  646. // Prototypes for the radio button widget APIs.
  647. //
  648. //*****************************************************************************
  649. extern int RadioButtonMsgProc(tWidget *pWidget, unsigned int ulMsg,
  650. unsigned int ulParam1, unsigned int ulParam2);
  651. extern void RadioButtonInit(tRadioButtonWidget *pWidget,
  652. const tDisplay *pDisplay, int lX, int lY,
  653. int lWidth, int lHeight);
  654. //*****************************************************************************
  655. //
  656. // Mark the end of the C bindings section for C++ compilers.
  657. //
  658. //*****************************************************************************
  659. #ifdef __cplusplus
  660. }
  661. #endif
  662. //*****************************************************************************
  663. //
  664. // Close the Doxygen group.
  665. //! @}
  666. //
  667. //*****************************************************************************
  668. #endif // __RADIOBUTTON_H__