The Page class implements the individual pages or tab sheets within a Selector object, like the 'Display' and 'Syntax Coloring' tabs in the APLX Preferences dialog. A Page must have a Selector as its parent, and typically will have other controls (such as check boxes and edit fields) as its children.
The Page caption property sets the title of the tab sheet.
The order property gives the position of the Page within the Selector, in index origin 1. You can change the position by writing a new value to order. Other Pages are re-numbered accordingly. Setting a non-integer value will place the Page between two existing pages.
For a Page object, the onShow and onHide callbacks are triggered when the page is selected/deselected.
Placing images on the tabs
Under Windows and Linux, you can optionally place images on the tabs of Page controls. To do this, you need to create an ImageList object which contains all the images which appear in the Pages of a given Selector object. You then write the name of the ImageList to the Selector object's imagelist property.
Finally, you set the imageindex property of each Page where you want to display an image. This selects one of the images from the ImageList and displays it on the tab. (See the description of the ImageList object for an example.)
∇DEMO_Page;DEMO  ⍝ Sample function demonstrating use of the Selector (tab sheet) object and pages  DEMO←'⎕' ⎕NEW 'Dialog' ⋄ DEMO.scale←1 ⋄ DEMO.size←14 40  DEMO.title←'Selector/Page Example'  ⍝  ⍝ Create selector to hold the individual pages  ⍝ (Could just use "align ¯1" here to make the selector the same size as the window.  ⍝ However if we make it slightly smaller we get the drop shadow under Mac OS X)  DEMO.Sel.New 'Selector' ⋄ DEMO.Sel.size←12 38 ⋄ DEMO.Sel.anchors←1 1 1 1  ⍝  ⍝ Now create three pages each with some radio buttons  DEMO.Sel.Page1.New 'Page' ⋄ DEMO.Sel.Page1.caption←'Appetizer'  DEMO.Sel.Page1.R1.New 'Radio' ⋄ DEMO.Sel.Page1.R1.caption←'Smoked Salmon'  DEMO.Sel.Page1.R1.where←2 1 ⋄ DEMO.Sel.Page1.R1.value←1  DEMO.Sel.Page1.R2.New 'Radio' ⋄ DEMO.Sel.Page1.R2.caption←'Fresh asparagus'  DEMO.Sel.Page1.R2.where←4 1  DEMO.Sel.Page1.R3.New 'Radio' ⋄ DEMO.Sel.Page1.R3.caption←'Clam chowder'  DEMO.Sel.Page1.R3.where←6 1  ⍝  DEMO.Sel.Page2.New 'Page' ⋄ DEMO.Sel.Page2.caption←'Main course'  DEMO.Sel.Page2.R1.New 'Radio' ⋄ DEMO.Sel.Page2.R1.caption←'Roast duck'  DEMO.Sel.Page2.R1.where←2 1 ⋄ DEMO.Sel.Page2.R1.value←1  DEMO.Sel.Page2.R2.New 'Radio' ⋄ DEMO.Sel.Page2.R2.caption←'Grilled steak'  DEMO.Sel.Page2.R2.where←4 1  DEMO.Sel.Page2.R3.New 'Radio' ⋄ DEMO.Sel.Page2.R3.caption←'Fresh sea-bass'  DEMO.Sel.Page2.R3.where←6 1  ⍝  DEMO.Sel.Page3.New 'Page' ⋄ DEMO.Sel.Page3.caption←'Dessert'  DEMO.Sel.Page3.R1.New 'Radio' ⋄ DEMO.Sel.Page3.R1.caption←'Fresh stawberries'  DEMO.Sel.Page3.R1.where←2 1 ⋄ DEMO.Sel.Page3.R1.value←1  DEMO.Sel.Page3.R2.New 'Radio' ⋄ DEMO.Sel.Page3.R2.caption←'Creme caramel'  DEMO.Sel.Page3.R2.where←4 1  DEMO.Sel.Page3.R3.New 'Radio' ⋄ DEMO.Sel.Page3.R3.caption←'Baked Alaska'  DEMO.Sel.Page3.R3.where←6 1  ⍝  ⍝ Wait for the user to close the window  0 0⍴⎕WE DEMO ∇
align anchors aquaadjust autodraw caption children class color data doublebuffered dragsource droptarget enabled events extent font handle imageindex maxsize methods minsize name opened order pointer properties scale self size sourceformats tabstop targetformats tie units visible where winptr
onClick onClose onDblClick onDestroy onDragDrop onDragEnd onDragEnter onDragLeave onDragOver onDragStart onFocus onHide onKeyDown onKeyPress onKeyUp onMouseDown onMouseMove onMouseUp onOpen onSend onShow onUnFocus
Copyright © 1996-2010 MicroAPL Ltd