home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / WINPROPM.ZIP / EXAMPLPM.RC < prev    next >
Text File  |  1989-06-19  |  12KB  |  259 lines

  1. /*    File:   examplpm.rc
  2.  
  3.       Description: Resource definition file for OS|2 Presentation Manager
  4.                 application ExamplPM.  Formatted for use with Presentation
  5.                 Manager prototype code generator WINPRO/PM.
  6.  
  7.       WINPRO/PM, a product of Louis J. Cutrona, Jr.
  8.       Xian Corporation
  9.       625 North Monroe Street
  10.       Ridgewood, NJ 07450-1206
  11.       (201) 447-3270
  12.  
  13. */
  14.  
  15. #include <os2.h>
  16.  
  17. /* Note: The file "examrc.h" will be created by WINPRO/PM, but you must    
  18.  remember to include the corresponding statement in your resource (.RC)    
  19.  file.  Its name is constructed by prefixing the first four letters of your
  20.  application name to the name "rc.h".  Thus, because this application's    
  21.  name is "examplpm", the resulting name is "examrc.h".  If your application
  22.  is called "myprog", the resulting name will be "myprrc.h".  If your       
  23.  application is called "foo", the name you must use here will be "foorc.h" 
  24. */
  25.  
  26. #include "examrc.h"     
  27.  
  28. /* Note: You will have to provide your own icon or use an existing one */
  29.  
  30. POINTER IDS_NAME examplpm.ico
  31.  
  32. STRINGTABLE
  33. {
  34.    IDS_NAME,     "ExamplPM"
  35.    IDS_ABOUT,    "About..."
  36.    IDS_TITLE,    "WINPRO/PM Example"
  37. }
  38.  
  39. MENU    IDS_NAME
  40. {
  41.    SUBMENU "~File", midFILE, MIS_TEXT|MIS_SUBMENU
  42.    {
  43.       MENUITEM "~New", midFILENEW, MIS_TEXT
  44.       MENUITEM "~Open...", midFILEOPEN, MIS_TEXT
  45.       MENUITEM "~Save", midFILESAVE, MIS_TEXT
  46.       MENUITEM SEPARATOR
  47.       MENUITEM "A~bout ExamplPM...", ABOUT, MIS_TEXT
  48.    }
  49.    SUBMENU "~Edit", midEDIT, MIS_TEXT|MIS_SUBMENU
  50.    {
  51.       MENUITEM "~Restore Image\tSh Esc", midEDITRESTORE
  52.       MENUITEM "Cu~t Image\tDel", midEDITCUT, MIS_TEXT 
  53.       MENUITEM "~Copy Image\tF2", midEDITCOPY, MIS_TEXT
  54.       MENUITEM "~Paste Image\tIns", midEDITPASTE       
  55.       MENUITEM "C~lear", midEDITCLEAR, MIS_TEXT        
  56.    }
  57.    SUBMENU "~Create", midCREATE, MIS_TEXT|MIS_SUBMENU
  58.    {
  59.       MENUITEM "~Scan...", midCREATESCAN, MIS_TEXT
  60.       MENUITEM "~Process...", midCREATEPROCESS, MIS_TEXT
  61.    }
  62.    SUBMENU "E~xit", midQUERYEXIT, MIS_TEXT|MIS_SUBMENU
  63.    {
  64.       MENUITEM "E~xit WINPRO/PM example...  F3", MID_EXIT, MIS_TEXT
  65.       MENUITEM "~Resume WINPRO/PM example", -1, MIS_TEXT
  66.    }
  67.    MENUITEM "F1=Help", midHELP, MIS_HELP | MIS_BUTTONSEPARATOR
  68. }
  69.  
  70. /* Note that MENUITEM midHELP has the MIS_HELP style attribute so that   
  71.  when it is selected, it will cause a WM_HELP message rather than a    
  72.  WM_COMMAND message.  Similarly, because ACCELTABLE item midHELP has   
  73.  the HELP acceloption, it, too will cause a WM_HELP message rather than
  74.  a WM_COMMAND message.                                                 
  75.  
  76.  WINPRO/PM recognizes the special identifier MID_EXIT as the application
  77.  terminator and will generate code to end the application when the menu
  78.  item with the identifier MID_EXIT is selected.
  79. */
  80.  
  81. ACCELTABLE      IDS_NAME
  82. BEGIN
  83.    VK_F1,     midHELP,            VIRTUALKEY,  HELP
  84.    VK_F2,     midEDITCOPY,        VIRTUALKEY
  85.    VK_F3,     MID_EXIT,           VIRTUALKEY
  86.    VK_F10,    accelF10,           VIRTUALKEY
  87.    VK_DELETE, midEDITCUT,         VIRTUALKEY
  88.    VK_ESC,    midEDITRESTORE,     VIRTUALKEY,  SHIFT
  89.    VK_INSERT, midEDITPASTE,       VIRTUALKEY
  90. END
  91.  
  92. /* The identifier accelF10 does not correspond to any menu item, so a     */
  93. /* separate function will be set up to be invoked whenever its key is     */
  94. /* pressed.                                                               */
  95.  
  96. /* WINPRO/PM requires the name of the "About..." dialog box to be "ABOUT" */
  97.  
  98. DLGTEMPLATE ABOUT
  99. {
  100.    DIALOG "", 0, 22, 17, 171, 82, WS_SAVEBITS | FS_DLGBORDER
  101.    {
  102.       CTEXT "Xian Corporation",                   -1, 49, 68, 83,  9
  103.       ICON  IDS_NAME,                       IDS_NAME,  7, 36,  0,  0
  104.       CTEXT "WINPRO/PM Example",                  -1, 38, 55, 98,  8
  105.       CTEXT "Version 1.00",                       -1, 57, 42, 65,  8
  106.       CTEXT "Copyright ╕ 1988, L. J. Cutrona",    -1, 14, 22,147,  9
  107.       DEFPUSHBUTTON "Ok",                     DID_OK, 69,  5, 38, 12, WS_GROUP
  108.    }
  109. }
  110.  
  111. /* Where the identifier assigned to the dialog box definition is the same 
  112.  as the identifier assigned to a menuitem, WINPRO/PM will automatically 
  113.  generate the code to activate the dialog box whenever the corresponding
  114.  menu item is selected.  Thus, the dialog box definition below labeled  
  115.  "midFILEOPEN" will be activated whenever the user selects the item     
  116.  "Open..." from the pull-down menu under "File" because the identifier  
  117.  assigned to "Open..." is also "midFILEOPEN"                            
  118. */
  119.  
  120. DLGTEMPLATE midFILEOPEN
  121. {
  122.    DIALOG "", 0, 51, 33, 196, 148, FS_NOBYTEALIGN | FS_DLGBORDER | 
  123.                 FS_SCREENALIGN | WS_CLIPSIBLINGS | WS_SAVEBITS
  124.    {
  125.       /* There's no such keyword as CTEXT, according to QuickHelp v1.06, */
  126.       /* but the following continues to work anyway!                     */
  127.       CTEXT "Open File"              -1,            67, 139, 56,  8
  128.       LTEXT "Use mouse to choose file, or type filename." -1, 6, 129, 187, 8
  129.       RTEXT "Current Directory :"    -1,             3, 115, 78,  8
  130.       LTEXT ""                       IDD_PATH,      88, 115, 97,  8
  131.       RTEXT "Filename :"             -1,            11, 100, 71,  8
  132.  
  133. /*      CONTROL "*.img", IDD_FILEEDIT, 88, 100, 96, 8, WC_ENTRYFIELD,       */
  134. /*            ES_LEFT | ES_AUTOSCROLL | ES_MARGIN | WS_TABSTOP | WS_VISIBLE */
  135.  
  136. /* The following control definition is equivalent to the one commented out  */
  137.  
  138.       ENTRYFIELD "*.img"             IDD_FILEEDIT, 88, 100, 96, 8,
  139.         ES_MARGIN | ES_AUTOSCROLL | WS_VISIBLE
  140.         
  141.       CTEXT "Directories"            DID_FIXEDTEXT, 10,  89, 70,  8
  142.       CTEXT "Files"                  DID_FIXEDTEXT,107,  89, 70,  8 
  143.       LISTBOX                        IDD_DIRLIST,    6,  22, 82, 64
  144.       LISTBOX                        IDD_FILELIST, 102,  22, 82, 64
  145.       DEFPUSHBUTTON "Open"           DID_OK,        33,   4, 48, 12, WS_GROUP
  146.       PUSHBUTTON "Cancel"            DID_CANCEL,   108,   4, 48, 12, WS_GROUP
  147.    }
  148. }
  149.  
  150. /* Note the use of numeric (-1) dialog control identifiers in several lines 
  151.  of the above dialog definition.  When the dialog procedure for this dialog 
  152.  box is set up by WINPRO/PM, it will not set up the code to expect messages 
  153.  from these four controls.  In any case, messages are not expected from     
  154.  these four controls because they are fixed text.  Alternatively, the same  
  155.  effect will result from the use of the predefined WINPRO/PM identifier     
  156.  DID_FIXEDTEXT that is used in the fourth from last line of the above       
  157.  definition.  Use of DID_FIXEDTEXT or the number -1 is preferred over the   
  158.  use of arbitrary numbers because of the chance that WINPRO/PM will assign  
  159.  the same number to the symbol of an active control in the same dialog box. 
  160. */
  161.  
  162.  
  163. DLGTEMPLATE midCREATEPROCESS LOADONCALL MOVEABLE DISCARDABLE 
  164. BEGIN
  165.     DIALOG "", midCREATEPROCESS, 12, 52, 299, 153, FS_NOBYTEALIGN | 
  166.                 FS_DLGBORDER | WS_CLIPSIBLINGS | WS_SAVEBITS
  167.     BEGIN
  168.         CONTROL "File to Process", -1, 158, 121, 132, 29, WC_STATIC, 
  169.                 SS_GROUPBOX | WS_GROUP | WS_VISIBLE
  170.         CONTROL "TEMP.SIF", GP_SIFNAME, 170, 126, 106, 12, WC_ENTRYFIELD, 
  171.                 ES_LEFT | WS_TABSTOP | WS_VISIBLE
  172.         CONTROL "Area to Process", -1, 7, 88, 137, 62, WC_STATIC, SS_GROUPBOX | 
  173.                 WS_GROUP | WS_VISIBLE
  174.         CONTROL "Offset from Left Edge", -1, 13, 129, 93, 8, WC_STATIC, 
  175.                 SS_TEXT | DT_LEFT | DT_TOP | WS_VISIBLE
  176.         CONTROL "0.00", GP_LOFFSET, 117, 127, 21, 12, WC_ENTRYFIELD, ES_LEFT | 
  177.                 WS_TABSTOP | WS_VISIBLE
  178.         CONTROL "Offset from Top Edge", -1, 13, 117, 93, 8, WC_STATIC, 
  179.                 SS_TEXT | DT_LEFT | DT_TOP | WS_VISIBLE
  180.         CONTROL "0.00", GP_TOFFSET, 117, 115, 21, 12, WC_ENTRYFIELD, ES_LEFT | 
  181.                 WS_TABSTOP | WS_VISIBLE
  182.         CONTROL "Width", -1, 13, 105, 93, 8, WC_STATIC, SS_TEXT | DT_LEFT | 
  183.                 DT_TOP | WS_VISIBLE
  184.         CONTROL "0.00", GP_WIDTH, 117, 103, 21, 12, WC_ENTRYFIELD, ES_LEFT | 
  185.                 WS_TABSTOP | WS_VISIBLE
  186.         CONTROL "Height", -1, 13, 93, 93, 8, WC_STATIC, SS_TEXT | DT_LEFT | 
  187.                 DT_TOP | WS_VISIBLE
  188.         CONTROL "0.00", GP_HEIGHT, 117, 91, 20, 12, WC_ENTRYFIELD, ES_LEFT | 
  189.                 WS_TABSTOP | WS_VISIBLE
  190.         CONTROL "Scale Factor", -1, 7, 28, 91, 53, WC_STATIC, SS_GROUPBOX | 
  191.                 WS_GROUP | WS_VISIBLE
  192.         CONTROL "Horizontal", -1, 13, 57, 44, 8, WC_STATIC, SS_TEXT | DT_LEFT | 
  193.                 DT_TOP | WS_VISIBLE
  194.         CONTROL "1.00", GP_HSCALE, 64, 57, 21, 12, WC_ENTRYFIELD, ES_LEFT | 
  195.                 WS_TABSTOP | WS_VISIBLE
  196.         CONTROL "Vertical", -1, 14, 39, 41, 8, WC_STATIC, SS_TEXT | DT_LEFT | 
  197.                 DT_TOP | WS_VISIBLE
  198.         CONTROL "1.00", GP_VSCALE, 64, 37, 21, 11, WC_ENTRYFIELD, ES_LEFT | 
  199.                 WS_TABSTOP | WS_VISIBLE
  200.         CONTROL "Process", -1, 191, 30, 99, 78, WC_STATIC, SS_GROUPBOX | 
  201.                 WS_GROUP | WS_VISIBLE
  202.         CONTROL "", GP_FORSCREEN, 205, 83, 9, 12, WC_BUTTON, BS_AUTORADIOBUTTON | 
  203.                 WS_GROUP | WS_TABSTOP | WS_VISIBLE
  204.         CONTROL "", GP_FORPRINTER, 205, 61, 9, 12, WC_BUTTON, BS_AUTORADIOBUTTON | 
  205.                 WS_TABSTOP | WS_VISIBLE
  206.         CONTROL "", GP_PRINT, 205, 38, 10, 12, WC_BUTTON, BS_AUTORADIOBUTTON | 
  207.                 WS_TABSTOP | WS_VISIBLE
  208.         CONTROL "To Clipboard for Printer", -1, 222, 58, 57, 17, WC_STATIC, 
  209.                 SS_TEXT | DT_LEFT | DT_TOP | DT_WORDBREAK | WS_GROUP | 
  210.                 WS_VISIBLE
  211.         CONTROL "To Clipboard for Screen", -1, 222, 79, 57, 18, WC_STATIC, 
  212.                 SS_TEXT | DT_LEFT | DT_TOP | DT_WORDBREAK | WS_VISIBLE
  213.         CONTROL "Directly to Printer", -1, 222, 35, 44, 18, WC_STATIC, 
  214.                 SS_TEXT | DT_LEFT | DT_TOP | DT_WORDBREAK | WS_VISIBLE
  215.         CONTROL "Favor", -1, 111, 29, 60, 45, WC_STATIC, SS_GROUPBOX | 
  216.                 WS_GROUP | WS_VISIBLE
  217. /*  
  218. *       CONTROL "White", GP_FAVORWHITE, 123, 53, 41, 9, WC_BUTTON, BS_AUTOCHECKBOX | 
  219. *               WS_GROUP | WS_TABSTOP | WS_VISIBLE
  220. */
  221.         /* There's no such keyword as AUTOCHECKBOX, according to QuickHelp v1.06 */
  222.         /* The above should, therefore, be used, but the following works anyway! */
  223.  
  224.         AUTOCHECKBOX "White", GP_FAVORWHITE, 123, 53, 41, 9, 
  225.                 WS_GROUP | WS_TABSTOP | WS_VISIBLE
  226.         CONTROL "Black", GP_FAVORBLACK, 123, 36, 38, 10, WC_BUTTON, BS_AUTO3STATE | 
  227.                 WS_TABSTOP | WS_VISIBLE
  228.         CONTROL "Process", DID_OK, 43, 7, 52, 12, WC_BUTTON, BS_PUSHBUTTON | 
  229.                 BS_DEFAULT | WS_GROUP | WS_TABSTOP | WS_VISIBLE
  230.         CONTROL "Defaults", GP_DEFAULTS, 121, 7, 52, 12, WC_BUTTON, BS_PUSHBUTTON | 
  231.                 WS_TABSTOP | WS_VISIBLE
  232.         CONTROL "Cancel", DID_CANCEL, 197, 7, 52, 12, WC_BUTTON, BS_PUSHBUTTON | 
  233.                 WS_TABSTOP | WS_VISIBLE
  234.     END
  235. END
  236.  
  237. /* Note that the identifier for the following dialog box definition      
  238.  (PRINTERABORT_DIALOG) does not correspond to an identifier in the       
  239.  application menu defined at the beginning of this file.                 
  240.  In this case, WINPRO/PM will declare and create a dialog procedures for 
  241.  the dialog box, and include it in the application prototype code, but it
  242.  will not be automatically activated.  The application developer will    
  243.  have to modify the prototype code to have it activated at the           
  244.  appropriate point
  245. */
  246.  
  247.  
  248. DLGTEMPLATE PRINTERABORT
  249. {
  250.     DIALOG "", 0, 20, 20, 157, 27, FS_DLGBORDER | WS_VISIBLE
  251.     {
  252.         DEFPUSHBUTTON "Cancel", DID_CANCEL, 55, 2, 37, 12
  253.         CTEXT "Select Cancel to cancel printing", -1, 10, 17, 139, 8, WS_GROUP
  254.     }
  255. }
  256.  
  257.  
  258. /*   E N D   O F   E X A M P L P M . R C   */
  259.