home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gkdemo.zip / GKFILES.SET / DEMOCTRL.GKR < prev    next >
Text File  |  1994-12-09  |  8KB  |  367 lines

  1. #
  2. # democtrl.c resource file
  3. #
  4.  
  5. !include "gui-kit.gkr"
  6.  
  7. # Create some fonts
  8. ObjectGroup "Democtrl-Fonts" {
  9.     Object Font "Italic" {
  10.         Name        "Times-Roman-Italic"
  11.         PointSize    200    # 20.0
  12.     }
  13.  
  14.     Object Font "Times-Roman-20.0" {
  15.         Name        "Times-Roman"
  16.         PointSize    200    # 20.0
  17.     }
  18. }
  19.  
  20. ObjectGroup "Democtrl" {
  21.  
  22. # Released image for custom button (also icon)
  23. Object GfxImage "ButtonImage-1" {
  24.     ImageFile        "demobut1.xpm"
  25.     TransparentColor    "#00ffff"
  26. }
  27.  
  28. # Pressed Image for custom button
  29. Object GfxImage "ButtonImage-2" {
  30.     ImageFile        "demobut2.xpm"
  31.     TransparentColor    "#00ffff"
  32. }
  33.  
  34. # Create a container with a Checkmark image and text; centered vertically
  35. Object GfxContainer "PushMeLabel" {
  36.     Layout        LeftToRight|CenterVertical
  37.  
  38.     Object GfxImage - {
  39.         ImageFile        "demobut3.xpm"
  40.         TransparentColor    "#00ffff"
  41.     }
  42.  
  43.     Object GfxText - {
  44.         String "{UL}P{ul}ush Me"
  45.     }
  46. }
  47.  
  48. # This is the pressed graphics for the On/Off toggle button
  49. Object GfxText "TogglePressedLabel" {
  50.     String        "{UL}O{ul}n"
  51. }
  52.  
  53. # ----------------------------------------------------------------------
  54. # Pop-up Sub-Menus
  55.  
  56. # File Sub-menu
  57. Object VertMenu "File-SubMenu" {
  58.     Menu.ItemStrings    "&Open..., &Save, Save &As..., &Delete"
  59.     Menu.NotifyProc        MenuNotify
  60. }
  61.  
  62. # Edit/Options Sub-Menu
  63. Object VertMenu "Edit-Options-SubMenu" {
  64.     Menu.NotifyProc        "MenuNotify"
  65.  
  66.     Object MenuItem - {
  67.         Label        "Sub-Item&1"
  68.         Accelerator    "Shift+Ctrl+Key(1)"
  69.     }
  70.     
  71.     Object MenuItem - {
  72.         Label        "Sub-Item&2"
  73.         Accelerator    "Shift+Ctrl+Key(2)"
  74.     }
  75.     
  76.     Object MenuItem - {
  77.         Label        "Sub-Item&3"
  78.         Accelerator    "Shift+Ctrl+Key(3)"
  79.     }
  80. }
  81.  
  82. # Edit Sub-Menu
  83. Object VertMenu "Edit-SubMenu" {
  84.     Menu.NotifyProc        "MenuNotify"
  85.  
  86.     Object MenuItem -  {
  87.         Label        "Cu&t"
  88.         Accelerator    "Ctrl+Key(x)"
  89.     }
  90.     
  91.     Object MenuItem -  {
  92.         Label        "&Copy"
  93.         Accelerator    "Ctrl+Key(c)"
  94.     }
  95.     
  96.     Object MenuItem -  {
  97.         Label        "&Paste"
  98.         Disabled    True
  99.         Accelerator    "Ctrl+Key(v)"
  100.     }
  101.     
  102.     Object MenuItem -  {
  103.         Separator    True
  104.     }
  105.  
  106.     Object MenuItem - {
  107.         Label        "&Options"
  108.         Accelerator    "Ctrl+Key(o)"
  109.         SubMenu        "Edit-Options-SubMenu"
  110.     }
  111. }
  112.  
  113. # Options Sub-Menu
  114. Object VertMenu "Options-SubMenu" {
  115.     Menu.NotifyProc    "MenuNotify"
  116.     Menu.OpenProc    "MenuOpenNotify"
  117.     Menu.CloseProc    "MenuCloseNotify"
  118.  
  119.     Object MenuItem - {
  120.         Label        "Toggle &1"
  121.         Accelerator    "NoShift+Ctrl+Key(1)"
  122.         AllowToggle    True
  123.     }
  124.     
  125.     Object MenuItem - {
  126.         Label        "Toggle &2"
  127.         Accelerator    "NoShift+Ctrl+Key(2)"
  128.         AllowToggle    True
  129.     }
  130.     
  131.     Object MenuItem - {
  132.         Label        "Toggle &3"
  133.         Accelerator    "NoShift+Ctrl+Key(3)"
  134.         AllowToggle    True
  135.     }
  136.     
  137.     Object MenuItem - {
  138.         Separator    True
  139.     }
  140.     
  141.     Object MenuItem - {
  142.         Label        "Excl-Toggle &A"
  143.         Accelerator    "NoShift+Ctrl+Key(A)"
  144.         AllowToggle    True
  145.         ExclGroup    1
  146.     }
  147.     
  148.     Object MenuItem - {
  149.         Label        "Excl-Toggle &B"
  150.         Accelerator    "NoShift+Ctrl+Key(B)"
  151.         AllowToggle    True
  152.         ExclGroup    1
  153.     }
  154.     
  155.     Object MenuItem - {
  156.         Label        "Excl-Toggle &C"
  157.         Accelerator    "NoShift+Ctrl+Key(C)"
  158.         AllowToggle    True
  159.         ExclGroup    1
  160.     }
  161.     
  162.     Object MenuItem - {
  163.         Separator    True
  164.     }
  165.     
  166.     Object MenuItem - {
  167.         Label        "Excl-Toggle &D"
  168.         Accelerator    "Shift+Ctrl+Key(D)"
  169.         AllowToggle    True
  170.         ExclGroup    2
  171.     }
  172.     
  173.     Object MenuItem - {
  174.         Label        "Excl-Toggle &E"
  175.         Accelerator    "Shift+Ctrl+Key(E)"
  176.         AllowToggle    True
  177.         ExclGroup    2
  178.     }
  179.     
  180.     Object MenuItem - {
  181.         Label        "Excl-Toggle &F"
  182.         Accelerator    "Shift+Ctrl+Key(F)"
  183.         AllowToggle    True
  184.         ExclGroup    2
  185.     }
  186. }
  187.  
  188. # ----------------------------------------------------------------------
  189. # Top-level frame
  190. Object Frame "MainFrame" {
  191.   Title        "Controls Demo"
  192.   Icon        "ButtonImage-1"
  193.  
  194.   # Outer form - arrranged top to bottom.
  195.   Object Form - {
  196.     AutoTopToBottom        -
  197.     Window.BackgroundColor    "GK-3D-Background"
  198.  
  199.     # Bar menu
  200.     Object HorzMenu "BarMenu" {
  201.         Menu.NotifyProc    "MenuNotify"
  202.  
  203.         Object MenuItem - {
  204.             Label        "&File"
  205.             SubMenu        "File-SubMenu"
  206.         }
  207.         
  208.         Object MenuItem - {
  209.             Label        "&Edit"
  210.             SubMenu        "Edit-SubMenu"
  211.         }
  212.         
  213.         Object MenuItem - {
  214.             Label        "Op&tions"
  215.             SubMenu        "Options-SubMenu"
  216.         }
  217.         
  218.         Object MenuItem - {
  219.             Label        "&Window"
  220.             Disabled    True
  221.         }
  222.         
  223.         Object MenuItem - {
  224.             Label        "&View"
  225.         }
  226.         
  227.         Object MenuItem - {
  228.             Label        "&Help"
  229.         }
  230.     } # End of Bar menu
  231.  
  232.     # The inner form of buttons, laid out left-to-right
  233.     Object FormWithEtchedFrame - {
  234.         Form.AutoLeftToRight    -
  235.         Form.Label        "Buttons"
  236.         Window.LeftObj        NULL
  237.         Window.LeftDistance    3mm
  238.         # Default topic for buttons
  239.  
  240.         Object PushButton - {
  241.             Button.Label        "&Button"
  242.             Button.NotifyProc    ButtonNotify
  243.         }
  244.         
  245.         Object PushButton - {
  246.             Button.LabelGfxObj    "PushMeLabel"
  247.             Button.Default        True
  248.             Button.NotifyProc    "PushMeNotify"
  249.             Button.KeyAccelerator    "AltOK+Key(p)"
  250.         }
  251.         
  252.         Object PushButton - {
  253.             InputObj.Focusable    False
  254.             Button.Label        "No, Push Me!"
  255.             Button.AllowDefault    False
  256.         }
  257.         
  258.         # Create a custom button
  259.         Object Button - {
  260.             Type            Push
  261.             Style            Custom
  262.             AllowDefault        False
  263.             LabelGfxObj        "ButtonImage-1"
  264.             PressedLabelGfxObj    "ButtonImage-2"
  265.         }
  266.         
  267.         Object CheckButton - {
  268.             Button.Label        "&Check"
  269.             Button.LabelPosition    Left
  270.         }
  271.         
  272.         
  273.         Object RadioButton - {
  274.             Button.Label        "Radio &1\nMulti-line"
  275.             Button.ExclGroup    25
  276.         }
  277.         
  278.         Object RadioButton - {
  279.             Button.Label        
  280.               "Radio &2\n{Font:Italic}{Color:Blue}Italic-Blue{Normal}"
  281.             Button.LabelPosition    Center
  282.             Button.ExclGroup    25
  283.         }
  284.         
  285.         Object RadioButton - {
  286.             Button.Label        "Radio &3"
  287.             Button.LabelPosition    Center
  288.             Button.ExclGroup    25
  289.         }
  290.         
  291.         Object ToggleButton - {
  292.             Button.Label            "&Off"
  293.             Button.PressedLabelGfxObj    "TogglePressedLabel"
  294.         }
  295.  
  296.     } # End Inner form
  297.     
  298.     # Create an Edit object on the outer form - this is deletable by pressing Alt+D
  299.     Object Edit "MyEdit" {
  300.         HorzScroll    True
  301.         VertScroll    True
  302.         VisibleLines    10
  303.         Text        "This is edit text"
  304.         ##NotifyProc    EditNotify
  305.         Window.TopLevelAccelerator    "Alt+Key(d), RemoveObj" 
  306.     }
  307.     
  308.     # Create the various combo boxes
  309.     Object AlwaysVisibleComboBox "FirstComboBox" {
  310.         ComboBox.VisibleItems    10
  311.         ComboBox.VisibleChars    20
  312.         ComboBox.Items
  313.             "A-Item 1, B-Item 2, [C-Item 3, with comma], D-Item 4, 
  314.              A-Item 5 sorted after 1, Item 6, Item 7, Item 8, Item 9,
  315.              Item 10, Item 11, Item 12, Item 13, Item 14, Item 15"
  316.         ComboBox.NotifyProc    "CBNotify"
  317.         ComboBox.Sort        -
  318.         ComboBox.EditText    "This isn't in the list"
  319.     }
  320.     
  321.     Object DropDownEditComboBox - {
  322.         ComboBox.VisibleItems    10
  323.         ComboBox.VisibleChars    20
  324.         ComboBox.Items
  325.             "A-Item 1, B-Item 2, [C-Item 3, with comma], D-Item 4, 
  326.              A-Item 5 sorted after 1, Item 6, Item 7, Item 8, Item 9,
  327.              Item 10, Item 11, Item 12, Item 13, Item 14, Item 15"
  328.         ComboBox.NotifyProc    "CBNotify"
  329.         ComboBox.Sort        -
  330.         ComboBox.EditText    "This isn't in the list"
  331.         ComboBox.ValidChars    "0123456789"
  332.         # Adjust the auto-layout here, move left of the first combo-box and stay
  333.         # below the edit object
  334.         Window.LeftObj        "FirstComboBox"
  335.         Window.UpperObj        "MyEdit"
  336.     }
  337.     
  338.     Object DropDownConstComboBox - {
  339.         ComboBox.VisibleItems    12
  340.         ComboBox.VisibleChars    10
  341.         ComboBox.NotifyProc    CBNotify
  342.         ComboBox.Items    
  343.             "A-Item 1, B-Item 2, [C-Item 3, with comma], D-Item 4, 
  344.              A-Item 5 unsorted, Item 6, Item 7, Item 8, Item 9,
  345.              Item 10, Item 11, Item 12, Item 13, Item 14, Item 15"
  346.     }
  347.  
  348.   } # End Outer form
  349.  
  350. } # End MainFrame
  351.  
  352. } # End of democtrl object group
  353.  
  354. # ----------------------------------------------------------------------
  355. ObjectGroup "MyDialogGroup" {
  356.     Object DialogFrame "MyDialog" {
  357.         Frame.Title        "Dialog Box"
  358.         Frame.OwnerFrame    "MainFrame"
  359.  
  360.         Object FormWithEtchedFrame - {
  361.             Object PushButton - {
  362.                 Button.Label    "Thank You!"
  363.             }
  364.         }
  365.     }
  366. }
  367.