home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / scnote / modallst.021 / ModalList.r < prev    next >
Encoding:
Text File  |  1989-10-01  |  3.9 KB  |  205 lines

  1. /*
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    ModalList : Simple Modal Dialog and List Manager Sample Application
  6. #
  7. #    ModalList.r
  8. #
  9. #    Copyright ⌐ 1989 Apple Computer, Inc.
  10. #    All rights reserved.
  11. #
  12. #    Versions:    
  13. #            1.00                     10/89
  14. #
  15. #    Components:
  16. #            ModalList.make            October 1, 1989
  17. #            ModalList.h                October 1, 1989
  18. #            ModalList.c                October 1, 1989
  19. #            ModalList.r                October 1, 1989
  20. #
  21. #    ModalList is an example application that demonstrates
  22. #    how to use the Dialog Manager and List Manager routines
  23. #    together. It is not a good example of a sample application
  24. #    but a great example of the use of lists in a dialog. The
  25. #    default LDEF is used to display a 2 dimensional list of strings.
  26. #    Each cell's string is initialized to represent it's position in the
  27. #    list. The user can change these strings and search for a particular
  28. #    cell value. Once again this is not meant as an example application and
  29. #    there are some features that are documented in the source listing
  30. #    that you should pay close attention to inorder to understand how
  31. #    this example works.
  32. #
  33. */
  34.  
  35. #include "SysTypes.r"
  36. #include "Types.r"
  37.  
  38. #include "ModalList.h"
  39.  
  40. resource 'vers' (1) {
  41.     0x01, 0x00, release, 0x00, verUS,
  42.     "1.00",
  43.     "1.00, Copyright ⌐ 1989 Apple Computer, Inc."
  44. };
  45.  
  46. /* this DLOG and DITL are used to display the list */
  47.  
  48. resource 'DLOG' (256) {
  49.     {32, 12, 330, 500},
  50.     plainDBox,
  51.     visible,
  52.     goAway,
  53.     0x0,
  54.     256,
  55.     "Dialog and List Manager Sample"
  56. };
  57.  
  58. resource 'DITL' (256) {
  59.     {    /* array DITLarray: 18 elements */
  60.         /* [1] */
  61.         {270, 303, 290, 363},
  62.         Button {
  63.             enabled,
  64.             "OK"
  65.         },
  66.         /* [2] */
  67.         {270, 398, 290, 458},
  68.         Button {
  69.             enabled,
  70.             "Cancel"
  71.         },
  72.         /* [3] OK Outline */
  73.         {270, 303, 290, 363},
  74.         UserItem {
  75.             enabled
  76.         },
  77.         /* [4] List View Rectangle */
  78.         {32, 32, 256, 256},
  79.         UserItem {
  80.             enabled
  81.         },
  82.         /* [5] */
  83.         {31, 289, 51, 396},
  84.         CheckBox {
  85.             enabled,
  86.             "lNoHilite"
  87.         },
  88.         /* [6] */
  89.         {51, 289, 71, 396},
  90.         CheckBox {
  91.             enabled,
  92.             "lUseSense"
  93.         },
  94.         /* [7] */
  95.         {71, 289, 91, 397},
  96.         CheckBox {
  97.             enabled,
  98.             "lNoRect"
  99.         },
  100.         /* [8] */
  101.         {91, 289, 111, 396},
  102.         CheckBox {
  103.             enabled,
  104.             "lNoExtend"
  105.         },
  106.         /* [9] */
  107.         {111, 289, 131, 396},
  108.         CheckBox {
  109.             enabled,
  110.             "lNoDisjoint"
  111.         },
  112.         /* [10] */
  113.         {131, 289, 151, 396},
  114.         CheckBox {
  115.             enabled,
  116.             "lExtendDrag"
  117.         },
  118.         /* [11] */
  119.         {151, 289, 171, 396},
  120.         CheckBox {
  121.             enabled,
  122.             "lOnlyOne"
  123.         },
  124.         /* [12] */
  125.         {194, 292, 213, 467},
  126.         EditText {
  127.             enabled,
  128.             ""
  129.         },
  130.         /* [13] */
  131.         {225, 301, 246, 362},
  132.         Button {
  133.             enabled,
  134.             "Set"
  135.         },
  136.         /* [14] */
  137.         {226, 396, 247, 457},
  138.         Button {
  139.             enabled,
  140.             "Find"
  141.         },
  142.         /* [15] */
  143.         {171, 272, 189, 484},
  144.         StaticText {
  145.             enabled,
  146.             "_____________________________"
  147.         },
  148.         /* [16] */
  149.         {15, 272, 32, 483},
  150.         StaticText {
  151.             enabled,
  152.             "_____________________________"
  153.         },
  154.         /* [17] */
  155.         {249, 272, 265, 483},
  156.         StaticText {
  157.             enabled,
  158.             "_____________________________"
  159.         },
  160.         /* [18] */
  161.         {104, 400, 143, 469},
  162.         StaticText {
  163.             enabled,
  164.             "Selection\n   Flags"
  165.         },
  166.  
  167.         /* [19] */
  168.         {8, 64, 22, 256},
  169.         StaticText {
  170.             disabled,
  171.             "ModalList by MacDTS"
  172.         },
  173.         /* [19] */
  174.         {270, 32, 286, 256},
  175.         StaticText {
  176.             disabled,
  177.             "Copyright ⌐ 1989 Apple Computer"
  178.         }
  179.     }
  180. };
  181.  
  182.  
  183. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  184.  
  185. resource 'SIZE' (-1) {
  186.     dontSaveScreen,
  187.     ignoreSuspendResumeEvents,
  188.     disableOptionSwitch,
  189.     cannotBackground,            /* we don't background; we are a modal dialog only */
  190.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  191.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  192.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  193.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  194.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  195.     reserved,
  196.     reserved,
  197.     reserved,
  198.     reserved,
  199.     reserved,
  200.     reserved,
  201.     reserved,
  202.     cPrefSize * 1024,
  203.     cMinSize * 1024    
  204. };
  205.