home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch ;
- access ;
- symbols ;
- locks ediger:1.4;
- comment @@;
-
-
- 1.4
- date 94.05.29.20.14.32; author ediger; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 94.05.29.14.59.51; author ediger; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 94.02.03.19.54.34; author ediger; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 93.12.19.13.02.54; author ediger; state Exp;
- branches ;
- next ;
-
-
- desc
- @NXApp's delegate object implementation for the MachOViewer app
- @
-
-
- 1.4
- log
- @help/explanation panel support
- @
- text
- @#import "Controller.h"
-
- @@implementation Controller
-
- /* $Log: Controller.m,v $
- Revision 1.3 94/05/29 14:59:51 ediger
- cleanup to eliminate compiler warning
-
- Revision 1.2 94/02/03 19:54:34 ediger
- cleanup of commented out code
-
- Revision 1.1 93/12/19 13:02:54 ediger
- Initial revision
-
- */
-
- static char rcsident[] = "$Id: Controller.m,v 1.3 94/05/29 14:59:51 ediger Exp Locker: ediger $";
-
- static BOOL
- fGetOpenPath(char *pcName, int iBufferLength, char *pcType)
- {
- BOOL fSuccess = NO;
- static char *ppcFileTypes[2] = {NULL, NULL};
- static id openPanel = Nil;
-
- assert(pcName != NULL);
-
- if (openPanel == Nil)
- openPanel = [OpenPanel new];
-
- assert(openPanel != Nil);
-
- if (pcType != NULL && *pcType != '\0')
- ppcFileTypes[0] = pcType;
-
- [NXApp setAutoupdate:NO];
-
- if ([openPanel runModalForTypes:ppcFileTypes])
- { const char *pcNameTmp = [openPanel filename];
- strncpy(pcName, pcNameTmp, iBufferLength);
- fSuccess = YES;
- }
-
- [NXApp setAutoupdate:YES];
-
- return fSuccess;
- }
-
-
- - init
- {
- infoPanel = Nil;
- return self;
- }
-
- - closeFile:sender
- {
- id oCurrentMainWindow;
-
- oCurrentMainWindow = [NXApp mainWindow];
- [oCurrentMainWindow close];
- [oCurrentMainWindow free];
-
- return self;
- }
-
- - openNewFile:sender
- {
- char pcPath[1024];
-
- if (fGetOpenPath(pcPath, 1024, NULL))
- { id p = [[Document alloc] init];
- [p openFileNamed:pcPath];
- [p show:self];
- }
-
- return self;
- }
-
- - showInfoPanel:sender
- {
- if (infoPanel == nil)
- if (![NXApp loadNibSection:"Info.nib" owner:self])
- return nil;
-
- [infoPanel makeKeyAndOrderFront:self];
- return self;
- }
-
- - showHelpPanel:sender
- {
- if (helpPanel == nil)
- if (![NXApp loadNibSection:"HelpPanel.nib" owner:self])
- return nil;
-
- [helpPanel makeKeyAndOrderFront:self];
- return self;
- }
-
-
- @@end
- @
-
-
- 1.3
- log
- @cleanup to eliminate compiler warning
- @
- text
- @d6 3
- d17 1
- a17 1
- static char rcsident[] = "$Id: Controller.m,v 1.2 94/02/03 19:54:34 ediger Exp Locker: ediger $";
- a52 1
- openFiles = [[List alloc] init];
- d87 10
- @
-
-
- 1.2
- log
- @cleanup of commented out code
- @
- text
- @d6 3
- d14 1
- a14 1
- static char rcsident[] = "$Id: Controller.m,v 1.1 93/12/19 13:02:54 ediger Exp Locker: ediger $";
- d36 1
- a36 1
- { char *pcNameTmp = [openPanel filename];
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d5 4
- a8 1
- /* $Log$
- d11 1
- a11 1
- static char rcsident[] = "$Id$";
- a67 1
- //printf("Should open \"%s\"\n", pcPath);
- d70 1
- a70 2
- } //else
- // printf("Shouldn't open any damn file\n");
- a76 1
- //printf("Controller -showInfoPanel:\n");
- @
-