home *** CD-ROM | disk | FTP | other *** search
- #include "rep_cmd.h"
- #include "rep_def.h"
-
- /******************************************************************************
- Parameter structure variable.
- *******************************************************************************/
- PREFIX struct StrForm FormArg; // copy of the form editor parameters
- PREFIX struct StrRep RepArg; // copy of the report initialization function parameters
-
- /******************************************************************************
- Common Parameter variables.
- *******************************************************************************/
- PREFIX char FrFileName[129]; // current report file name
- PREFIX BOOL FrShowHorBar, // show horizontal scroll bar
- FrShowVerBar; // show vertical scroll bar
-
- PREFIX HGLOBAL hItem; // item table buffer handle
- PREFIX HINSTANCE hFrInst; // Handle of the current instanaces.
- PREFIX HINSTANCE hFrPrevInst; // Handle of the previous instances.
- PREFIX HANDLE hFrAccTable; // Fr accelerator table handle
- PREFIX HWND hFrParentWnd; // Handle to the parent window
- PREFIX CATCHBUF FrAbort; // Error return location
- PREFIX MSG_CALLBACK MsgCallback; // callback function to send REP messages
-
- /****************************************************************************
- Screen Item Structure Array
- *****************************************************************************/
- PREFIX struct StrItem {
- int type; // screen item type: LABEL,FIELD,SECTION,LINE
-
- int x; // X position of the top/left corner of the object
- int y; // Y position of the top/left coner of the object
- int width; // width of the object
- int height; // height of the object
-
- UINT flags; // Attributes, see OFLAG_ constants
-
- int section; // index into 'section' array
-
- int font; // index into font structure for types LABEL, FIELD or PICT
- int field; // index into 'field' array for type = FIELD
-
- char label[LINE_WIDTH+1];// label text when type is LABEL
- COLORREF TextColor; // color of the text when type is LABEL or FIELD
-
- int OutlineSelect; // selects outlines to draw: OUTLINE_LEFT,OUTLINE_RIGHT,OUTLINE_TOP,OUTLINE_BOT
- int OutlineStyle; // line style of the bounding rectangle
- int OutlineWidth; // line width (1/10 mm) of the bounding rectangle
- COLORREF OutlineColor; // line color of the bounding rectangle
-
- int LineAngle; // line angle
- int LineStyle; // line style of the line type item
- int LineWidth; // line width (1/10 mm) of the line type item
- COLORREF LineColor; // line color of the line type item
-
- LOGBRUSH brush; // brush to paint the background rectangle
-
- BOOL InGroup; // part of the current group
- BOOL sized; // TRUE when item is manually sized
-
- int HeightAdj; // temporarily used by Report executer to calculated height adjustment
-
- char reserved[28];
-
- #ifndef WIN32
- char PadTo512[127]; // padding upto 512 bytes
- #endif
-
- } huge *item;
-
-
- /******************************************************************************
- Screen display control variables
- *******************************************************************************/
- PREFIX HWND hFrWnd, // handle to the form window
- hDescWnd; // handle to the description window
- PREFIX HDC hFrDC, // handle to FORM class DC
- hMemDC, // comaptible display context
- hPictDC, // comaptible display context to draw picture bitmaps
- hPrtDC; // comaptible display context to draw picture bitmaps
- PREFIX HFONT hFrRegFont, // regular fixed pitched font
- hFrCurFont; // current font in the display context
- PREFIX HBITMAP hBM, // compatible bitmap
- hOldBM; // save the previous bitmap to restore later
-
- PREFIX HMENU hFrMenu; // handle to the menu
-
- PREFIX TEXTMETRIC FrTextMet; // Form text metric
- PREFIX HCURSOR hWaitCursor, // handle to Hour glass cursor
- hArrowCursor, // Arrow cursor
- hCrossCursor, // Cross cursor
- hHorzCursor, // Horizontal Cursor
- hVertCursor, // Vertical Cursor
- hDiagCursor, // Forward diagonal curosr
- hDiagBackCursor; // Backward diagonal cursor
-
- PREFIX RECT FrRect, // form drawing rectangle in pixel units
- FrWinRect, // form drawing rectangal in logical units
- InputRect, // input area rectangal in logical units
- RulerRect, // Ruler area rectangal in logical units
- CursRect, // currently selected rectangle in logica units
- TabRect[8]; // defines tabs for the current rectangle in logical units
-
- PREFIX int TotalItems, // total number of screen objects
- SelItem, // Currently selected screen object
- CharHeight, // height of a character using the default font
- CurCmd, // Stores the id of the current command
- CurTab, // Current sizing tab
- TotalTabRects, // number of tab rectangle being displayed
- ReportWidth, // report width in device units
- LineWidth, // maximum current line width in device units
- PaintFlag, // indicates scope of painting
- HorScrollPos, // horizontal scroll position
- VerScrollPos, // vertical scroll position
- FrWidth, // form width in logical units
- FrHeight, // form height in logical units
- FrWinWidth, // form window width in logical units
- FrWinHeight, // form window height in logical units
- FrWinOrgX, // window origin x co-ordinates
- FrWinOrgY, // window origin y co-ordinates
- PaintEnabled, // When FALSE, disables the window painting
- SessionType, // R=Report Executer, F=Form Editor
- ErrorCode, // latest error code
- DescWndType, // Description window type
- LastWrapItem; // last wrap item in the detail section
-
- PREFIX BOOL FocusRectDrawn, // TRUE if focus rectangle drawn
- FrModified; // file modified
-
- PREFIX WNDPROC OrigEditProc, // original edit control proceedure
- OurEditProc; // new edit control subclass proceedure
-
- /******************************************************************************
- Mouse control variables
- *******************************************************************************/
- PREFIX int MouseX, // current x position of mouse
- MouseY; // current y position of mouse
-
- PREFIX BOOL IgnoreMouseMove; // ignore mouse move until a mouse button is depressed
-
- /******************************************************************************
- Option Rectangle Variables
- *******************************************************************************/
- PREFIX BOOL DrawOptRect; // TRUE to draw option rectangle
- PREFIX RECT OptRect[MAX_OPTS]; // option rectangles
-
- /******************************************************************************
- Font and Picture Control Data
- ******************************************************************************/
-
- PREFIX BYTE FontSign; // indicates the beginning of the font table
-
- PREFIX struct StrFont {
- BOOL InUse; // TRUE indicates that this font/picture is in use in the current document
- BOOL IsPict; // TRUE if this structure represents a picture
- //******* Font Variables *********
- HFONT hFont; // font handle
- LOGFONT lFont; // logical font structure
- //****** Picture Variables ********
- HBITMAP hBM; // bitmap handle if style&PICT is TRUE
- DWORD ImageSize; // size of the device independent bitmap image
- DWORD InfoSize; // size of the device independent bitmap information structure
- HANDLE hImage; // handle to the device independent bitmap image
- HANDLE hInfo; // handle to the device independent bitmap info structure
- int bmHeight; // actual height of the stored bitmap
- int bmWidth; // actual width of the stored bitmap
- int PictHeight; // display height in point size
- int PictWidth; // display width in point size
- //****** Common Variables *********
- int height; // point size converted to logical units
- int BaseHeight; // baseline to the top of the character/picture
- int CharWidth[256];// stores the character width of each style
- } far *FrFont; // pointer to the font structure
-
- PREFIX HANDLE hFrFont; // handle to the above font structure
-
- PREFIX int TotalFonts, // Total fonts in use by the current window
- NewPict; // new picture font index being created
-
- /******************************************************************************
- Undo operation variables
- *******************************************************************************/
- PREFIX struct StrItem far *UndoItem; // pointer to the saved item data
- PREFIX int TotalUndoItems; // total items in the undo item array
-
- /******************************************************************************
- Print control variables
- *******************************************************************************/
-
- PREFIX char PrinterName[60], // name of the printer
- PrinterDriver[60], // printer driver
- PrinterPort[60]; // printer port
-
- PREFIX LPDEVMODE pDevMode; // pointer to the device mode storage
- PREFIX HANDLE hDevMode; // handle to device mode memory
-
- PREFIX HWND hAbortWnd; // abort window handle
-
- /******************************************************************************
- Color control variables
- ******************************************************************************/
- PREFIX COLORREF DrawColor, // color to draw ruler, input area, and divider lines
- BackColor, // back ground color
- InputAreaColor, // input area color
- SelectionColor, // multiple selection color
- OptRectColor; // color of the option rectangles
-
- PREFIX HBRUSH hBackBrush, // Brush to paint the background
- hDrawBrush, // foreground brush
- hInputAreaBrush;// Input area brush
-
- PREFIX HPEN hFrPen, // Pen to draw dividers, rulers, input area etc
- hFocusPen, // Pen to draw the focus rectangle
- hSelectionPen; // color to draw multiple selection rectangle
-
- /******************************************************************************
- Field and Section Information
- ******************************************************************************/
- PREFIX struct StrFormHdr FormHdr; // form file header, defined in rew.h
-
- PREFIX int NewField, // index to the new field
- TotalFields, // total fields in the field array in use
- TotalBreakFields; // total break fields in use
-
- PREFIX struct StrField huge *field, // individual field definition, defined in rew.h
- huge *TempField, // temporary fields used for calculations
- huge *SortField, // sort fields
- huge *UserField; // field for application to provide data
-
- PREFIX HANDLE hField, // handle for the field array
- hTempField, // handle for the temporary fields
- hSortField, // handle for the sort fields
- hUserField; // handle for the user fields
-
- PREFIX struct StrBreakField { // define the break fields
- int SortField; // field used to sort
- int CompField; // field compared to determine section break
- int section; // index in to StrSection field
- }BreakField[MAX_BREAK_FIELDS];
-
-
- PREFIX struct StrSection { // report sections
- int InUse; // this section in use
- unsigned flags; // flags
- int columns; // number of columns across
- int SelExp[NAME_WIDTH+2]; // section selection criteria
- int selected; // answer of the selection expression
- int ScrItem; // Screen item number for the
- int height; // section height in logical units (used by report executer)
- int FirstItem; // First item in the item array that belongs to this section
- int ItemCount; // number of items in the item array which belong to this section
- char reserved[16]; // reserved for future use
- }section[MAX_SECTIONS];
-
- PREFIX char SectionName[MAX_SECTIONS][20],
- FieldString[NAME_WIDTH+2]; // contains the field characters
-
- PREFIX struct StrSysField { // define the break fields
- char name[NAME_WIDTH+1]; // field name
- int type; // numeric/alphanumeric/logical/date
- int width; // initial width of the field
- }SysField[MAX_SYS_FIELDS];
-
- PREFIX char SumName[MAX_VALS][12], // literals for summary: total,average,count, etc
- DateFormat[MAX_DT_FORMATS][12], // date format names
- OpSym[MAX_OPS][14], // operator symbol
- far *OpHelp[MAX_OPS]; // operator help message
-
- PREFIX int OpPrec[MAX_OPS]; // operator precedece
-
- PREFIX BOOL OpUnary[MAX_OPS], // TRUE if unary operator
- OpFooter[MAX_OPS], // operator used for footers only
- OpFct[MAX_OPS]; // is this operator a function
-
- PREFIX struct StrDlgField { // dialog field definition
- int InUse; // TRUE indicates that the dialog field is in use
- char name[NAME_WIDTH+2]; // field name
- char prompt[NAME_WIDTH+2]; // prompt to get data from the user
- int type; // field type, see TYPE_ constants
- int PromptOrder; // prompt order
- char CharData[NAME_WIDTH+2]; // character data
- long NumData; // numeric data
- double DblData; // double data
- int x; // cooridinates of the dialog box(future use)
- int y;
- int width; // width of the field
- int ValExp[NAME_WIDTH+2]; // validation expression (future use)
- char reserved[20]; // reserved for future use
- } DlgField[MAX_DLGS];
-
- PREFIX LPSTR DlgExpString; // expression string to pass to the dialog box
- PREFIX int DlgExpType, // value to pass to the dialog box
- DlgCursPos, // cursor position in the dialog box
- DlgIndex, // pass index info to the dialog box
- DlgSec; // pass the current section to the dialog box
- PREFIX struct StrField DlgTempField; // for the temporary use by the dialog boxes
-
- /******************************************************************************
- Variables for printing to a printer
- ******************************************************************************/
- PREFIX int UseScreen, // use screen for output
- ResX, // pixels per logical inch in the x direction
- ResY, // pixels per logical inch in the y direction
- CurHeight, // CurHeight of the printer page
- CurX, // current X position during printing
- PageCount, // number of pages printed
- PageAdvanced, // set after page is advanced
- AdvancingPage, // set during page advance
- CurCol, // current report column for multiple column report
- TrialMode, // trial mode prints trial records
- LeftMargin, // margins in device units
- RightMargin,
- TopMargin,
- BottomMargin,
- PrintWidth, // paper width in device units
- PrintHeight, // paper height in device units
- PageHeight, // height of the printed page in logical units
- LastY; // Last Y position used for printing
-
- PREFIX long RecCount; // current number of records processed
-
- PREFIX float PrintWidthInches, // paper width/height in inches
- PrintHeightInches;
-
- PREFIX char *MonthName[12], // month names
- SystemTime[9]; // system time
-
- PREFIX long SystemDate; // system date
-
-
- PREFIX FARPROC lpProc, // printing abort control process
- lpAbortDlg; // printing abort dialog process
-
- PREFIX HWND hAbortDlg; // handle to the dialog box to allow suspending the printing session
-
- /******************************************************************************
- Variables for printing on the screen
- ******************************************************************************/
- PREFIX HANDLE hPageLoc; // screen page location table
- PREFIX long far *PageLoc; // pointer to the page location table
-
- PREFIX int ScrPage, // current screen page
- ReportStatus, // status: suspended, resumed, or abort
- ReportStage, // processing records, writing footer, or in exit
- FirstPrintPage, // first page to print from screen
- LastPrintPage; // last page to print from screen
-
- PREFIX BOOL printing; // TRUE=selective printing from screen in progress
-
- PREFIX HDC hMetaDC; // metafile device context
- PREFIX HMETAFILE hMetaFile; // current meta file
-
- PREFIX char MetaFile[128], // meta file
- TempMetaFile[128], // meta file to hold the current page
- ScrMetaFile[128], // meta file to show screen pages
- PrtMetaFile[128]; // meta file to print selective pages
-
- PREFIX LPSTR FileBuf; // file buffer
-
- /******************************************************************************
- Miscellaneous variables.
- *******************************************************************************/
-
- PREFIX BOOL FrHelpWanted, // TRUE when help is requested
- WindowBeingCreated, // TRUE when a window is being created
- Win32; // TRUE for a WIN32 session
-
- PREFIX char msg[LINE_WIDTH+2], // general purpose buffer
- FrHelpFile[13]; // Help file for the editor
-
- /******************************************************************************
- INTERNAL PROTOTYPES
- *******************************************************************************/
- #include "rep_prot.h"
-