Difference between revisions of "Move Method"
From Lianjapedia
(Created page with '{{Common Method}} Category:Methods Category:Common Methods') |
|||
Line 1: | Line 1: | ||
− | { | + | __NOTOC__ |
+ | Changes the position or size of the object. | ||
+ | |||
+ | <pre> | ||
+ | ob.move(nLeft [, nTop [, nWidth [nHeight]]]) | ||
+ | </pre> | ||
+ | |||
+ | ===Arguments=== | ||
+ | |||
+ | {|class="wikitable" | ||
+ | !Argument||Type||Description | ||
+ | |- | ||
+ | |nLeft||N||Left column position | ||
+ | |- | ||
+ | |nTop||N||Top row position | ||
+ | |- | ||
+ | |nWidth||N||Width | ||
+ | |- | ||
+ | |nHeight||N|Heightt | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | |||
+ | ==Example== | ||
+ | <code lang="recital"> | ||
+ | // | ||
+ | // Lianja custom section for page "page1" section "section1" | ||
+ | // | ||
+ | namespace custom1 | ||
+ | public textbox1, textbox2 | ||
+ | define class page1_section1 as section | ||
+ | enddefine | ||
+ | |||
+ | define class moveright_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.move(textbox1.left+10) | ||
+ | textbox2.move(textbox2.left+10) | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | define class moveleft_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.move(textbox1.left-10) | ||
+ | textbox2.move(textbox2.left-10) | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | define class moveup_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.move(textbox1.left,textbox1.top-10) | ||
+ | textbox2.move(textbox2.left,textbox2.top-10) | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | define class movedown_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.move(textbox1.left,textbox1.top+10) | ||
+ | textbox2.move(textbox2.left,textbox2.top+10) | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | define class moveresize_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.move(textbox1.left,textbox1.top,100,100) | ||
+ | textbox2.move(textbox2.left,textbox2.top,100,100) | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | define class resize_button as CommandButton | ||
+ | proc click | ||
+ | textbox1.resize(200,50) | ||
+ | textbox2.resize(200,50) | ||
+ | endproc | ||
+ | enddefine | ||
+ | |||
+ | proc page1_section1 | ||
+ | page1_section1 = createobject("page1_section1") | ||
+ | |||
+ | page1_section1.addobject("moverightbutton","moveright_button") | ||
+ | moverightbutton.caption = "Move Right" | ||
+ | |||
+ | page1_section1.addobject("moveleftbutton","moveleft_button") | ||
+ | moveleftbutton.caption = "Move Left" | ||
+ | |||
+ | page1_section1.addobject("moveupbutton","moveup_button") | ||
+ | moveupbutton.caption = "Move Up" | ||
+ | |||
+ | page1_section1.addobject("movedownbutton","movedown_button") | ||
+ | movedownbutton.caption = "Move Down" | ||
+ | |||
+ | page1_section1.addobject("moveresizebutton","moveresize_button") | ||
+ | moveresizebutton.caption = "Resize using move method" | ||
+ | |||
+ | page1_section1.addobject("resizebutton","resize_button") | ||
+ | resizebutton.caption = "Resize using resize method" | ||
+ | |||
+ | page1_section1.addobject("textbox1", "Textbox") | ||
+ | textbox1.value = "Textbox 1" | ||
+ | textbox1.backcolor = "orange" | ||
+ | |||
+ | page1_section1.addobject("textbox2", "Textbox") | ||
+ | textbox2.value = "Textbox 2" | ||
+ | textbox2.backcolor = "gray" | ||
+ | return page1_section1 | ||
+ | </code> | ||
[[Category:Methods]] | [[Category:Methods]] | ||
[[Category:Common Methods]] | [[Category:Common Methods]] |
Revision as of 07:56, 28 September 2011
Changes the position or size of the object.
ob.move(nLeft [, nTop [, nWidth [nHeight]]])
Arguments
Argument | Type | Description |
---|---|---|
nLeft | N | Left column position |
nTop | N | Top row position |
nWidth | N | Width |
nHeight | Heightt |
Example
// // Lianja custom section for page "page1" section "section1" // namespace custom1 public textbox1, textbox2 define class page1_section1 as section enddefine define class moveright_button as CommandButton proc click textbox1.move(textbox1.left+10) textbox2.move(textbox2.left+10) endproc enddefine define class moveleft_button as CommandButton proc click textbox1.move(textbox1.left-10) textbox2.move(textbox2.left-10) endproc enddefine define class moveup_button as CommandButton proc click textbox1.move(textbox1.left,textbox1.top-10) textbox2.move(textbox2.left,textbox2.top-10) endproc enddefine define class movedown_button as CommandButton proc click textbox1.move(textbox1.left,textbox1.top+10) textbox2.move(textbox2.left,textbox2.top+10) endproc enddefine define class moveresize_button as CommandButton proc click textbox1.move(textbox1.left,textbox1.top,100,100) textbox2.move(textbox2.left,textbox2.top,100,100) endproc enddefine define class resize_button as CommandButton proc click textbox1.resize(200,50) textbox2.resize(200,50) endproc enddefine proc page1_section1 page1_section1 = createobject("page1_section1") page1_section1.addobject("moverightbutton","moveright_button") moverightbutton.caption = "Move Right" page1_section1.addobject("moveleftbutton","moveleft_button") moveleftbutton.caption = "Move Left" page1_section1.addobject("moveupbutton","moveup_button") moveupbutton.caption = "Move Up" page1_section1.addobject("movedownbutton","movedown_button") movedownbutton.caption = "Move Down" page1_section1.addobject("moveresizebutton","moveresize_button") moveresizebutton.caption = "Resize using move method" page1_section1.addobject("resizebutton","resize_button") resizebutton.caption = "Resize using resize method" page1_section1.addobject("textbox1", "Textbox") textbox1.value = "Textbox 1" textbox1.backcolor = "orange" page1_section1.addobject("textbox2", "Textbox") textbox2.value = "Textbox 2" textbox2.backcolor = "gray" return page1_section1