Difference between revisions of "Pageframe"

From Lianjapedia
Jump to: navigation, search
(Created page with '====Properties==== This class supports the '''Common properties''' plus the following: {| class="wikitable" !width="20%"|Property !Access (R/RW) !Value !width="50%"|Description…')
 
(Description)
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
 +
 +
====Description====
 +
Shown below in a standalone [[Form]].  Click the image to see in a [[Custom_Sections_and_Gadgets|Custom Section]] in a Lianja [[Page Attributes|Page]].
 +
 +
[[{{ns:file}}:page_pageframe.png|link={{filepath:page_pageframe_cs.png}}|Page, Pageframe]]
 +
 +
Creates a page frame to contain [[Page]] objects.
 +
 +
A page frame is a container object that contains pages, which can contain containers and controls.
 +
 +
The page frame defines global characteristics of the page: size and positioning, border style, which page is active, and so on. The page frame determines the location of the pages and how much of each page is visible. Pages are positioned at the top left corner of the page frame. If the page frame is moved, the pages move with the page frame.
 +
 +
A page frame contains individual pages that are named Page1, Page2, Page3, and so on by default.
 +
 
====Properties====
 
====Properties====
  
This class supports the '''Common properties''' plus the following:
+
This class supports the [[:Category:Common_Properties|Common Properties]] plus the following:
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
 
!width="20%"|Property
 
!width="20%"|Property
 
!Access (R/RW)
 
!Access (R/RW)
Line 9: Line 24:
 
!width="50%"|Description
 
!width="50%"|Description
 
|-
 
|-
 
+
|ActivePage
 +
|RW
 +
|Numeric
 +
|Index of the selected page, starting from 0, left to right
 +
|-
 +
|valign="top"|Closable
 +
|valign="top"|RW
 +
|valign="top"|Boolean
 +
|Whether individual tabs have a close button (x)
 +
|-
 +
|PageCount
 +
|RW
 +
|Numeric
 +
|Number of pages in the pageframe.
 +
|-
 +
|valign="top"|Tabs
 +
|valign="top"|RW
 +
|valign="top"|Boolean
 +
|Whether the tab bar is displayed
 +
|-
 +
|valign="top"|Tabposition
 +
|valign="top"|RW
 +
|valign="top"|Character
 +
|Defines the position of the tabbar: 'north', 'south', 'east' or 'west'
 +
|-
 
|}
 
|}
  
 
====Methods====
 
====Methods====
  
This class supports the '''Common methods''' plus the following:
+
This class supports the [[:Category:Common_Methods|Common Methods]] plus the following:
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
 
!width="20%"|Method
 
!width="20%"|Method
 
!Args
 
!Args
 
!width="50%"|Description
 
!width="50%"|Description
 
+
|-
 +
|valign="top"|AddObject
 +
|valign="top"|existing as Object | newobject as Character, class as Character
 +
|valign="top"|Add an existing object or a new object, in which case the object's class must also be specified
 +
|-
 +
|Removeobject
 +
|existing as Object
 +
|Remove the specified object
 +
|-
 
|}
 
|}
  
 
====Events====
 
====Events====
  
This class supports the '''Common events''' plus the following:
+
This class supports the [[:Category:Common_Events|Common Events]] plus the following:
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
 
!width="20%"|Event
 
!width="20%"|Event
 
!Args
 
!Args
Line 33: Line 80:
  
 
|}
 
|}
 +
 +
====Examples====
 +
 +
'''VFP'''
 +
<code lang="recital">
 +
//
 +
// VFP custom section for page "page1" section "section1"
 +
//
 +
namespace rectabs
 +
public pageframe1, tab0, tab1, tab2
 +
 +
define class page1_section1 as section
 +
enddefine
 +
 +
define class tabbutton as CommandButton
 +
proc click
 +
do case
 +
case upper(this.name) = "TABBUTTON1"
 +
pageframe1.activepage = 1
 +
case upper(this.name) = "TABBUTTON2"
 +
pageframe1.activepage = 2
 +
case upper(this.name) = "TABBUTTON3"
 +
messagebox(etos(int(pageframe1.pagecount)),64,"Pages")
 +
case upper(this.name) = "TABBUTTON4"
 +
pageframe1.closable = not pageframe1.closable
 +
case upper(this.name) = "TABBUTTON5"
 +
pageframe1.tabs = not pageframe1.tabs
 +
case upper(this.name) = "TABBUTTON6"
 +
if pageframe1.pagecount = 3
 +
pageframe1.removeobject(tab2)
 +
else
 +
pageframe1.addobject("tab2","page")
 +
tab2.caption = "Tab2"
 +
tab2.backcolor = "green"
 +
endif
 +
endcase
 +
endproc
 +
enddefine
 +
 +
proc page1_section1
 +
page1_section1 = createobject("page1_section1")
 +
page1_section1.addobject("pageframe1", "pageframe")
 +
pageframe1.addobject("tab0", "page")
 +
tab0.layout = 3
 +
tab0.picture = ":/images/recital_background"
 +
tab0.caption = "Tab0"
 +
tab0.addobject("tabbutton1", "tabbutton")
 +
tabbutton1.caption = "Select Tab1"
 +
tab0.addobject("tabbutton2", "tabbutton")
 +
tabbutton2.caption = "Select Tab2"
 +
tab0.addobject("tabbutton3", "tabbutton")
 +
tabbutton3.caption = "Display Pagecount"
 +
tab0.addobject("tabbutton4", "tabbutton")
 +
tabbutton4.caption = "Toggle closable tabs"
 +
tab0.addobject("tabbutton5", "tabbutton")
 +
tabbutton5.caption = "Toggle tab bar"
 +
tab0.addobject("tabbutton6", "tabbutton")
 +
tabbutton6.caption = "Add/remove tab"
 +
 +
pageframe1.addobject("tab1", "page")
 +
tab1.caption = "Tab1"
 +
tab1.backcolor = "red"
 +
 +
pageframe1.addobject("tab2", "page")
 +
tab2.caption = "Tab2"
 +
tab2.backcolor = "blue"
 +
 +
return page1_section1
 +
</code>
 +
 +
[[Category:Documentation]]
 +
[[Category:Framework Classes]]

Latest revision as of 10:50, 9 April 2018

Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.

Description

Shown below in a standalone Form. Click the image to see in a Custom Section in a Lianja Page.

Page, Pageframe

Creates a page frame to contain Page objects.

A page frame is a container object that contains pages, which can contain containers and controls.

The page frame defines global characteristics of the page: size and positioning, border style, which page is active, and so on. The page frame determines the location of the pages and how much of each page is visible. Pages are positioned at the top left corner of the page frame. If the page frame is moved, the pages move with the page frame.

A page frame contains individual pages that are named Page1, Page2, Page3, and so on by default.

Properties

This class supports the Common Properties plus the following:

Property Access (R/RW) Value Description
ActivePage RW Numeric Index of the selected page, starting from 0, left to right
Closable RW Boolean Whether individual tabs have a close button (x)
PageCount RW Numeric Number of pages in the pageframe.
Tabs RW Boolean Whether the tab bar is displayed
Tabposition RW Character Defines the position of the tabbar: 'north', 'south', 'east' or 'west'

Methods

This class supports the Common Methods plus the following:

Method Args Description
AddObject existing as Object | newobject as Character, class as Character Add an existing object or a new object, in which case the object's class must also be specified
Removeobject existing as Object Remove the specified object

Events

This class supports the Common Events plus the following:

Event Args Description

Examples

VFP

//
// VFP custom section for page "page1" section "section1"
//
namespace rectabs
public pageframe1, tab0, tab1, tab2
 
define class page1_section1 as section
enddefine
 
define class tabbutton as CommandButton 
proc click
	do case
		case upper(this.name) = "TABBUTTON1"
			pageframe1.activepage = 1
		case upper(this.name) = "TABBUTTON2"
			pageframe1.activepage = 2
		case upper(this.name) = "TABBUTTON3"
			messagebox(etos(int(pageframe1.pagecount)),64,"Pages")
		case upper(this.name) = "TABBUTTON4"
			pageframe1.closable = not pageframe1.closable
		case upper(this.name) = "TABBUTTON5"
			pageframe1.tabs = not pageframe1.tabs
		case upper(this.name) = "TABBUTTON6"
			if pageframe1.pagecount = 3
				pageframe1.removeobject(tab2)
			else
				pageframe1.addobject("tab2","page")
				tab2.caption = "Tab2"
				tab2.backcolor = "green"
			endif
	endcase
endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
	page1_section1.addobject("pageframe1", "pageframe")
	pageframe1.addobject("tab0", "page")
	tab0.layout = 3
	tab0.picture = ":/images/recital_background"
	tab0.caption = "Tab0"
	tab0.addobject("tabbutton1", "tabbutton")
	tabbutton1.caption = "Select Tab1"
	tab0.addobject("tabbutton2", "tabbutton")
	tabbutton2.caption = "Select Tab2"
	tab0.addobject("tabbutton3", "tabbutton")
	tabbutton3.caption = "Display Pagecount"
	tab0.addobject("tabbutton4", "tabbutton")
	tabbutton4.caption = "Toggle closable tabs"
	tab0.addobject("tabbutton5", "tabbutton")
	tabbutton5.caption = "Toggle tab bar"
	tab0.addobject("tabbutton6", "tabbutton")
	tabbutton6.caption = "Add/remove tab"
 
	pageframe1.addobject("tab1", "page")
	tab1.caption = "Tab1"
	tab1.backcolor = "red"
 
	pageframe1.addobject("tab2", "page")
	tab2.caption = "Tab2"
	tab2.backcolor = "blue"
 
return page1_section1