File:  [OS/2 SDKs] / pmsdk / samples / newcard / cfdata.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:28:12 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: pmsdk-1988, HEAD
Microsoft OS/2 SDK PM 08-08-1988

#include "cardfile.h"

/*********************************************************************/
/*  Windows/PM Cardfile Shared Code                                  */
/*                                                                   */
/*  (c) Copyright Microsoft Corp. 1987,1988 - All Rights Reserved    */
/*********************************************************************/

/*********************************************************************/
/*    The following shared code was developed from the original      */
/* Cardfile application.  This code can be compiled to run under     */
/* either the Windows or the PM manager environment.  All            */
/* functionality associated with bitmaps or printing has been        */
/* deleted.  Some comments refering to these functions may still be  */
/* present in the code and should be disregarded. jw.                */
/*********************************************************************/


HINST hCardfileInstance;  /* instance handle */

/* variables for cardfile's main window */
HWND   hCardfileWnd;       /* cardfile's main window */
HANDLE hAccel;          /* handle of accelerator table */
char rgchCardfileClass[] = "Cardfile"; /* Class name - not translatable. */

int CardPhone = IDM_CARDFILE;   /* mode: either IDM_CARDFILE or IDM_PHONEBOOK */

/* font metrics */
int     CharFixWidth;   /* width of the system font */
int     CharFixHeight;  /* height of the system font */
int ExtLeading;         /* external leading of the system font */

/* variables relating to display ************************************/
/*               |                 |  |  |                   -      */
/*            +-----------------+  |  |--+                   |      */
/*            |                 |  |  |                      |      */
/*         +-----------------+  |  |--+                      |      */
/*         |                 |  |  |             yFirstCard--+      */
/*       +----------------+  |  |--+   -                     |      */
/*       |                |  |  |      +-ySpacing            |      */
/*     +---------------+  |  |--+      -            -        -      */
/*     |               |  |  |                      |               */
/*     |---------------|  |--+                      |               */
/*     |               |  |                     CardHeight          */
/*     |               |--+                         |               */
/*     |               |                            |               */
/*     +---------------+                            -               */
/*                                                                  */
/*     |---CardWidth---|                                            */
/*                                                                  */
/*|-+--|                                                            */
/*  |                                                               */
/*  +--xFirstCard                                                   */
/*                                                                  */
/*                                                                  */
/*                                                                  */
/*  In this case:                                                   */
/*      cScreenHeads = 5   (there are 5 partially visible)          */
/*      cFSHeads = 4       (only 4 are fully visible)               */
/*      cScreenCards = 7                                            */
/*                                                                  */
/*                                                                  */
/*                                                                  */
/********************************************************************/

int CardWidth;      /* the screen width of a card */
int CardHeight;     /* the screen height of a card */
int cScreenHeads;   /* the num of headers that are partially visible (>=1) */
int cFSHeads;       /* the num of fully visible headers */
int cScreenCards;   /* the num of cards that are partially visible (>=1) */
int xFirstCard;     /* the x */
int yFirstCard;     /* and y coordinates of the front card */
int ySpacing;       /* the y offset of each card (CharFixHeight + 1) */

int cxMainWindow;       /* current width of main window */
int cyMainWindow;       /* current height of main window */

int iFirstCard = 0;     /* front card on screen */
int iTopCard   = 0;     /* in phonemode, the first visible line */

/* variables relating to list of cards */
int     cCards;                 /* the current number of cards */
HANDLE  hCards;                 /* the handle of the header buffer */
CARDHEADER CurCardHead;         /* the header struct for the front card */
CARD       CurCard;             /* the data for the front card */

/* Headings for sections of win.ini */
char rgchWindows[] = "Windows";
char rgchDevice[] =  "Device";

unsigned wMerge;        /* value used by MergeStrings */

HWND    hCardWnd;                    /* the edit control window handle */

/* brush handles */

/* PM Note: For PM, the type HBRUSH is defined to be a long (color) */

HBRUSH hbrBack;   /* handle of brush with background color */
                  /* this will be BLUE on a color system, gray on B/W */
HBRUSH hbrLine;   /* handle of brush with color of line on card */
                  /* this will be RED on a color system, black on B/W */
HBRUSH hbrWhite;  /* white brush */
HBRUSH hbrBlack;  /* black brush */
HBRUSH hbrGray;   /* gray brush */


int fFileDirty = FALSE; /* TRUE is the user has made changes */

/* dialog procs */
FARPROC lpDlgProc;
FARPROC lpfnOpen;
FARPROC lpfnSave;
FARPROC lpfnAbout;
FARPROC lpEditWndProc;

/* strings of interest */
char rgchCardfile[40];              /* title bar name - translatable */
char CurIFile[PATHMAX];             /* pathname of current file */
char CurIFind[40];                  /* current search pattern */
char rgchUntitled[30];              /* "Untitled" string - translatable */
char NotEnoughMem[50];              /* "Not enough Memory" */
char rgchCardData[40];              /* "Cardfile data" for temp file */
char TmpFile[PATHMAX];              /* the tempfilename */
char szExtSave[] = "\\*.CRD";       /* used by open and save */

/* relating to scrolling */
int fCardCleared = FALSE;   /* TRUE if the card has been erased */
int iCardStartScroll;       /* the front card before start of scroll */
int fScrolling = FALSE;     /* true if scrolling */

OFSTRUCT tmpreopen;         /* saves pathname of Cardfile */
OFSTRUCT mainreopen;        /* saves pathname of Tempfile */
int fReadOnly = FALSE;      /* TRUE in weird cases */

int DBcmd;                  /* dialog function needs to know which command */



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.