home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / MSJV5-6.ZIP / WINTRO3.ZIP / STOCK.H < prev    next >
C/C++ Source or Header  |  1990-11-01  |  5KB  |  178 lines

  1. /*===========================================================================*/
  2. /*                                                                           */
  3. /* File    : STOCK.H                                                         */
  4. /*                                                                           */
  5. /* Purpose :                                                                 */
  6. /*                                                                           */
  7. /* History :                                                                 */
  8. /*                                                                           */
  9. /* (C) Copyright 1990 Marc Adler/Magma Systems     All Rights Reserved       */
  10. /*===========================================================================*/
  11.  
  12.  
  13. extern HANDLE hThisInstance;  /* Program instance handle */
  14. extern HWND hWndMain;         /* Handle to main window   */
  15. extern HWND hwndMDIClient;    /* Handle to MDI client    */
  16. extern HWND hWndActive;
  17. extern HWND hWndStatus;
  18.   #define Y_STATUSWINDOW   20   /* The height of the status window */
  19. extern HANDLE hCurrStockInfo;
  20.  
  21. #define CBWNDEXTRA          sizeof(HANDLE)
  22.  
  23.  
  24. /*
  25.   Stock information
  26. */
  27.  
  28. #define MAXSTOCKNAME     4
  29. #define MAXDESCRIPTION   32
  30.  
  31. typedef struct tagDate
  32. {
  33.   BYTE   chMonth;
  34.   BYTE   chDay;
  35.   BYTE   chYear;
  36. } DATE;
  37.  
  38. typedef struct tagPrice
  39. {
  40.   DWORD  dwTotal;      /* dollar amt * iDenominator + fractional amount */
  41. } PRICE;
  42.  
  43. typedef struct tagTick
  44. {
  45.   PRICE  price;
  46.   DWORD  dwVolume;
  47.   DATE   date;
  48. } TICK, FAR *LPTICK;
  49.  
  50. /*
  51.   Data structure describing how we draw the graph
  52. */
  53. typedef struct tagGraphInfo
  54. {
  55.   DWORD dwMinPrice;
  56.   DWORD dwMaxPrice;
  57.   DWORD dwScaleFactor;
  58.   DWORD dwTickInterval;
  59.   WORD  iDenominator;    /* the fractional amount used for this stock */
  60.   WORD  iGridPen;
  61. } GRAPHINFO, FAR *LPGRAPHINFO;
  62.  
  63.  
  64. typedef struct tagStockFile
  65. {
  66.   DWORD  dwMagic;
  67. #define MAGIC_COOKIE             66666666L
  68.   char   szStock[MAXSTOCKNAME];
  69.   char   szDescription[MAXDESCRIPTION];
  70.   GRAPHINFO graphinfo;
  71.   WORD   nTicks;
  72. /*
  73.   TICK   aTicks[1];
  74. */
  75. } STOCKFILE;
  76.  
  77. typedef struct tagInCoreStockInfo
  78. {
  79.   char      szFileName[14];  /* file name where the stock data is kept  */
  80.   STOCKFILE StockFile;       /* a copy of the stock file header         */
  81.   HANDLE    hTicks;
  82.   HWND      hWnd;            /* window which the stock is shown in      */
  83.   DWORD     dwFlags;         /* any kind of status bits we need to keep */
  84. #define STATE_HAS_VGRID  1L
  85. #define STATE_HAS_HGRID  2L
  86.   HANDLE    hNextStockInfo;  /* link to next stock info structure       */
  87. } STOCKINFO, FAR *LPSTOCKINFO;
  88.  
  89.  
  90. #define ID_ABOUT            99
  91. #define ID_STOCK            100
  92. #define ID_GRAPH            101
  93.  
  94. #define ID_NEW              101
  95. #define ID_OPEN             102
  96. #define ID_SAVE             103
  97. #define ID_CLOSE            104
  98. #define ID_PRINT            105
  99. #define ID_EXIT             106
  100. #define ID_MAP              107
  101.  
  102. #define ID_TICK_ADD         200
  103. #define ID_TICK_CHANGE      201
  104. #define ID_GRAPH_PRICE      202
  105. #define ID_GRAPH_VOLUME     203
  106. #define ID_GRAPH_ZOOM       204
  107. #define ID_GRAPH_COLORS     205
  108. #define ID_GRAPH_OPTIONS    199
  109. #define ID_GRAPH_GRID_HORZ  206
  110. #define ID_GRAPH_GRID_VERT  207
  111. #define ID_WINDOW_TILE      208
  112. #define ID_WINDOW_CASCADE   209
  113. #define ID_WINDOW_ICONS     210
  114. #define ID_WINDOW_CLOSEALL  211
  115. #define ID_WINDOW_CHILDREN  220
  116.  
  117. #define ID_TICK_DATE        100
  118. #define ID_TICK_PRICE       101
  119. #define ID_TICK_VOLUME      102
  120.  
  121.  
  122. #define ID_RECTTEXT   120
  123. #define ID_VXEXT      109
  124. #define ID_VXORG      107
  125. #define ID_VYEXT      111
  126. #define ID_VYORG      113
  127. #define ID_WXEXT      103
  128. #define ID_WXORG      101
  129. #define ID_WYEXT      105
  130. #define ID_WYORG      115
  131.  
  132. #define IDC_FILENAME  400
  133. #define IDC_EDIT      401
  134. #define IDC_FILES     402
  135. #define IDC_PATH      403
  136. #define IDC_LISTBOX   404
  137.  
  138.  
  139. /*
  140.   Stuff for graph dialog box
  141. */
  142. #define ID_SYMBOL     300
  143. #define ID_MINPRICE   301
  144. #define ID_MAXPRICE   302
  145. #define ID_FACTOR     303
  146. #define ID_TICKINT    304
  147. #define ID_HORZGRID   305
  148. #define ID_VERTGRID   306
  149. #define ID_GRIDSTYLE  307
  150. #define ID_HELP       308
  151. #define ID_DENOMINATOR 309
  152.  
  153.  
  154.  
  155. int NEAR PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
  156. BOOL FAR PASCAL InitializeApplication(VOID);
  157. BOOL FAR PASCAL InitializeInstance(LPSTR lpCmdLine, WORD nCmdShow);
  158. LONG FAR PASCAL MainWndProc(HWND, WORD, WORD, LONG);
  159. LONG FAR PASCAL StatusWndProc(HWND, WORD, WORD, LONG);
  160. LONG FAR PASCAL GraphWndProc(HWND, WORD, WORD, LONG);
  161. BOOL FAR PASCAL AboutDlgProc(HWND, WORD, WORD, LONG);
  162. BOOL FAR PASCAL MapDlgProc(HWND, WORD, WORD, LONG);
  163. BOOL FAR PASCAL AddTickDlgProc(HWND, WORD, WORD, LONG);
  164. BOOL FAR PASCAL GraphInfoDlgProc(HWND, WORD, WORD, LONG);
  165. VOID MainPaint(HWND, HDC);
  166. int PASCAL StockFileRead(LPSTR szFileName);
  167. HWND PASCAL GraphCreateWindow(LPSTR lpName);
  168. int PASCAL GraphWndPaint(HWND hWnd, HDC hDC, LPSTOCKINFO lpStockInfo);
  169.  
  170. /* FILEOPEN.C */
  171. HANDLE FAR PASCAL OpenDlg(HWND, unsigned, WORD, LONG);
  172. void SeparateFile(HWND, LPSTR, LPSTR, LPSTR);
  173. void UpdateListBox(HWND);
  174. void AddExt(PSTR, PSTR);
  175. void ChangeDefExt(PSTR, PSTR);
  176.  
  177.  
  178.