|
Mac OS 9
|
Control Manager interfaces. More...
#include <MacTypes.h>#include <Quickdraw.h>#include <Menus.h>#include <TextEdit.h>#include <Drag.h>#include <Icons.h>#include <Collections.h>#include <MacErrors.h>Go to the source code of this file.
Data Structures | |
| struct | ControlTemplate |
| struct | ControlRecord |
| struct | CtlCTab |
| struct | AuxCtlRec |
| struct | ControlButtonContentInfo |
| struct | ControlFontStyleRec |
| struct | IndicatorDragConstraint |
| struct | ControlTrackingRec |
| struct | ControlKeyDownRec |
| struct | ControlDataAccessRec |
| struct | ControlCalcSizeRec |
| struct | ControlBackgroundRec |
| struct | ControlApplyTextColorRec |
| struct | ControlGetRegionRec |
| struct | ControlSetCursorRec |
| struct | ControlContextualMenuClickRec |
| struct | ControlClickActivationRec |
| struct | ControlDefSpec |
| struct | ControlID |
| struct | ControlKind |
Macros | |
| #define | NewControlActionUPP(userRoutine) |
| #define | DisposeControlActionUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeControlActionUPP(theControl, partCode, userUPP) |
| #define | NewControlActionProc(userRoutine) NewControlActionUPP(userRoutine) |
| #define | CallControlActionProc(userRoutine, theControl, partCode) InvokeControlActionUPP(theControl, partCode, userRoutine) |
| #define | NewControlDefUPP(userRoutine) |
| #define | DisposeControlDefUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeControlDefUPP(varCode, theControl, message, param, userUPP) |
| #define | NewControlDefProc(userRoutine) NewControlDefUPP(userRoutine) |
| #define | CallControlDefProc(userRoutine, varCode, theControl, message, param) InvokeControlDefUPP(varCode, theControl, message, param, userRoutine) |
| #define | NewControlKeyFilterUPP(userRoutine) |
| #define | DisposeControlKeyFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, userUPP) |
| #define | NewControlKeyFilterProc(userRoutine) NewControlKeyFilterUPP(userRoutine) |
| #define | CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, modifiers) |
| #define | NewControlCNTLToCollectionUPP(userRoutine) |
| #define | DisposeControlCNTLToCollectionUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, procID, refCon, title, collection, userUPP) |
| #define | NewControlCNTLToCollectionProc(userRoutine) NewControlCNTLToCollectionUPP(userRoutine) |
| #define | CallControlCNTLToCollectionProc(userRoutine, bounds, value, visible, max, min, procID, refCon, title, collection) |
| #define | DrawOneControl(theControl) Draw1Control(theControl) |
| #define | NewControlColorUPP(userRoutine) |
| #define | DisposeControlColorUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeControlColorUPP(inControl, inMessage, inDrawDepth, inDrawInColor, userUPP) |
| #define | NewControlColorProc(userRoutine) NewControlColorUPP(userRoutine) |
| #define | CallControlColorProc(userRoutine, inControl, inMessage, inDrawDepth, inDrawInColor) |
| #define | GetControlRefFromCookie GetControlHandleFromCookie |
| #define | GetControlListFromWindow(theWindow) (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20)) |
| #define | GetControlOwningWindowControlList(theWindow) (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20)) |
| #define | SetControlPopupMenuRef SetControlPopupMenuHandle |
| #define | GetControlListFromWindow(theWindow) (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20)) |
| #define | GetControlOwningWindowControlList(theWindow) (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20)) |
Typedefs | |
| typedef struct ControlTemplate | ControlTemplate |
| typedef ControlTemplate * | ControlTemplatePtr |
| typedef ControlTemplatePtr * | ControlTemplateHandle |
| typedef UInt32 | ControlNotification |
| typedef UInt32 | ControlCapabilities |
| typedef struct ControlRecord | ControlRecord |
| typedef ControlRecord * | ControlPtr |
| typedef ControlPtr * | ControlRef |
| typedef ControlRef | ControlHandle |
| typedef SInt16 | ControlPartCode |
| typedef ControlPartCode | partCode |
| typedef struct CtlCTab | CtlCTab |
| typedef CtlCTab * | CCTabPtr |
| typedef CCTabPtr * | CCTabHandle |
| typedef struct AuxCtlRec | AuxCtlRec |
| typedef AuxCtlRec * | AuxCtlPtr |
| typedef AuxCtlPtr * | AuxCtlHandle |
| typedef SInt16 | ControlVariant |
| typedef SInt16 | ControlFocusPart |
| typedef SInt16 | ControlContentType |
| typedef struct ControlButtonContentInfo | ControlButtonContentInfo |
| typedef ControlButtonContentInfo * | ControlButtonContentInfoPtr |
| typedef ControlButtonContentInfo | ControlImageContentInfo |
| typedef ControlButtonContentInfo * | ControlImageContentInfoPtr |
| typedef UInt32 | ControlKeyScriptBehavior |
| typedef struct ControlFontStyleRec | ControlFontStyleRec |
| typedef ControlFontStyleRec * | ControlFontStylePtr |
| typedef UInt32 | ClickActivationResult |
| typedef SInt16 | ControlDefProcMessage |
| typedef UInt16 | ControlSize |
| typedef struct IndicatorDragConstraint | IndicatorDragConstraint |
| typedef IndicatorDragConstraint * | IndicatorDragConstraintPtr |
| typedef struct ControlTrackingRec | ControlTrackingRec |
| typedef ControlTrackingRec * | ControlTrackingPtr |
| typedef struct ControlKeyDownRec | ControlKeyDownRec |
| typedef ControlKeyDownRec * | ControlKeyDownPtr |
| typedef struct ControlDataAccessRec | ControlDataAccessRec |
| typedef ControlDataAccessRec * | ControlDataAccessPtr |
| typedef struct ControlCalcSizeRec | ControlCalcSizeRec |
| typedef ControlCalcSizeRec * | ControlCalcSizePtr |
| typedef struct ControlBackgroundRec | ControlBackgroundRec |
| typedef ControlBackgroundRec * | ControlBackgroundPtr |
| typedef struct ControlApplyTextColorRec | ControlApplyTextColorRec |
| typedef ControlApplyTextColorRec * | ControlApplyTextColorPtr |
| typedef struct ControlGetRegionRec | ControlGetRegionRec |
| typedef ControlGetRegionRec * | ControlGetRegionPtr |
| typedef struct ControlSetCursorRec | ControlSetCursorRec |
| typedef ControlSetCursorRec * | ControlSetCursorPtr |
| typedef struct ControlContextualMenuClickRec | ControlContextualMenuClickRec |
| typedef ControlContextualMenuClickRec * | ControlContextualMenuClickPtr |
| typedef struct ControlClickActivationRec | ControlClickActivationRec |
| typedef ControlClickActivationRec * | ControlClickActivationPtr |
| typedef ControlRef | theControl |
| typedef ControlRef ControlDefProcMessage | message |
| typedef ControlRef ControlDefProcMessage SInt32 | param |
| typedef SInt16 | ControlKeyFilterResult |
| typedef SInt16 * | keyCode |
| typedef SInt16 SInt16 * | charCode |
| typedef SInt16 SInt16 EventModifiers * | modifiers |
| typedef UInt32 | ControlDefType |
| typedef struct ControlDefSpec | ControlDefSpec |
| typedef SInt16 | value |
| typedef SInt16 Boolean | visible |
| typedef SInt16 Boolean SInt16 | max |
| typedef SInt16 Boolean SInt16 SInt16 | min |
| typedef SInt16 Boolean SInt16 SInt16 SInt16 | procID |
| typedef SInt16 Boolean SInt16 SInt16 SInt16 SInt32 | refCon |
| typedef SInt16 Boolean SInt16 SInt16 SInt16 SInt32 ConstStr255Param | title |
| typedef SInt16 Boolean SInt16 SInt16 SInt16 SInt32 ConstStr255Param Collection | collection |
| typedef SInt16 | inMessage |
| typedef SInt16 SInt16 | inDrawDepth |
| typedef SInt16 SInt16 Boolean | inDrawInColor |
| typedef struct ControlID | ControlID |
| typedef struct ControlKind | ControlKind |
| typedef ControlRef ControlNotification | notification |
| typedef ControlRef ControlNotification long | param1 |
| typedef ControlRef ControlNotification long long | param2 |
| typedef EventRecord * | theEvent |
| typedef ControlNotificationProcPtr | ControlNotificationUPP |
Enumerations | |
| enum | { kControlDefProcType = FOUR_CHAR_CODE('CDEF') , kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL') , kControlColorTableResourceType = FOUR_CHAR_CODE('cctb') , kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF') } |
| enum | { controlNotifyNothing = FOUR_CHAR_CODE('nada') , controlNotifyClick = FOUR_CHAR_CODE('clik') , controlNotifyFocus = FOUR_CHAR_CODE('focu') , controlNotifyKey = FOUR_CHAR_CODE('key ') } |
| enum | { kControlCanAutoInvalidate } |
| enum | { staticTextProc = 256 , editTextProc = 272 , iconProc = 288 , userItemProc = 304 , pictItemProc = 320 } |
| enum | { uppControlActionProcInfo = 0x000002C0 } |
| enum | { cFrameColor = 0 , cBodyColor = 1 , cTextColor = 2 , cThumbColor = 3 , kNumberCtlCTabEntries = 4 } |
| enum | { kControlNoVariant = 0 , kControlUsesOwningWindowsFontVariant } |
| enum | { kControlNoPart = 0 , kControlIndicatorPart = 129 , kControlDisabledPart = 254 , kControlInactivePart = 255 } |
| enum | { kControlEntireControl = 0 } |
| enum | { kControlStructureMetaPart = -1 , kControlContentMetaPart = -2 } |
| enum | { kControlFocusNoPart = 0 , kControlFocusNextPart = -1 , kControlFocusPrevPart = -2 } |
| enum | { kControlCollectionTagBounds , kControlCollectionTagValue = FOUR_CHAR_CODE('valu') , kControlCollectionTagMinimum , kControlCollectionTagMaximum , kControlCollectionTagViewSize , kControlCollectionTagVisibility , kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc') , kControlCollectionTagTitle , kControlCollectionTagUnicodeTitle , kControlCollectionTagIDSignature , kControlCollectionTagIDID , kControlCollectionTagCommand , kControlCollectionTagVarCode } |
| enum | { kControlContentTextOnly = 0 , kControlNoContent = 0 , kControlContentIconSuiteRes = 1 , kControlContentCIconRes = 2 , kControlContentPictRes = 3 , kControlContentICONRes = 4 , kControlContentIconSuiteHandle = 129 , kControlContentCIconHandle = 130 , kControlContentPictHandle = 131 , kControlContentIconRef = 132 , kControlContentICON = 133 } |
| enum | { kControlKeyScriptBehaviorAllowAnyScript , kControlKeyScriptBehaviorPrefersRoman , kControlKeyScriptBehaviorRequiresRoman } |
| enum | { kControlFontBigSystemFont = -1 , kControlFontSmallSystemFont = -2 , kControlFontSmallBoldSystemFont = -3 , kControlFontViewSystemFont } |
| enum | { kControlUseFontMask = 0x0001 , kControlUseFaceMask = 0x0002 , kControlUseSizeMask = 0x0004 , kControlUseForeColorMask = 0x0008 , kControlUseBackColorMask = 0x0010 , kControlUseModeMask = 0x0020 , kControlUseJustMask = 0x0040 , kControlUseAllMask = 0x00FF , kControlAddFontSizeMask = 0x0100 } |
| enum | { kControlAddToMetaFontMask = 0x0200 } |
| enum | { kControlUseThemeFontIDMask = 0x0080 } |
| enum | { kDoNotActivateAndIgnoreClick , kDoNotActivateAndHandleClick = 1 , kActivateAndIgnoreClick , kActivateAndHandleClick = 3 } |
| enum | { kControlFontStyleTag = FOUR_CHAR_CODE('font') , kControlKeyFilterTag = FOUR_CHAR_CODE('fltr') , kControlKindTag = FOUR_CHAR_CODE('kind') , kControlSizeTag = FOUR_CHAR_CODE('size') } |
| enum | { kControlSupportsGhosting = 1 << 0 , kControlSupportsEmbedding = 1 << 1 , kControlSupportsFocus = 1 << 2 , kControlWantsIdle = 1 << 3 , kControlWantsActivate = 1 << 4 , kControlHandlesTracking = 1 << 5 , kControlSupportsDataAccess = 1 << 6 , kControlHasSpecialBackground = 1 << 7 , kControlGetsFocusOnClick = 1 << 8 , kControlSupportsCalcBestRect = 1 << 9 , kControlSupportsLiveFeedback = 1 << 10 , kControlHasRadioBehavior , kControlSupportsDragAndDrop = 1 << 12 , kControlAutoToggles = 1 << 14 , kControlSupportsGetRegion = 1 << 17 , kControlSupportsFlattening = 1 << 19 , kControlSupportsSetCursor = 1 << 20 , kControlSupportsContextualMenus = 1 << 21 , kControlSupportsClickActivation = 1 << 22 , kControlIdlesWithTimer = 1 << 23 } |
| enum | { drawCntl = 0 , testCntl = 1 , calcCRgns = 2 , initCntl = 3 , dispCntl = 4 , posCntl = 5 , thumbCntl = 6 , dragCntl = 7 , autoTrack = 8 , calcCntlRgn = 10 , calcThumbRgn = 11 , drawThumbOutline = 12 , kControlMsgDrawGhost = 13 , kControlMsgCalcBestRect , kControlMsgHandleTracking = 15 , kControlMsgFocus = 16 , kControlMsgKeyDown = 17 , kControlMsgIdle = 18 , kControlMsgGetFeatures = 19 , kControlMsgSetData = 20 , kControlMsgGetData = 21 , kControlMsgActivate = 22 , kControlMsgSetUpBackground = 23 , kControlMsgCalcValueFromPos = 26 , kControlMsgTestNewMsgSupport , kControlMsgSubValueChanged = 25 , kControlMsgSubControlAdded = 28 , kControlMsgSubControlRemoved = 29 , kControlMsgApplyTextColor = 30 , kControlMsgGetRegion = 31 , kControlMsgFlatten = 32 , kControlMsgSetCursor , kControlMsgDragEnter = 38 , kControlMsgDragLeave = 39 , kControlMsgDragWithin = 40 , kControlMsgDragReceive = 41 , kControlMsgDisplayDebugInfo = 46 , kControlMsgContextualMenuClick , kControlMsgGetClickActivation } |
| enum | { kControlSizeNormal = 0 , kControlSizeSmall = 1 , kControlSizeLarge = 2 , kControlSizeAuto = 0xFFFF } |
| enum | { kDrawControlEntireControl = 0 , kDrawControlIndicatorOnly = 129 } |
| enum | { kDragControlEntireControl = 0 , kDragControlIndicator = 1 } |
| enum | { kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ') } |
| enum | { uppControlDefProcInfo = 0x00003BB0 } |
| enum | { kControlKeyFilterBlockKey = 0 , kControlKeyFilterPassKey = 1 } |
| enum | { uppControlKeyFilterProcInfo = 0x00003FE0 } |
| enum | { noConstraint = kNoConstraint , hAxisOnly = 1 , vAxisOnly = 2 } |
| enum | { kControlDefProcPtr = 0 , kControlDefObjectClass = 1 } |
| enum | { uppControlCNTLToCollectionProcInfo = 0x00FEA6F0 } |
| enum | { uppControlColorProcInfo = 0x00001AF0 } |
| enum | { kControlKindSignatureApple = FOUR_CHAR_CODE('appl') } |
| enum | { kControlPropertyPersistent = 0x00000001 } |
| enum | { kDragTrackingEnterControl = 2 , kDragTrackingInControl = 3 , kDragTrackingLeaveControl = 4 } |
Functions | |
| typedef | CALLBACK_API (void, ControlActionProcPtr)(ControlRef theControl |
| typedef | STACK_UPP_TYPE (ControlActionProcPtr) ControlActionUPP |
| ControlActionUPP | NewControlActionUPP (ControlActionProcPtr userRoutine) |
| void | DisposeControlActionUPP (ControlActionUPP userUPP) |
| void | InvokeControlActionUPP (ControlRef theControl, ControlPartCode partCode, ControlActionUPP userUPP) |
| typedef | CALLBACK_API (SInt32, ControlDefProcPtr)(SInt16 varCode |
| typedef | STACK_UPP_TYPE (ControlDefProcPtr) ControlDefUPP |
| ControlDefUPP | NewControlDefUPP (ControlDefProcPtr userRoutine) |
| void | DisposeControlDefUPP (ControlDefUPP userUPP) |
| SInt32 | InvokeControlDefUPP (SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param, ControlDefUPP userUPP) |
| typedef | CALLBACK_API (ControlKeyFilterResult, ControlKeyFilterProcPtr)(ControlRef theControl |
| typedef | STACK_UPP_TYPE (ControlKeyFilterProcPtr) ControlKeyFilterUPP |
| ControlKeyFilterUPP | NewControlKeyFilterUPP (ControlKeyFilterProcPtr userRoutine) |
| void | DisposeControlKeyFilterUPP (ControlKeyFilterUPP userUPP) |
| ControlKeyFilterResult | InvokeControlKeyFilterUPP (ControlRef theControl, SInt16 *keyCode, SInt16 *charCode, EventModifiers *modifiers, ControlKeyFilterUPP userUPP) |
| OSStatus | CreateCustomControl (WindowRef owningWindow, const Rect *contBounds, const ControlDefSpec *def, Collection initData, ControlRef *outControl) |
| ControlRef | NewControl (WindowRef owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference) |
| ControlRef | GetNewControl (SInt16 resourceID, WindowRef owningWindow) |
| void | DisposeControl (ControlRef theControl) |
| void | KillControls (WindowRef theWindow) |
| typedef | CALLBACK_API (OSStatus, ControlCNTLToCollectionProcPtr)(const Rect *bounds |
| typedef | STACK_UPP_TYPE (ControlCNTLToCollectionProcPtr) ControlCNTLToCollectionUPP |
| ControlCNTLToCollectionUPP | NewControlCNTLToCollectionUPP (ControlCNTLToCollectionProcPtr userRoutine) |
| void | DisposeControlCNTLToCollectionUPP (ControlCNTLToCollectionUPP userUPP) |
| OSStatus | InvokeControlCNTLToCollectionUPP (const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection, ControlCNTLToCollectionUPP userUPP) |
| OSStatus | RegisterControlDefinition (SInt16 inCDEFResID, const ControlDefSpec *inControlDef, ControlCNTLToCollectionUPP inConversionProc) |
| void | HiliteControl (ControlRef theControl, ControlPartCode hiliteState) |
| void | ShowControl (ControlRef theControl) |
| void | HideControl (ControlRef theControl) |
| Boolean | IsControlActive (ControlRef inControl) |
| Boolean | IsControlVisible (ControlRef inControl) |
| OSErr | ActivateControl (ControlRef inControl) |
| OSErr | DeactivateControl (ControlRef inControl) |
| OSErr | SetControlVisibility (ControlRef inControl, Boolean inIsVisible, Boolean inDoDraw) |
| Boolean | IsControlEnabled (ControlRef inControl) |
| OSStatus | EnableControl (ControlRef inControl) |
| OSStatus | DisableControl (ControlRef inControl) |
| EndUpdate (updtWin) | |
| Draw all controls visible in a window. More... | |
| SetPort (savePort) break | |
| void | Draw1Control (ControlRef theControl) |
| void | UpdateControls (WindowRef inWindow, RgnHandle inUpdateRegion) |
| OSErr | GetBestControlRect (ControlRef inControl, Rect *outRect, SInt16 *outBaseLineOffset) |
| OSErr | SetControlFontStyle (ControlRef inControl, const ControlFontStyleRec *inStyle) |
| void | DrawControlInCurrentPort (ControlRef inControl) |
| OSErr | SetUpControlBackground (ControlRef inControl, SInt16 inDepth, Boolean inIsColorDevice) |
| OSErr | SetUpControlTextColor (ControlRef inControl, SInt16 inDepth, Boolean inIsColorDevice) |
| typedef | CALLBACK_API (OSStatus, ControlColorProcPtr)(ControlRef inControl |
| typedef | STACK_UPP_TYPE (ControlColorProcPtr) ControlColorUPP |
| ControlColorUPP | NewControlColorUPP (ControlColorProcPtr userRoutine) |
| void | DisposeControlColorUPP (ControlColorUPP userUPP) |
| OSStatus | InvokeControlColorUPP (ControlRef inControl, SInt16 inMessage, SInt16 inDrawDepth, Boolean inDrawInColor, ControlColorUPP userUPP) |
| OSStatus | SetControlColorProc (ControlRef inControl, ControlColorUPP inProc) |
| ControlPartCode | TrackControl (ControlRef theControl, Point startPoint, ControlActionUPP actionProc) |
| void | DragControl (ControlRef theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis) |
| ControlPartCode | TestControl (ControlRef theControl, Point testPoint) |
| ControlPartCode | FindControl (Point testPoint, WindowRef theWindow, ControlRef *theControl) |
| ControlRef | FindControlUnderMouse (Point inWhere, WindowRef inWindow, ControlPartCode *outPart) |
| ControlPartCode | HandleControlClick (ControlRef inControl, Point inWhere, EventModifiers inModifiers, ControlActionUPP inAction) |
| OSStatus | HandleControlContextualMenuClick (ControlRef inControl, Point inWhere, Boolean *menuDisplayed) |
| OSStatus | GetControlClickActivation (ControlRef inControl, Point inWhere, EventModifiers inModifiers, ClickActivationResult *outResult) |
| ControlPartCode | HandleControlKey (ControlRef inControl, SInt16 inKeyCode, SInt16 inCharCode, EventModifiers inModifiers) |
| void | IdleControls (WindowRef inWindow) |
| OSStatus | HandleControlSetCursor (ControlRef control, Point localPoint, EventModifiers modifiers, Boolean *cursorWasSet) |
| void | MoveControl (ControlRef theControl, SInt16 h, SInt16 v) |
| void | SizeControl (ControlRef theControl, SInt16 w, SInt16 h) |
| void | SetControlTitle (ControlRef theControl, ConstStr255Param title) |
| void | GetControlTitle (ControlRef theControl, Str255 title) |
| OSStatus | SetControlTitleWithCFString (ControlRef inControl, CFStringRef inString) |
| OSStatus | CopyControlTitleAsCFString (ControlRef inControl, CFStringRef *outString) |
| SInt16 | GetControlValue (ControlRef theControl) |
| void | SetControlValue (ControlRef theControl, SInt16 newValue) |
| SInt16 | GetControlMinimum (ControlRef theControl) |
| void | SetControlMinimum (ControlRef theControl, SInt16 newMinimum) |
| SInt16 | GetControlMaximum (ControlRef theControl) |
| void | SetControlMaximum (ControlRef theControl, SInt16 newMaximum) |
| SInt32 | GetControlViewSize (ControlRef theControl) |
| void | SetControlViewSize (ControlRef theControl, SInt32 newViewSize) |
| SInt32 | GetControl32BitValue (ControlRef theControl) |
| void | SetControl32BitValue (ControlRef theControl, SInt32 newValue) |
| SInt32 | GetControl32BitMaximum (ControlRef theControl) |
| void | SetControl32BitMaximum (ControlRef theControl, SInt32 newMaximum) |
| SInt32 | GetControl32BitMinimum (ControlRef theControl) |
| void | SetControl32BitMinimum (ControlRef theControl, SInt32 newMinimum) |
| Boolean | IsValidControlHandle (ControlRef theControl) |
| OSStatus | SetControlID (ControlRef inControl, const ControlID *inID) |
| OSStatus | GetControlID (ControlRef inControl, ControlID *outID) |
| OSStatus | GetControlByID (WindowRef inWindow, const ControlID *inID, ControlRef *outControl) |
| OSStatus | SetControlCommandID (ControlRef inControl, UInt32 inCommandID) |
| OSStatus | GetControlCommandID (ControlRef inControl, UInt32 *outCommandID) |
| OSStatus | GetControlKind (ControlRef inControl, ControlKind *outControlKind) |
| OSStatus | GetControlProperty (ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer) |
| OSStatus | GetControlPropertySize (ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 *size) |
| OSStatus | SetControlProperty (ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData) |
| OSStatus | RemoveControlProperty (ControlRef control, OSType propertyCreator, OSType propertyTag) |
| OSStatus | GetControlPropertyAttributes (ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 *attributes) |
| OSStatus | ChangeControlPropertyAttributes (ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) |
| OSStatus | GetControlRegion (ControlRef inControl, ControlPartCode inPart, RgnHandle outRegion) |
| ControlVariant | GetControlVariant (ControlRef theControl) |
| void | SetControlAction (ControlRef theControl, ControlActionUPP actionProc) |
| ControlActionUPP | GetControlAction (ControlRef theControl) |
| void | SetControlReference (ControlRef theControl, SInt32 data) |
| SInt32 | GetControlReference (ControlRef theControl) |
| Boolean | GetAuxiliaryControlRecord (ControlRef theControl, AuxCtlHandle *acHndl) |
| void | SetControlColor (ControlRef theControl, CCTabHandle newColorTable) |
| SInt32 | SendControlMessage (ControlRef inControl, SInt16 inMessage, void *inParam) |
| OSErr | DumpControlHierarchy (WindowRef inWindow, const FSSpec *inDumpFile) |
| OSErr | CreateRootControl (WindowRef inWindow, ControlRef *outControl) |
| OSErr | GetRootControl (WindowRef inWindow, ControlRef *outControl) |
| OSErr | EmbedControl (ControlRef inControl, ControlRef inContainer) |
| OSErr | AutoEmbedControl (ControlRef inControl, WindowRef inWindow) |
| OSErr | GetSuperControl (ControlRef inControl, ControlRef *outParent) |
| OSErr | CountSubControls (ControlRef inControl, UInt16 *outNumChildren) |
| OSErr | GetIndexedSubControl (ControlRef inControl, UInt16 inIndex, ControlRef *outSubControl) |
| OSErr | SetControlSupervisor (ControlRef inControl, ControlRef inBoss) |
| OSErr | GetKeyboardFocus (WindowRef inWindow, ControlRef *outControl) |
| OSErr | SetKeyboardFocus (WindowRef inWindow, ControlRef inControl, ControlFocusPart inPart) |
| OSErr | AdvanceKeyboardFocus (WindowRef inWindow) |
| OSErr | ReverseKeyboardFocus (WindowRef inWindow) |
| OSErr | ClearKeyboardFocus (WindowRef inWindow) |
| OSErr | GetControlFeatures (ControlRef inControl, UInt32 *outFeatures) |
| OSErr | SetControlData (ControlRef inControl, ControlPartCode inPart, ResType inTagName, Size inSize, const void *inData) |
| OSErr | GetControlData (ControlRef inControl, ControlPartCode inPart, ResType inTagName, Size inBufferSize, void *inBuffer, Size *outActualSize) |
| OSErr | GetControlDataSize (ControlRef inControl, ControlPartCode inPart, ResType inTagName, Size *outMaxSize) |
| OSStatus | HandleControlDragTracking (ControlRef inControl, DragTrackingMessage inMessage, DragReference inDrag, Boolean *outLikesDrag) |
| OSStatus | HandleControlDragReceive (ControlRef inControl, DragReference inDrag) |
| OSStatus | SetControlDragTrackingEnabled (ControlRef theControl, Boolean tracks) |
| OSStatus | IsControlDragTrackingEnabled (ControlRef theControl, Boolean *tracks) |
| OSStatus | SetAutomaticControlDragTrackingEnabledForWindow (WindowRef theWindow, Boolean tracks) |
| OSStatus | IsAutomaticControlDragTrackingEnabledForWindow (WindowRef theWindow, Boolean *tracks) |
| typedef | CALLBACK_API_C (void, ControlNotificationProcPtr)(WindowRef theWindow |
| typedef | CALLBACK_API_C (Boolean, PreFilterEventProc)(ControlRef theControl |
| long | GetControlComponentInstance (ControlRef theControl) |
| ControlRef | GetControlHandleFromCookie (long cookie) |
| void | SetControlDefProc (short resID, ControlDefProcPtr proc) |
| void | dragcontrol (ControlRef theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis) |
| ControlRef | newcontrol (WindowRef theWindow, const Rect *boundsRect, const char *title, Boolean visible, short value, short min, short max, short procID, long refCon) |
| short | findcontrol (Point *thePoint, WindowRef theWindow, ControlRef *theControl) |
| void | getcontroltitle (ControlRef theControl, char *title) |
| void | setcontroltitle (ControlRef theControl, const char *title) |
| short | trackcontrol (ControlRef theControl, Point *thePoint, ControlActionUPP actionProc) |
| short | testcontrol (ControlRef theControl, Point *thePt) |
| *void | SetControlBounds (ControlRef control, const Rect *bounds) |
| void | SetControlPopupMenuHandle (ControlRef control, MenuRef popupMenu) |
| void | SetControlPopupMenuID (ControlRef control, short menuID) |
Variables | |
| case | mouseDown |
Control Manager interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define CallControlCNTLToCollectionProc | ( | userRoutine, | |
| bounds, | |||
| value, | |||
| visible, | |||
| max, | |||
| min, | |||
| procID, | |||
| refCon, | |||
| title, | |||
| collection | |||
| ) |
| #define CallControlColorProc | ( | userRoutine, | |
| inControl, | |||
| inMessage, | |||
| inDrawDepth, | |||
| inDrawInColor | |||
| ) |
| #define CallControlKeyFilterProc | ( | userRoutine, | |
| theControl, | |||
| keyCode, | |||
| charCode, | |||
| modifiers | |||
| ) |
| #define InvokeControlActionUPP | ( | theControl, | |
| partCode, | |||
| userUPP | |||
| ) |
| #define InvokeControlCNTLToCollectionUPP | ( | bounds, | |
| value, | |||
| visible, | |||
| max, | |||
| min, | |||
| procID, | |||
| refCon, | |||
| title, | |||
| collection, | |||
| userUPP | |||
| ) |
| #define InvokeControlColorUPP | ( | inControl, | |
| inMessage, | |||
| inDrawDepth, | |||
| inDrawInColor, | |||
| userUPP | |||
| ) |
| #define InvokeControlDefUPP | ( | varCode, | |
| theControl, | |||
| message, | |||
| param, | |||
| userUPP | |||
| ) |
| #define InvokeControlKeyFilterUPP | ( | theControl, | |
| keyCode, | |||
| charCode, | |||
| modifiers, | |||
| userUPP | |||
| ) |
| #define NewControlActionUPP | ( | userRoutine | ) |
| #define NewControlCNTLToCollectionUPP | ( | userRoutine | ) |
| #define NewControlColorUPP | ( | userRoutine | ) |
| #define NewControlDefUPP | ( | userRoutine | ) |
| #define NewControlKeyFilterUPP | ( | userRoutine | ) |
| typedef UInt32 ControlNotification |
��������������������������������������������������������������������������������������������������������� � NON-MAC COMPATIBILITY CODES (QuickTime 3.0) ���������������������������������������������������������������������������������������������������������
| anonymous enum |
Discussion: Get/SetControlData Common Tags
| Enumerator | |
|---|---|
| kControlKindTag | Sent with a pointer to a ControlKind record to be filled in. Only valid for GetControlData. |
| kControlSizeTag | Sent with a pointer to a ControlSize. Only valid with explicitly sizeable controls. |
| anonymous enum |
| OSErr ActivateControl | ( | ControlRef | inControl | ) |
| OSErr AdvanceKeyboardFocus | ( | WindowRef | inWindow | ) |
| OSErr AutoEmbedControl | ( | ControlRef | inControl, |
| WindowRef | inWindow | ||
| ) |
| typedef CALLBACK_API | ( | OSStatus | , |
| ControlColorProcPtr | |||
| ) |
ControlColorProcPtr
Discussion: Callback allowing clients to specify/override the background color and text color that a Control will use during drawing. Your procedure should make the color changes to the current port. See SetControlColorProc, SetUpControlBackground, and SetUpControlTextColor for more information. Available on Mac OS 8.5, CarbonLib 1.1, Mac OS X, and later.
Parameters:
inControl: A reference to the Control for whom your proc is setting up colors.
inMessage: A ControlDefProcMessage indicating what sort of color your procedure should set up. It will be either kControlMsgApplyTextColor or kControlMsgSetUpBackground. kControlMsgApplyTextColor is a request to set up the appropriate text color (by setting the current port's foreground color, pen information, etc.). kControlMsgSetUpBackground is a request to set up the appropriate background color (the current port's background color, pattern, etc.).
inDrawDepth: A short integer indicating the bit depth of the device into which the Control is drawing. The bit depth is typically passed in as a result of someone someone trying to draw properly across multiple monitors with different bit depths. If your procedure wants to handle proper color set up based on bit depth, it should use this parameter to help decide what color to apply.
inDrawInColor: A Boolean indicating whether or not the device that the Control is drawing into is a color device. The value is typically passed in as a result of someone trying to draw properly across multiple monitors which may or may not be color devices. If your procedure wants to handle proper color set up for both color and grayscale devices, it should use this parameter to help decide what color to apply.
Result: An OSStatus code indicating success or failure. Returning noErr is an indication that your proc completely handled the color set up. If you return any other value, the Control Manager will fall back to the normal color set up mechanism.
| typedef CALLBACK_API_C | ( | Boolean | , |
| PreFilterEventProc | |||
| ) |
Proc used to prefilter events before handled by control. A client of a control calls CTRLSetPreFilterProc() to have the control call this proc before handling the event. If the proc returns TRUE, the control can go ahead and handle the event.
| OSStatus ChangeControlPropertyAttributes | ( | ControlRef | control, |
| OSType | propertyCreator, | ||
| OSType | propertyTag, | ||
| UInt32 | attributesToSet, | ||
| UInt32 | attributesToClear | ||
| ) |
ChangeControlPropertyAttributes()
| OSErr ClearKeyboardFocus | ( | WindowRef | inWindow | ) |
| OSStatus CopyControlTitleAsCFString | ( | ControlRef | inControl, |
| CFStringRef * | outString | ||
| ) |
| OSErr CountSubControls | ( | ControlRef | inControl, |
| UInt16 * | outNumChildren | ||
| ) |
| OSStatus CreateCustomControl | ( | WindowRef | owningWindow, |
| const Rect * | contBounds, | ||
| const ControlDefSpec * | def, | ||
| Collection | initData, | ||
| ControlRef * | outControl | ||
| ) |
| OSErr CreateRootControl | ( | WindowRef | inWindow, |
| ControlRef * | outControl | ||
| ) |
Summary: Creates a new root control for a window.
Parameters:
inWindow: The window for which to create a root control.
outControl: On exit, contains the window's root control. In Mac OS 10.1 and CarbonLib 1.5 and later, this parameter may be NULL if you don't need the ControlRef.
Result: A result code indicating success or failure. errRootAlreadyExists is returned if the window already has a root control.
| OSErr DeactivateControl | ( | ControlRef | inControl | ) |
| OSStatus DisableControl | ( | ControlRef | inControl | ) |
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| void DisposeControl | ( | ControlRef | theControl | ) |
| void DisposeControlActionUPP | ( | ControlActionUPP | userUPP | ) |
| void DisposeControlCNTLToCollectionUPP | ( | ControlCNTLToCollectionUPP | userUPP | ) |
DisposeControlCNTLToCollectionUPP()
| void DisposeControlColorUPP | ( | ControlColorUPP | userUPP | ) |
| void DisposeControlDefUPP | ( | ControlDefUPP | userUPP | ) |
| void DisposeControlKeyFilterUPP | ( | ControlKeyFilterUPP | userUPP | ) |
| void dragcontrol | ( | ControlRef | theControl, |
| Point * | startPt, | ||
| const Rect * | limitRect, | ||
| const Rect * | slopRect, | ||
| short | axis | ||
| ) |
| void DragControl | ( | ControlRef | theControl, |
| Point | startPoint, | ||
| const Rect * | limitRect, | ||
| const Rect * | slopRect, | ||
| DragConstraint | axis | ||
| ) |
| void Draw1Control | ( | ControlRef | theControl | ) |
| void DrawControlInCurrentPort | ( | ControlRef | inControl | ) |
| OSErr DumpControlHierarchy | ( | WindowRef | inWindow, |
| const FSSpec * | inDumpFile | ||
| ) |
| OSErr EmbedControl | ( | ControlRef | inControl, |
| ControlRef | inContainer | ||
| ) |
| OSStatus EnableControl | ( | ControlRef | inControl | ) |
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| EndUpdate | ( | updtWin | ) |
Draw all controls visible in a window.
DrawControls draws all of a window's currently active and visible controls. This (or UpdtControl ) should be used upon detecting an update event for a window that contains controls. theWindow is a pointer to a 108-byte GrafPort structure (actually a 156-byte WindowRecord ). It is typically a value obtained from EventRecord .message after calling WaitNextEvent .
none
This can be used at any time to draw the controls in a window. It works by
drawing all the controls, and letting the off-screen or covered controls be
clipped. The 128K ROM UpdtControl function is more efficient since it
doesn't waste time drawing outside of the window's visible region.
The most common usage is to call DrawControls to redraw scroll bars
upon detecting an update event as in this code skeleton:
if ( GetNextEvent ( everyEvent , &myEvent ) ) {
switch ( myEvent.what ) {
case updateEvt :
updtWin = (WindowPtr)myEvent.message;
GetPort ( &savePort );
SetPort ( updtWin)
BeginUpdate ( updtWin );
DrawControls ( updtWin );
DrawGrowIcon ( updtWin); // if needed
MyDrawWin(updtWin); /* draw window contents
| short findcontrol | ( | Point * | thePoint, |
| WindowRef | theWindow, | ||
| ControlRef * | theControl | ||
| ) |
| ControlPartCode FindControl | ( | Point | testPoint, |
| WindowRef | theWindow, | ||
| ControlRef * | theControl | ||
| ) |
| ControlRef FindControlUnderMouse | ( | Point | inWhere, |
| WindowRef | inWindow, | ||
| ControlPartCode * | outPart | ||
| ) |
| Boolean GetAuxiliaryControlRecord | ( | ControlRef | theControl, |
| AuxCtlHandle * | acHndl | ||
| ) |
| OSErr GetBestControlRect | ( | ControlRef | inControl, |
| Rect * | outRect, | ||
| SInt16 * | outBaseLineOffset | ||
| ) |
| SInt32 GetControl32BitMaximum | ( | ControlRef | theControl | ) |
| SInt32 GetControl32BitMinimum | ( | ControlRef | theControl | ) |
| SInt32 GetControl32BitValue | ( | ControlRef | theControl | ) |
| ControlActionUPP GetControlAction | ( | ControlRef | theControl | ) |
| OSStatus GetControlByID | ( | WindowRef | inWindow, |
| const ControlID * | inID, | ||
| ControlRef * | outControl | ||
| ) |
| OSStatus GetControlClickActivation | ( | ControlRef | inControl, |
| Point | inWhere, | ||
| EventModifiers | inModifiers, | ||
| ClickActivationResult * | outResult | ||
| ) |
| OSStatus GetControlCommandID | ( | ControlRef | inControl, |
| UInt32 * | outCommandID | ||
| ) |
| long GetControlComponentInstance | ( | ControlRef | theControl | ) |
| OSErr GetControlData | ( | ControlRef | inControl, |
| ControlPartCode | inPart, | ||
| ResType | inTagName, | ||
| Size | inBufferSize, | ||
| void * | inBuffer, | ||
| Size * | outActualSize | ||
| ) |
| OSErr GetControlDataSize | ( | ControlRef | inControl, |
| ControlPartCode | inPart, | ||
| ResType | inTagName, | ||
| Size * | outMaxSize | ||
| ) |
| OSErr GetControlFeatures | ( | ControlRef | inControl, |
| UInt32 * | outFeatures | ||
| ) |
| ControlRef GetControlHandleFromCookie | ( | long | cookie | ) |
| OSStatus GetControlID | ( | ControlRef | inControl, |
| ControlID * | outID | ||
| ) |
| OSStatus GetControlKind | ( | ControlRef | inControl, |
| ControlKind * | outControlKind | ||
| ) |
Summary: Returns the kind of the given control.
Discussion: GetControlKind allows you to query the kind of any control. This function is only available in Mac OS X.
Parameters:
inControl: The ControlRef to find the kind of.
outControlKind: On successful exit, this will contain the control signature and kind. See ControlDefinitions.h for the kinds of each system control.
| SInt16 GetControlMaximum | ( | ControlRef | theControl | ) |
| SInt16 GetControlMinimum | ( | ControlRef | theControl | ) |
| OSStatus GetControlProperty | ( | ControlRef | control, |
| OSType | propertyCreator, | ||
| OSType | propertyTag, | ||
| UInt32 | bufferSize, | ||
| UInt32 * | actualSize, | ||
| void * | propertyBuffer | ||
| ) |
| OSStatus GetControlPropertyAttributes | ( | ControlRef | control, |
| OSType | propertyCreator, | ||
| OSType | propertyTag, | ||
| UInt32 * | attributes | ||
| ) |
GetControlPropertyAttributes()
| OSStatus GetControlPropertySize | ( | ControlRef | control, |
| OSType | propertyCreator, | ||
| OSType | propertyTag, | ||
| UInt32 * | size | ||
| ) |
| SInt32 GetControlReference | ( | ControlRef | theControl | ) |
| OSStatus GetControlRegion | ( | ControlRef | inControl, |
| ControlPartCode | inPart, | ||
| RgnHandle | outRegion | ||
| ) |
| void getcontroltitle | ( | ControlRef | theControl, |
| char * | title | ||
| ) |
| void GetControlTitle | ( | ControlRef | theControl, |
| Str255 | title | ||
| ) |
| SInt16 GetControlValue | ( | ControlRef | theControl | ) |
| ControlVariant GetControlVariant | ( | ControlRef | theControl | ) |
| SInt32 GetControlViewSize | ( | ControlRef | theControl | ) |
| OSErr GetIndexedSubControl | ( | ControlRef | inControl, |
| UInt16 | inIndex, | ||
| ControlRef * | outSubControl | ||
| ) |
| OSErr GetKeyboardFocus | ( | WindowRef | inWindow, |
| ControlRef * | outControl | ||
| ) |
| ControlRef GetNewControl | ( | SInt16 | resourceID, |
| WindowRef | owningWindow | ||
| ) |
| OSErr GetRootControl | ( | WindowRef | inWindow, |
| ControlRef * | outControl | ||
| ) |
| OSErr GetSuperControl | ( | ControlRef | inControl, |
| ControlRef * | outParent | ||
| ) |
| ControlPartCode HandleControlClick | ( | ControlRef | inControl, |
| Point | inWhere, | ||
| EventModifiers | inModifiers, | ||
| ControlActionUPP | inAction | ||
| ) |
| OSStatus HandleControlContextualMenuClick | ( | ControlRef | inControl, |
| Point | inWhere, | ||
| Boolean * | menuDisplayed | ||
| ) |
HandleControlContextualMenuClick()
| OSStatus HandleControlDragReceive | ( | ControlRef | inControl, |
| DragReference | inDrag | ||
| ) |
| OSStatus HandleControlDragTracking | ( | ControlRef | inControl, |
| DragTrackingMessage | inMessage, | ||
| DragReference | inDrag, | ||
| Boolean * | outLikesDrag | ||
| ) |
| ControlPartCode HandleControlKey | ( | ControlRef | inControl, |
| SInt16 | inKeyCode, | ||
| SInt16 | inCharCode, | ||
| EventModifiers | inModifiers | ||
| ) |
| OSStatus HandleControlSetCursor | ( | ControlRef | control, |
| Point | localPoint, | ||
| EventModifiers | modifiers, | ||
| Boolean * | cursorWasSet | ||
| ) |
| void HideControl | ( | ControlRef | theControl | ) |
| void HiliteControl | ( | ControlRef | theControl, |
| ControlPartCode | hiliteState | ||
| ) |
| void IdleControls | ( | WindowRef | inWindow | ) |
| void InvokeControlActionUPP | ( | ControlRef | theControl, |
| ControlPartCode | partCode, | ||
| ControlActionUPP | userUPP | ||
| ) |
| OSStatus InvokeControlCNTLToCollectionUPP | ( | const Rect * | bounds, |
| SInt16 | value, | ||
| Boolean | visible, | ||
| SInt16 | max, | ||
| SInt16 | min, | ||
| SInt16 | procID, | ||
| SInt32 | refCon, | ||
| ConstStr255Param | title, | ||
| Collection | collection, | ||
| ControlCNTLToCollectionUPP | userUPP | ||
| ) |
InvokeControlCNTLToCollectionUPP()
| OSStatus InvokeControlColorUPP | ( | ControlRef | inControl, |
| SInt16 | inMessage, | ||
| SInt16 | inDrawDepth, | ||
| Boolean | inDrawInColor, | ||
| ControlColorUPP | userUPP | ||
| ) |
| SInt32 InvokeControlDefUPP | ( | SInt16 | varCode, |
| ControlRef | theControl, | ||
| ControlDefProcMessage | message, | ||
| SInt32 | param, | ||
| ControlDefUPP | userUPP | ||
| ) |
| ControlKeyFilterResult InvokeControlKeyFilterUPP | ( | ControlRef | theControl, |
| SInt16 * | keyCode, | ||
| SInt16 * | charCode, | ||
| EventModifiers * | modifiers, | ||
| ControlKeyFilterUPP | userUPP | ||
| ) |
IsAutomaticControlDragTrackingEnabledForWindow()
| Boolean IsControlActive | ( | ControlRef | inControl | ) |
| OSStatus IsControlDragTrackingEnabled | ( | ControlRef | theControl, |
| Boolean * | tracks | ||
| ) |
IsControlDragTrackingEnabled()
| Boolean IsControlEnabled | ( | ControlRef | inControl | ) |
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.0 and later
| Boolean IsControlVisible | ( | ControlRef | inControl | ) |
| Boolean IsValidControlHandle | ( | ControlRef | theControl | ) |
IsValidControlHandle will tell you if the handle you pass in belongs to a control the Control Manager knows about. It does not sanity check the data in the control. IsValidControlHandle()
| void KillControls | ( | WindowRef | theWindow | ) |
| void MoveControl | ( | ControlRef | theControl, |
| SInt16 | h, | ||
| SInt16 | v | ||
| ) |
| ControlRef NewControl | ( | WindowRef | owningWindow, |
| const Rect * | boundsRect, | ||
| ConstStr255Param | controlTitle, | ||
| Boolean | initiallyVisible, | ||
| SInt16 | initialValue, | ||
| SInt16 | minimumValue, | ||
| SInt16 | maximumValue, | ||
| SInt16 | procID, | ||
| SInt32 | controlReference | ||
| ) |
| ControlRef newcontrol | ( | WindowRef | theWindow, |
| const Rect * | boundsRect, | ||
| const char * | title, | ||
| Boolean | visible, | ||
| short | value, | ||
| short | min, | ||
| short | max, | ||
| short | procID, | ||
| long | refCon | ||
| ) |
| ControlActionUPP NewControlActionUPP | ( | ControlActionProcPtr | userRoutine | ) |
| ControlCNTLToCollectionUPP NewControlCNTLToCollectionUPP | ( | ControlCNTLToCollectionProcPtr | userRoutine | ) |
NewControlCNTLToCollectionUPP()
| ControlColorUPP NewControlColorUPP | ( | ControlColorProcPtr | userRoutine | ) |
| ControlDefUPP NewControlDefUPP | ( | ControlDefProcPtr | userRoutine | ) |
| ControlKeyFilterUPP NewControlKeyFilterUPP | ( | ControlKeyFilterProcPtr | userRoutine | ) |
| OSStatus RegisterControlDefinition | ( | SInt16 | inCDEFResID, |
| const ControlDefSpec * | inControlDef, | ||
| ControlCNTLToCollectionUPP | inConversionProc | ||
| ) |
Summary: Associates or dissociates a control definition with a virtual CDEF resource ID.
Discussion: In GetNewControl or NewControl on Carbon, the Control Manager needs to know how to map the procID to a ControlDefSpec. With RegisterControlDefinition, your application can inform the Control Manager which ControlDefSpec to call when it sees a request to use a 'CDEF' of a particular resource ID. Since custom control definitions receive their initialization data in a Collection passed in the 'param' parameter, you must also provide a procedure to convert the bounds, min, max, and other parameters to NewControl into a Collection. If you don't provide a conversion proc, your control will receive an empty collection when it is sent the initialization message. If you want the value, min, visibility, etc. to be given to the control, you must add the appropriate tagged data to the collection. See the Control Collection Tags above. If you want to unregister a ControlDefSpec that you have already registered, call RegisterControlDefinition with the same CDEF resource ID, but pass NULL for the inControlDef parameter. In this situation, inConversionProc is effectively ignored.
Parameters:
inCDEFResID: The virtual CDEF resource ID to which you'd like to associate or dissociate the control definition.
inControlDef: A pointer to a ControlDefSpec which represents the control definition you want to register, or NULL if you are attempting to unregister a control definition.
inConversionProc: The conversion proc which will translate the NewControl parameters into a Collection.
Result: An OSStatus code indicating success or failure.
| OSStatus RemoveControlProperty | ( | ControlRef | control, |
| OSType | propertyCreator, | ||
| OSType | propertyTag | ||
| ) |
| OSErr ReverseKeyboardFocus | ( | WindowRef | inWindow | ) |
| SInt32 SendControlMessage | ( | ControlRef | inControl, |
| SInt16 | inMessage, | ||
| void * | inParam | ||
| ) |
SetAutomaticControlDragTrackingEnabledForWindow()
| void SetControl32BitMaximum | ( | ControlRef | theControl, |
| SInt32 | newMaximum | ||
| ) |
| void SetControl32BitMinimum | ( | ControlRef | theControl, |
| SInt32 | newMinimum | ||
| ) |
| void SetControl32BitValue | ( | ControlRef | theControl, |
| SInt32 | newValue | ||
| ) |
| void SetControlAction | ( | ControlRef | theControl, |
| ControlActionUPP | actionProc | ||
| ) |
| * void SetControlBounds | ( | ControlRef | control, |
| const Rect * | bounds | ||
| ) |
| void SetControlColor | ( | ControlRef | theControl, |
| CCTabHandle | newColorTable | ||
| ) |
| OSStatus SetControlColorProc | ( | ControlRef | inControl, |
| ControlColorUPP | inProc | ||
| ) |
Summary: Associates a ControlColorUPP with a given Control, thereby allowing you to bypass the embedding hierarchy-based color setup of SetUpControlBackground/SetUpControlTextColor and replace it with your own.
Discussion: Before an embedded Control can erase, it calls SetUpControlBackground to have its background color set up by any parent controls. Similarly, any Control which draws text calls SetUpControlTextColor to have the appropriate text color set up. This allows certain controls (such as Tabs and Placards) to offer special backgrounds and text colors for any child controls. By default, the SetUp routines only move up the Control Manager embedding hierarchy looking for a parent which has a special background. This is fine in a plain vanilla embedding case, but many application frameworks find it troublesome; if there are interesting views between two Controls in the embedding hierarchy, the framework needs to be in charge of the background and text colors, otherwise drawing defects will occur. You can only associate a single color proc with a given ControlRef. Available on Mac OS 8.5, CarbonLib 1.1, Mac OS X, and later.
Parameters:
inControl: The ControlRef with whom the color proc should be associated.
inProc: The color proc to associate with the ControlRef. If you pass NULL, the ControlRef will be dissociated from any previously installed color proc.
Result: An OSStatus code indicating success or failure. The most likely error is a controlHandleInvalidErr resulting from a bad ControlRef.
| OSStatus SetControlCommandID | ( | ControlRef | inControl, |
| UInt32 | inCommandID | ||
| ) |
| OSErr SetControlData | ( | ControlRef | inControl, |
| ControlPartCode | inPart, | ||
| ResType | inTagName, | ||
| Size | inSize, | ||
| const void * | inData | ||
| ) |
| void SetControlDefProc | ( | short | resID, |
| ControlDefProcPtr | proc | ||
| ) |
| OSStatus SetControlDragTrackingEnabled | ( | ControlRef | theControl, |
| Boolean | tracks | ||
| ) |
SetControlDragTrackingEnabled()
| OSErr SetControlFontStyle | ( | ControlRef | inControl, |
| const ControlFontStyleRec * | inStyle | ||
| ) |
| OSStatus SetControlID | ( | ControlRef | inControl, |
| const ControlID * | inID | ||
| ) |
| void SetControlMaximum | ( | ControlRef | theControl, |
| SInt16 | newMaximum | ||
| ) |
| void SetControlMinimum | ( | ControlRef | theControl, |
| SInt16 | newMinimum | ||
| ) |
| void SetControlPopupMenuHandle | ( | ControlRef | control, |
| MenuRef | popupMenu | ||
| ) |
| void SetControlPopupMenuID | ( | ControlRef | control, |
| short | menuID | ||
| ) |
| OSStatus SetControlProperty | ( | ControlRef | control, |
| OSType | propertyCreator, | ||
| OSType | propertyTag, | ||
| UInt32 | propertySize, | ||
| void * | propertyData | ||
| ) |
| void SetControlReference | ( | ControlRef | theControl, |
| SInt32 | data | ||
| ) |
| OSErr SetControlSupervisor | ( | ControlRef | inControl, |
| ControlRef | inBoss | ||
| ) |
| void setcontroltitle | ( | ControlRef | theControl, |
| const char * | title | ||
| ) |
| void SetControlTitle | ( | ControlRef | theControl, |
| ConstStr255Param | title | ||
| ) |
| OSStatus SetControlTitleWithCFString | ( | ControlRef | inControl, |
| CFStringRef | inString | ||
| ) |
| void SetControlValue | ( | ControlRef | theControl, |
| SInt16 | newValue | ||
| ) |
| void SetControlViewSize | ( | ControlRef | theControl, |
| SInt32 | newViewSize | ||
| ) |
| OSErr SetControlVisibility | ( | ControlRef | inControl, |
| Boolean | inIsVisible, | ||
| Boolean | inDoDraw | ||
| ) |
| OSErr SetKeyboardFocus | ( | WindowRef | inWindow, |
| ControlRef | inControl, | ||
| ControlFocusPart | inPart | ||
| ) |
| OSErr SetUpControlBackground | ( | ControlRef | inControl, |
| SInt16 | inDepth, | ||
| Boolean | inIsColorDevice | ||
| ) |
Summary: Applies the proper background color for the given control to the current port.
Discussion: An embedding-savvy control which erases before drawing must ensure that its background color properly matches the body color of any parent controls on top of which it draws. This routine asks the Control Manager to determine and apply the proper background color to the current port. If a ControlColorProc has been provided for the given control, the proc will be called to set up the background color. If no proc exists, or if the proc returns a value other than noErr, the Control Manager ascends the parent chain for the given control looking for a control which has a special background (see the kControlHasSpecialBackground feature bit). The first such parent is asked to set up the background color (see the kControlMsgSetUpBackground message). If no such parent exists, the Control Manager applies any ThemeBrush which has been associated with the owning window (see SetThemeWindowBackground). Available in Appearance 1.0 (Mac OS 8), CarbonLib 1.0, Mac OS X, and later.
Parameters:
inControl: The ControlRef that wants to erase.
inDepth: A short integer indicating the color depth of the device onto which drawing will take place.
inIsColorDevice: A Boolean indicating whether the draw device is a color device.
Result: An OSStatus code indicating success or failure. The most likely error is a controlHandleInvalidErr, resulting from a bad ControlRef. Any non-noErr result indicates that the color set up failed, and that the caller should probably give up its attempt to draw.
| OSErr SetUpControlTextColor | ( | ControlRef | inControl, |
| SInt16 | inDepth, | ||
| Boolean | inIsColorDevice | ||
| ) |
Summary: Applies the proper text color for the given control to the current port.
Discussion: An embedding-savvy control which draws text must ensure that its text color properly contrasts the background on which it draws. This routine asks the Control Manager to determine and apply the proper text color to the current port. If a ControlColorProc has been provided for the given control, the proc will be called to set up the text color. If no proc exists, or if the proc returns a value other than noErr, the Control Manager ascends the parent chain for the given control looking for a control which has a special background (see the kControlHasSpecialBackground feature bit). The first such parent is asked to set up the text color (see the kControlMsgApplyTextColor message). If no such parent exists, the Control Manager chooses a text color which contrasts any ThemeBrush which has been associated with the owning window (see SetThemeWindowBackground). Available in Appearance 1.1 (Mac OS 8.5), CarbonLib 1.0, Mac OS X, and later.
Parameters:
inControl: The ControlRef that wants to draw text.
inDepth: A short integer indicating the color depth of the device onto which drawing will take place.
inIsColorDevice: A Boolean indicating whether the draw device is a color device.
Result: An OSStatus code indicating success or failure. The most likely error is a controlHandleInvalidErr, resulting from a bad ControlRef. Any non-noErr result indicates that the color set up failed, and that the caller should probably give up its attempt to draw.
| void ShowControl | ( | ControlRef | theControl | ) |
| void SizeControl | ( | ControlRef | theControl, |
| SInt16 | w, | ||
| SInt16 | h | ||
| ) |
| short testcontrol | ( | ControlRef | theControl, |
| Point * | thePt | ||
| ) |
| ControlPartCode TestControl | ( | ControlRef | theControl, |
| Point | testPoint | ||
| ) |
| short trackcontrol | ( | ControlRef | theControl, |
| Point * | thePoint, | ||
| ControlActionUPP | actionProc | ||
| ) |
| ControlPartCode TrackControl | ( | ControlRef | theControl, |
| Point | startPoint, | ||
| ControlActionUPP | actionProc | ||
| ) |
NOTE ON CONTROL ACTION PROCS
When using the TrackControl() call when tracking an indicator, the actionProc parameter (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP (see Quickdraw.h).
If, however, you are using the live feedback variants of scroll bars or sliders, you must pass a ControlActionUPP in when tracking the indicator as well. This functionality is available in Appearance 1.0 or later. TrackControl()
Summary: Redraws the controls that intersect a specified region in a window.
Parameters:
inWindow: The window whose controls to redraw.
inUpdateRegion: The region (in local coordinates) describing which controls to redraw. In Mac OS 10.1 and later, and in CarbonLib 1.5 and later, you may pass NULL for this parameter to redraw the controls intersecting the visible region of the window.