Pageframe [examples]

 

//
// 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

https://www.lianja.com/doc/index.php/Pageframe


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.