Important: The information in this document is obsolete and should not be used for new development.
PATH![]() |
![]() ![]() |
When your action function is called for a control part, your action function is passed a handle to the control and the control's part code. Your action function should then respond as is appropriate. For an example of such an action function, see MyActionProc . The only exception to this is for indicators that don't support live feedback.
If the mouse-down event occurs in an indicator of a control that does not support live feedback, your action function should take no parameters, because the user may move the cursor outside the indicator while dragging it. For an example of such an action function, see MyIndicatorActionProc .
The following Control Manager functions for defining your own control action functions are new, changed, or not recommended with Appearance Manager 1.0:
MyActionProc
defines actions t
o be performed repeatedly in response to a mouse-down event in a control part. Changed with Appearance Manager 1.0.MyIndicatorActionProc
defines actions to be performed while the user holds down the mouse button when the cursor is over a control's indicator part. Not recommended with Appearance Manager 1.0.Defines actions t o be performed repeatedly in response to a mouse-down event in a control part.
The Control Manager declares the type for an application-defined action function as follows:
typedef pascal void (*ControlActionProcPtr)(
ControlHandle theControl,
ControlPartCode partCode);
The Control Manager defines the data type ControlActionUPP
to identify the universal procedure pointer for this application-defined function:
typedef UniversalProcPtr ControlActionUPP;
You typically use the NewControlActionProc
macro like this:
ControlActionUPP
myActionUPP; myActionUPP = NewControlActionProc(MyAction);
You typically use the CallControlActionProc
macro like this:
CallControlActionProc(MyActionUPP, theControl, partCode);
Here's how to declare an action function for a control part if you were to name the function MyActionProc
:
pascal void MyActionProc (
ControlHandle theControl,
ControlPartCode partCode);
theControl
partCode
When a mouse-down event occurs in a control,
HandleControlClick
and TrackControl
respond as is appropriate by
highlighting the control or dragging the indicator as long as the user holds down the mouse button. You can define other actions to be performed repeatedly during this interval. To do so, define your own action function
and point to it in the actionProc
parameter of the TrackControl
function or the inAction
parameter of HandleControlClick
. This is the only way to specify actions in response to all mouse-down events in a control or indicator.
You should use the MyIndicatorActionProc
function while tracking indicators of controls that don't support live feedback.
Defines actions to be performed while the user holds down the mouse button when the cursor is over a control's indicator.
When the Appearance Manager is available, you should use MyActionProc
to define actions to be performed in response to a mouse-down event in an indicator of a control that supports live feedback. You should only use MyIndicatorActionProc
if the control does not support live feedback.