Difference between revisions of "Minwidth Property"

From Lianjapedia
Jump to: navigation, search
(Created page with '__NOTOC__ The minimum width of the object in pixels. Read/write. The width of an object is dependent on the width available in the parent container. Minwidth can be used to spe…')
 
 
(2 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
</pre>
 
</pre>
  
===nTop===
+
===nMinwidth===
 
Numeric signifying the minimum width in pixels.
 
Numeric signifying the minimum width in pixels.
  
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 55: Line 55:
 
return page1_section1
 
return page1_section1
 
</code>
 
</code>
 +
 +
[[Category:Properties]]
 +
[[Category:Common Properties]]

Latest revision as of 07:56, 26 September 2011

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

nMinwidth = ob.minwidth
ob.minwidth = nMinwidth

nMinwidth

Numeric signifying the minimum 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
		// Shrink container size
		container1.fixedwidth = 400
		// Textbox1 stays at fixedwidth
		textbox1.value = "Width = " + etos(int(textbox1.width))
		// Textbox2 does not go below its minimum 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"
	// 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 = "Min width 200"
	textbox2.minwidth = 200
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1