2001-12-13 22:24:37 +01:00
|
|
|
# FindControlUnderMouse() returns an existing control, not a new one,
|
|
|
|
# so create this one by hand.
|
|
|
|
f = Function(ExistingControlHandle, 'FindControlUnderMouse',
|
|
|
|
(Point, 'inWhere', InMode),
|
|
|
|
(WindowRef, 'inWindow', InMode),
|
|
|
|
(SInt16, 'outPart', OutMode),
|
|
|
|
)
|
|
|
|
functions.append(f)
|
|
|
|
|
1999-02-07 15:02:03 +01:00
|
|
|
f = Function(ControlHandle, 'as_Control',
|
2004-07-18 08:16:08 +02:00
|
|
|
(Handle, 'h', InMode))
|
1999-02-07 15:02:03 +01:00
|
|
|
functions.append(f)
|
|
|
|
|
1999-12-23 15:32:06 +01:00
|
|
|
f = Method(Handle, 'as_Resource', (ControlHandle, 'ctl', InMode))
|
1995-06-18 22:16:33 +02:00
|
|
|
methods.append(f)
|
1996-10-01 12:46:46 +02:00
|
|
|
|
2000-03-21 17:25:23 +01:00
|
|
|
f = Method(void, 'GetControlRect', (ControlHandle, 'ctl', InMode), (Rect, 'rect', OutMode))
|
|
|
|
methods.append(f)
|
|
|
|
|
1996-10-01 12:46:46 +02:00
|
|
|
DisposeControl_body = """
|
2004-07-18 08:16:08 +02:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
if ( _self->ob_itself ) {
|
|
|
|
SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */
|
|
|
|
DisposeControl(_self->ob_itself);
|
|
|
|
_self->ob_itself = NULL;
|
|
|
|
}
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
1996-10-01 12:46:46 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
f = ManualGenerator("DisposeControl", DisposeControl_body)
|
|
|
|
f.docstring = lambda : "() -> None"
|
|
|
|
|
|
|
|
methods.append(f)
|
2001-12-13 22:24:37 +01:00
|
|
|
|
|
|
|
# All CreateXxxXxxControl() functions return a new object in an output
|
|
|
|
# parameter; these should however be managed by us (we're creating them
|
|
|
|
# after all), so set the type to ControlRef.
|
|
|
|
for f in functions:
|
2004-07-18 08:16:08 +02:00
|
|
|
if f.name.startswith("Create"):
|
|
|
|
v = f.argumentList[-1]
|
|
|
|
if v.type == ExistingControlHandle:
|
|
|
|
v.type = ControlRef
|