home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / Level 1 Extensions 29Sep94 / CheckBox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  1.8 KB  |  58 lines  |  [TEXT/KAHL]

  1. /* CheckBox.h */
  2.  
  3. #ifndef Included_CheckBox_h
  4. #define Included_CheckBox_h
  5.  
  6. /* CheckBox module depends on: */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* Screen */
  13. /* DataMunging */
  14. /* EventLoop */
  15.  
  16. /* CheckBox module provides a name and box with an X in it.  The X in the */
  17. /* box reflects the state (True = X, False = empty) of the object.  The state */
  18. /* is toggled when the box is clicked on. */
  19.  
  20. #include "Screen.h"
  21.  
  22. struct CheckBoxRec;
  23. typedef struct CheckBoxRec CheckBoxRec;
  24.  
  25. /* create a new check box.  Name is null-terminated.  returns NIL if it failed */
  26. CheckBoxRec*        NewCheckBox(WinType* Window, char* Name,
  27.                                     OrdType X, OrdType Y, OrdType Width, OrdType Height);
  28.  
  29. /* dispose of a check box and internal data */
  30. void                        DisposeCheckBox(CheckBoxRec* TheButton);
  31.  
  32. /* find out where the box is located */
  33. OrdType                    GetCheckBoxXLoc(CheckBoxRec* TheButton);
  34. OrdType                    GetCheckBoxYLoc(CheckBoxRec* TheButton);
  35. OrdType                    GetCheckBoxWidth(CheckBoxRec* TheButton);
  36. OrdType                    GetCheckBoxHeight(CheckBoxRec* TheButton);
  37.  
  38. /* change the location of the box */
  39. void                        SetCheckBoxLocation(CheckBoxRec* TheButton,
  40.                                     OrdType X, OrdType Y, OrdType Width, OrdType Height);
  41.  
  42. /* redraw the box completely */
  43. void                        RedrawCheckBox(CheckBoxRec* TheButton);
  44.  
  45. /* handle mouse downs.  returns True if the state of the box changed. */
  46. MyBoolean                CheckBoxMouseDown(CheckBoxRec* TheButton, OrdType X, OrdType Y);
  47.  
  48. /* force the state of the box to a certain value */
  49. void                        SetCheckBoxState(CheckBoxRec* TheButton, MyBoolean TheState);
  50.  
  51. /* get the state of the box */
  52. MyBoolean                GetCheckBoxState(CheckBoxRec* TheButton);
  53.  
  54. /* check to see if the specified location is in the box */
  55. MyBoolean                CheckBoxHitTest(CheckBoxRec* TheButton, OrdType X, OrdType Y);
  56.  
  57. #endif
  58.