home *** CD-ROM | disk | FTP | other *** search
-
- /* InspectorManager.m
- created by Robert Vasvari - July 1994
- */
-
- #import "InspectorManager.h"
- #import "MenuController.h"
- #import "ClockView.h"
- #import "AdjFontTextField.h"
- #import "Document.h"
-
- @implementation InspectorManager
-
- - awakeFromNib
- {
- [super awakeFromNib];
- /* set up the textfields */
- [nameText setFontString:"Helvetica"];
- [nameText setAttributes:4 :8
- align:NX_CENTERED
- lines:1];
- [pathText setFontString:"Helvetica"];
- [pathText setAttributes:0 :4
- align:NX_LEFTALIGNED
- lines:2];
- [panel setDocEdited:NO];
-
- return self;
- }
-
- - updateInspector:sender
- {
- id doc=[[NXApp delegate] currentDoc];
-
- //printf("in updateInspector\n");
- if(!doc)
- { name=NULL;
- path=NULL;
- cTime=0;
- mTime=0;
- return self;
- }
-
- /* lets get info from the current document */
- [doc getInspectorData:&name :&path :&tag :&cTime :&mTime];
-
- return self;
- }
-
- - loadDataFor:(int)boxTag
- {
- /* this method loads the data into the currently selected
- screen.
- */
- switch(boxTag)
- { case 0:
- [nameText setStringValue:name];
- [pathText setStringValue:path];
- [createClock setLongValue:cTime];
- [modifyClock setLongValue:mTime];
- [tagText setIntValue:tag];
- [panel setTitle:"Screen 1 Inspector"];
-
- break;
- case 1:
- [panel setTitle:"Screen 2 Inspector"];
- break;
- default:fprintf(stderr,"loadDataFor: bad boxTag:%d\n",boxTag);
- }
- return self;
- }
-
- - getPanelWithScreen:(int)index
- { /* this needed to be overridden to make sure
- updateInspector gets called
- */
- [panel disableFlushWindow];
- [panel disableDisplay];
- [self updateInspector:nil];
- [super getPanelWithScreen:index];
- [panel reenableDisplay];
- [panel display];
- [panel reenableFlushWindow];
- [panel flushWindow];
- return self;
- }
-
- - windowDidUpdate:sender
- {
- //printf("in Inspector windowDidUpdate\n");
- [panel disableFlushWindow];
- [panel disableDisplay];
- if([panel isVisible]) [self updateInspector:nil];
-
- /* this will call loadData */
- [super windowDidUpdate:sender];
- [panel reenableDisplay];
- [panel display];
- [panel reenableFlushWindow];
- [panel flushWindow];
- return self;
- }
-
- @end
-
-