API  0.9.10
CPRadio Class Reference

#import <CPRadio.h>

+ Inheritance diagram for CPRadio:

Instance Methods

(CPImage- alternateImage
 
(void) - encodeWithCoder:
 
(CPImage- image
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(id) - initWithFrame:radioGroup:
 
(CPInteger) - nextState
 
(CPRadioGroup- radioGroup
 
(BOOL) - sendAction:to:
 
(void) - setObjectValue:
 
(void) - setRadioGroup:
 
(BOOL) - startTrackingAt:
 
- Instance Methods inherited from CPButton
(BOOL) - allowsMixedState
 
(CPString- alternateTitle
 
(CGRect) - bezelRectForBounds:
 
(unsigned) - bezelStyle
 
(CGRect) - contentRectForBounds:
 
(CPView- createEphemeralSubviewNamed:
 
(CPInteger) - highlightsBy
 
(BOOL) - imageDimsWhenDisabled
 
(float) - imageOffset
 
(void) - invalidateTimers
 
(BOOL) - isBordered
 
(CPString- keyEquivalent
 
(unsigned) - keyEquivalentModifierMask
 
(void) - layoutSubviews
 
(void) - mouseDown:
 
(void) - onContinousEvent:
 
(void) - performClick:
 
(BOOL) - performKeyEquivalent:
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - setAllowsMixedState:
 
(void) - setAlternateImage:
 
(void) - setAlternateTitle:
 
(void) - setBezelStyle:
 
(void) - setBordered:
 
(void) - setButtonType:
 
(void) - setControlSize:
 
(void) - setHighlightsBy:
 
(void) - setImage:
 
(void) - setImageDimsWhenDisabled:
 
(void) - setImageOffset:
 
(void) - setKeyEquivalent:
 
(void) - setKeyEquivalentModifierMask:
 
(void) - setNextState
 
(void) - setPeriodicDelay:interval:
 
(void) - setShowsStateBy:
 
(void) - setState:
 
(void) - setTitle:
 
(CPInteger) - showsStateBy
 
(void) - sizeToFit
 
(CPInteger) - state
 
(void) - stopTracking:at:mouseIsUp:
 
(CPString- title
 
(void) - viewWillMoveToWindow:
 
- Instance Methods inherited from CPControl
(BOOL) - acceptsFirstMouse:
 
(SEL) - action
 
(CPTextAlignment) - alignment
 
(CPWritingDirection) - baseWritingDirection
 
(BOOL) - continueTracking:at:
 
(CPControlSize) - controlSize
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPUInteger) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(id) - objectValue
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(void) - setBaseWritingDirection:
 
(void) - setContinuous:
 
(void) - setDoubleValue:
 
(void) - setEnabled:
 
(void) - setFloatValue:
 
(void) - setFont:
 
(void) - setFormatter:
 
(void) - setHighlighted:
 
(void) - setImagePosition:
 
(void) - setImageScaling:
 
(void) - setIntegerValue:
 
(void) - setIntValue:
 
(void) - setLineBreakMode:
 
(void) - setSendsActionOnEndEditing:
 
(void) - setStringValue:
 
(void) - setTarget:
 
(void) - setTextColor:
 
(void) - setTextShadowColor:
 
(void) - setTextShadowOffset:
 
(void) - setVerticalAlignment:
 
(CPString- stringValue
 
(void) - takeDoubleValueFrom:
 
(void) - takeFloatValueFrom:
 
(void) - takeIntegerValueFrom:
 
(void) - takeIntValueFrom:
 
(void) - takeObjectValueFrom:
 
(void) - takeStringValueFrom:
 
(id) - target
 
(CPColor- textColor
 
(void) - textDidBeginEditing:
 
(void) - textDidChange:
 
(void) - textDidEndEditing:
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(void) - unhighlightButtonTimerDidFinish:
 
(void) - updateTrackingAreas
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(void) - addTrackingArea:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(CAAnimation- animationForKey:
 
(CPDictionary- animations
 
(id) - animator
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(CPString- debug_description
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPAppearance- effectiveAppearance
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGRect) - frameRectOfView:inSuperviewSize:
 
(CGSize) - frameSize
 
(CGRect) - frameWithNewSuperviewSize:
 
(BOOL) - hasCustomDrawRect
 
(BOOL) - hasCustomLayoutSubviews
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(void) - layout
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(BOOL) - needsPanelToBecomeKey
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(void) - objectDidChangeTheme
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeAllTrackingAreas
 
(void) - removeFromSuperview
 
(void) - removeTrackingArea:
 
(void) - replaceSubview:with:
 
(BOOL) - resignFirstResponder
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAnimations:
 
(void) - setAppearance:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setFrame:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidLayout
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(void) - viewWillLayout
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 

Class Methods

(CPString+ defaultThemeClass
 
(id) + radioWithTitle:
 
(id) + radioWithTitle:theme:
 
(CPButton+ standardButtonWithTitle:
 
- Class Methods inherited from CPButton
(id) + buttonWithTitle:
 
(id) + buttonWithTitle:theme:
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(Class) + animatorClass
 
(CAAnimation+ defaultAnimationForKey:
 
(CPMenu+ defaultMenu
 
(BOOL) + isHighDPIDrawingEnabled
 
(CPSet) + keyPathsForValuesAffectingBounds
 
(CPSet) + keyPathsForValuesAffectingFrame
 
(void) + setHighDPIDrawingEnabled:
 

Detailed Description

from this mailing list thread: http://groups.google.com/group/objectivej/browse_thread/thread/7c41cbd9cbee9ea3


Creating a checkbox is easy enough:

checkbox = [[CPCheckBox alloc] initWithFrame:aFrame];

That's basically all there is to it. Radio buttons are very similar, the key difference is the introduction of a new class CPRadioGroup, which defines which radio buttons are part of the same group:

[myRadioButton setRadioGroup:aRadioGroup];

Every radio button receives a unique radio group by default (so if you do nothing further, they will all behave independently), but you can use an existing radio button's group with other buttons as so:

button1 = [[CPRadio alloc] initWithFrame:aFrame]; ... button2 = [[CPRadio alloc] initWithFrame:aFrame radioGroup:[button1 radioGroup]]; ... button3 = [[CPRadio alloc] initWithFrame:aFrame radioGroup:[button1 radioGroup]]; ...etc...

Here, all the radio buttons will act "together". [[button1 radioGroup] allRadios] returns every button that's part of this group, and [[button1 radioGroup] selectedRadio] returns the currently selected option.

Definition at line 2 of file CPRadio.h.

Method Documentation

◆ alternateImage()

- (CPImage) alternateImage
implementation

Returns the image used when the button is in an alternate state.

Reimplemented from CPButton.

Provided by category CPRadio(CPCoding).

Definition at line 187 of file CPRadio.j.

◆ defaultThemeClass()

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPButton.

Definition at line 91 of file CPRadio.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Archives this button into the provided coder.

Parameters
aCoderthe coder to which the button's instance data will be written.

Reimplemented from CPButton.

Provided by category CPRadio(CPCoding).

Definition at line 175 of file CPRadio.j.

◆ image()

- (CPImage) image
implementation

Reimplemented from CPButton.

Provided by category CPRadio(CPCoding).

Definition at line 182 of file CPRadio.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the button by unarchiving data from aCoder.

Parameters
aCoderthe coder containing the archived CPButton.

Reimplemented from CPButton.

Provided by category CPRadio(CPCoding).

Definition at line 165 of file CPRadio.j.

◆ initWithFrame:()

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes and returns a newly allocated CPButton object with a specified frame rectangle.

Parameters
aFrameThe frame rectangle for the created button object.
Returns
An initialized CPView object or nil if the object couldn't be created.

Reimplemented from CPButton.

Definition at line 118 of file CPRadio.j.

◆ initWithFrame:radioGroup:()

- (id) initWithFrame: (CGRect)  aFrame
radioGroup: (CPRadioGroup aRadioGroup 
implementation

Definition at line 97 of file CPRadio.j.

◆ nextState()

- (CPInteger) nextState
implementation

Returns the button's next state.

Returns
The button's state. A button can have two or three states. If it has two, this value is either CPOffState (the normal or unpressed state) or CPOnState (the alternate or pressed state). If it has three, this value can be CPOnState (the feature is in effect everywhere), CPOffState (the feature is in effect nowhere), or CPMixedState (the feature is in effect somewhere).

Reimplemented from CPButton.

Definition at line 123 of file CPRadio.j.

◆ radioGroup()

- (CPRadioGroup) radioGroup
implementation

Definition at line 138 of file CPRadio.j.

◆ radioWithTitle:()

+ (id) radioWithTitle: (CPString aTitle
implementation

Definition at line 77 of file CPRadio.j.

◆ radioWithTitle:theme:()

+ (id) radioWithTitle: (CPString aTitle
theme: (CPTheme aTheme 
implementation

Definition at line 72 of file CPRadio.j.

◆ sendAction:to:()

- (BOOL) sendAction: (SEL)  anAction
to: (id)  anObject 
implementation

Causes anAction to be sent to anObject.

Parameters
anActionthe action to send
anObjectthe object to which the action will be sent

Reimplemented from CPControl.

Definition at line 151 of file CPRadio.j.

◆ setObjectValue:()

- (void) setObjectValue: (id)  anObjectValue
implementation

Sets the value of the button using an Objective-J object.

Parameters
anObjectValueThe value of the button interpreted as an Objective-J object.

Reimplemented from CPButton.

Definition at line 143 of file CPRadio.j.

◆ setRadioGroup:()

- (void) setRadioGroup: (CPRadioGroup aRadioGroup
implementation

Definition at line 128 of file CPRadio.j.

◆ standardButtonWithTitle:()

+ (CPButton) standardButtonWithTitle: (CPString aTitle
implementation

Definition at line 82 of file CPRadio.j.

◆ startTrackingAt:()

- (BOOL) startTrackingAt: (CGPoint)  aPoint
implementation

Reimplemented from CPButton.

Provided by category CPRadio(CPCoding).

Definition at line 192 of file CPRadio.j.


The documentation for this class was generated from the following files: