diff --git a/PCLib/PCProjectBuilder.m b/PCLib/PCProjectBuilder.m index 91a46fd..26fde7a 100644 --- a/PCLib/PCProjectBuilder.m +++ b/PCLib/PCProjectBuilder.m @@ -83,7 +83,11 @@ [logOutput setEditable:NO]; [logOutput setSelectable:YES]; [logOutput setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; - [logOutput setBackgroundColor:[NSColor lightGrayColor]]; + //[logOutput setBackgroundColor:[NSColor lightGrayColor]]; + [logOutput setBackgroundColor:[NSColor colorWithDeviceRed:0.93 + green:0.77 + blue:0.46 + alpha:1.0]]; [[logOutput textContainer] setWidthTracksTextView:YES]; [[logOutput textContainer] setHeightTracksTextView:YES]; [logOutput setHorizontallyResizable: NO]; diff --git a/PCLib/PCProjectDebugger.h b/PCLib/PCProjectDebugger.h index a302ffb..a0480ec 100644 --- a/PCLib/PCProjectDebugger.h +++ b/PCLib/PCProjectDebugger.h @@ -32,6 +32,7 @@ @interface PCProjectDebugger : NSObject { NSBox *componentView; + NSPopUpButton *popup; NSButton *runButton; @@ -44,6 +45,8 @@ NSFileHandle *readHandle; NSFileHandle *errorReadHandle; NSTask *task; + + int debugTarget; } - (id)initWithProject:(PCProject *)aProject; @@ -51,6 +54,8 @@ - (NSView *)componentView; +- (void)popupChanged:(id)sender; + - (void)debug:(id)sender; - (void)run:(id)sender; diff --git a/PCLib/PCProjectDebugger.m b/PCLib/PCProjectDebugger.m index c025b87..686b8b7 100644 --- a/PCLib/PCProjectDebugger.m +++ b/PCLib/PCProjectDebugger.m @@ -38,6 +38,11 @@ #define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter] #endif +enum { + DEBUG_DEFAULT_TARGET = 1, + DEBUG_DEBUG_TARGET = 2 +}; + @interface PCProjectDebugger (CreateUI) - (void)_createComponentView; @@ -56,6 +61,7 @@ NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease]; id button; id textField; + NSBox *box; componentView = [[NSBox alloc] initWithFrame:NSMakeRect(-1,-1,562,248)]; [componentView setTitlePosition:NSNoTitle]; @@ -67,7 +73,7 @@ * */ - scrollView1 = [[NSScrollView alloc] initWithFrame:NSMakeRect (-1,0,562,40)]; + scrollView1 = [[NSScrollView alloc] initWithFrame:NSMakeRect (-1,0,562,46)]; [scrollView1 setHasHorizontalScroller: NO]; [scrollView1 setHasVerticalScroller: YES]; @@ -110,7 +116,7 @@ [scrollView2 setDocumentView:stdError]; - split = [[NSSplitView alloc] initWithFrame:NSMakeRect(-1,-1,562,136)]; + split = [[NSSplitView alloc] initWithFrame:NSMakeRect(-1,-1,562,152)]; [split setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [split addSubview: scrollView1]; [split addSubview: scrollView2]; @@ -124,7 +130,7 @@ /* */ - _w_frame = NSMakeRect(-1,144,120,60); + _w_frame = NSMakeRect(-1,160,120,60); matrix = [[NSMatrix alloc] initWithFrame: _w_frame mode: NSHighlightModeMatrix prototype: buttonCell @@ -156,6 +162,21 @@ [button setTitle:@"Debug"]; [button setAction:@selector(debug:)]; + box = [[NSBox alloc] initWithFrame:NSMakeRect(128,160,204,60)]; + [box setTitle:@"Launch Target"]; + [box setBorderType:NSBezelBorder]; + [box setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; + [componentView addSubview:box]; + RELEASE(box); + + popup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(8,6,172,21)]; + [popup addItemWithTitle:@"Default"]; + [popup addItemWithTitle:@"Debug"]; + [popup setTarget:self]; + [popup setAction:@selector(popupChanged:)]; + [box addSubview:popup]; + RELEASE(popup); + [componentView sizeToFit]; [split adjustSubviews]; } @@ -168,8 +189,11 @@ { NSAssert(aProject,@"No project specified!"); - if ((self = [super init])) { + if ((self = [super init])) + { currentProject = aProject; + debugTarget = DEBUG_DEFAULT_TARGET; + } return self; } @@ -196,6 +220,21 @@ return componentView; } +- (void)popupChanged:(id)sender +{ + switch ([sender indexOfSelectedItem]) + { + case 0: + debugTarget = DEBUG_DEFAULT_TARGET; + break; + case 1: + debugTarget = DEBUG_DEBUG_TARGET; + break; + default: + break; + } +} + - (void)debug:(id)sender { NSRunAlertPanel(@"Attention!",@"Integrated debugging is not yet available...",@"OK",nil,nil); @@ -227,19 +266,37 @@ */ if ([currentProject isKindOfClass:NSClassFromString(@"PCAppProject")] || - [currentProject isKindOfClass:NSClassFromString(@"PCGormProject")]) { - NSString *tname; + [currentProject isKindOfClass:NSClassFromString(@"PCGormProject")]) + { + NSString *tn; + NSString *pn = [currentProject projectName]; openPath = [NSString stringWithString:@"openapp"]; - tname = [[currentProject projectName] stringByAppendingPathExtension:@"app"]; - [args addObject:tname]; + + switch( debugTarget ) + { + case DEBUG_DEFAULT_TARGET: + tn = [pn stringByAppendingPathExtension:@"app"]; + break; + case DEBUG_DEBUG_TARGET: + tn = [pn stringByAppendingPathExtension:@"debug"]; + break; + default: + [NSException raise:@"PCInternalDevException" + format:@"Unknown build target!"]; + break; + } + [args addObject:tn]; } - else if ([currentProject isKindOfClass:NSClassFromString(@"PCToolProject")]) { + else if ([currentProject isKindOfClass:NSClassFromString(@"PCToolProject")]) + { openPath = [NSString stringWithString:@"opentool"]; [args addObject:[currentProject projectName]]; } - else { - [NSException raise:@"PCInternalDevException" format:@"Unknown executable project type!"]; + else + { + [NSException raise:@"PCInternalDevException" + format:@"Unknown executable project type!"]; return; }