Fixed some edge case bugs, added full nib2cib support
No files matched your search
@@ -44,6 +44,7 @@
|
||||
@import "CPColor.j"
|
||||
@import "CPColorPanel.j"
|
||||
@import "CPColorWell.j"
|
||||
@import "CPComboBox.j"
|
||||
@import "CPCompatibility.j"
|
||||
@import "CPControl.j"
|
||||
@import "CPCookie.j"
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <AppKit/CPTextField.j>
|
||||
@import <AppKit/_CPPopUpList.j>
|
||||
@import "CPTextField.j"
|
||||
@import "_CPPopUpList.j"
|
||||
|
||||
|
||||
CPComboBoxSelectionDidChangeNotification = @"CPComboBoxSelectionDidChangeNotification";
|
||||
@@ -29,9 +29,12 @@ CPComboBoxSelectionIsChangingNotification = @"CPComboBoxSelectionIsChangingNotif
|
||||
CPComboBoxWillDismissNotification = @"CPComboBoxWillDismissNotification";
|
||||
CPComboBoxWillPopUpNotification = @"CPComboBoxWillPopUpNotification";
|
||||
|
||||
CPComboBoxStateButtonBordered = CPThemeState("button-bordered");
|
||||
|
||||
var CPComboBoxTextSubview = @"text",
|
||||
CPComboBoxButtonSubview = @"button",
|
||||
CPComboBoxDefaultNumberOfVisibleItems = 5;
|
||||
CPComboBoxDefaultNumberOfVisibleItems = 5,
|
||||
CPComboBoxFocusWidth = 2;
|
||||
|
||||
|
||||
@implementation CPComboBox : CPTextField
|
||||
@@ -47,6 +50,25 @@ var CPComboBoxTextSubview = @"text",
|
||||
BOOL _forceSelection;
|
||||
BOOL _hasVerticalScroller;
|
||||
CPString _selectedStringValue;
|
||||
BOOL _popUpButtonCausedResign;
|
||||
}
|
||||
|
||||
+ (CPString)defaultThemeClass
|
||||
{
|
||||
return "combobox";
|
||||
}
|
||||
|
||||
+ (id)themeAttributes
|
||||
{
|
||||
return [CPDictionary dictionaryWithObjects:[CGSizeMake(21.0, 23.0)] forKeys:[@"popup-button-size"]];
|
||||
}
|
||||
|
||||
+ (Class)_binderClassForBinding:(CPString)theBinding
|
||||
{
|
||||
if (theBinding === CPContentBinding || theBinding === CPContentValuesBinding)
|
||||
return [_CPComboBoxContentBinder class];
|
||||
|
||||
return [super _binderClassForBinding:theBinding];
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
@@ -54,14 +76,14 @@ var CPComboBoxTextSubview = @"text",
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
if (self)
|
||||
[self _init];
|
||||
[self _initComboBox];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_init
|
||||
- (void)_initComboBox
|
||||
{
|
||||
_items = []
|
||||
_items = [CPArray array];
|
||||
_listClass = [_CPPopUpList class];
|
||||
_usesDataSource = NO;
|
||||
_completes = NO;
|
||||
@@ -70,14 +92,19 @@ var CPComboBoxTextSubview = @"text",
|
||||
_forceSelection = NO;
|
||||
_hasVerticalScroller = YES;
|
||||
_selectedStringValue = @"";
|
||||
_popUpButtonCausedResign = NO;
|
||||
|
||||
[self setTarget:self];
|
||||
[self setAction:@selector(textFieldAction:)];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(controlTextDidChange:) name:CPControlTextDidChangeNotification object:self];
|
||||
[self setTheme:[CPTheme defaultTheme]];
|
||||
[self setBordered:YES];
|
||||
[self setBezeled:YES];
|
||||
[self setEditable:YES];
|
||||
[self setThemeState:CPComboBoxStateButtonBordered];
|
||||
}
|
||||
|
||||
//#pragma mark Setting Display Attributes
|
||||
#pragma mark Setting Display Attributes
|
||||
|
||||
- (BOOL)hasVerticalScroller
|
||||
{
|
||||
@@ -107,13 +134,15 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
- (BOOL)isButtonBordered
|
||||
{
|
||||
return YES;
|
||||
//return [[self ephemeralSubviewNamed:CPComboBoxButtonSubview] isBordered];
|
||||
return [self hasThemeState:CPComboBoxStateButtonBordered];
|
||||
}
|
||||
|
||||
- (void)setButtonBordered:(BOOL)flag
|
||||
{
|
||||
//[[self ephemeralSubviewNamed:CPComboBoxButtonSubview] setBordered:flag];
|
||||
if (!!flag)
|
||||
[self setThemeState:CPComboBoxStateButtonBordered];
|
||||
else
|
||||
[self unsetThemeState:CPComboBoxStateButtonBordered];
|
||||
}
|
||||
|
||||
- (float)itemHeight
|
||||
@@ -124,6 +153,9 @@ var CPComboBoxTextSubview = @"text",
|
||||
- (void)setItemHeight:(float)itemHeight
|
||||
{
|
||||
[[_list tableView] setRowHeight:itemHeight];
|
||||
|
||||
// FIXME: This shouldn't be necessary, but CPTableView does not tile after setRowHeight
|
||||
[[_list tableView] reloadData];
|
||||
}
|
||||
|
||||
- (int)numberOfVisibleItems
|
||||
@@ -137,7 +169,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
_numberOfVisibleItems = MAX(visibleItems, 1);
|
||||
}
|
||||
|
||||
//#pragma mark Setting a Delegate
|
||||
#pragma mark Setting a Delegate
|
||||
|
||||
- (id < CPComboBoxDelegate >)delegate
|
||||
{
|
||||
@@ -197,11 +229,11 @@ var CPComboBoxTextSubview = @"text",
|
||||
[super setDelegate:aDelegate];
|
||||
}
|
||||
|
||||
//#pragma mark Setting a Data Source
|
||||
#pragma mark Setting a Data Source
|
||||
|
||||
- (id < CPComboBoxDataSource >)dataSource
|
||||
{
|
||||
if (_usesDataSource === NO)
|
||||
if (!_usesDataSource)
|
||||
[self dataSourceWarningForMethod:_cmd condition:NO];
|
||||
|
||||
return _dataSource;
|
||||
@@ -209,7 +241,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
- (void)setDataSource:(id < CPComboBoxDataSource >)aSource
|
||||
{
|
||||
if (_usesDataSource === NO)
|
||||
if (!_usesDataSource)
|
||||
[self dataSourceWarningForMethod:_cmd condition:NO];
|
||||
else if (_dataSource !== aSource)
|
||||
{
|
||||
@@ -244,7 +276,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
[self reloadData];
|
||||
}
|
||||
|
||||
//#pragma mark Working with an Internal List
|
||||
#pragma mark Working with an Internal List
|
||||
|
||||
- (void)addItemsWithObjectValues:(CPArray)objects
|
||||
{
|
||||
@@ -271,8 +303,9 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the internal array of items. Note that this does a deep copy of the array,
|
||||
effectively returning an immutable array to be consistent with Cocoa.
|
||||
Returns the internal array of items. NOTE: Unlike Cocoa the array is mutable,
|
||||
since all arrays in Objective-J are mutable. But you should treat it as
|
||||
an immutable array. Do <b>NOT</b> attempt to change the returned array in any way.
|
||||
|
||||
If usesDataSource is YES, a warning is logged and an empty array is returned.
|
||||
*/
|
||||
@@ -281,7 +314,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
if (_usesDataSource)
|
||||
[self dataSourceWarningForMethod:_cmd condition:YES];
|
||||
|
||||
return [[CPArray alloc] initWithArray:_items copyItems:YES];
|
||||
return _items;
|
||||
}
|
||||
|
||||
- (void)removeAllItems
|
||||
@@ -316,7 +349,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
return _items.length;
|
||||
}
|
||||
|
||||
//#pragma mark Manipulating the Displayed List
|
||||
#pragma mark Manipulating the Displayed List
|
||||
|
||||
/*!
|
||||
Returns the helper class to be used when creating the pop up list.
|
||||
@@ -329,7 +362,8 @@ var CPComboBoxTextSubview = @"text",
|
||||
/*!
|
||||
Sets the helper class to be used when creating the pop up list.
|
||||
By default this is _CPPopUpList. If you are using a subclass
|
||||
of _CPPopUpList, call this method with your subclass.
|
||||
of _CPPopUpList, call this method with your subclass <b>before</b>
|
||||
the list is popped up for the first time.
|
||||
*/
|
||||
- (void)setListClass:(Class)aClass
|
||||
{
|
||||
@@ -379,7 +413,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
[self makeList];
|
||||
|
||||
[self selectMatchingItem];
|
||||
[_list popUpRelativeTo:[self borderFrame]];
|
||||
[_list popUpRelativeToRect:[self borderFrame] view:self offset:CPComboBoxFocusWidth];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
@@ -430,6 +464,10 @@ var CPComboBoxTextSubview = @"text",
|
||||
selector:@selector(comboBoxSelectionDidChange:)
|
||||
name:CPTableViewSelectionDidChangeNotification
|
||||
object:tableView];
|
||||
|
||||
// Apply our text style to the list
|
||||
[_list setFont:[self font]];
|
||||
[_list setAlignment:[self alignment]];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
@@ -449,21 +487,30 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
/*!
|
||||
If the list is non-empty, sets the value of the field from the currently selected value of the list
|
||||
and returns YES. IF the list is empty, immediately returns NO.
|
||||
and returns YES. If the list is empty or the list has no selected item, returns NO.
|
||||
@ignore
|
||||
*/
|
||||
- (BOOL)takeStringValueFromList
|
||||
{
|
||||
if ([_dataSource numberOfItemsInComboBox:self] === 0)
|
||||
if (_usesDataSource && _dataSource && [_dataSource numberOfItemsInComboBox:self] === 0)
|
||||
return NO;
|
||||
|
||||
_selectedStringValue = [_list selectedStringValue] || @"";
|
||||
var selectedStringValue = [_list selectedStringValue];
|
||||
|
||||
if (selectedStringValue === nil)
|
||||
return NO;
|
||||
else
|
||||
_selectedStringValue = selectedStringValue;
|
||||
|
||||
[self setStringValue:_selectedStringValue];
|
||||
[self _reverseSetBinding];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
/*!
|
||||
The field receives this notification when the list is about to be pop up.
|
||||
The receiver receives this notification when the list is about to be pop up.
|
||||
@ignore
|
||||
*/
|
||||
- (void)listWillPopUp:(CPNotification)aNotification
|
||||
{
|
||||
@@ -471,7 +518,8 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
|
||||
/*!
|
||||
The field receives this notification when the list is about to be dismissed.
|
||||
The receiver receives this notification when the list is about to be dismissed.
|
||||
@ignore
|
||||
*/
|
||||
- (void)listWillDismiss:(CPNotification)aNotification
|
||||
{
|
||||
@@ -479,7 +527,8 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
|
||||
/*!
|
||||
The field receives this notification when the list is closed.
|
||||
The receiver receives this notification when the list is closed.
|
||||
@ignore
|
||||
*/
|
||||
- (void)listDidDismiss:(CPNotification)aNotification
|
||||
{
|
||||
@@ -487,14 +536,15 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
|
||||
/*!
|
||||
The field receives this notification when an item in the list is clicked.
|
||||
The receiver receives this notification when an item in the list is clicked.
|
||||
@ignore
|
||||
*/
|
||||
- (void)itemWasClicked:(CPNotification)aNotification
|
||||
{
|
||||
[self takeStringValueFromList];
|
||||
}
|
||||
|
||||
//#pragma mark Manipulating the Selection
|
||||
#pragma mark Manipulating the Selection
|
||||
|
||||
- (void)deselectItemAtIndex:(int)index
|
||||
{
|
||||
@@ -546,7 +596,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
[self selectItemAtIndex:index];
|
||||
}
|
||||
|
||||
//#pragma mark Completing the Text Field
|
||||
#pragma mark Completing the Text Field
|
||||
|
||||
- (BOOL)completes
|
||||
{
|
||||
@@ -584,14 +634,26 @@ var CPComboBoxTextSubview = @"text",
|
||||
an item that is in the item list. If \c flag is \c YES and the user enters a value
|
||||
that is not in the list, when the field loses focus it will revert
|
||||
to the previous value. If \c flag is \c NO, the user can enter any value they wish.
|
||||
|
||||
Note that this flag is ignored if \ref setStringValue or \ref setObjectValue are
|
||||
called directly.
|
||||
*/
|
||||
- (void)setForceSelection:(BOOL)flag
|
||||
{
|
||||
_forceSelection = !!flag;
|
||||
}
|
||||
|
||||
//#pragma mark CPTextField Delegate Methods and Overrides
|
||||
#pragma mark CPTextField Delegate Methods and Overrides
|
||||
|
||||
/*! @ignore */
|
||||
- (void)setObjectValue:(id)object
|
||||
{
|
||||
[super setObjectValue:object];
|
||||
|
||||
_selectedStringValue = [self stringValue];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)keyDown:(CPEvent)anEvent
|
||||
{
|
||||
// Only if characters are added at the end of the value can completion occur
|
||||
@@ -611,6 +673,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
[super keyDown:anEvent];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)paste:(id)sender
|
||||
{
|
||||
if (_completes)
|
||||
@@ -627,7 +690,8 @@ var CPComboBoxTextSubview = @"text",
|
||||
[super paste:sender];
|
||||
}
|
||||
|
||||
- (void)controlTextDidChange:(CPNotification)anNotification
|
||||
/*! @ignore */
|
||||
- (void)textDidChange:(CPNotification)aNotification
|
||||
{
|
||||
/*
|
||||
Completion is attempted iff:
|
||||
@@ -650,8 +714,11 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
[self selectMatchingItem];
|
||||
_canComplete = NO;
|
||||
|
||||
[super textDidChange:aNotification];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (BOOL)performKeyEquivalent:(CPEvent)anEvent
|
||||
{
|
||||
if ([[self window] firstResponder] === self)
|
||||
@@ -679,7 +746,9 @@ var CPComboBoxTextSubview = @"text",
|
||||
case CPEscapeFunctionKey:
|
||||
if ([self listIsVisible])
|
||||
{
|
||||
if (_forceSelection)
|
||||
// If we are forcing a selection and the user has entered a value which is not
|
||||
// in the list, revert to the most recent valid value.
|
||||
if (_forceSelection && ([self _inputElement].value !== _selectedStringValue))
|
||||
[self setStringValue:_selectedStringValue];
|
||||
|
||||
[_list close];
|
||||
@@ -724,25 +793,30 @@ var CPComboBoxTextSubview = @"text",
|
||||
return [super performKeyEquivalent:anEvent];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (BOOL)resignFirstResponder
|
||||
{
|
||||
var buttonCausedResign = _popUpButtonCausedResign;
|
||||
|
||||
_popUpButtonCausedResign = NO;
|
||||
|
||||
/*
|
||||
If the list is clicked, we lose focus. In that case the list will refuse first responder,
|
||||
If the list or popup button is clicked, we lose focus. The list will refuse first responder,
|
||||
and we refuse to resign. But we still have to manually restore the focus to the input element.
|
||||
*/
|
||||
if ([_list listWasClicked])
|
||||
if ([_list listWasClicked] || buttonCausedResign)
|
||||
{
|
||||
/*
|
||||
If an item was not clicked (probably the scrollbar), clear the click flag so that future
|
||||
clicks outside the list will allow it to close. It isn't so great doing that here, but
|
||||
the sequence of events is such that it has to be done here.
|
||||
*/
|
||||
if (![_list itemWasClicked])
|
||||
if ([_list listWasClicked] && ![_list itemWasClicked])
|
||||
[_list setListWasClicked:NO];
|
||||
|
||||
//#if PLATFORM(DOM)
|
||||
#if PLATFORM(DOM)
|
||||
[self _inputElement].focus();
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
return NO;
|
||||
}
|
||||
@@ -765,32 +839,65 @@ var CPComboBoxTextSubview = @"text",
|
||||
return [super resignFirstResponder];
|
||||
}
|
||||
|
||||
/*!
|
||||
We override this so that we can know when the field is about to lose focus
|
||||
because the user pressed tab.
|
||||
*/
|
||||
- (CPView)nextValidKeyView
|
||||
- (void)setFont:(CPFont)aFont
|
||||
{
|
||||
if ([self listIsVisible])
|
||||
[self takeStringValueFromList];
|
||||
|
||||
return [super nextValidKeyView];
|
||||
[super setFont:aFont];
|
||||
[_list setFont:aFont];
|
||||
}
|
||||
|
||||
/*!
|
||||
We override this so that we can know when the field is about to lose focus
|
||||
because the user pressed shift tab.
|
||||
*/
|
||||
- (CPView)previousValidKeyView
|
||||
- (void)setAlignment:(CPTextAlignment)alignment
|
||||
{
|
||||
if ([self listIsVisible])
|
||||
[self takeStringValueFromList];
|
||||
|
||||
return [super previousValidKeyView];
|
||||
[super setAlignment:alignment];
|
||||
[_list setAlignment:alignment];
|
||||
}
|
||||
|
||||
//#pragma mark Internal Helpers
|
||||
#pragma mark Pop Up Button Layout
|
||||
|
||||
- (CGRect)popupButtonRectForBounds:(CGRect)bounds
|
||||
{
|
||||
var inset = [self currentValueForThemeAttribute:@"border-inset"],
|
||||
buttonSize = [self currentValueForThemeAttribute:@"popup-button-size"];
|
||||
|
||||
bounds.origin.x += _CGRectGetMaxX(bounds) - inset.right - buttonSize.width;
|
||||
bounds.origin.y += inset.top;
|
||||
bounds.size.width = buttonSize.width;
|
||||
bounds.size.height = buttonSize.height;
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
- (CGRect)rectForEphemeralSubviewNamed:(CPString)aName
|
||||
{
|
||||
if (aName === "popup-button-view")
|
||||
return [self popupButtonRectForBounds:[self bounds]];
|
||||
|
||||
return [super rectForEphemeralSubviewNamed:aName];
|
||||
}
|
||||
|
||||
- (CPView)createEphemeralSubviewNamed:(CPString)aName
|
||||
{
|
||||
if (aName === "popup-button-view")
|
||||
{
|
||||
var view = [[_CPComboBoxPopUpButton alloc] initWithFrame:_CGRectMakeZero() comboBox:self];
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
return [super createEphemeralSubviewNamed:aName];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
var popupButtonView = [self layoutEphemeralSubviewNamed:@"popup-button-view"
|
||||
positioned:CPWindowAbove
|
||||
relativeToEphemeralSubviewNamed:@"content-view"];
|
||||
}
|
||||
|
||||
#pragma mark Internal Helpers
|
||||
|
||||
/*! @ignore */
|
||||
- (void)dataSourceWarningForMethod:(SEL)cmd condition:(CPString)flag
|
||||
{
|
||||
CPLog.warn("-[%s %s] should not be called when usesDataSource is set to %s", [self className], cmd, flag ? "YES" : "NO");
|
||||
@@ -798,11 +905,15 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
- (id)objectValueForItemAtIndex:(int)index
|
||||
{
|
||||
return [_dataSource comboBox:self objectValueForItemAtIndex:index];
|
||||
if (_usesDataSource)
|
||||
return [_dataSource comboBox:self objectValueForItemAtIndex:index];
|
||||
else
|
||||
return _items[index];
|
||||
}
|
||||
|
||||
/*!
|
||||
Select the item that matches the current value of the combobox.
|
||||
@ignore
|
||||
*/
|
||||
- (void)selectMatchingItem
|
||||
{
|
||||
@@ -822,11 +933,12 @@ var CPComboBoxTextSubview = @"text",
|
||||
// selectRow scrolls the row to visible, if a row is selected scroll it to the top
|
||||
if (index !== CPNotFound)
|
||||
{
|
||||
[_list scrollRowToTop:index];
|
||||
[_list scrollItemAtIndexToTop:index];
|
||||
_selectedStringValue = stringValue;
|
||||
}
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (BOOL)textFieldAction:(id)sender
|
||||
{
|
||||
if ([self listIsVisible])
|
||||
@@ -839,46 +951,68 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
|
||||
Calculate the frame in base coordinates that will nestle just below the visible border of the text field.
|
||||
@ignore
|
||||
*/
|
||||
- (CGRect)borderFrame
|
||||
{
|
||||
// Calculate the focus inset by subtracting the focused bezel inset
|
||||
// from the unfocused bezel inset
|
||||
var unfocusedInset = [self valueForThemeAttribute:@"bezel-inset" inState:CPThemeStateBezeled],
|
||||
focusedInset = [self valueForThemeAttribute:@"bezel-inset" inState:CPThemeStateBezeled | CPThemeStateEditing],
|
||||
focusInset = CGInsetDifference(unfocusedInset, focusedInset),
|
||||
bounds = [self convertRectToBase:[self bounds]];
|
||||
var borderInset = [self valueForThemeAttribute:@"border-inset"],
|
||||
frame = [self bounds];
|
||||
|
||||
bounds.origin.x += focusInset.left;
|
||||
bounds.origin.y += focusInset.top;
|
||||
bounds.size.width -= focusInset.left + focusInset.right;
|
||||
bounds.size.height -= focusInset.top + focusInset.bottom;
|
||||
frame.origin.x += borderInset.left;
|
||||
frame.origin.y += borderInset.top;
|
||||
frame.size.width -= borderInset.left + borderInset.right;
|
||||
frame.size.height -= borderInset.top + borderInset.bottom;
|
||||
|
||||
return bounds;
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
- (void)popUpButtonWasClicked
|
||||
{
|
||||
if (![self isEnabled])
|
||||
return;
|
||||
|
||||
// If we are currently the first responder, we will be asked to resign when the list pops up.
|
||||
// Set a flag to let resignResponder know that the button was clicked and we should not resign.
|
||||
var firstResponder = [[self window] firstResponder];
|
||||
|
||||
_popUpButtonCausedResign = firstResponder === self;
|
||||
|
||||
if ([self listIsVisible])
|
||||
[_list close];
|
||||
else
|
||||
{
|
||||
if (firstResponder !== self)
|
||||
[[self window] makeFirstResponder:self];
|
||||
|
||||
[self popUpList];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPComboBox (CPComboBoxDelegate)
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxSelectionIsChanging:(CPNotification)aNotification
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxSelectionIsChangingNotification object:self];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxSelectionDidChange:(CPNotification)aNotification
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxSelectionDidChangeNotification object:self];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxWillPopUp
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxWillPopUpNotification object:self];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxWillDismiss
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxWillDismissNotification object:self];
|
||||
@@ -888,6 +1022,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
@implementation CPComboBox (CPComboBoxDataSource)
|
||||
|
||||
/*! @ignore */
|
||||
- (CPString)comboBoxCompletedString:(CPString)uncompletedString
|
||||
{
|
||||
if ([_dataSource respondsToSelector:@selector(comboBox:completedString:)])
|
||||
@@ -898,6 +1033,36 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPComboBox (Bindings)
|
||||
|
||||
/*! @ignore */
|
||||
- (void)setContentValues:(CPArray)anArray
|
||||
{
|
||||
[self setUsesDataSource:NO];
|
||||
[self removeAllItems];
|
||||
[self addItemsWithObjectValues:anArray];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)setContent:(CPArray)anArray
|
||||
{
|
||||
[self setUsesDataSource:NO];
|
||||
|
||||
// Directly nuke _items, [_items removeAll] will trigger an extra call to setContent
|
||||
_items = [];
|
||||
|
||||
var values = [];
|
||||
|
||||
[anArray enumerateObjectsUsingBlock:function(object)
|
||||
{
|
||||
values.push([object description]);
|
||||
}];
|
||||
|
||||
[self addItemsWithObjectValues:values];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPComboBoxItemsKey = @"CPComboBoxItemsKey",
|
||||
CPComboBoxListKey = @"CPComboBoxListKey",
|
||||
CPComboBoxDelegateKey = @"CPComboBoxDelegateKey",
|
||||
@@ -905,7 +1070,8 @@ var CPComboBoxItemsKey = @"CPComboBoxItemsKey",
|
||||
CPComboBoxUsesDataSourceKey = @"CPComboBoxUsesDataSourceKey",
|
||||
CPComboBoxCompletesKey = @"CPComboBoxCompletesKey",
|
||||
CPComboBoxNumberOfVisibleItemsKey = @"CPComboBoxNumberOfVisibleItemsKey",
|
||||
CPComboBoxHasVerticalScrollerKey = @"CPComboBoxHasVerticalScrollerKey";
|
||||
CPComboBoxHasVerticalScrollerKey = @"CPComboBoxHasVerticalScrollerKey",
|
||||
CPComboBoxButtonBorderedKey = @"CPComboBoxButtonBorderedKey";
|
||||
|
||||
@implementation CPComboBox (CPCoding)
|
||||
|
||||
@@ -915,7 +1081,7 @@ var CPComboBoxItemsKey = @"CPComboBoxItemsKey",
|
||||
|
||||
if (self)
|
||||
{
|
||||
[self _init];
|
||||
[self _initComboBox];
|
||||
|
||||
_items = [aCoder decodeObjectForKey:CPComboBoxItemsKey];
|
||||
_list = [aCoder decodeObjectForKey:CPComboBoxListKey];
|
||||
@@ -925,6 +1091,7 @@ var CPComboBoxItemsKey = @"CPComboBoxItemsKey",
|
||||
_completes = [aCoder decodeBoolForKey:CPComboBoxCompletesKey];
|
||||
_numberOfVisibleItems = [aCoder decodeIntForKey:CPComboBoxNumberOfVisibleItemsKey];
|
||||
_hasVerticalScroller = [aCoder decodeBoolForKey:CPComboBoxHasVerticalScrollerKey];
|
||||
[self setButtonBordered:[aCoder decodeBoolForKey:CPComboBoxButtonBorderedKey]];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -942,6 +1109,7 @@ var CPComboBoxItemsKey = @"CPComboBoxItemsKey",
|
||||
[aCoder encodeBool:_completes forKey:CPComboBoxCompletesKey];
|
||||
[aCoder encodeInt:_numberOfVisibleItems forKey:CPComboBoxNumberOfVisibleItemsKey];
|
||||
[aCoder encodeBool:_hasVerticalScroller forKey:CPComboBoxHasVerticalScrollerKey];
|
||||
[aCoder encodeBool:[self isButtonBordered] forKey:CPComboBoxButtonBorderedKey];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -951,3 +1119,90 @@ var CPComboBoxCompletionTest = function(object, index, context)
|
||||
{
|
||||
return object.toString().indexOf(context) === 0;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
This class is only used for CPContentBinding and CPContentValuesBinding.
|
||||
*/
|
||||
@implementation _CPComboBoxContentBinder : CPBinder
|
||||
|
||||
- (void)setValueFor:(CPString)theBinding
|
||||
{
|
||||
var destination = [_info objectForKey:CPObservedObjectKey],
|
||||
keyPath = [_info objectForKey:CPObservedKeyPathKey],
|
||||
options = [_info objectForKey:CPOptionsKey],
|
||||
newValue = [destination valueForKeyPath:keyPath],
|
||||
isPlaceholder = CPIsControllerMarker(newValue);
|
||||
|
||||
[_source removeAllItems];
|
||||
|
||||
if (isPlaceholder)
|
||||
{
|
||||
// By default the placeholders will all result in an empty list
|
||||
switch (newValue)
|
||||
{
|
||||
case CPMultipleValuesMarker:
|
||||
newValue = [options objectForKey:CPMultipleValuesPlaceholderBindingOption] || [];
|
||||
break;
|
||||
|
||||
case CPNoSelectionMarker:
|
||||
newValue = [options objectForKey:CPNoSelectionPlaceholderBindingOption] || [];
|
||||
break;
|
||||
|
||||
case CPNotApplicableMarker:
|
||||
if ([options objectForKey:CPRaisesForNotApplicableKeysBindingOption])
|
||||
[CPException raise:CPGenericException
|
||||
reason:@"can't transform non applicable key on: "+ _source + " value: " + newValue];
|
||||
|
||||
newValue = [options objectForKey:CPNotApplicablePlaceholderBindingOption] || [];
|
||||
break;
|
||||
|
||||
case CPNullMarker:
|
||||
newValue = [options objectForKey:CPNullPlaceholderBindingOption] || [];
|
||||
break;
|
||||
}
|
||||
|
||||
if (![newValue isKindOfClass:[CPArray class]])
|
||||
newValue = [];
|
||||
}
|
||||
else
|
||||
newValue = [self transformValue:newValue withOptions:options];
|
||||
|
||||
switch (theBinding)
|
||||
{
|
||||
case CPContentBinding: [_source setContent:newValue];
|
||||
break;
|
||||
|
||||
case CPContentValuesBinding: [_source setContentValues:newValue];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPComboBoxPopUpButton : CPView
|
||||
{
|
||||
CPComboBox _comboBox;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame comboBox:(CPComboBox)aComboBox
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
if (self)
|
||||
_comboBox = aComboBox;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)mouseDown:(CPEvent)theEvent
|
||||
{
|
||||
[_comboBox popUpButtonWasClicked];
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstResponder
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -169,8 +169,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
+ (id)themeAttributes
|
||||
{
|
||||
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(2.0, 2.0, 2.0, 2.0), [CPNull null]]
|
||||
forKeys:[@"bezel-inset", @"content-inset", @"bezel-color"]];
|
||||
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMake(2.0, 2.0, 2.0, 2.0), _CGInsetMake(3.0, 3.0, 3.0, 3.0), [CPNull null]]
|
||||
forKeys:[@"bezel-inset", @"content-inset", @"border-inset", @"bezel-color"]];
|
||||
}
|
||||
|
||||
/* @ignore */
|
||||
|
||||
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 219 B |
|
After Width: | Height: | Size: 487 B |
|
After Width: | Height: | Size: 160 B |
|
After Width: | Height: | Size: 353 B |
|
After Width: | Height: | Size: 661 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 146 B |
|
After Width: | Height: | Size: 141 B |
|
After Width: | Height: | Size: 219 B |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 160 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 622 B |
|
After Width: | Height: | Size: 221 B |
|
After Width: | Height: | Size: 441 B |
|
After Width: | Height: | Size: 527 B |
@@ -801,7 +801,7 @@ var themedButtonValues = nil,
|
||||
|
||||
placeholderColor = [CPColor colorWithCalibratedRed:189.0 / 255.0 green:199.0 / 255.0 blue:211.0 / 255.0 alpha:1.0];
|
||||
|
||||
// Global for reuse by CPTokenField.
|
||||
// Global for reuse by subclasses
|
||||
themedTextFieldValues =
|
||||
[
|
||||
[@"vertical-alignment", CPTopVerticalTextAlignment, CPThemeStateBezeled],
|
||||
@@ -815,6 +815,9 @@ var themedButtonValues = nil,
|
||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled],
|
||||
[@"bezel-inset", CGInsetMake(0.0, 0.0, 0.0, 0.0), CPThemeStateBezeled | CPThemeStateEditing],
|
||||
|
||||
// Because the bezel artwork does not use insets, provide an inset to the border
|
||||
[@"border-inset", CGInsetMake(3.0, 3.0, 3.0, 3.0), CPThemeStateBezeled],
|
||||
|
||||
[@"text-color", placeholderColor, CPTextFieldStatePlaceholder],
|
||||
|
||||
[@"line-break-mode", CPLineBreakByTruncatingTail, CPThemeStateTableDataView],
|
||||
@@ -998,6 +1001,95 @@ var themedButtonValues = nil,
|
||||
return button;
|
||||
}
|
||||
|
||||
+ (CPComboBox)themedComboBox
|
||||
{
|
||||
var combo = [[CPComboBox alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 29.0)],
|
||||
|
||||
bezelColor = PatternColor(
|
||||
[
|
||||
["combobox-bezel-left.png", 6.0, 29.0],
|
||||
["combobox-bezel-center.png", 1.0, 29.0],
|
||||
["combobox-bezel-right.png", 24.0, 29.0]
|
||||
],
|
||||
PatternIsHorizontal),
|
||||
|
||||
bezelFocusedColor = PatternColor(
|
||||
[
|
||||
["combobox-bezel-focused-left.png", 6.0, 29.0],
|
||||
["combobox-bezel-focused-center.png", 1.0, 29.0],
|
||||
["combobox-bezel-focused-right.png", 24.0, 29.0]
|
||||
],
|
||||
PatternIsHorizontal),
|
||||
|
||||
bezelDisabledColor = PatternColor(
|
||||
[
|
||||
["combobox-bezel-disabled-left.png", 6.0, 29.0],
|
||||
["combobox-bezel-disabled-center.png", 1.0, 29.0],
|
||||
["combobox-bezel-disabled-right.png", 24.0, 29.0]
|
||||
],
|
||||
PatternIsHorizontal),
|
||||
|
||||
bezelNoBorderColor = PatternColor(
|
||||
[
|
||||
["combobox-bezel-no-border-left.png", 6.0, 29.0],
|
||||
["combobox-bezel-no-border-center.png", 1.0, 29.0],
|
||||
["combobox-bezel-no-border-right.png", 24.0, 29.0]
|
||||
],
|
||||
PatternIsHorizontal),
|
||||
|
||||
bezelNoBorderFocusedColor = PatternColor(
|
||||
[
|
||||
["combobox-bezel-no-border-focused-left.png", 6.0, 29.0],
|
||||
["combobox-bezel-no-border-focused-center.png", 1.0, 29.0],
|
||||
["combobox-bezel-no-border-focused-right.png", 24.0, 29.0]
|
||||
],
|
||||
PatternIsHorizontal),
|
||||
|
||||
bezelNoBorderDisabledColor = PatternColor(
|
||||
[
|
||||
["combobox-bezel-no-border-disabled-left.png", 6.0, 29.0],
|
||||
["combobox-bezel-no-border-disabled-center.png", 1.0, 29.0],
|
||||
["combobox-bezel-no-border-disabled-right.png", 24.0, 29.0]
|
||||
],
|
||||
PatternIsHorizontal),
|
||||
|
||||
overrides =
|
||||
[
|
||||
[@"bezel-color", bezelColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered],
|
||||
[@"bezel-color", bezelFocusedColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateEditing],
|
||||
[@"bezel-color", bezelDisabledColor, CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateDisabled],
|
||||
|
||||
[@"bezel-color", bezelNoBorderColor, CPThemeStateBezeled],
|
||||
[@"bezel-color", bezelNoBorderFocusedColor, CPThemeStateBezeled | CPThemeStateEditing],
|
||||
[@"bezel-color", bezelNoBorderDisabledColor, CPThemeStateBezeled | CPThemeStateDisabled],
|
||||
|
||||
// The right inset has to make room for the popup button
|
||||
[@"content-inset", CGInsetMake(8.0, 28.0, 5.0, 8.0), CPThemeStateBezeled | CPComboBoxStateButtonBordered],
|
||||
[@"content-inset", CGInsetMake(7.0, 26.0, 6.0, 8.0), CPThemeStateBezeled | CPComboBoxStateButtonBordered | CPThemeStateEditing],
|
||||
|
||||
[@"content-inset", CGInsetMake(8.0, 25.0, 5.0, 8.0), CPThemeStateBezeled],
|
||||
[@"content-inset", CGInsetMake(7.0, 23.0, 6.0, 8.0), CPThemeStateBezeled | CPThemeStateEditing],
|
||||
|
||||
[@"content-inset", CGInsetMake(0.0, 15.0, 0.0, 5.0), CPThemeStateTableDataView],
|
||||
[@"content-inset", CGInsetMake(6.0, 20.0, 6.0, 5.0), CPThemeStateTableDataView | CPThemeStateEditing],
|
||||
|
||||
[@"content-inset", CGInsetMake(0.0, 20.0, 0.0, 5.0), CPThemeStateTableDataView | CPComboBoxStateButtonBordered],
|
||||
[@"content-inset", CGInsetMake(6.0, 25.0, 6.0, 5.0), CPThemeStateTableDataView | CPComboBoxStateButtonBordered | CPThemeStateEditing],
|
||||
|
||||
[@"content-inset", CGInsetMake(0.0, 20.0, 0.0, 5.0), CPThemeStateTableDataView],
|
||||
|
||||
// Because combo box uses a thre-part bezel, the height is fixed
|
||||
[@"min-size", CGSizeMake(-1, 29.0)],
|
||||
[@"max-size", CGSizeMake(-1, 29.0)],
|
||||
|
||||
[@"popup-button-size", CGSizeMake(21.0, 23.0)]
|
||||
];
|
||||
|
||||
[self registerThemeValues:overrides forView:combo inherit:themedTextFieldValues];
|
||||
|
||||
return combo;
|
||||
}
|
||||
|
||||
+ (CPRadioButton)themedRadioButton
|
||||
{
|
||||
var button = [CPRadio radioWithTitle:@"Hello Friend!"],
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <AppKit/CPTableView.j>
|
||||
@import "CPTableView.j"
|
||||
|
||||
|
||||
/*!
|
||||
@@ -55,6 +55,8 @@ _CPPopUpListDidDismissNotification = @"_CPPopUpListDidDismissNotification";
|
||||
_CPPopUpListItemWasClickedNotification = @"_CPPopUpListItemWasClickedNotification";
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
|
||||
The minimum number of items that must be visible below the related field.
|
||||
If less than this number would be completely visible, and there is room for this many complete items
|
||||
above the field, the list is displayed above.
|
||||
@@ -98,7 +100,6 @@ var ListColumnIdentifier = @"1";
|
||||
Creates a pop up list of choices which will display relative to the given rect in base coordinates.
|
||||
|
||||
@param aDelegate The object that usually is controlling this list.
|
||||
@param baseRect A rect in base coordinates relative to which the list should be displayed
|
||||
*/
|
||||
- (id)initWithDelegate:(_CPPopUpListDelegate)aDelegate
|
||||
{
|
||||
@@ -107,6 +108,10 @@ var ListColumnIdentifier = @"1";
|
||||
if (self)
|
||||
{
|
||||
_delegate = aDelegate;
|
||||
_itemWasClicked = NO;
|
||||
_listWasClicked = NO;
|
||||
_listWidth = 0;
|
||||
|
||||
_tableView = [self makeTableView];
|
||||
|
||||
// Start with a default size, we will resize it later
|
||||
@@ -152,7 +157,8 @@ var ListColumnIdentifier = @"1";
|
||||
[panel setTitle:@""];
|
||||
[panel setFloatingPanel:YES];
|
||||
[panel setBecomesKeyOnlyIfNeeded:YES];
|
||||
[panel setHasShadow:NO];
|
||||
[panel setHasShadow:YES];
|
||||
[panel setShadowStyle:CPMenuWindowShadowStyle];
|
||||
[panel setDelegate:self];
|
||||
|
||||
return panel;
|
||||
@@ -220,6 +226,7 @@ var ListColumnIdentifier = @"1";
|
||||
|
||||
return scroll;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the desired width of the list.
|
||||
*/
|
||||
@@ -238,22 +245,53 @@ var ListColumnIdentifier = @"1";
|
||||
_listWidth = width;
|
||||
}
|
||||
|
||||
/!*
|
||||
- (void)setFont:(CPFont)aFont
|
||||
{
|
||||
var oldDataView = [_tableColumn dataView],
|
||||
newDataView = [CPTextField new];
|
||||
|
||||
[newDataView setFont:aFont];
|
||||
[newDataView setAlignment:[oldDataView alignment]];
|
||||
[_tableColumn setDataView:newDataView];
|
||||
|
||||
// Force the data view cache to flush
|
||||
[_tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)setAlignment:(CPTextAlignment)alignment
|
||||
{
|
||||
var oldDataView = [_tableColumn dataView],
|
||||
newDataView = [CPTextField new];
|
||||
|
||||
[newDataView setAlignment:alignment];
|
||||
[newDataView setFont:[oldDataView font]];
|
||||
[_tableColumn setDataView:newDataView];
|
||||
|
||||
// Force the data view cache to flush
|
||||
[_tableView reloadData];
|
||||
}
|
||||
|
||||
/*!
|
||||
Pop up the list if it is not already visible.
|
||||
If it is not visible, a _CPPopUpListWillPopUpNotification will be sent.
|
||||
|
||||
@param aRect A rect (in \c aView coordinates) to display relative to
|
||||
@param aView The view whose coordinate system \c aRect is in
|
||||
@param offset How far to offset the list from \c aRect
|
||||
*/
|
||||
- (void)popUpRelativeTo:(CGRect)baseRect
|
||||
- (void)popUpRelativeToRect:(CGRect)aRect view:(CPView)aView offset:(int)offset
|
||||
{
|
||||
if ([_panel isVisible])
|
||||
return;
|
||||
|
||||
var frame = CGRectMake(0, 0, MAX(_listWidth, CGRectGetWidth(baseRect)), [self rowHeightForTableView:_tableView] * [self numberOfRowsInTableView:_tableView]);
|
||||
var frame = CGRectMake(0, 0, MAX(_listWidth, CGRectGetWidth(aRect)), [self rowHeightForTableView:_tableView] * [self numberOfRowsInTableView:_tableView]);
|
||||
|
||||
// Place the frame relative to the baseRect and constrain it to the screen bounds
|
||||
frame = [self constrain:frame relativeTo:baseRect];
|
||||
// Place the frame relative to aRect and constrain it to the screen bounds
|
||||
frame = [self constrain:frame relativeToRect:aRect view:aView offset:offset];
|
||||
|
||||
[_panel setFrame:frame];
|
||||
[_scrollView setFrameSize:CGSizeMakeCopy(frame.size)];
|
||||
[self scrollItemAtIndexToTop:[_tableView selectedRow]];
|
||||
|
||||
[self listWillPopUp];
|
||||
|
||||
@@ -261,20 +299,26 @@ var ListColumnIdentifier = @"1";
|
||||
}
|
||||
|
||||
/*!
|
||||
Return a frame in base coordinates such that the list, when displayed, will show at least ListMinimumItems
|
||||
items completely on screen. Normally the list should be displayed below \c baseRect, but if there is not room
|
||||
Return a frame in platform window base coordinates such that the list, when displayed, will show at least ListMinimumItems
|
||||
items completely on screen. Normally the list should be displayed below \c aRect, but if there is not room
|
||||
for at least ListMinimumItems items, an attempt should be made to display that many
|
||||
items above \c baseRect. If the minimum cannot be displayed on top, whichever direction can display more items
|
||||
items above \c aRect. If the minimum cannot be displayed on top, whichever direction can display more items
|
||||
is chosen.
|
||||
*/
|
||||
- (CGRect)constrain:(CGRect)aFrame relativeTo:(CGRect)baseRect
|
||||
- (CGRect)constrain:(CGRect)aFrame relativeToRect:(CGRect)aRect view:(CPView)aView offset:(int)offset
|
||||
{
|
||||
var baseOrigin = CGPointMake(CGRectGetMinX(baseRect), CGRectGetMaxY(baseRect)),
|
||||
// Convert from the view's coordinate system to the coordinate system of the primary platform window
|
||||
var baseOrigin = [aView convertPointToBase:aRect.origin],
|
||||
windowOrigin = [[aView window] convertBaseToPlatformWindow:baseOrigin],
|
||||
rowHeight = [self rowHeightForTableView:_tableView],
|
||||
|
||||
// Be sure to clip the number of displayed rows to what the field wants
|
||||
numberOfRows = MIN([self numberOfRowsInTableView:_tableView], [_delegate numberOfVisibleItems]),
|
||||
|
||||
// Add 2 to height for border
|
||||
frame = CGRectMake(baseOrigin.x, baseOrigin.y, MAX(_listWidth, CGRectGetWidth(aFrame)), (rowHeight * numberOfRows) + 2),
|
||||
frame = CGRectMake(windowOrigin.x, windowOrigin.y + CGRectGetHeight(aRect) + offset, MAX(_listWidth, CGRectGetWidth(aFrame)), (rowHeight * numberOfRows) + 2),
|
||||
|
||||
// Get the bottom coordinate of the frame and the platform window
|
||||
bottomFrame = CGRectMakeCopy(frame),
|
||||
bottom = CGRectGetMaxY(bottomFrame),
|
||||
viewRect = [[CPPlatformWindow primaryPlatformWindow] visibleFrame],
|
||||
@@ -294,7 +338,7 @@ var ListColumnIdentifier = @"1";
|
||||
// The minimum number of items will not fit, try above
|
||||
var topFrame = CGRectMakeCopy(frame);
|
||||
|
||||
topFrame.origin.y = CGRectGetMinY(baseRect) - CGRectGetHeight(topFrame);
|
||||
topFrame.origin.y = windowOrigin.y - offset - CGRectGetHeight(topFrame);
|
||||
|
||||
var visibleTop = CGRectGetMinY(viewRect),
|
||||
topVisibleRows = numberOfRows;
|
||||
@@ -418,7 +462,7 @@ var ListColumnIdentifier = @"1";
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)scrollRowToTop:(int)row
|
||||
- (void)scrollItemAtIndexToTop:(int)row
|
||||
{
|
||||
var rect = [_tableView rectOfRow:row];
|
||||
|
||||
@@ -584,6 +628,9 @@ var _CPPopUpListFieldKey = @"_CPPopUpListDelegateKey",
|
||||
|
||||
if (self)
|
||||
{
|
||||
_listWasClicked = NO;
|
||||
_itemWasClicked = NO;
|
||||
|
||||
_delegate = [aCoder decodeObjectForKey:_CPPopUpListDelegateKey];
|
||||
_listWidth = [aCoder decodeIntForKey:_CPPopUpListListWidthKey];
|
||||
_panel = [aCoder decodeObjectForKey:_CPPopUpListListPanelKey];
|
||||
@@ -607,12 +654,6 @@ var _CPPopUpListFieldKey = @"_CPPopUpListDelegateKey",
|
||||
[aCoder encodeObject:_tableView forKey:_CPPopUpListTableViewKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPPopUpList (CPTableViewDelegate)
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPPopUpList (CPTableViewDataSource)
|
||||
@@ -653,7 +694,7 @@ var _CPPopUpListFieldKey = @"_CPPopUpListDelegateKey",
|
||||
*/
|
||||
- (CPTableColumn)listColumn
|
||||
{
|
||||
return [self tableColumnWithIdentifier:ListColumnIdentifier];
|
||||
return _tableColumn;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,361 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
9EEC4498135749D200615446 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EEC4497135749D200615446 /* Cocoa.framework */; };
|
||||
9EEC44B5135749D300615446 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EEC4497135749D200615446 /* Cocoa.framework */; };
|
||||
9EEC44CC13574A0B00615446 /* CPComboBoxTest in Resources */ = {isa = PBXBuildFile; fileRef = 9EEC44CB13574A0B00615446 /* CPComboBoxTest */; };
|
||||
E172BA5013FF420400B03445 /* MainMenu.xib in Sources */ = {isa = PBXBuildFile; fileRef = E172BA4F13FF420400B03445 /* MainMenu.xib */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
9EEC44B6135749D300615446 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 9EEC448A135749D200615446 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 9EEC4492135749D200615446;
|
||||
remoteInfo = Another;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
9EEC4493135749D200615446 /* Another.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Another.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9EEC4497135749D200615446 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
9EEC449A135749D300615446 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
9EEC449B135749D300615446 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
9EEC449C135749D300615446 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
9EEC44B4135749D300615446 /* AnotherTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AnotherTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9EEC44CB13574A0B00615446 /* CPComboBoxTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CPComboBoxTest; path = ..; sourceTree = "<group>"; };
|
||||
E172BA4F13FF420400B03445 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainMenu.xib; path = ../Resources/MainMenu.xib; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
9EEC4490135749D200615446 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9EEC4498135749D200615446 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
9EEC44B0135749D300615446 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9EEC44B5135749D300615446 /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
9EEC4488135749D200615446 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E172BA4F13FF420400B03445 /* MainMenu.xib */,
|
||||
9EEC44CB13574A0B00615446 /* CPComboBoxTest */,
|
||||
9EEC4496135749D200615446 /* Frameworks */,
|
||||
9EEC4494135749D200615446 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9EEC4494135749D200615446 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9EEC4493135749D200615446 /* Another.app */,
|
||||
9EEC44B4135749D300615446 /* AnotherTests.octest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9EEC4496135749D200615446 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9EEC4497135749D200615446 /* Cocoa.framework */,
|
||||
9EEC4499135749D300615446 /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9EEC4499135749D300615446 /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9EEC449A135749D300615446 /* AppKit.framework */,
|
||||
9EEC449B135749D300615446 /* CoreData.framework */,
|
||||
9EEC449C135749D300615446 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
9EEC4492135749D200615446 /* Another */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 9EEC44C5135749D300615446 /* Build configuration list for PBXNativeTarget "Another" */;
|
||||
buildPhases = (
|
||||
9EEC448F135749D200615446 /* Sources */,
|
||||
9EEC4490135749D200615446 /* Frameworks */,
|
||||
9EEC4491135749D200615446 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Another;
|
||||
productName = Another;
|
||||
productReference = 9EEC4493135749D200615446 /* Another.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
9EEC44B3135749D300615446 /* AnotherTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 9EEC44C8135749D300615446 /* Build configuration list for PBXNativeTarget "AnotherTests" */;
|
||||
buildPhases = (
|
||||
9EEC44AF135749D300615446 /* Sources */,
|
||||
9EEC44B0135749D300615446 /* Frameworks */,
|
||||
9EEC44B1135749D300615446 /* Resources */,
|
||||
9EEC44B2135749D300615446 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
9EEC44B7135749D300615446 /* PBXTargetDependency */,
|
||||
);
|
||||
name = AnotherTests;
|
||||
productName = AnotherTests;
|
||||
productReference = 9EEC44B4135749D300615446 /* AnotherTests.octest */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
9EEC448A135749D200615446 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0420;
|
||||
ORGANIZATIONNAME = "280 North, Inc.";
|
||||
};
|
||||
buildConfigurationList = 9EEC448D135749D200615446 /* Build configuration list for PBXProject "CPComboBoxTest" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 9EEC4488135749D200615446;
|
||||
productRefGroup = 9EEC4494135749D200615446 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
9EEC4492135749D200615446 /* Another */,
|
||||
9EEC44B3135749D300615446 /* AnotherTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
9EEC4491135749D200615446 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9EEC44CC13574A0B00615446 /* CPComboBoxTest in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
9EEC44B1135749D300615446 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
9EEC44B2135749D300615446 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
9EEC448F135749D200615446 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E172BA5013FF420400B03445 /* MainMenu.xib in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
9EEC44AF135749D300615446 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
9EEC44B7135749D300615446 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 9EEC4492135749D200615446 /* Another */;
|
||||
targetProxy = 9EEC44B6135749D300615446 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
9EEC44C3135749D300615446 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
9EEC44C4135749D300615446 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
9EEC44C6135749D300615446 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Another/Another-Prefix.pch";
|
||||
INFOPLIST_FILE = "Another/Another-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
9EEC44C7135749D300615446 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Another/Another-Prefix.pch";
|
||||
INFOPLIST_FILE = "Another/Another-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
9EEC44C9135749D300615446 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Another.app/Contents/MacOS/Another";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "AnotherTests/AnotherTests-Prefix.pch";
|
||||
INFOPLIST_FILE = "AnotherTests/AnotherTests-Info.plist";
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SenTestingKit,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUNDLE_LOADER)";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
9EEC44CA135749D300615446 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Another.app/Contents/MacOS/Another";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "AnotherTests/AnotherTests-Prefix.pch";
|
||||
INFOPLIST_FILE = "AnotherTests/AnotherTests-Info.plist";
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SenTestingKit,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUNDLE_LOADER)";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
9EEC448D135749D200615446 /* Build configuration list for PBXProject "CPComboBoxTest" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
9EEC44C3135749D300615446 /* Debug */,
|
||||
9EEC44C4135749D300615446 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
9EEC44C5135749D300615446 /* Build configuration list for PBXNativeTarget "Another" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
9EEC44C6135749D300615446 /* Debug */,
|
||||
9EEC44C7135749D300615446 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
9EEC44C8135749D300615446 /* Build configuration list for PBXNativeTarget "AnotherTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
9EEC44C9135749D300615446 /* Debug */,
|
||||
9EEC44CA135749D300615446 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 9EEC448A135749D200615446 /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:CPComboBoxTest.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
@interface Companies : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@interface AppController : NSObject
|
||||
{
|
||||
IBOutlet NSWindow* theWindow;
|
||||
IBOutlet NSComboBox* cibCombo;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
@interface Companies : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@interface AppController : NSObject
|
||||
{
|
||||
IBOutlet NSWindow* theWindow;
|
||||
IBOutlet NSComboBox* cibCombo;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPComboBoxTest
|
||||
*
|
||||
* Created by Aparajita Fishman.
|
||||
* Copyright (c) 2011, Intalio, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <AppKit/CPComboBox.j>
|
||||
|
||||
|
||||
@implementation Companies : CPObject
|
||||
{
|
||||
CPMutableArray items @accessors;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
items = [CPMutableArray array];
|
||||
|
||||
var employees = "Tom,Dick,Harry,Ted,Sam,Fred,Ralph,Ed,Tim,John,Bill,Irving,Stan,Rodney".split(",");
|
||||
|
||||
employees = [CPArray arrayWithObjects:employees count:employees.length];
|
||||
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Spacely Sprockets", @"name", employees, @"employees"]];
|
||||
|
||||
employees = "Jane,Sally,Joan,Sara,Melissa,Beverly,Gillian,Sandra,Samantha,Mary,Kate".split(",");
|
||||
employees = [CPArray arrayWithObjects:employees count:employees.length];
|
||||
[items addObject:[CPDictionary dictionaryWithObjectsAndKeys:@"Cogswell Cogs", @"name", employees, @"employees"]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
CPString employee @accessors;
|
||||
Companies companies @accessors;
|
||||
CPArrayController companiesController;
|
||||
CPArrayController employeesController;
|
||||
CPComboBox combo;
|
||||
@outlet CPComboBox cibCombo;
|
||||
CPString fontName;
|
||||
int nextCheckboxY;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if (self = [super init])
|
||||
{
|
||||
fontName = [CPFont systemFontFace];
|
||||
companies = [Companies new];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(30, 50, 500, 400) styleMask:CPTitledWindowMask | CPResizableWindowMask];
|
||||
|
||||
var contentView = [theWindow contentView],
|
||||
companiesScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(30, 30, 200, 100)],
|
||||
companiesTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
|
||||
employeesScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(250, 30, 200, 200)],
|
||||
employeesTable = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
|
||||
|
||||
[theWindow setTitle:@"CPComboBox (from code)"];
|
||||
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:@"name"];
|
||||
|
||||
[column setResizingMask:CPTableColumnAutoresizingMask];
|
||||
[companiesTable addTableColumn:column];
|
||||
[companiesTable setAllowsMultipleSelection:YES];
|
||||
[companiesTable setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||
[companiesScrollView setHasHorizontalScroller:NO];
|
||||
[companiesScrollView setHasVerticalScroller:YES];
|
||||
[companiesScrollView setDocumentView:companiesTable];
|
||||
[companiesScrollView setBorderType:CPBezelBorder];
|
||||
[companiesTable setHeaderView:nil];
|
||||
[companiesTable setAllowsEmptySelection:NO];
|
||||
|
||||
[contentView addSubview:companiesScrollView];
|
||||
|
||||
column = [[CPTableColumn alloc] initWithIdentifier:@"name"];
|
||||
|
||||
[column setResizingMask:CPTableColumnAutoresizingMask];
|
||||
[employeesTable addTableColumn:column];
|
||||
[employeesTable setAllowsMultipleSelection:YES];
|
||||
[employeesTable setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||
[employeesScrollView setHasHorizontalScroller:NO];
|
||||
[employeesScrollView setHasVerticalScroller:YES];
|
||||
[employeesScrollView setDocumentView:employeesTable];
|
||||
[employeesScrollView setBorderType:CPBezelBorder];
|
||||
[employeesTable setHeaderView:nil];
|
||||
[employeesTable setAllowsEmptySelection:YES];
|
||||
|
||||
[contentView addSubview:employeesScrollView];
|
||||
|
||||
combo = [[CPComboBox alloc] initWithFrame:CGRectMake(250, 240, 200, 29)];
|
||||
[combo setCompletes:YES];
|
||||
[contentView addSubview:combo];
|
||||
|
||||
var center = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[center addObserver:self selector:@selector(comboNote:) name:CPComboBoxSelectionDidChangeNotification object:combo];
|
||||
[center addObserver:self selector:@selector(comboNote:) name:CPComboBoxSelectionIsChangingNotification object:combo];
|
||||
[center addObserver:self selector:@selector(comboNote:) name:CPComboBoxWillDismissNotification object:combo];
|
||||
[center addObserver:self selector:@selector(comboNote:) name:CPComboBoxWillPopUpNotification object:combo];
|
||||
|
||||
nextCheckboxY = 166;
|
||||
[self makeCheckBoxWithTitle:@"Enabled" defaultState:CPOnState];
|
||||
[self makeCheckBoxWithTitle:@"Button bordered" defaultState:CPOnState];
|
||||
[self makeCheckBoxWithTitle:@"Bold" defaultState:CPOffState];
|
||||
[self makeCheckBoxWithTitle:@"Completes" defaultState:CPOnState];
|
||||
[self makeCheckBoxWithTitle:@"Force selection" defaultState:CPOffState];
|
||||
[self makeCheckBoxWithTitle:@"Vertical scroller" defaultState:CPOnState];
|
||||
[self makeCheckBoxWithTitle:@"Big item height" defaultState:CPOffState];
|
||||
[self makeCheckBoxWithTitle:@"More visible items" defaultState:CPOffState];
|
||||
|
||||
companiesController = [CPArrayController new];
|
||||
[companiesController bind:@"contentArray" toObject:companies withKeyPath:@"items" options:nil];
|
||||
|
||||
employeesController = [CPArrayController new];
|
||||
[employeesController bind:@"contentArray" toObject:companiesController withKeyPath:@"selection.employees" options:nil];
|
||||
|
||||
var employeeController = [CPObjectController new];
|
||||
|
||||
[employeeController bind:@"content" toObject:employeesController withKeyPath:@"selection.self" options:nil];
|
||||
|
||||
[[companiesTable tableColumnWithIdentifier:@"name"] bind:@"value" toObject:companiesController withKeyPath:@"arrangedObjects.name" options:nil];
|
||||
[[employeesTable tableColumnWithIdentifier:@"name"] bind:@"value" toObject:employeesController withKeyPath:@"arrangedObjects" options:nil];
|
||||
[combo bind:@"contentValues" toObject:employeesController withKeyPath:@"arrangedObjects" options:nil];
|
||||
[combo bind:@"value" toObject:employeeController withKeyPath:@"content" options:nil];
|
||||
|
||||
[companiesController addObserver:self forKeyPath:@"selection" options:0 context:@"companies.selection"];
|
||||
[companiesController addObserver:self forKeyPath:@"selectionIndexes" options:0 context:@"companies.selectionIndexes"];
|
||||
[companiesController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:@"companies.arrangedObjects"];
|
||||
[employeesController addObserver:self forKeyPath:@"selectionIndexes" options:0 context:@"employees.selectionIndexes"];
|
||||
[employeesController addObserver:self forKeyPath:@"selection" options:0 context:@"employees.selection"];
|
||||
[employeesController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:@"employees.arrangedObjects"];
|
||||
[combo addObserver:self forKeyPath:@"value" options:0 context:@"combo.value"];
|
||||
|
||||
[theWindow setInitialFirstResponder:companiesTable];
|
||||
[theWindow orderFront:self];
|
||||
}
|
||||
|
||||
- (void)makeCheckBoxWithTitle:(CPString)aTitle defaultState:(BOOL)aState
|
||||
{
|
||||
var checkbox = [CPCheckBox checkBoxWithTitle:aTitle];
|
||||
[checkbox setFrameOrigin:CGPointMake(55, nextCheckboxY)];
|
||||
[checkbox setState:aState];
|
||||
[checkbox setTarget:self];
|
||||
[checkbox setAction:@selector(setComboState:)];
|
||||
[[theWindow contentView] addSubview:checkbox];
|
||||
|
||||
nextCheckboxY += 25;
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(CPString)keyPath ofObject:(id)object change:(CPDictionary)change context:(id)context
|
||||
{
|
||||
console.log("\nkeyPath: %s\ncontext: %s\nnew: %s\nold: %s", keyPath, context, [[change valueForKey:CPKeyValueChangeNewKey] description], [[change valueForKey:CPKeyValueChangeOldKey] description]);
|
||||
}
|
||||
|
||||
- (void)setComboState:(id)sender
|
||||
{
|
||||
var title = [sender title],
|
||||
state = [sender state] === CPOnState;
|
||||
|
||||
if (title === @"Enabled")
|
||||
[combo setEnabled:state];
|
||||
else if (title === @"Button bordered")
|
||||
[combo setButtonBordered:state];
|
||||
else if (title === @"Bold")
|
||||
{
|
||||
var font = [sender state] === CPOnState ? [CPFont boldFontWithName:fontName size:12] : [CPFont fontWithName:fontName size:12];
|
||||
[combo setFont:font];
|
||||
}
|
||||
else if (title === @"Completes")
|
||||
[combo setCompletes:state];
|
||||
else if (title === @"Force selection")
|
||||
[combo setForceSelection:state];
|
||||
else if (title === @"Vertical scroller")
|
||||
[combo setHasVerticalScroller:state];
|
||||
else if (title === @"Big item height")
|
||||
[combo setItemHeight:state ? 47 : 23];
|
||||
else if (title === @"More visible items")
|
||||
[combo setNumberOfVisibleItems:state ? 10 : 5];
|
||||
}
|
||||
|
||||
- (void)comboNote:(CPNotification)aNote
|
||||
{
|
||||
console.log([aNote name]);
|
||||
|
||||
var object = [aNote object];
|
||||
|
||||
if ([aNote name] === CPComboBoxWillDismissNotification)
|
||||
console.log("Selected: %d - %s", [object indexOfSelectedItem], [object objectValueOfSelectedItem]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Main cib file base name</key>
|
||||
<string>MainMenu.cib</string>
|
||||
<key>CPBundleName</key>
|
||||
<string>CPComboBoxTest</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* test
|
||||
*
|
||||
* Created by aparajita on August 19, 2011.
|
||||
* Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os");
|
||||
|
||||
app ("test", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "test.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("test");
|
||||
task.setIdentifier("com.aparajita.test");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Victory-Heart Productions");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("test");
|
||||
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
|
||||
task.setResources(new FileList("Resources/**"));
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
task.setNib2CibFlags("-R Resources/");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
else
|
||||
task.setCompilerFlags("-O");
|
||||
});
|
||||
|
||||
task ("default", ["test"], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"]);
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", "test", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "test", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "test"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "test"), FILE.join("Build", "Deployment", "test")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "test"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "test"), FILE.join("Build", "Desktop", "test", "test.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "test", "test.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "test"));
|
||||
print("----------------------------");
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;4E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;7E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;9E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;2;10E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;2;11E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;2;12E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;2;13E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;2;14E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;16E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;18E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;34E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;55E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;E;E;S;16;IBCocoaFrameworkD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;1;0E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;31E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;15E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;65E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;17E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;66E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;2;67E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;2;68E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;2;69E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;2;70E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;2;71E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;2;34E;E;D;K;10;$classnameS;10;CPCheckBoxK;8;$classesA;S;10;CPCheckBoxS;8;CPButtonS;9;CPControlS;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;21E;K;27;CPResponderNextResponderKeyD;K;6;CP$UIDd;2;34E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;2;72E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;2;73E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;2;74E;K;18;CPViewSuperviewKeyD;K;6;CP$UIDd;2;34E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;2;75E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;2;76E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;2;77E;K;16;$aimage-positionD;K;6;CP$UIDd;2;78E;K;6;$afontD;K;6;CP$UIDd;2;80E;K;17;$aline-break-modeD;K;6;CP$UIDd;2;72E;K;11;$aalignmentD;K;6;CP$UIDd;2;72E;K;17;CPControlValueKeyD;K;6;CP$UIDd;2;81E;K;24;CPControlSendActionOnKeyD;K;6;CP$UIDd;2;82E;K;16;CPButtonTitleKeyD;K;6;CP$UIDd;2;83E;K;25;CPButtonAlternateTitleKeyD;K;6;CP$UIDd;1;0E;K;27;CPButtonAllowsMixedStateKeyD;K;6;CP$UIDd;2;84E;K;32;CPButtonImageDimsWhenDisabledKeyD;K;6;CP$UIDd;1;0E;K;24;CPButtonImagePositionKeyD;K;6;CP$UIDd;2;78E;K;Line truncated
|
||||
@@ -0,0 +1,756 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10K549</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1923</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.36</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1923</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSView</string>
|
||||
<string>NSComboBox</string>
|
||||
<string>NSWindowTemplate</string>
|
||||
<string>NSObjectController</string>
|
||||
<string>NSButtonCell</string>
|
||||
<string>NSComboBoxCell</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSCustomObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomObject" id="1021">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1014">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1050">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="635946545">
|
||||
<string key="NSClassName">AppController</string>
|
||||
</object>
|
||||
<object class="NSObjectController" id="412838899">
|
||||
<string key="NSObjectClassName">NSComboBox</string>
|
||||
<bool key="NSEditable">YES</bool>
|
||||
<object class="_NSManagedProxy" key="_NSManagedProxy"/>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="739395868">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{583, 886}, {394, 166}}</string>
|
||||
<int key="NSWTFlags">544735232</int>
|
||||
<string key="NSWindowTitle">CPComboBox (from cib)</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<object class="NSView" key="NSWindowView" id="177694051">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSComboBox" id="584113036">
|
||||
<reference key="NSNextResponder" ref="177694051"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{20, 115}, {191, 26}}</string>
|
||||
<reference key="NSSuperview" ref="177694051"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="288514536"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSComboBoxCell" key="NSCell" id="58512575">
|
||||
<int key="NSCellFlags">343014976</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport" id="64180879">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="584113036"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">textBackgroundColor</string>
|
||||
<object class="NSColor" key="NSColor" id="308779708">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="234844066">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<int key="NSVisibleItemCount">7</int>
|
||||
<bool key="NSHasVerticalScroller">YES</bool>
|
||||
<bool key="NSCompletes">YES</bool>
|
||||
<object class="NSMutableArray" key="NSPopUpListData">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>Moe</string>
|
||||
<string>Larry</string>
|
||||
<string>Cheese</string>
|
||||
<string>Curly</string>
|
||||
<string>Shemp</string>
|
||||
<string>Groucho</string>
|
||||
<string>Harpo</string>
|
||||
<string>Chico</string>
|
||||
<string>Zeppo</string>
|
||||
</object>
|
||||
<reference key="NSDelegate" ref="584113036"/>
|
||||
<object class="NSComboTableView" key="NSTableView" id="116006387">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrameSize">{13, 189}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSMutableArray" key="NSTableColumns">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSTableColumn">
|
||||
<double key="NSWidth">10</double>
|
||||
<double key="NSMinWidth">10</double>
|
||||
<double key="NSMaxWidth">1000</double>
|
||||
<object class="NSTableHeaderCell" key="NSHeaderCell">
|
||||
<int key="NSCellFlags">75628032</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">12</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
|
||||
</object>
|
||||
<reference key="NSTextColor" ref="308779708"/>
|
||||
</object>
|
||||
<object class="NSTextFieldCell" key="NSDataCell">
|
||||
<int key="NSCellFlags">338820672</int>
|
||||
<int key="NSCellFlags2">1024</int>
|
||||
<reference key="NSSupport" ref="64180879"/>
|
||||
<reference key="NSControlView" ref="116006387"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="729693961">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlBackgroundColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="NSTextColor" ref="234844066"/>
|
||||
</object>
|
||||
<int key="NSResizingMask">3</int>
|
||||
<bool key="NSIsResizeable">YES</bool>
|
||||
<reference key="NSTableView" ref="116006387"/>
|
||||
</object>
|
||||
</object>
|
||||
<double key="NSIntercellSpacingWidth">3</double>
|
||||
<double key="NSIntercellSpacingHeight">2</double>
|
||||
<reference key="NSBackgroundColor" ref="729693961"/>
|
||||
<object class="NSColor" key="NSGridColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">gridColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<double key="NSRowHeight">19</double>
|
||||
<string key="NSAction">tableViewAction:</string>
|
||||
<int key="NSTvFlags">-765427712</int>
|
||||
<reference key="NSDelegate" ref="58512575"/>
|
||||
<reference key="NSDataSource" ref="58512575"/>
|
||||
<reference key="NSTarget" ref="58512575"/>
|
||||
<int key="NSColumnAutoresizingStyle">1</int>
|
||||
<int key="NSDraggingSourceMaskForLocal">15</int>
|
||||
<int key="NSDraggingSourceMaskForNonLocal">0</int>
|
||||
<bool key="NSAllowsTypeSelect">YES</bool>
|
||||
<int key="NSTableViewDraggingDestinationStyle">0</int>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="288514536">
|
||||
<reference key="NSNextResponder" ref="177694051"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{247, 118}, {72, 18}}</string>
|
||||
<reference key="NSSuperview" ref="177694051"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="104434533"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="132463171">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Enabled</string>
|
||||
<reference key="NSSupport" ref="64180879"/>
|
||||
<reference key="NSControlView" ref="288514536"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<object class="NSCustomResource" key="NSNormalImage" id="887534559">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSSwitch</string>
|
||||
</object>
|
||||
<object class="NSButtonImageSource" key="NSAlternateImage" id="286406562">
|
||||
<string key="NSImageName">NSSwitch</string>
|
||||
</object>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="104434533">
|
||||
<reference key="NSNextResponder" ref="177694051"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{247, 93}, {125, 18}}</string>
|
||||
<reference key="NSSuperview" ref="177694051"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="121703403"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="299849276">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Button bordered</string>
|
||||
<reference key="NSSupport" ref="64180879"/>
|
||||
<reference key="NSControlView" ref="104434533"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="887534559"/>
|
||||
<reference key="NSAlternateImage" ref="286406562"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="121703403">
|
||||
<reference key="NSNextResponder" ref="177694051"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{247, 68}, {89, 18}}</string>
|
||||
<reference key="NSSuperview" ref="177694051"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="583065641"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="794409030">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Completes</string>
|
||||
<reference key="NSSupport" ref="64180879"/>
|
||||
<reference key="NSControlView" ref="121703403"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="887534559"/>
|
||||
<reference key="NSAlternateImage" ref="286406562"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="583065641">
|
||||
<reference key="NSNextResponder" ref="177694051"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{247, 43}, {117, 18}}</string>
|
||||
<reference key="NSSuperview" ref="177694051"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="493411239"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="933414996">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Force selection</string>
|
||||
<reference key="NSSupport" ref="64180879"/>
|
||||
<reference key="NSControlView" ref="583065641"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="887534559"/>
|
||||
<reference key="NSAlternateImage" ref="286406562"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="493411239">
|
||||
<reference key="NSNextResponder" ref="177694051"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{247, 18}, {129, 18}}</string>
|
||||
<reference key="NSSuperview" ref="177694051"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="626840863">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Vertical scrollbar</string>
|
||||
<reference key="NSSupport" ref="64180879"/>
|
||||
<reference key="NSControlView" ref="493411239"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="887534559"/>
|
||||
<reference key="NSAlternateImage" ref="286406562"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{394, 166}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="584113036"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSMaxSize">{1e+13, 1e+13}</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
</object>
|
||||
<int key="connectionID">451</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">theWindow</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="739395868"/>
|
||||
</object>
|
||||
<int key="connectionID">464</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">cibCombo</string>
|
||||
<reference key="source" ref="635946545"/>
|
||||
<reference key="destination" ref="584113036"/>
|
||||
</object>
|
||||
<int key="connectionID">529</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">enabled: selection</string>
|
||||
<reference key="source" ref="584113036"/>
|
||||
<reference key="destination" ref="412838899"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="584113036"/>
|
||||
<reference key="NSDestination" ref="412838899"/>
|
||||
<string key="NSLabel">enabled: selection</string>
|
||||
<string key="NSBinding">enabled</string>
|
||||
<string key="NSKeyPath">selection</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">522</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: cibCombo.enabled</string>
|
||||
<reference key="source" ref="288514536"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="288514536"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">value: cibCombo.enabled</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">cibCombo.enabled</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">531</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">contentObject: combo</string>
|
||||
<reference key="source" ref="412838899"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="412838899"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">contentObject: combo</string>
|
||||
<string key="NSBinding">contentObject</string>
|
||||
<string key="NSKeyPath">combo</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">521</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: cibCombo.completes</string>
|
||||
<reference key="source" ref="121703403"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="121703403"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">value: cibCombo.completes</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">cibCombo.completes</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">535</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: cibCombo.forceSelection</string>
|
||||
<reference key="source" ref="583065641"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="583065641"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">value: cibCombo.forceSelection</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">cibCombo.forceSelection</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">548</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: cibCombo.hasVerticalScroller</string>
|
||||
<reference key="source" ref="493411239"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="493411239"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">value: cibCombo.hasVerticalScroller</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">cibCombo.hasVerticalScroller</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">546</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: cibCombo.buttonBordered</string>
|
||||
<reference key="source" ref="104434533"/>
|
||||
<reference key="destination" ref="635946545"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="104434533"/>
|
||||
<reference key="NSDestination" ref="635946545"/>
|
||||
<string key="NSLabel">value: cibCombo.buttonBordered</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">cibCombo.buttonBordered</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">552</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1048"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1021"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1014"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1050"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">450</int>
|
||||
<reference key="object" ref="635946545"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">460</int>
|
||||
<reference key="object" ref="739395868"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="177694051"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">461</int>
|
||||
<reference key="object" ref="177694051"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="584113036"/>
|
||||
<reference ref="288514536"/>
|
||||
<reference ref="121703403"/>
|
||||
<reference ref="583065641"/>
|
||||
<reference ref="493411239"/>
|
||||
<reference ref="104434533"/>
|
||||
</object>
|
||||
<reference key="parent" ref="739395868"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">462</int>
|
||||
<reference key="object" ref="584113036"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="58512575"/>
|
||||
</object>
|
||||
<reference key="parent" ref="177694051"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">463</int>
|
||||
<reference key="object" ref="58512575"/>
|
||||
<reference key="parent" ref="584113036"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">515</int>
|
||||
<reference key="object" ref="288514536"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="132463171"/>
|
||||
</object>
|
||||
<reference key="parent" ref="177694051"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">516</int>
|
||||
<reference key="object" ref="132463171"/>
|
||||
<reference key="parent" ref="288514536"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">517</int>
|
||||
<reference key="object" ref="412838899"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">532</int>
|
||||
<reference key="object" ref="121703403"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="794409030"/>
|
||||
</object>
|
||||
<reference key="parent" ref="177694051"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">533</int>
|
||||
<reference key="object" ref="794409030"/>
|
||||
<reference key="parent" ref="121703403"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">536</int>
|
||||
<reference key="object" ref="583065641"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="933414996"/>
|
||||
</object>
|
||||
<reference key="parent" ref="177694051"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">537</int>
|
||||
<reference key="object" ref="933414996"/>
|
||||
<reference key="parent" ref="583065641"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">539</int>
|
||||
<reference key="object" ref="493411239"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="626840863"/>
|
||||
</object>
|
||||
<reference key="parent" ref="177694051"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">540</int>
|
||||
<reference key="object" ref="626840863"/>
|
||||
<reference key="parent" ref="493411239"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">549</int>
|
||||
<reference key="object" ref="104434533"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="299849276"/>
|
||||
</object>
|
||||
<reference key="parent" ref="177694051"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">550</int>
|
||||
<reference key="object" ref="299849276"/>
|
||||
<reference key="parent" ref="104434533"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>450.IBPluginDependency</string>
|
||||
<string>460.IBPluginDependency</string>
|
||||
<string>460.IBWindowTemplateEditedContentRect</string>
|
||||
<string>460.NSWindowTemplate.visibleAtLaunch</string>
|
||||
<string>461.IBPluginDependency</string>
|
||||
<string>462.IBPluginDependency</string>
|
||||
<string>463.IBComboBoxObjectValuesKey.objectValues</string>
|
||||
<string>463.IBPluginDependency</string>
|
||||
<string>515.IBPluginDependency</string>
|
||||
<string>516.IBPluginDependency</string>
|
||||
<string>517.IBPluginDependency</string>
|
||||
<string>532.IBPluginDependency</string>
|
||||
<string>533.IBPluginDependency</string>
|
||||
<string>536.IBPluginDependency</string>
|
||||
<string>537.IBPluginDependency</string>
|
||||
<string>539.IBPluginDependency</string>
|
||||
<string>540.IBPluginDependency</string>
|
||||
<string>549.IBPluginDependency</string>
|
||||
<string>550.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{357, 418}, {480, 270}}</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSArray">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>Moe</string>
|
||||
<string>Larry</string>
|
||||
<string>Cheese</string>
|
||||
<string>Curly</string>
|
||||
<string>Shemp</string>
|
||||
<string>Groucho</string>
|
||||
<string>Harpo</string>
|
||||
<string>Chico</string>
|
||||
<string>Zeppo</string>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">552</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">AppController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>cibCombo</string>
|
||||
<string>theWindow</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSComboBox</string>
|
||||
<string>NSWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>cibCombo</string>
|
||||
<string>theWindow</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">cibCombo</string>
|
||||
<string key="candidateClassName">NSComboBox</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">theWindow</string>
|
||||
<string key="candidateClassName">NSWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/AppController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<string key="NS.key.0">NSSwitch</string>
|
||||
<string key="NS.object.0">{15, 15}</string>
|
||||
</object>
|
||||
</data>
|
||||
</archive>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CPComboBoxTest
|
||||
|
||||
Created by aparajita on August 8, 2011.
|
||||
Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>CPComboBoxTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||
</script>
|
||||
|
||||
<script src="Frameworks/Debug/Objective-J/Objective-J.js" type="text/javascript" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
|
||||
// Uncomment to enable runtime type checking:
|
||||
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||
|
||||
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||
//objj_typecheck_prints_backtrace = true;
|
||||
|
||||
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||
//CPLogUnregister(CPLogDefault);
|
||||
|
||||
// Uncomment to enable a specific logger:
|
||||
//CPLogRegister(CPLogConsole);
|
||||
//CPLogRegister(CPLogPopup);
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPComboBoxTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CPComboBoxTest
|
||||
|
||||
Created by aparajita on August 8, 2011.
|
||||
Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1" />
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png" />
|
||||
|
||||
<title>CPComboBoxTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading CPComboBoxTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* test
|
||||
*
|
||||
* Created by aparajita on August 19, 2011.
|
||||
* Copyright 2011, Victory-Heart Productions All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
@import "NSColorWell.j"
|
||||
@import "NSCollectionView.j"
|
||||
@import "NSCollectionViewItem.j"
|
||||
@import "NSComboBox.j"
|
||||
@import "NSControl.j"
|
||||
@import "NSCustomObject.j"
|
||||
@import "NSCustomResource.j"
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* NSComboBox.j
|
||||
* nib2cib
|
||||
*
|
||||
* Created by Aparajita Fishman.
|
||||
* Copyright (c) 2011, Intalio, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <AppKit/CPTextField.j>
|
||||
|
||||
@import "NSTextField.j"
|
||||
|
||||
|
||||
@implementation CPComboBox (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super NS_initWithCoder:aCoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
var cell = [aCoder decodeObjectForKey:@"NSCell"];
|
||||
|
||||
_items = [cell itemList];
|
||||
_usesDataSource = [cell usesDataSource];
|
||||
_completes = [cell completes];
|
||||
_numberOfVisibleItems = [cell visibleItemCount];
|
||||
_hasVerticalScroller = [cell hasVerticalScroller];
|
||||
[self setButtonBordered:[cell borderedButton]];
|
||||
|
||||
// Make sure the height is clipped to the max given by the theme
|
||||
var maxSize = [[[Converter sharedConverter] themes][0] valueForAttributeWithName:@"max-size" forClass:[CPComboBox class]],
|
||||
size = [self frameSize];
|
||||
|
||||
[self setFrameSize:CGSizeMake(size.width, MIN(size.height, maxSize.height))];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSComboBox : CPComboBox
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
return [self NS_initWithCoder:aCoder];
|
||||
}
|
||||
|
||||
- (Class)classForKeyedArchiver
|
||||
{
|
||||
return [CPComboBox class];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSComboBoxCell : NSTextFieldCell
|
||||
{
|
||||
int _visibleItemCount @accessors(readonly, getter=visibleItemCount);
|
||||
BOOL _hasVerticalScroller @accessors(readonly, getter=hasVerticalScroller);
|
||||
BOOL _usesDataSource @accessors(readonly, getter=usesDataSource);
|
||||
BOOL _completes @accessors(readonly, getter=completes);
|
||||
CPArray _itemList @accessors(readonly, getter=itemList);
|
||||
BOOL _borderedButton @accessors(readonly, getter=borderedButton);
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
self = [super initWithCoder:aCoder];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_visibleItemCount = [aCoder decodeIntForKey:@"NSVisibleItemCount"];
|
||||
_hasVerticalScroller = [aCoder decodeBoolForKey:@"NSHasVerticalScroller"];
|
||||
_usesDataSource = [aCoder decodeBoolForKey:@"NSUsesDataSource"];
|
||||
_completes = [aCoder decodeBoolForKey:@"NSCompletes"];
|
||||
|
||||
if (!_usesDataSource)
|
||||
_itemList = [aCoder decodeObjectForKey:@"NSPopUpListData"];
|
||||
else
|
||||
_itemList = [];
|
||||
|
||||
// NSButtonBordered key is present only if the value is NO, go figure
|
||||
_borderedButton = [aCoder containsValueForKey:@"NSButtonBordered"] ? [aCoder decodeBoolForKey:@"NSButtonBordered"] : YES;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||