Annotation of pmsdk/samples/newcard/cfdata.c, revision 1.1

1.1     ! root        1: #include "cardfile.h"
        !             2: 
        !             3: /*********************************************************************/
        !             4: /*  Windows/PM Cardfile Shared Code                                  */
        !             5: /*                                                                   */
        !             6: /*  (c) Copyright Microsoft Corp. 1987,1988 - All Rights Reserved    */
        !             7: /*********************************************************************/
        !             8: 
        !             9: /*********************************************************************/
        !            10: /*    The following shared code was developed from the original      */
        !            11: /* Cardfile application.  This code can be compiled to run under     */
        !            12: /* either the Windows or the PM manager environment.  All            */
        !            13: /* functionality associated with bitmaps or printing has been        */
        !            14: /* deleted.  Some comments refering to these functions may still be  */
        !            15: /* present in the code and should be disregarded. jw.                */
        !            16: /*********************************************************************/
        !            17: 
        !            18: 
        !            19: HINST hCardfileInstance;  /* instance handle */
        !            20: 
        !            21: /* variables for cardfile's main window */
        !            22: HWND   hCardfileWnd;       /* cardfile's main window */
        !            23: HANDLE hAccel;          /* handle of accelerator table */
        !            24: char rgchCardfileClass[] = "Cardfile"; /* Class name - not translatable. */
        !            25: 
        !            26: int CardPhone = IDM_CARDFILE;   /* mode: either IDM_CARDFILE or IDM_PHONEBOOK */
        !            27: 
        !            28: /* font metrics */
        !            29: int     CharFixWidth;   /* width of the system font */
        !            30: int     CharFixHeight;  /* height of the system font */
        !            31: int ExtLeading;         /* external leading of the system font */
        !            32: 
        !            33: /* variables relating to display ************************************/
        !            34: /*               |                 |  |  |                   -      */
        !            35: /*            +-----------------+  |  |--+                   |      */
        !            36: /*            |                 |  |  |                      |      */
        !            37: /*         +-----------------+  |  |--+                      |      */
        !            38: /*         |                 |  |  |             yFirstCard--+      */
        !            39: /*       +----------------+  |  |--+   -                     |      */
        !            40: /*       |                |  |  |      +-ySpacing            |      */
        !            41: /*     +---------------+  |  |--+      -            -        -      */
        !            42: /*     |               |  |  |                      |               */
        !            43: /*     |---------------|  |--+                      |               */
        !            44: /*     |               |  |                     CardHeight          */
        !            45: /*     |               |--+                         |               */
        !            46: /*     |               |                            |               */
        !            47: /*     +---------------+                            -               */
        !            48: /*                                                                  */
        !            49: /*     |---CardWidth---|                                            */
        !            50: /*                                                                  */
        !            51: /*|-+--|                                                            */
        !            52: /*  |                                                               */
        !            53: /*  +--xFirstCard                                                   */
        !            54: /*                                                                  */
        !            55: /*                                                                  */
        !            56: /*                                                                  */
        !            57: /*  In this case:                                                   */
        !            58: /*      cScreenHeads = 5   (there are 5 partially visible)          */
        !            59: /*      cFSHeads = 4       (only 4 are fully visible)               */
        !            60: /*      cScreenCards = 7                                            */
        !            61: /*                                                                  */
        !            62: /*                                                                  */
        !            63: /*                                                                  */
        !            64: /********************************************************************/
        !            65: 
        !            66: int CardWidth;      /* the screen width of a card */
        !            67: int CardHeight;     /* the screen height of a card */
        !            68: int cScreenHeads;   /* the num of headers that are partially visible (>=1) */
        !            69: int cFSHeads;       /* the num of fully visible headers */
        !            70: int cScreenCards;   /* the num of cards that are partially visible (>=1) */
        !            71: int xFirstCard;     /* the x */
        !            72: int yFirstCard;     /* and y coordinates of the front card */
        !            73: int ySpacing;       /* the y offset of each card (CharFixHeight + 1) */
        !            74: 
        !            75: int cxMainWindow;       /* current width of main window */
        !            76: int cyMainWindow;       /* current height of main window */
        !            77: 
        !            78: int iFirstCard = 0;     /* front card on screen */
        !            79: int iTopCard   = 0;     /* in phonemode, the first visible line */
        !            80: 
        !            81: /* variables relating to list of cards */
        !            82: int     cCards;                 /* the current number of cards */
        !            83: HANDLE  hCards;                 /* the handle of the header buffer */
        !            84: CARDHEADER CurCardHead;         /* the header struct for the front card */
        !            85: CARD       CurCard;             /* the data for the front card */
        !            86: 
        !            87: /* Headings for sections of win.ini */
        !            88: char rgchWindows[] = "Windows";
        !            89: char rgchDevice[] =  "Device";
        !            90: 
        !            91: unsigned wMerge;        /* value used by MergeStrings */
        !            92: 
        !            93: HWND    hCardWnd;                    /* the edit control window handle */
        !            94: 
        !            95: /* brush handles */
        !            96: 
        !            97: /* PM Note: For PM, the type HBRUSH is defined to be a long (color) */
        !            98: 
        !            99: HBRUSH hbrBack;   /* handle of brush with background color */
        !           100:                   /* this will be BLUE on a color system, gray on B/W */
        !           101: HBRUSH hbrLine;   /* handle of brush with color of line on card */
        !           102:                   /* this will be RED on a color system, black on B/W */
        !           103: HBRUSH hbrWhite;  /* white brush */
        !           104: HBRUSH hbrBlack;  /* black brush */
        !           105: HBRUSH hbrGray;   /* gray brush */
        !           106: 
        !           107: 
        !           108: int fFileDirty = FALSE; /* TRUE is the user has made changes */
        !           109: 
        !           110: /* dialog procs */
        !           111: FARPROC lpDlgProc;
        !           112: FARPROC lpfnOpen;
        !           113: FARPROC lpfnSave;
        !           114: FARPROC lpfnAbout;
        !           115: FARPROC lpEditWndProc;
        !           116: 
        !           117: /* strings of interest */
        !           118: char rgchCardfile[40];              /* title bar name - translatable */
        !           119: char CurIFile[PATHMAX];             /* pathname of current file */
        !           120: char CurIFind[40];                  /* current search pattern */
        !           121: char rgchUntitled[30];              /* "Untitled" string - translatable */
        !           122: char NotEnoughMem[50];              /* "Not enough Memory" */
        !           123: char rgchCardData[40];              /* "Cardfile data" for temp file */
        !           124: char TmpFile[PATHMAX];              /* the tempfilename */
        !           125: char szExtSave[] = "\\*.CRD";       /* used by open and save */
        !           126: 
        !           127: /* relating to scrolling */
        !           128: int fCardCleared = FALSE;   /* TRUE if the card has been erased */
        !           129: int iCardStartScroll;       /* the front card before start of scroll */
        !           130: int fScrolling = FALSE;     /* true if scrolling */
        !           131: 
        !           132: OFSTRUCT tmpreopen;         /* saves pathname of Cardfile */
        !           133: OFSTRUCT mainreopen;        /* saves pathname of Tempfile */
        !           134: int fReadOnly = FALSE;      /* TRUE in weird cases */
        !           135: 
        !           136: int DBcmd;                  /* dialog function needs to know which command */
        !           137: 
        !           138: 

unix.superglobalmegacorp.com

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