46 + (Class)_binderClassForBinding:(
CPString)aBinding
48 if (aBinding === CPValueBinding)
49 return [_CPCheckBoxValueBinder class];
51 return [
super _binderClassForBinding:aBinding];
54 - (id)initWithFrame:(CGRect)aFrame
73 - (void)takeStateFromKeyPath:(
CPString)aKeyPath ofObjects:(CPArray)objects
75 var count = objects.
length,
91 - (void)takeValueFromKeyPath:(
CPString)aKeyPath ofObjects:(CPArray)objects
98 return [
self currentValueForThemeAttribute:@"image"];
103 return [
self currentValueForThemeAttribute:@"image"];
106 - (BOOL)startTrackingAt:(CGPoint)aPoint
110 return startedTracking;
115 #pragma mark Override methods from CPButton 117 - (CGSize)_minimumFrameSize
119 var size = [
super _minimumFrameSize],
120 contentView = [
self ephemeralSubviewNamed:@"content-view"];
122 if (!contentView && [[
self title] length])
124 var minSize = [
self currentValueForThemeAttribute:@"min-size"],
125 maxSize = [
self currentValueForThemeAttribute:@"max-size"];
130 if (maxSize.width >= 0.0)
131 size.width = MIN(size.width, maxSize.width);
138 @implementation _CPCheckBoxValueBinder :
CPBinder 143 - (void)_updatePlaceholdersWithOptions:(
CPDictionary)options
145 [
super _updatePlaceholdersWithOptions:options];
147 [
self _setPlaceholder:CPMixedState forMarker:CPMultipleValuesMarker isDefault:YES];
148 [
self _setPlaceholder:CPOffState forMarker:CPNoSelectionMarker isDefault:YES];
149 [
self _setPlaceholder:CPOffState forMarker:CPNotApplicableMarker isDefault:YES];
150 [
self _setPlaceholder:CPOffState forMarker:CPNullMarker isDefault:YES];
153 - (void)setPlaceholderValue:(
id)aValue withMarker:(
CPString)aMarker forBinding:(
CPString)aBinding
155 [_source setAllowsMixedState:(aValue === CPMixedState)];
156 [_source setState:aValue];
159 - (void)setValue:(
id)aValue forBinding:(
CPString)aBinding
161 [_source setState:aValue];
175 - (void)setValue:(
id)aValue forThemeAttribute:(
CPString)aName
void setValue:forThemeAttribute:inState:(id aValue, [forThemeAttribute] CPString aName, [inState] ThemeState aState)
void takeStateFromKeyPath:ofObjects:(CPString aKeyPath, [ofObjects] CPArray objects)
void setValue:forThemeAttribute:(id aValue, [forThemeAttribute] CPString aName)
void setImagePosition:(CPCellImagePosition position)
A mutable key-value pair collection.
An immutable string (collection of characters).
void highlight:(BOOL shouldHighlight)
void setAlignment:(CPTextAlignment alignment)