This is ErrorInspector.m in view mode; [Download] [Up]
// Copyright H. Giesen, University of Koblenz-Landau 1996
#import "Controller.h"
#import "ErrorInspector.h"
#import "BibTexParser.h"
#import "Preferences.h"
id itsMe = NULL;
@implementation ErrorInspector
+ new
{
if( itsMe==NULL ){
itsMe = [[super alloc] init];
}
return itsMe;
}
+ alloc
{
return [self notImplemented:_cmd];
}
// returns -2 : abort
// returns -1 : skip
// returns >0 : valid index in entryPopUpList
- (int) setError:(char *)errText inLine:(int)nr for:obj
{
int rtn;
char localBuffer[256];
if( entryErrorPanel==NULL ){
int index;
[NXApp loadNibSection:"EntryError.nib" owner:self];
[entryErrorPanel setWorksWhenModal:YES];
entryPopUpList = [[PopUpList alloc] init];
preferences = [Preferences new];
entryNameList = [preferences entryNameList];
for( index=0; index<[entryNameList count]; index++ ){
[entryPopUpList addItem:
(const char *)[entryNameList objectAt:index]];
}
NXAttachPopUpList( entryButton, entryPopUpList );
[entryPopUpList sizeButton:entryButton];
}
sprintf( localBuffer, "wrong entryname found in line %d", nr );
[wrongTextLine setStringValue:localBuffer];
[wrongText setStringValue:errText];
[entryErrorPanel center];
[entryErrorPanel orderFront:self];
[self center];
if( (rtn=[NXApp runModalFor:entryErrorPanel])<0) return rtn;
return [entryPopUpList indexOfItem:[entryButton title]];
}
// buttons from errorPanel
- entryCancelButton:sender
{
[NXApp stopModal:-1];
[entryErrorPanel close];
return self;
}
- entryStopButton:sender
{
[NXApp stopModal:-2];
[entryErrorPanel close];
return self;
}
- entryOkButton:sender
{
[NXApp stopModal:1];
[entryErrorPanel close];
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.