APLX Help : System Classes : List of Classes : Page
|
|
![]() |
Page |
DescriptionThe 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 tabsUnder 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.) Example∇DEMO_Page;DEMO [1] ⍝ Sample function demonstrating use of the Selector (tab sheet) object and pages [2] DEMO←'⎕' ⎕NEW 'Dialog' ⋄ DEMO.scale←1 ⋄ DEMO.size←14 40 [3] DEMO.title←'Selector/Page Example' [4] ⍝ [5] ⍝ Create selector to hold the individual pages [6] ⍝ (Could just use "align ¯1" here to make the selector the same size as the window. [7] ⍝ However if we make it slightly smaller we get the drop shadow under Mac OS X) [8] DEMO.Sel.New 'Selector' ⋄ DEMO.Sel.size←12 38 ⋄ DEMO.Sel.anchors←1 1 1 1 [9] ⍝ [10] ⍝ Now create three pages each with some radio buttons [11] DEMO.Sel.Page1.New 'Page' ⋄ DEMO.Sel.Page1.caption←'Appetizer' [12] DEMO.Sel.Page1.R1.New 'Radio' ⋄ DEMO.Sel.Page1.R1.caption←'Smoked Salmon' [13] DEMO.Sel.Page1.R1.where←2 1 ⋄ DEMO.Sel.Page1.R1.value←1 [14] DEMO.Sel.Page1.R2.New 'Radio' ⋄ DEMO.Sel.Page1.R2.caption←'Fresh asparagus' [15] DEMO.Sel.Page1.R2.where←4 1 [16] DEMO.Sel.Page1.R3.New 'Radio' ⋄ DEMO.Sel.Page1.R3.caption←'Clam chowder' [17] DEMO.Sel.Page1.R3.where←6 1 [18] ⍝ [19] DEMO.Sel.Page2.New 'Page' ⋄ DEMO.Sel.Page2.caption←'Main course' [20] DEMO.Sel.Page2.R1.New 'Radio' ⋄ DEMO.Sel.Page2.R1.caption←'Roast duck' [21] DEMO.Sel.Page2.R1.where←2 1 ⋄ DEMO.Sel.Page2.R1.value←1 [22] DEMO.Sel.Page2.R2.New 'Radio' ⋄ DEMO.Sel.Page2.R2.caption←'Grilled steak' [23] DEMO.Sel.Page2.R2.where←4 1 [24] DEMO.Sel.Page2.R3.New 'Radio' ⋄ DEMO.Sel.Page2.R3.caption←'Fresh sea-bass' [25] DEMO.Sel.Page2.R3.where←6 1 [26] ⍝ [27] DEMO.Sel.Page3.New 'Page' ⋄ DEMO.Sel.Page3.caption←'Dessert' [28] DEMO.Sel.Page3.R1.New 'Radio' ⋄ DEMO.Sel.Page3.R1.caption←'Fresh stawberries' [29] DEMO.Sel.Page3.R1.where←2 1 ⋄ DEMO.Sel.Page3.R1.value←1 [30] DEMO.Sel.Page3.R2.New 'Radio' ⋄ DEMO.Sel.Page3.R2.caption←'Creme caramel' [31] DEMO.Sel.Page3.R2.where←4 1 [32] DEMO.Sel.Page3.R3.New 'Radio' ⋄ DEMO.Sel.Page3.R3.caption←'Baked Alaska' [33] DEMO.Sel.Page3.R3.where←6 1 [34] ⍝ [35] ⍝ Wait for the user to close the window [36] 0 0⍴⎕WE DEMO ∇ Propertiesalign 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 MethodsClick Clienttoscreen Close Create Delete Draw Focus Hide New Open Paint Resize Screentoclient Send Set Show Trigger CallbacksonClick onClose onDblClick onDestroy onDragDrop onDragEnd onDragEnter onDragLeave onDragOver onDragStart onFocus onHide onKeyDown onKeyPress onKeyUp onMouseDown onMouseMove onMouseUp onOpen onSend onShow onUnFocus |
|
APLX Help : System Classes : List of Classes : Page
|
Copyright © 1996-2010 MicroAPL Ltd