mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-12 01:38:59 +00:00
new: manual tests
This commit is contained in:
1 parent
f34cbbdf29
commit
7fad67484c
2 files changed
+38
No files matched your search
@@ -308,4 +308,17 @@ var rowHeights = [ ];
|
||||
return anItem.customHeight;
|
||||
}
|
||||
|
||||
- (CPString)outlineView:(CPOutlineView)anOutlineView toolTipForView:(CPView)aView rect:(CGRect)aRect tableColumn:(CPTableColumn)aTableColumn item:(id)anItem mouseLocation:(CGPoint)aPoint
|
||||
{
|
||||
if (anItem === nil)
|
||||
return nil;
|
||||
|
||||
var title = [anItem title],
|
||||
childCount = [[anItem children] count],
|
||||
childString = childCount === 1 ? @"1 child" : childCount + @" children";
|
||||
|
||||
// Dynamischer Tooltip basierend auf dem 'Menu' Objekt
|
||||
return [CPString stringWithFormat:@"Outline Node: %@\nContains: %@", title, childString];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -64,6 +64,9 @@ var AppControllerInstance = nil;
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
[[tableView tableColumns][0] setDataView:dataView];
|
||||
|
||||
// Set the delegate so we can test the new toolTip feature
|
||||
[tableView setDelegate:self];
|
||||
|
||||
rows = [
|
||||
[CPDictionary dictionaryWithJSObject:{ id:1, filename: "Jack.png", size:1327, uploading:NO, progress:0 }],
|
||||
@@ -88,6 +91,28 @@ var AppControllerInstance = nil;
|
||||
return !uploading;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Tool tip test
|
||||
// --------------------------------------------------------------------------------------
|
||||
- (CPString)tableView:(CPTableView)aTableView toolTipForView:(CPView)aView rect:(CGRect)aRect tableColumn:(CPTableColumn)aTableColumn row:(CPInteger)aRowIndex mouseLocation:(CGPoint)aPoint
|
||||
{
|
||||
// Make sure the row exists
|
||||
if (aRowIndex < 0 || aRowIndex >= [rows count])
|
||||
return nil;
|
||||
|
||||
var info =[rows objectAtIndex:aRowIndex],
|
||||
filename = [info valueForKey:@"filename"],
|
||||
isUploading =[info valueForKey:@"uploading"],
|
||||
progress = [info valueForKey:@"progress"];
|
||||
|
||||
// Provide a dynamic tooltip based on the state of the data in the row
|
||||
if (isUploading)
|
||||
return[CPString stringWithFormat:@"Uploading '%@' (%d%% complete)", filename, progress];
|
||||
|
||||
return[CPString stringWithFormat:@"File: %@\nStatus: Idle", filename];
|
||||
}
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
- (@action)start:(id)sender
|
||||
{
|
||||
// Note we use setUploading:YES instead of uploading = YES.
|
||||
|
||||
Reference in new issue
Block a user