home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-27 | 1.4 KB | 48 lines | [TEXT/PJMM] |
- { StubCDEF: Stub project to facilitate insertion and debugging of CDEFs in applications }
- {}
- { Copyright © Sebastiano Pilla 1996 }
- { All rights reserved }
- { Original version Copyright © by Peter N. Lewis }
- {}
- { <mailto:case@tvol.it> }
-
- { This StubCDEF must be compiled and saved like any other CDEF resource. }
- {}
- { When defining controls, StubCDEF behaves like a normal CDEF: the control definition ID must contain }
- { 16 * (CDEF ID) + varCode, if the actual defproc requires variation codes. }
- { All other fields are specified by the real defproc documentation. }
- {}
- { At the control creation a ControlDefUPP pointing to the real defproc must be created and }
- { stored into the control's refCon: StubCDEF works by fetching that UPP and calling it. As it is, }
- { it assumes that the control's refCon is not used for anything else. }
-
- unit StubCDEF;
-
-
- interface
-
-
- function Main (inVarCode: SInt16;
- inControlHdl: ControlHandle;
- inMessage: ControlDefProcMessage;
- inParam: SInt32): SInt32;
-
-
- implementation
-
-
- function Main (inVarCode: SInt16;
- inControlHdl: ControlHandle;
- inMessage: ControlDefProcMessage;
- inParam: SInt32): SInt32;
- var
- ctrlDefUPP: ControlDefUPP;
- begin
- Main := 0;
- ctrlDefUPP := ControlDefUPP(GetControlReference(inControlHdl));
- if ctrlDefUPP <> nil then
- Main := CallControlDefProc(inVarCode, inControlHdl, inMessage, inParam, ctrlDefUPP);
- end;
-
-
- end.