Spin.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /********************************************************************************
  2. * Function Describe: Spin.c declare module
  3. * Relate Module: GUI.c
  4. * Writer: Shliangwen
  5. * Date: 2016-1-8
  6. *******************************************************************************/
  7. struct SUT_SPIN
  8. {
  9. char **item; //spin item
  10. unsigned short x; //position x
  11. unsigned char y; //position y
  12. unsigned char width; //max string width
  13. unsigned char itemnum; //item number
  14. short top; //first item
  15. short bottom; //last item
  16. short handle; //current item
  17. short step; //data spin step
  18. unsigned char focus; //input focus
  19. unsigned char disable;
  20. unsigned char keyflag;
  21. char *unit;
  22. unsigned char type; //data/string spin
  23. };
  24. //initialize struct
  25. void SpinInit
  26. (
  27. struct SUT_SPIN *,
  28. unsigned short x,
  29. unsigned char y,
  30. char **item
  31. );
  32. void SpinInitData
  33. (
  34. struct SUT_SPIN *p,
  35. unsigned short x,
  36. unsigned char y,
  37. unsigned char width,
  38. short min,
  39. short max,
  40. short step,
  41. char *unit
  42. );
  43. void SpinSetRange
  44. (
  45. struct SUT_SPIN *,
  46. short top,
  47. short bottom
  48. );
  49. //switch spin focus
  50. void SpinSetFocus(struct SUT_SPIN *);
  51. void SpinLoseFocus(struct SUT_SPIN *);
  52. //show spin
  53. void SpinShow(struct SUT_SPIN *);
  54. void SpinShowBorder(struct SUT_SPIN *);
  55. //get spin 's handle
  56. short SpinGetHandle(struct SUT_SPIN *);
  57. //response key
  58. unsigned char SpinResponse(struct SUT_SPIN *);
  59. void SpinSetNext(struct SUT_SPIN *);
  60. /********************************************************************************
  61. * end of module
  62. *******************************************************************************/