input_std.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #include "globals.h"
  2. #include "local_proto.h"
  3. #define INP_STD 1
  4. float Nstd;
  5. static int use = 1;
  6. int input_std(void)
  7. {
  8. static Objects objects[] = {
  9. INFO("Number of Std Deviations: ", &use),
  10. MENU(" 0.5 ", nstd050, &use),
  11. MENU(" 0.75 ", nstd075, &use),
  12. MENU(" 1.0 ", nstd100, &use),
  13. MENU(" 1.25 ", nstd125, &use),
  14. MENU(" 1.5 ", nstd150, &use),
  15. MENU(" 1.75 ", nstd175, &use),
  16. MENU(" 2.0 ", nstd200, &use),
  17. MENU(" 2.25 ", nstd225, &use),
  18. MENU(" 2.5 ", nstd250, &use),
  19. MENU(" Other ", other, &use),
  20. {0}
  21. };
  22. Input_pointer(objects);
  23. Menu_msg("");
  24. return (INP_STD);
  25. }
  26. int other(void)
  27. {
  28. char tmpstr[50];
  29. float tempflt;
  30. int good;
  31. Menu_msg("Use Keyboard on Text Terminal...");
  32. do {
  33. Curses_prompt_gets("Enter Number of Standard Deviations: ", tmpstr);
  34. good = sscanf(tmpstr, " %f ", &tempflt);
  35. if (tempflt <= 0.0)
  36. good = 0;
  37. } while (good != 1);
  38. Nstd = tempflt;
  39. use_mouse_msg();
  40. return (1);
  41. }
  42. int nstd050(void)
  43. {
  44. Nstd = 0.50;
  45. return (1);
  46. }
  47. int nstd075(void)
  48. {
  49. Nstd = 0.75;
  50. return (1);
  51. }
  52. int nstd100(void)
  53. {
  54. Nstd = 1.0;
  55. return (1);
  56. }
  57. int nstd125(void)
  58. {
  59. Nstd = 1.25;
  60. return (1);
  61. }
  62. int nstd150(void)
  63. {
  64. Nstd = 1.50;
  65. return (1);
  66. }
  67. int nstd175(void)
  68. {
  69. Nstd = 1.75;
  70. return (1);
  71. }
  72. int nstd200(void)
  73. {
  74. Nstd = 2.00;
  75. return (1);
  76. }
  77. int nstd225(void)
  78. {
  79. Nstd = 2.25;
  80. return (1);
  81. }
  82. int nstd250(void)
  83. {
  84. Nstd = 2.50;
  85. return (1);
  86. }