Difference between revisions of "Pageframe"

From Lianjapedia
Jump to: navigation, search
Line 1: Line 1:
 +
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
 +
 
====Properties====
 
====Properties====
  
Line 11: Line 13:
 
|valign="top"|Tabs
 
|valign="top"|Tabs
 
|valign="top"|RW
 
|valign="top"|RW
|valign="top"|boolean
+
|valign="top"|Boolean
|If true, the tab bar is displayed. If false, only the current page is displayed.
+
|Whether the tab bar is displayed  
 
|-
 
|-
|Activepage
+
|ActivePage
 
|RW
 
|RW
|numeric
+
|Numeric
|Index of the selected page (starting from 0, left to right).
+
|Index of the selected page, starting from 0, left to right
 
|-
 
|-
 
|valign="top"|Closable
 
|valign="top"|Closable
 
|valign="top"|RW
 
|valign="top"|RW
|valign="top"|boolean
+
|valign="top"|Boolean
|If true, individual tabs have a close button (x).  If false tabs cannot be closed.
+
|Whether individual tabs have a close button (x)  
 
|-
 
|-
|Pagecount
+
|PageCount
 
|RW
 
|RW
|numeric
+
|Numeric
 
|Number of pages in the pageframe.
 
|Number of pages in the pageframe.
 
|-
 
|-
Line 40: Line 42:
 
!width="50%"|Description
 
!width="50%"|Description
 
|-
 
|-
|Addobject
+
|valign="top"|AddObject
|name,class
+
|valign="top"|existing as Object | newobject as Character, class as Character
|Adds an object to the pageframe container.
+
|valign="top"|Add an existing object or a new object, in which case the object's class must also be specified
 
|-
 
|-
 
|Removeobject
 
|Removeobject
|object
+
|existing as Object
|Removes an object from the pageframe container.
+
|Remove the specified object
 
|-
 
|-
 
|}
 
|}

Revision as of 08:12, 9 January 2013

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

Properties

This class supports the Common Properties plus the following:

Property Access (R/RW) Value Description
Tabs RW Boolean Whether the tab bar is displayed
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.

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