home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c040 / 1.ddi / SAMPLES / CHRTDEMO.H$ / CHRTDEMO.bin
Encoding:
Text File  |  1990-01-19  |  5.4 KB  |  147 lines

  1. /* File: CHRTDEMO.H
  2.  *
  3.  * Common definitions for major modules of CHRTDEMO.
  4.  */
  5.  
  6. /* Include only once */
  7. #ifndef CHRTDEMO_H
  8. #define CHRTDEMO_H
  9.  
  10. /* --- For graphics adaptors that are color capable: --- */
  11. #define C_INPUTCOLOR  11      /* Color for data input                 */
  12. #define C_HILITECOLOR 10      /* Color for first-letter highlights    */
  13. #define C_FORMCOLOR   15      /* Color for screen form lines and help */
  14. #define C_TITLECOLOR  15      /* Color for QuickCHART title           */
  15. #define C_ERRORCOLOR  14      /* Color for error lines                */
  16. #define C_INFOCOLOR    7      /* Color non-input data on screen       */
  17.  
  18. /* --- For graphics adaptors that are not color capable: --- */
  19. #define M_INPUTCOLOR   7      /* Color for data input                 */
  20. #define M_HILITECOLOR 15      /* Color for first-letter highlights    */
  21. #define M_FORMCOLOR    7      /* Color for screen form lines and help */
  22. #define M_TITLECOLOR  15      /* Color for QuickCHART title           */
  23. #define M_ERRORCOLOR  15      /* Color for error lines                */
  24. #define M_INFOCOLOR    7      /* Color non-input data on screen       */
  25.  
  26. /* Define macros to determine whether the graphics adaptor is color-capable. */
  27. #define ismono(m) ( ((m) == _MRESNOCOLOR) || ((m) == _HRESBW)      || \
  28.                     ((m) == _HERCMONO)    || ((m) == _ERESNOCOLOR) || \
  29.                     ((m) == _VRES2COLOR) )
  30. #define iscolor(m) (!ismono(m))
  31.  
  32. /* ASCII codes for commonly used control functions. */
  33. #define BEEP        7
  34. #define ESCAPE     27
  35.  
  36. /* Constant limits. */
  37. #define MAXVALUES  12
  38. #define MAXSERIES  4
  39.  
  40. /* Constants that identify typefaces to ChooseFont. */
  41. enum tagTypeFace
  42. {
  43.     COURIER,
  44.     HELV,
  45.     TMS_RMN,
  46.     MODERN,
  47.     SCRIPT,
  48.     ROMAN,
  49.     NOFONT
  50. };
  51.  
  52. typedef enum tagBool { FALSE, TRUE } BOOL;
  53.  
  54. /* Variables used to track control and screen position.  */
  55. struct SCREENINFO
  56. {
  57.     int  top;                        /* Row under top form line      */
  58.     int  bot;                        /* Row above bottom form line   */
  59.     int  mid;                        /* Middle line of form          */
  60.     int  help;                       /* Line number of help line     */
  61.     int  mode;                       /* Current screen mode          */
  62.     int  xMax;
  63.     int  yMax;
  64.     BOOL fColor;
  65. };
  66.  
  67. /* This variable holds either the constants #defined for color
  68.  * graphics adaptors (those that are formed: C_xxxxxCOLOR) or those
  69.  * #defined for monochrome graphics adaptors (those that are formed:
  70.  * M_xxxxxCOLOR).  They do NOT control the color of the presentation
  71.  * graphics -- just the color of the menus and prompts.
  72.  */
  73. struct tagColor
  74. {
  75.     short InputColor;                /* Color for input requests     */
  76.     short HiliteColor;               /* Color for prompt highlights  */
  77.     short FormColor;                 /* Color for input forms/menus  */
  78.     short TitleColor;                /* Color for titles             */
  79.     short ErrorColor;                /* Color for error messages     */
  80.     short InfoColor;                 /* Color for informations msgs. */
  81. };
  82.  
  83. /* Declarations of functions in CHRTDEMO.C  */
  84. void ChartOptions( void );
  85. void ChartType( void );
  86. void ClearData( BOOL fConfirm );
  87. void DefaultData( short iType, short iStyle, BOOL fClear );
  88. int  FindVideoMode( struct videoconfig vc );
  89. void Initialize( void );
  90. int  main( void );
  91. void MainMenu( void );
  92. void ResetOptions( void );
  93. void Demo( void );
  94. BOOL SetGraphMode( int mode );
  95. void ShowError( int iErr );
  96. void ShowChartData( void );
  97. int  ShowAxisType( int iRow, int iCol, axistype theAxis );
  98. int  ShowFontInfo( int iRow, int iCol, struct _fontinfo theFont );
  99. int  ShowLegendType( int iRow, int iCol, legendtype theLegend );
  100. void ShowSampleData( void );
  101. int  ShowTitleType( int iRow, int iCol, titletype theTitle );
  102. int  ShowWindowType( int iRow, int iCol, windowtype theWindow );
  103. int  ViewChart( void );
  104.  
  105. /* Declarations of functions in CHRTOPT.C  */
  106. void Axes( void );
  107. void Axis( axistype *pat );
  108. void AxisRange( axistype *pat );
  109. void AxisScale( axistype *pat );
  110. void AxisTics( axistype *pat );
  111. void Border( windowtype *pwt );
  112. int  ChangeTypeface( int iFaceIndex );
  113. void ChooseFont( int WhichFont, int Height );
  114. void ChartWindow( void );
  115. void DataWindow( void );
  116. void FontOptions( void );
  117. void Justify( titletype *ptt );
  118. void Legend( void );
  119. void LegendPlace( void );
  120. void ScreenMode( void );
  121. void TitleOpt( titletype *ptt );
  122. void Titles( void );
  123. void Windows( void );
  124. void WindowSize( windowtype *pwt );
  125.  
  126. /* Declaration of functions in CHRTSUPT.C */
  127. int  BlankMenu( char *pchTitle, char *pchChoice1, char *pchChoice2 );
  128. void ClrForm( void );
  129. void ClrHelp( void );
  130. void ErrorMsg( char *pchMsg );
  131. void Help( char *pchMsg, short sColor );
  132. int  InputCh( char *pchPrompt, char *pchAccept );
  133. int  InputInt( char *pchPrompt, int iOld, int iMin, int iMax );
  134. float InputFloat( char *pchPrompt, float fOld );
  135. char *InputStr( char *pchPrompt, char *pchOld );
  136. BOOL InRange( int Value, int iMin, int iMax );
  137. int  Menu( char *pszMenuList[] );
  138. void PopTitle( void );
  139. void PushTitle( char *pchOldTitle );
  140. void PrintAt(int row, int column, char far * lpszString, short sColor);
  141. void PrintChar(int row, int column, char cChar, short sColor);
  142. void SetDisplayColors( void );
  143. void SprintAt( int iRow, int iCol, char * szFmt, ... );
  144. void WrtForm( int yBot );
  145.  
  146. #endif /* CHRTDEMO_H */
  147.