Height Property

From Lianjapedia
Jump to: navigation, search

The height of the object in pixels. Read/write. The object height is dependent on the height available in the parent container. The fixedheight property can be used to specify an absolute height.

nHeight = ob.height
ob.height = nHeight

nHeight

Numeric signifying the height in pixels.

Example

//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, label1, label2, label3, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Increase container size
		container1.fixedheight = 600
		// label1 stays at fixedheight (120)
		label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120"
		// label2 does not go above its maximum height (200)
		label2.caption = "Height = " + etos(int(label2.height)) //"Max height 200"
		// label3 resizes to fill the container height
		label3.caption = "Height = " + etos(int(label3.height)) //"Resizable"
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.fixedheight = 300
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("label1", "label")
	label1.caption = "Fixed height 120"
	label1.fixedheight = 120
	label1.borderstyle = 1
 
	container1.addobject("label2", "label")
	label2.caption = "Max height 200"
	label2.maxheight = 200
	label2.borderstyle = 1
 
	container1.addobject("label3", "label")
	label3.caption = "Resizable"
	label3.height = 200
	label3.borderstyle = 1
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1