Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: Overview /


Appendix A - Constants, Types, and Variables

This appendix defines most of the constants, data types, and global variables used by the Venn Diagrammer application.

UNIT Global;
INTERFACE

   CONST
      {menu constants (resource IDs and menu command numbers)}
      rMenuBar       = 128;                  {menu bar resource ID}

      mApple         = 128;                  {resource ID of Apple menu}
      iAbout         = 1;                    {our About... dialog}

      mFile          = 129;                  {resource ID of File menu}
      iNew           = 1;
      iClose         = 2;
      iQuit          = 4;

      mEdit          = 130;                  {resource ID of Edit menu}
      iUndo          = 1;
      iCut           = 3;
      iCopy          = 4;
      iPaste         = 5;
      iClear         = 6;

      mVennD         = 131;                  {resource ID of Venn menu}
      iCheckVenn     = 1;
      iDoVenn        = 2;
      iClearVenn     = 3;
      iNextTask      = 4;
      iCheckArg      = 5;
      iGetVennPrefs  = 7;

      kNumTools      = 5;

      rVennD         = mVennD;         {resource ID of Venn diagram window}

      {dialog boxes and their associated items}
      rAboutDial     = 7000;                    {resource ID of About dialog}
      iOK            = 1;                       {OK button}
      iCancel        = 2;                       {Cancel button}

      rVennDPrefsDial = 3040;    {resource ID of Preferences dialog}
      iEmpty1Radio            = 1;           {dialog item numbers}
      iEmpty2Radio            = 2;
      iEmpty3Radio            = 3;
      iEmpty4Radio            = 4;
      iEmpty1Icon             = 5;
      iEmpty2Icon             = 6;
      iEmpty3Icon             = 7;
      iEmpty4Icon             = 8;
      iExist1Radio            = 9;
      iExist2Radio            = 10;
      iExist3Radio            = 11;
      iExist4Radio            = 12;
      iExist1Icon             = 13;
      iExist2Icon             = 14;
      iExist3Icon             = 15;
      iExist4Icon             = 16;
      iGetNextRandomly        = 19;
      iAutoAdjust             = 20;
      iShowSchoolNames        = 21;
      iUseExistImport         = 22;
      iSaveVennPrefs          = 23;
      kVennPrefsItemCount     = 23;

      kVisualDelay      = 8;     {ticks to invert a button to simulate press}
      kCntlActivate     = 0;     {enabled control's hilite state}
      kCntlDeactivate   = $FF;   {disabled control's hilite state}

      kToolHt           = 14;    {height of a tool icon}
      kToolWd           = 21;    {width of a tool icon}

      kVennToolsIconStart = 768; {base resource ID of tools icons}
      kExistID          = 2000;  {first (of four) icons showing existence}
      kEmptyID          = 3000;  {first (of four) patterns showing emptiness}

      {Text strings printed in a Venn diagram window.}
      rMiscStrings      = 1004;  {resource ID of 'STR#' for text items}
      kShowAnswerText   = 1;     {in Venn menu}
      kShowUserText     = 2;     {in Venn menu}
      kAllText          = 3;
      kNoText           = 4;
      kSomeText         = 5;
      kAreText          = 6;
      kAreNotText       = 7;
      kFigureText       = 8;
      kMoodText         = 9;

      {Venn Diagram window status messages: 'STR#' resource ID = rVennD}
      eDiagramCorrect      = 1;
      eDiagramIncorrect    = 2;
      eHereIsSolution      = 3;
      eHereIsYourWork      = 4;
      eCannotEditAnswer    = 5;
      eCannotEraseAnswer   = 6;
      eArgIsValid          = 7;
      eArgNotValid         = 8;
      eExistNotPossible    = 9;

      rErrorAlert       = 129;   {res ID of 'ALRT' resource for error mesgs}
      kErrorStrings     = 1005;  {res ID of 'STR#' resource for error mesgs}
      eCantFindMenus    = 1;     {can't read menu bar resource}
      eNotEnoughMemory  = 2;     {insufficient memory for operation}

      {constants defining several keyboard characters}
      kEnter            = char(3);              {the enter character}
      kReturn           = char(13);             {the return character}
      kEscape           = char(27);             {the escape character}
      kPeriod           = '.';                  {the period character}

   TYPE 
      {record to hold the current settings of a Venn Diagram window}
      MyDocRec = 
         RECORD            {information about a document window}
            figure:           Integer;          {the figure of the syllogism}
            mood:             ARRAY[1..3] of Integer;
                                                {the moods of the statements}
            terms:            ARRAY[1..3] of Str31;      {the three terms}
            statusText:       Str255;           {most recent status message}
            userSolution:     MyDiagramState;   {user's diagram state}
            realSolution:     MyDiagramState;   {answer's diagram state}
            isAnswerShowing:  Boolean;          {is the answer showing?}
            isExistImport:    Boolean;          {stmts imply exists subject?}
            needsAdjusting:   Boolean;          {diagram needs adjusting?}
         END;
      MyDocRecPtr = ^MyDocRec;
      MyDocRecHnd = ^MyDocRecPtr;

   VAR
      gNumDocWindows:      Integer;    {the number of open document windows}
      gPrefsDialog:        DialogPtr;  {pointer to Preferences dialog window}
      gAppsResourceFile:   Integer;    {reference number of app's res file}
      gPreferencesFile:    Integer;    {reference number of app's prefs file}
      gToolsIcons:         ARRAY[1..kNumTools] of Handle;
                                       {handles to tools icons}
      gEmptyPats:          ARRAY[1..4] of PatHandle;
                                       {handles to emptiness patterns}
      gExistIcons:         ARRAY[1..4] of Handle;
                                       {handles to existence symbols}
      gMoodIcons:          ARRAY[1..4] of Handle;
                                       {handles to mood icons}
      gFigureIcons:        ARRAY[1..4] of Handle;
                                       {handles to figure icons}
      gExistIndex:         Integer;    {rank of icon showing existence}
      gEmptyIndex:         Integer;    {rank of icon showing emptiness}
      gStepRandom:         Boolean;    {generate next setup randomly?}
      gAutoAdjust:         Boolean;    {automatically adjust the diagram?}
      gGiveImport:         Boolean;    {do subjects have existential import?}
      gShowNames:          Boolean;    {do we show names of valid forms?}

IMPLEMENTATION
END. {UNIT Global}


Previous Book Contents Book Index Next

© Apple Computer, Inc.
9 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help