Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UIobject creation and event method

0 views
Skip to first unread message

Jean Yves Cojan

unread,
Aug 30, 2004, 4:40:59 PM8/30/04
to corel.wpoffice.paradox-opal

Is it possible in object PAL to create an object and associate to it an
event method?
For example : how to create a box and its mouseclick method.

Mark Bannister

unread,
Aug 30, 2004, 5:09:31 PM8/30/04
to corel.wpoffice.paradox-opal

Jean:
Sure, look at the create method for UI objects. Use MethodSet method to
add code. The form or report must be in design mode. You can open it
hidden, add your objects and then run the form though.

Tom Nelson

unread,
Aug 30, 2004, 5:22:32 PM8/30/04
to corel.wpoffice.paradox-opal

> Is it possible in object PAL to create an object and associate to it an
> event method?
> For example : how to create a box and its mouseclick method.

Jean Yves,
something like this:

method run(var eventInfo Event)
const
kInch = 1440 ; One inch = 1,440 twips.
endConst
var
uiBox uiObject
fo form
endVar


fo.create()
uiBox.create(boxTool, .1*kInch,.1*kInch,1*kInch,2*kInch, fo)
uiBox.visible = True
uiBox.MethodSet("MouseClick","method mouseClick(var eventInfo MouseEvent)
self.color = Blue
endmethod")
fo.run()

endmethod

Tom Nelson


Tom Nelson

unread,
Aug 30, 2004, 5:48:23 PM8/30/04
to corel.wpoffice.paradox-opal

> uiBox.MethodSet("MouseClick","method mouseClick(var eventInfo MouseEvent)
> self.color = Blue
> endmethod")

If you have a method that requires more than two or three lines I think the
following version will be better for you:

method run(var eventInfo Event)
const
kInch = 1440 ; One inch = 1,440 twips.
endConst
var
uiBox uiObject
fo form

st string
endVar


fo.create()
uiBox.create(boxTool, .1*kInch,.1*kInch,1*kInch,2*kInch, fo)
uiBox.visible = True

st = "method mouseClick(var eventInfo MouseEvent)\r\n\r\n"
st = st + "self.color = Blue\r\n"
st = st + "endmethod"
uiBox.MethodSet("MouseClick", st)

fo.run()

endmethod

Tom Nelson


Jean Yves Cojan

unread,
Aug 31, 2004, 5:28:20 PM8/31/04
to corel.wpoffice.paradox-opal
OK THANKS TO ALL OF YOU? IT WORKS.

0 new messages