home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / astrnomy / ephem421.zip / SCREEN.H < prev    next >
Text File  |  1990-09-13  |  5KB  |  217 lines

  1. /* screen layout details
  2.  *
  3.  * it looks better if the fields are drawn in some nice order so it you
  4.  * rearrange the fields, check the menu printing functions.
  5.  */
  6.  
  7. /* size of screen */
  8. #define    NR    24
  9. #define    NC    80
  10.  
  11. #define    ASPECT    (4./3.)    /* screen width to height dimensions ratio */
  12.  
  13. #define    GAP    6    /* gap between field name and value */
  14.  
  15. #define    COL1        1
  16. #define    COL2        27
  17. #define    COL3        44
  18. #define    COL4        61    /* calendar */
  19.  
  20. #define    R_PROMPT    1    /* prompt row */
  21. #define    C_PROMPT    COL1
  22.  
  23. #define    R_NEWCIR    2
  24. #define    C_NEWCIR    ((NC-17)/2) /* 17 is length of the message */
  25.  
  26. #define    R_TOP        3    /* first row of top menu items */
  27.  
  28. #define    R_TZN    (R_TOP+0)
  29. #define    C_TZN    COL1
  30. #define    R_LT    R_TZN
  31. #define    C_LT    (C_TZN+GAP-2)
  32. #define    R_LD    R_TZN
  33. #define    C_LD    (C_TZN+13)
  34.  
  35. #define    R_UT    (R_TOP+1)
  36. #define    C_UT    COL1
  37. #define    C_UTV    (C_UT+GAP-2)
  38. #define    R_UD    R_UT
  39. #define    C_UD    (C_UT+13)
  40.  
  41. #define    R_JD    (R_TOP+2)
  42. #define    C_JD    COL1
  43. #define    C_JDV    (C_JD+GAP+3)
  44.  
  45. #define    R_LST    (R_TOP)
  46. #define    C_LST    COL2
  47. #define    C_LSTV    (C_LST+GAP)
  48.  
  49. #define    R_LAT    (R_TOP+0)
  50. #define    C_LAT    COL3
  51. #define    C_LATV    (C_LAT+4)
  52.  
  53. #define    R_DAWN    (R_TOP+2)
  54. #define    C_DAWN    COL2
  55. #define    C_DAWNV    (C_DAWN+GAP+3)
  56.  
  57. #define    R_STPSZ    (R_TOP+7)
  58. #define    C_STPSZ    COL2
  59. #define    C_STPSZV (C_STPSZ+GAP-1)
  60.  
  61. #define    R_HEIGHT (R_TOP+2)
  62. #define    C_HEIGHT COL3
  63. #define    C_HEIGHTV (C_HEIGHT+GAP)
  64.  
  65. #define    R_PRES    (R_TOP+4)
  66. #define    C_PRES    COL3
  67. #define    C_PRESV    (C_PRES+GAP)
  68.  
  69. #define    R_WATCH    (R_TOP+3)
  70. #define    C_WATCH    COL1
  71.  
  72. #define    R_LISTING (R_TOP+4)
  73. #define    C_LISTING COL1
  74. #define    C_LISTINGV (C_LISTING+20)
  75.  
  76. #define    R_SRCH    (R_TOP+5)
  77. #define    C_SRCH    COL1
  78. #define    C_SRCHV    (C_SRCH+16)
  79.  
  80. #define    R_PLOT    (R_TOP+6)
  81. #define    C_PLOT    COL1
  82. #define    C_PLOTV (C_PLOT+20)
  83.  
  84. #define    R_ALTM    (R_TOP+7)
  85. #define    C_ALTM    COL1
  86. #define    C_ALTMV    (C_ALTM+10)
  87.  
  88. #define    R_TZONE    (R_TOP+5)
  89. #define    C_TZONE    COL3
  90. #define    C_TZONEV (C_TZONE+GAP-1)
  91.  
  92. #define    R_LONG    (R_TOP+1)
  93. #define    C_LONG    COL3
  94. #define    C_LONGV    (C_LONG+4)
  95.  
  96. #define    R_DUSK    (R_TOP+3)
  97. #define    C_DUSK    COL2
  98. #define    C_DUSKV    (C_DUSK+GAP+3)
  99.  
  100. #define    R_NSTEP (R_TOP+6)
  101. #define    C_NSTEP    COL2
  102. #define    C_NSTEPV (C_NSTEP+GAP)
  103.  
  104. #define    R_TEMP    (R_TOP+3)
  105. #define    C_TEMP    COL3
  106. #define    C_TEMPV    (C_TEMP+GAP)
  107.  
  108. #define    R_EPOCH        (R_TOP+6)
  109. #define    C_EPOCH        COL3
  110. #define    C_EPOCHV    (C_EPOCH+GAP)
  111.  
  112. #define    R_PAUSE (R_TOP+7)
  113. #define    C_PAUSE    COL3
  114. #define    C_PAUSEV (C_PAUSE+GAP)
  115.  
  116. #define    R_MNUDEP    (R_TOP+6)
  117. #define    C_MNUDEP    COL3
  118. #define    C_MNUDEPV    (C_EPOCH+GAP)
  119.  
  120. #define    R_LON    (R_TOP+4)
  121. #define    C_LON    COL2
  122. #define    C_LONV    (C_LON+GAP+3)
  123.  
  124. #define    R_CAL    R_TOP
  125. #define    C_CAL   COL4
  126.  
  127. /* planet rows, for all menus */
  128. #define    R_PLANTAB    (R_TOP+9)
  129. #define    R_SUN        (R_PLANTAB+1)
  130. #define    R_MOON        (R_PLANTAB+2)
  131. #define    R_MERCURY    (R_PLANTAB+3)
  132. #define    R_VENUS        (R_PLANTAB+4)
  133. #define    R_MARS        (R_PLANTAB+5)
  134. #define    R_JUPITER    (R_PLANTAB+6)
  135. #define    R_SATURN    (R_PLANTAB+7)
  136. #define    R_URANUS    (R_PLANTAB+8)
  137. #define    R_NEPTUNE    (R_PLANTAB+9)
  138. #define    R_PLUTO        (R_PLANTAB+10)
  139. #define    R_OBJX        (R_PLANTAB+11)
  140. #define    R_OBJY        (R_PLANTAB+12)
  141.  
  142. /* menu 1 info table */
  143. #define    C_OBJ        1
  144. #define    C_RA        4
  145. #define    C_DEC        12
  146. #define    C_AZ        19
  147. #define    C_ALT        26
  148. #define    C_HLONG        33
  149. #define    C_HLAT        40
  150. #define    C_EDIST        47
  151. #define C_SDIST     54
  152. #define    C_ELONG        61
  153. #define    C_SIZE        68
  154. #define    C_MAG        73
  155. #define    C_PHASE        78
  156.  
  157. /* menu 2 screen items */
  158. #define    C_RISETM    7
  159. #define    C_RISEAZ    18
  160. #define    C_TRANSTM    29
  161. #define    C_TRANSALT    40
  162. #define    C_SETTM        51
  163. #define    C_SETAZ        62
  164. #define    C_TUP        73
  165.  
  166. /* menu 3 items */
  167. #define    C_SUN        4
  168. #define    C_MOON        10
  169. #define    C_MERCURY    17
  170. #define    C_VENUS        23
  171. #define    C_MARS        30
  172. #define    C_JUPITER    36
  173. #define    C_SATURN    43
  174. #define    C_URANUS    49
  175. #define    C_NEPTUNE    56
  176. #define    C_PLUTO        62
  177. #define    C_OBJX        69
  178. #define    C_OBJY        75
  179.  
  180. #define    PW    (NC-C_PROMPT+1)    /* total prompt line width */
  181.  
  182. /* macros to pack a row/col and menu selection flags all into an int.
  183.  * (use this rather than a structure because we can compare them so easily.
  184.  * could use bit fields and a union, but then can't init them or use switch.)
  185.  * bit field defs: [15..14]=menu  [13..12]=flags  [11..7]=row  [6..0]=column.
  186.  * see sel_fld.c.
  187.  * F_MNUX also used in main to manage which bottom menu is up.
  188.  */
  189. #define    F_CHG        (1<<12)    /* field may be picked for changing */
  190. #define    F_PLT        (1<<13)    /* field may be picked for plotting or listng */
  191. #define    F_MMNU        (0<<14)    /* field is on main menu */
  192. #define    F_MNU1        (1<<14)    /* field is on menu 1 */
  193. #define    F_MNU2         (2<<14)    /* field is on menu 2 */
  194. #define    F_MNU3        (3<<14)    /* field is on menu 3 */
  195. #define    rcfpack(r,c,f)    ((f) | ((r) << 7) | (c))
  196. #define    unpackr(p)    (((p) >> 7) & 0x1f)
  197. #define    unpackc(p)    ((p) & 0x7f)
  198. #define    unpackrc(p)    ((p) & 0xfff)
  199. #define    tstpackf(p,f)    (((p) & ((f)&0x3000)) && \
  200.             (((p)&0xc000) == ((f)&0xc000) || ((p)&0xc000) == 0))
  201.  
  202. /* additions to the planet defines from astro.h.
  203.  * must not conflict, and must fit in range 0..15.
  204.  */
  205. #define    SUN    (PLUTO+1)
  206. #define    MOON    (PLUTO+2)
  207. #define    OBJX    (PLUTO+3)    /* the user-defined object */
  208. #define    OBJY    (PLUTO+4)    /* the user-defined object */
  209. #define    NOBJ    (OBJY+1)    /* total number of objects */
  210.  
  211. #define    cntrl(x)    ((x) & 037)
  212. #define    QUIT        cntrl('d')    /* char to exit program */
  213. #define    HELP        '?'        /* char to give help message */
  214. #define    REDRAW        cntrl('l')    /* char to redraw (like vi) */
  215. #define    VERSION        cntrl('v')    /* char to display version number */
  216. #define    END        'q'        /* char to quit current mode */
  217.