Difference between revisions of "Maxwidth Property"

From Lianjapedia
Jump to: navigation, search
(Created page with '__NOTOC__ The maximum width of the object in pixels. Read/write. The width of an object is dependent on the width available in the parent container. Maxwidth can be used to spe…')
 
 
(One intermediate revision by one other user not shown)
Line 17: Line 17:
 
//
 
//
 
namespace custom1
 
namespace custom1
public textbox1, textbox2, sizebutton
+
public container1, textbox1, textbox2, sizebutton
 
define class page1_section1 as section
 
define class page1_section1 as section
 
enddefine
 
enddefine
Line 56: Line 56:
 
return page1_section1
 
return page1_section1
 
</code>
 
</code>
 +
 +
[[Category:Properties]]
 +
[[Category:Common Properties]]

Latest revision as of 06:59, 26 September 2011

The maximum width of the object in pixels. Read/write. The width of an object is dependent on the width available in the parent container. Maxwidth can be used to specify a width above which the object will not resize.

nMaxwidth = ob.maxwidth
ob.maxwidth = nMaxwidth

nMaxwidth

Numeric signifying the maximum width in pixels.

Example

//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1, textbox2, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Increase container size
		container1.fixedwidth = 600
		// Textbox1 stays at fixedwidth
		textbox1.value = "Width = " + etos(int(textbox1.width))
		// Textbox2 does not go above its maximum width
		textbox2.value = "Width = " + etos(int(textbox2.width))
		// Sizebutton resizes to fill the rest of the available container width
		sizebutton.caption = "Width = " + etos(int(sizebutton.width))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.backcolor = "slategray"
	container1.fixedwidth = 400
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Fixed width 120"
	textbox1.fixedwidth = 120
 
	container1.addobject("textbox2", "Textbox")
	textbox2.value = "Max width 200"
	textbox2.maxwidth = 200
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1