Difference between revisions of "Minheight Property"
From Lianjapedia
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
The minimum height of the object in pixels. Read/write. | The minimum height of the object in pixels. Read/write. | ||
− | The height of an object is dependent on the height available in the parent container. Minheight can be used to specify a height below which the object will not resize. | + | The height of an object is dependent on the height available in the parent container. Minheight can be used to specify a height below which the object will not resize, within the limits of its parent. |
<pre> | <pre> | ||
Line 14: | Line 14: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
+ | // | ||
+ | // Lianja custom section for page "page1" section "section1" | ||
+ | // | ||
+ | namespace custom2 | ||
+ | public container1, label1, label2, label3, sizebutton | ||
+ | define class page1_section1 as section | ||
+ | |||
+ | enddefine | ||
+ | |||
+ | define class size_button as CommandButton | ||
+ | proc click | ||
+ | // Resize container | ||
+ | container1.fixedheight = 150 | ||
+ | // label1 stays at fixedheight (120) | ||
+ | label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120" | ||
+ | // label2 does not go below its minimum height (200), but is restricted by the container | ||
+ | label2.caption = "Height = " + etos(int(label2.height)) //"Min height 200" | ||
+ | // label3 resizes | ||
+ | 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 = 500 | ||
+ | container1.layout = 1 | ||
+ | |||
+ | container1.addobject("label1", "label") | ||
+ | label1.caption = "Fixed height 120" | ||
+ | label1.fixedheight = 120 | ||
+ | label1.borderstyle = 1 | ||
+ | |||
+ | container1.addobject("label2", "label") | ||
+ | label2.caption = "Min height 200" | ||
+ | label2.height = 120 | ||
+ | label2.minheight = 200 | ||
+ | label2.borderstyle = 1 | ||
+ | |||
+ | container1.addobject("label3", "label") | ||
+ | label3.caption = "Resizable" | ||
+ | label3.height = 120 | ||
+ | label3.borderstyle = 1 | ||
+ | |||
+ | container1.addobject("sizebutton","size_button") | ||
+ | sizebutton.caption = "Click" | ||
+ | return page1_section1 | ||
</code> | </code> |
Revision as of 11:21, 26 September 2011
The minimum height of the object in pixels. Read/write. The height of an object is dependent on the height available in the parent container. Minheight can be used to specify a height below which the object will not resize, within the limits of its parent.
nMinheight = ob.minheight ob.minheight = nMinheight
nMinheight
Numeric signifying the minimum height in pixels.
Example
// // Lianja custom section for page "page1" section "section1" // namespace custom2 public container1, label1, label2, label3, sizebutton define class page1_section1 as section enddefine define class size_button as CommandButton proc click // Resize container container1.fixedheight = 150 // label1 stays at fixedheight (120) label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120" // label2 does not go below its minimum height (200), but is restricted by the container label2.caption = "Height = " + etos(int(label2.height)) //"Min height 200" // label3 resizes 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 = 500 container1.layout = 1 container1.addobject("label1", "label") label1.caption = "Fixed height 120" label1.fixedheight = 120 label1.borderstyle = 1 container1.addobject("label2", "label") label2.caption = "Min height 200" label2.height = 120 label2.minheight = 200 label2.borderstyle = 1 container1.addobject("label3", "label") label3.caption = "Resizable" label3.height = 120 label3.borderstyle = 1 container1.addobject("sizebutton","size_button") sizebutton.caption = "Click" return page1_section1