Difference between revisions of "Drag Method"
From Lianjapedia
(Created page with '{{Common Method}} Category:Methods Category:Common Methods') |
Yvonne.milne (Talk | contribs) m (Reverted edits by Helen.george (talk) to last revision by Yvonne.milne) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | { | + | __NOTOC__ |
+ | Begins, ends or cancels a drag operation. | ||
+ | |||
+ | <pre> | ||
+ | ob.drag([nAction]) | ||
+ | </pre> | ||
+ | |||
+ | ==Arguments== | ||
+ | |||
+ | {|class="wikitable" width=100% | ||
+ | !width=20%|Argument||Type||width=70%|Description | ||
+ | |- | ||
+ | |nAction||N||0 = Cancel, 1 = Begin (default), 2 = End | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | |||
+ | ==Example== | ||
+ | <code lang="recital"> | ||
+ | // | ||
+ | // Lianja custom section for page "page1" section "section1" | ||
+ | // | ||
+ | namespace custom1 | ||
+ | define class page1_section1 as section | ||
+ | enddefine | ||
+ | |||
+ | define class dragMe as commandbutton | ||
+ | |||
+ | top = 38 | ||
+ | left = 350 | ||
+ | height = 23 | ||
+ | fixedWidth = 63 | ||
+ | |||
+ | proc mouseUp | ||
+ | lparameters nButton, nShift, nXCoord, nYCoord | ||
+ | this.drag(0) | ||
+ | this.move(this.left + nXCoord,this.top + nYCoord) | ||
+ | endproc | ||
+ | proc mouseDown | ||
+ | this.drag(1) | ||
+ | endproc | ||
+ | |||
+ | |||
+ | enddefine | ||
+ | |||
+ | proc page1_section1 | ||
+ | page1_section1 = createobject("page1_section1") | ||
+ | page1_section1.addobject("oDragMe", "dragMe") | ||
+ | oDragMe.caption = "Drag Me" | ||
+ | return page1_section1 | ||
+ | </code> | ||
[[Category:Methods]] | [[Category:Methods]] | ||
[[Category:Common Methods]] | [[Category:Common Methods]] |
Latest revision as of 06:26, 30 April 2013
Begins, ends or cancels a drag operation.
ob.drag([nAction])
Arguments
Argument | Type | Description |
---|---|---|
nAction | N | 0 = Cancel, 1 = Begin (default), 2 = End |
Example
// // Lianja custom section for page "page1" section "section1" // namespace custom1 define class page1_section1 as section enddefine define class dragMe as commandbutton top = 38 left = 350 height = 23 fixedWidth = 63 proc mouseUp lparameters nButton, nShift, nXCoord, nYCoord this.drag(0) this.move(this.left + nXCoord,this.top + nYCoord) endproc proc mouseDown this.drag(1) endproc enddefine proc page1_section1 page1_section1 = createobject("page1_section1") page1_section1.addobject("oDragMe", "dragMe") oDragMe.caption = "Drag Me" return page1_section1