source: gs2-extensions/iOs-3.x/trunk/Classes/QueryCascadeView.mm@ 22603

Last change on this file since 22603 was 22603, checked in by davidb, 14 years ago

Initial cut as iOs 3.x version of Greenstone2.app

File size: 1.8 KB
Line 
1
2#import "GSResultItem.h"
3#import "GreenstoneApplication.h"
4
5#import "QueryCascadeView.h"
6
7
8@implementation QueryCascadeView
9
10
11-(id) initWithFrame:(CGRect)rect withParent:(UIView*)parent
12 withCollection:(NSString*)collection withTitle:(NSString*)title withGID:(NSString*)gid
13{
14 _queryViews = [[NSMutableArray alloc] initWithCapacity:MCInitCapacity];
15
16 return [super initWithFrame:rect withParent:parent withCollection:collection
17 withTitle:title withGID:gid];
18}
19
20-(void) appendMenuItem:(NSObject*)app withItem:(NSString*)item_label withGID:(NSString*)childGID
21{
22 [super appendMenuItem:app withItem:item_label withGID:childGID];
23
24 CGRect workarea_rect = [GreenstoneApplication workAreaRect];
25 QueryView* queryView = [[QueryView alloc] initWithFrame:workarea_rect
26 withParent:self withCollection:childGID withTitle:item_label];
27
28 [_queryViews addObject:queryView];
29
30}
31
32-(void) tableRowSelected:(NSNotification*)notification
33{
34 UITable* table = [notification object];
35 int rowId = [table selectedRow];
36
37 GreenstoneAPI* greenstoneAPI = [GreenstoneApplication greenstoneAPI];
38
39 NSString* childTitle = [[_oidItem objectAtIndex:rowId] title];
40 NSString* childGID = [[_oidItem objectAtIndex:rowId] oid];
41
42 NSString* chosenCollection = [[NSString alloc] initWithString:childGID];
43
44 CGRect workarea_rect = [GreenstoneApplication workAreaRect];
45 QueryView* queryView = [_queryViews objectAtIndex:rowId];
46
47 [GreenstoneApplication setInCollection:chosenCollection];
48 [GreenstoneApplication transitionView:UITransitionBothShiftLeft
49 fromView:self toView:queryView];
50}
51
52-(UIView*) directEntry:(int)rowId
53{
54 return [_queryViews objectAtIndex:rowId];
55}
56
57-(void) dealloc
58{
59 [_queryViews release];
60
61 [super dealloc];
62}
63
64
65@end
Note: See TracBrowser for help on using the repository browser.