home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / repease / rep1.h < prev    next >
C/C++ Source or Header  |  1995-07-18  |  21KB  |  375 lines

  1. #include "rep_cmd.h"
  2. #include "rep_def.h"
  3.  
  4. /******************************************************************************
  5.     Parameter structure variable.
  6. *******************************************************************************/
  7. PREFIX struct StrForm FormArg;      // copy of the form editor parameters 
  8. PREFIX struct StrRep  RepArg;       // copy of the report initialization function parameters 
  9.  
  10. /******************************************************************************
  11.     Common Parameter variables.
  12. *******************************************************************************/
  13. PREFIX char FrFileName[129];         // current report file name 
  14. PREFIX BOOL FrShowHorBar,            // show horizontal scroll bar 
  15.             FrShowVerBar;            // show vertical scroll bar 
  16.  
  17. PREFIX  HGLOBAL   hItem;             // item table buffer handle
  18. PREFIX  HINSTANCE hFrInst;           // Handle of the current instanaces. 
  19. PREFIX  HINSTANCE hFrPrevInst;       // Handle of the previous instances. 
  20. PREFIX  HANDLE hFrAccTable;          // Fr accelerator table handle 
  21. PREFIX  HWND   hFrParentWnd;         // Handle to the parent window 
  22. PREFIX  CATCHBUF FrAbort;            // Error return location 
  23. PREFIX  MSG_CALLBACK MsgCallback;    // callback function to send REP messages
  24.  
  25. /****************************************************************************
  26.                       Screen Item Structure Array
  27. *****************************************************************************/
  28. PREFIX struct StrItem {
  29.     int type;                // screen item type: LABEL,FIELD,SECTION,LINE
  30.     
  31.     int x;                   // X position of the top/left corner of the object
  32.     int y;                   // Y position of the top/left coner of the object
  33.     int width;               // width of the object 
  34.     int height;              // height of the object
  35.  
  36.     UINT flags;              // Attributes, see OFLAG_ constants 
  37.     
  38.     int section;             // index into 'section' array
  39.  
  40.     int font;                // index into font structure for types LABEL, FIELD or PICT
  41.     int field;               // index into 'field' array for type = FIELD
  42.     
  43.     char label[LINE_WIDTH+1];// label text when type is LABEL
  44.     COLORREF TextColor;      // color of the text when type is LABEL or FIELD
  45.  
  46.     int OutlineSelect;       // selects outlines to draw: OUTLINE_LEFT,OUTLINE_RIGHT,OUTLINE_TOP,OUTLINE_BOT
  47.     int OutlineStyle;        // line style of the bounding rectangle
  48.     int OutlineWidth;        // line width (1/10 mm) of the bounding rectangle
  49.     COLORREF OutlineColor;   // line color of the bounding rectangle
  50.  
  51.     int LineAngle;           // line angle
  52.     int LineStyle;           // line style of the line type item
  53.     int LineWidth;           // line width (1/10 mm) of the line type item
  54.     COLORREF LineColor;      // line color of the line type item
  55.  
  56.     LOGBRUSH brush;          // brush to paint the background rectangle
  57.  
  58.     BOOL     InGroup;        // part of the current group
  59.     BOOL     sized;          // TRUE when item is manually sized
  60.     
  61.     int      HeightAdj;      // temporarily used by Report executer to calculated height adjustment
  62.  
  63.     char     reserved[28];       
  64.  
  65.     #ifndef WIN32
  66.        char  PadTo512[127];  // padding upto 512 bytes
  67.     #endif
  68.  
  69.     } huge *item;
  70.  
  71.  
  72. /******************************************************************************
  73.      Screen display control variables
  74. *******************************************************************************/
  75. PREFIX HWND     hFrWnd,             // handle to the form window 
  76.                 hDescWnd;           // handle to the description window
  77. PREFIX HDC      hFrDC,              // handle to FORM class DC 
  78.                 hMemDC,             // comaptible display context
  79.                 hPictDC,            // comaptible display context to draw picture bitmaps
  80.                 hPrtDC;             // comaptible display context to draw picture bitmaps
  81. PREFIX HFONT    hFrRegFont,         // regular fixed pitched font 
  82.                 hFrCurFont;         // current font in the display context
  83. PREFIX HBITMAP  hBM,                // compatible bitmap
  84.                 hOldBM;             // save the previous bitmap to restore later
  85.  
  86. PREFIX HMENU    hFrMenu;            // handle to the menu 
  87.  
  88. PREFIX TEXTMETRIC FrTextMet;        // Form text metric 
  89. PREFIX HCURSOR  hWaitCursor,        // handle to Hour glass cursor 
  90.                 hArrowCursor,       // Arrow cursor
  91.                 hCrossCursor,       // Cross cursor
  92.                 hHorzCursor,        // Horizontal Cursor
  93.                 hVertCursor,        // Vertical Cursor
  94.                 hDiagCursor,        // Forward diagonal curosr
  95.                 hDiagBackCursor;    // Backward diagonal cursor
  96.  
  97. PREFIX RECT     FrRect,             // form drawing rectangle in pixel units
  98.                 FrWinRect,          // form drawing rectangal in logical units
  99.                 InputRect,          // input area rectangal in logical units
  100.                 RulerRect,          // Ruler area rectangal in logical units
  101.                 CursRect,           // currently selected rectangle in logica units
  102.                 TabRect[8];         // defines tabs for the current rectangle in logical units
  103.  
  104. PREFIX int      TotalItems,         // total number of screen objects
  105.                 SelItem,            // Currently selected screen object
  106.                 CharHeight,         // height of a character using the default font
  107.                 CurCmd,             // Stores the id of the current command
  108.                 CurTab,             // Current sizing tab
  109.                 TotalTabRects,      // number of tab rectangle being displayed
  110.                 ReportWidth,        // report width in device units                              
  111.                 LineWidth,          // maximum current line width in device units                              
  112.                 PaintFlag,          // indicates scope of painting 
  113.                 HorScrollPos,       // horizontal scroll position 
  114.                 VerScrollPos,       // vertical scroll position 
  115.                 FrWidth,            // form width in logical units 
  116.                 FrHeight,           // form height in logical units 
  117.                 FrWinWidth,         // form window width in logical units 
  118.                 FrWinHeight,        // form window height in logical units 
  119.                 FrWinOrgX,          // window origin x co-ordinates 
  120.                 FrWinOrgY,          // window origin y co-ordinates 
  121.                 PaintEnabled,       // When FALSE, disables the window painting 
  122.                 SessionType,        // R=Report Executer, F=Form Editor 
  123.                 ErrorCode,          // latest error code 
  124.                 DescWndType,        // Description window type
  125.                 LastWrapItem;       // last wrap item in the detail section
  126.  
  127. PREFIX BOOL     FocusRectDrawn,     // TRUE if focus rectangle drawn
  128.                 FrModified;         // file modified 
  129.  
  130. PREFIX  WNDPROC OrigEditProc,       // original edit control proceedure
  131.                 OurEditProc;        // new edit control subclass proceedure
  132.  
  133. /******************************************************************************
  134.      Mouse control variables
  135. *******************************************************************************/
  136. PREFIX  int  MouseX,             // current x position of mouse 
  137.              MouseY;             // current y position of mouse   
  138.  
  139. PREFIX BOOL  IgnoreMouseMove;    // ignore mouse move until a mouse button is depressed 
  140.  
  141. /******************************************************************************
  142.      Option Rectangle Variables
  143. *******************************************************************************/
  144. PREFIX BOOL     DrawOptRect;        // TRUE to draw option rectangle
  145. PREFIX RECT     OptRect[MAX_OPTS];  // option rectangles
  146.  
  147. /******************************************************************************
  148.                        Font and Picture Control Data
  149. ******************************************************************************/
  150.  
  151. PREFIX BYTE   FontSign;           // indicates the beginning of the font table 
  152.  
  153. PREFIX struct StrFont {
  154.               BOOL    InUse;      // TRUE indicates that this font/picture is in use in the current document 
  155.               BOOL    IsPict;     // TRUE if this structure represents a picture
  156.               //******* Font Variables *********
  157.               HFONT   hFont;      // font handle 
  158.               LOGFONT lFont;      // logical font structure
  159.               //****** Picture Variables ********
  160.               HBITMAP hBM;        // bitmap handle if style&PICT is TRUE 
  161.               DWORD   ImageSize;  // size of the device independent bitmap image 
  162.               DWORD   InfoSize;   // size of the device independent bitmap information structure 
  163.               HANDLE  hImage;     // handle to the device independent bitmap image 
  164.               HANDLE  hInfo;      // handle to the device independent bitmap info structure 
  165.               int     bmHeight;   // actual height of the stored bitmap 
  166.               int     bmWidth;    // actual width of the stored bitmap 
  167.               int     PictHeight; // display height in point size 
  168.               int     PictWidth;  // display width in point size 
  169.               //****** Common Variables *********
  170.               int     height;     // point size converted to logical units
  171.               int     BaseHeight; // baseline to the top of the character/picture 
  172.               int     CharWidth[256];// stores the character width of each style 
  173.               } far *FrFont;      // pointer to the font structure 
  174.  
  175. PREFIX HANDLE hFrFont;         // handle to the above font structure 
  176.  
  177. PREFIX int    TotalFonts,      // Total fonts in use by the current window 
  178.               NewPict;         // new picture font index being created
  179.  
  180. /******************************************************************************
  181.      Undo operation variables
  182. *******************************************************************************/
  183. PREFIX struct StrItem far *UndoItem;  // pointer to the saved item data
  184. PREFIX int    TotalUndoItems;         // total items in the undo item array
  185.  
  186. /******************************************************************************
  187.      Print control variables
  188. *******************************************************************************/
  189.  
  190. PREFIX char  PrinterName[60],   // name of the printer 
  191.              PrinterDriver[60], // printer driver 
  192.              PrinterPort[60];   // printer port 
  193.  
  194. PREFIX LPDEVMODE pDevMode;      // pointer to the device mode storage 
  195. PREFIX HANDLE  hDevMode;        // handle to device mode memory                
  196.  
  197. PREFIX HWND    hAbortWnd;       // abort window handle 
  198.  
  199. /******************************************************************************
  200.      Color control variables
  201. ******************************************************************************/
  202. PREFIX COLORREF DrawColor,      // color to draw ruler, input area, and divider lines
  203.                 BackColor,      // back ground color
  204.                 InputAreaColor, // input area color
  205.                 SelectionColor, // multiple selection color
  206.                 OptRectColor;   // color of the option rectangles
  207.  
  208. PREFIX HBRUSH   hBackBrush,     // Brush to paint the background
  209.                 hDrawBrush,     // foreground brush
  210.                 hInputAreaBrush;// Input area brush
  211.  
  212. PREFIX HPEN     hFrPen,         // Pen to draw dividers, rulers, input area etc
  213.                 hFocusPen,      // Pen to draw the focus rectangle
  214.                 hSelectionPen;  // color to draw multiple selection rectangle
  215.  
  216. /******************************************************************************
  217.      Field and Section Information
  218. ******************************************************************************/
  219. PREFIX struct StrFormHdr FormHdr; // form file header, defined in rew.h 
  220.  
  221. PREFIX int          NewField,         // index to the new field
  222.                     TotalFields,      // total fields in the field array in use
  223.                     TotalBreakFields; // total break fields in use
  224.  
  225. PREFIX struct StrField huge *field,    // individual field definition, defined in rew.h 
  226.                     huge *TempField,   // temporary fields used for calculations 
  227.                     huge *SortField,   // sort fields 
  228.                     huge *UserField;   // field for application to provide data 
  229.  
  230. PREFIX HANDLE       hField,       // handle for the field array 
  231.                     hTempField,   // handle for the temporary fields 
  232.                     hSortField,   // handle for the sort fields 
  233.                     hUserField;   // handle for the user fields 
  234.  
  235. PREFIX struct StrBreakField {     // define the break fields 
  236.          int SortField;           // field used to sort 
  237.          int CompField;           // field compared to determine section break 
  238.          int section;             // index in to StrSection field 
  239.        }BreakField[MAX_BREAK_FIELDS];
  240.  
  241.  
  242. PREFIX struct StrSection {        // report sections 
  243.          int InUse;               // this section in use 
  244.          unsigned flags;          // flags 
  245.          int columns;             // number of columns across 
  246.          int SelExp[NAME_WIDTH+2]; // section selection criteria
  247.          int selected;            // answer of the selection expression 
  248.          int ScrItem;             // Screen item number for the 
  249.          int height;              // section height in logical units (used by report executer)
  250.          int FirstItem;           // First item in the item array that belongs to this section 
  251.          int ItemCount;           // number of items in the item array which belong to this section
  252.          char reserved[16];       // reserved for future use 
  253.        }section[MAX_SECTIONS];
  254.  
  255. PREFIX char SectionName[MAX_SECTIONS][20],
  256.             FieldString[NAME_WIDTH+2]; // contains the field characters 
  257.  
  258. PREFIX struct StrSysField {       // define the break fields 
  259.          char name[NAME_WIDTH+1]; // field name 
  260.          int type;                // numeric/alphanumeric/logical/date 
  261.          int width;               // initial width of the field 
  262.        }SysField[MAX_SYS_FIELDS];
  263.  
  264. PREFIX char SumName[MAX_VALS][12],          // literals for summary: total,average,count, etc 
  265.             DateFormat[MAX_DT_FORMATS][12], // date format names 
  266.             OpSym[MAX_OPS][14],             // operator symbol 
  267.             far *OpHelp[MAX_OPS];           // operator help message 
  268.  
  269. PREFIX int  OpPrec[MAX_OPS];      // operator precedece 
  270.  
  271. PREFIX BOOL OpUnary[MAX_OPS],     // TRUE if unary operator 
  272.             OpFooter[MAX_OPS],    // operator used for footers only  
  273.             OpFct[MAX_OPS];       // is this operator a function 
  274.  
  275. PREFIX struct StrDlgField {       // dialog field definition 
  276.             int   InUse;          // TRUE indicates that the dialog field is in use 
  277.             char  name[NAME_WIDTH+2];      // field name 
  278.             char  prompt[NAME_WIDTH+2];    // prompt to get data from the user 
  279.             int   type;           // field type, see TYPE_ constants 
  280.             int    PromptOrder;   // prompt order 
  281.             char   CharData[NAME_WIDTH+2]; // character data 
  282.             long   NumData;       // numeric data 
  283.             double DblData;       // double data 
  284.             int    x;             // cooridinates of the dialog box(future use) 
  285.             int    y;               
  286.             int    width;         // width of the field
  287.             int    ValExp[NAME_WIDTH+2]; // validation expression (future use)
  288.             char   reserved[20];  // reserved for future use 
  289.             } DlgField[MAX_DLGS];
  290.  
  291. PREFIX LPSTR      DlgExpString;   // expression string to pass to the dialog box 
  292. PREFIX int        DlgExpType,     // value to pass to the dialog box 
  293.                   DlgCursPos,     // cursor position in the dialog box 
  294.                   DlgIndex,       // pass index info to the dialog box 
  295.                   DlgSec;         // pass the current section to the dialog box 
  296. PREFIX struct StrField DlgTempField;  // for the temporary use by the dialog boxes 
  297.  
  298. /******************************************************************************
  299.                      Variables for printing to a printer
  300. ******************************************************************************/
  301. PREFIX int UseScreen,              // use screen for output 
  302.            ResX,                   // pixels per logical inch in the x direction 
  303.            ResY,                   // pixels per logical inch in the y direction 
  304.            CurHeight,              // CurHeight of the printer page 
  305.            CurX,                   // current X position during printing
  306.            PageCount,              // number of pages printed 
  307.            PageAdvanced,           // set after page is advanced
  308.            AdvancingPage,          // set during page advance
  309.            CurCol,                 // current report column for multiple column report 
  310.            TrialMode,              // trial mode prints trial records 
  311.            LeftMargin,             // margins in device units 
  312.            RightMargin,
  313.            TopMargin,
  314.            BottomMargin,
  315.            PrintWidth,             // paper width in device units 
  316.            PrintHeight,            // paper height in device units               
  317.            PageHeight,             // height of the printed page in logical units
  318.            LastY;                  // Last Y position used for printing
  319.  
  320. PREFIX long RecCount;              // current number of records processed
  321.  
  322. PREFIX float PrintWidthInches,     // paper width/height in inches 
  323.              PrintHeightInches;
  324.  
  325. PREFIX char *MonthName[12],        // month names 
  326.             SystemTime[9];         // system time 
  327.  
  328. PREFIX long SystemDate;            // system date 
  329.  
  330.  
  331. PREFIX FARPROC lpProc,             // printing abort control process 
  332.                lpAbortDlg;         // printing abort dialog process 
  333.  
  334. PREFIX HWND    hAbortDlg;          // handle to the dialog box to allow suspending the printing session 
  335.  
  336. /******************************************************************************
  337.                      Variables for printing on the screen
  338. ******************************************************************************/
  339. PREFIX HANDLE hPageLoc;            // screen page location table
  340. PREFIX long far *PageLoc;          // pointer to the page location table
  341.  
  342. PREFIX int  ScrPage,               // current screen page
  343.             ReportStatus,          // status: suspended, resumed, or abort 
  344.             ReportStage,           // processing records, writing footer, or in exit 
  345.             FirstPrintPage,        // first page to print from screen
  346.             LastPrintPage;         // last page to print from screen
  347.  
  348. PREFIX BOOL printing;              // TRUE=selective printing from screen in progress
  349.  
  350. PREFIX HDC  hMetaDC;               // metafile device context
  351. PREFIX HMETAFILE hMetaFile;        // current meta file
  352.  
  353. PREFIX char MetaFile[128],         // meta file
  354.             TempMetaFile[128],     // meta file to hold the current page
  355.             ScrMetaFile[128],      // meta file to show screen pages
  356.             PrtMetaFile[128];      // meta file to print selective pages
  357.  
  358. PREFIX LPSTR   FileBuf;           // file buffer
  359.  
  360. /******************************************************************************
  361.      Miscellaneous variables.
  362. *******************************************************************************/
  363.  
  364. PREFIX BOOL       FrHelpWanted,        // TRUE when help is requested 
  365.                   WindowBeingCreated,  // TRUE when a window is being created 
  366.                   Win32;               // TRUE for a WIN32 session
  367.  
  368. PREFIX char       msg[LINE_WIDTH+2],   // general purpose buffer 
  369.                   FrHelpFile[13];      // Help file for the editor 
  370.  
  371. /******************************************************************************
  372.      INTERNAL PROTOTYPES
  373. *******************************************************************************/
  374. #include "rep_prot.h"
  375.