Forge: InspectorControl and KeypairView compile with no warnings now.

This commit is contained in:
Jeff Teunissen 2001-03-16 19:19:24 +00:00
parent cc85f21430
commit ed2f2ce2ca
4 changed files with 55 additions and 58 deletions

View file

@ -59,10 +59,10 @@ extern id inspcontrol_i;
id itemHelp_i; // docs
}
- awakeFromNib;
- changeInspector:sender;
- changeInspectorTo:(insp_e)which;
- (insp_e)getCurrentInspector;
- (id) awakeFromNib;
- (void) changeInspector: (id) sender;
- (void) changeInspectorTo: (insp_e) which;
- (insp_e) currentInspector;
@end

View file

@ -5,7 +5,7 @@ extern id keypairview_i;
{
}
- calcViewSize;
- (void) calcViewSize;
#define SPACING 4
#define FONTSIZE 12

View file

@ -10,7 +10,7 @@ id inspcontrol_i;
@implementation InspectorControl
- awakeFromNib
- (id) awakeFromNib
{
inspcontrol_i = self;
@ -65,7 +65,7 @@ id inspcontrol_i;
[inspectorView_i addSubview: inspectorSubview_i];
currentInspectorType = -1;
[self changeInspectorTo:i_project];
[self changeInspectorTo: i_project];
return self;
}
@ -75,19 +75,19 @@ id inspcontrol_i;
// Sent by the PopUpList in the Inspector
// Each cell in the PopUpList must have the correct tag
//
- changeInspector:sender
- (void) changeInspector: (id) sender
{
id cell;
cell = [sender selectedCell];
[self changeInspectorTo:[cell tag]];
return self;
[self changeInspectorTo: [cell tag]];
return;
}
//
// Change to specific Inspector
//
- changeInspectorTo:(insp_e)which
- (void) changeInspectorTo: (insp_e) which
{
id newView;
NSRect r;
@ -95,7 +95,7 @@ id inspcontrol_i;
NSRect f;
if (which == currentInspectorType)
return self;
return;
currentInspectorType = which;
newView = [contentList objectAtIndex: which];
@ -118,10 +118,10 @@ id inspcontrol_i;
[inspectorSubview_i unlockFocus];
[inspectorView_i display];
return self;
return;
}
- (insp_e)getCurrentInspector
- (insp_e) currentInspector
{
return currentInspectorType;
}

View file

@ -10,87 +10,84 @@ id keypairview_i;
initFrame:
==================
*/
- initFrame:(const NXRect *)frameRect
- (id) initWithFrame: (NSRect) frameRect
{
[super initFrame:frameRect];
[super initWithFrame: frameRect];
keypairview_i = self;
return self;
}
- calcViewSize
- (void) calcViewSize
{
NXCoord w;
NXCoord h;
NXRect b;
NXPoint pt;
int count;
id ent;
ent = [map_i currentEntity];
count = [ent numPairs];
NSRect b = [[self superview] bounds];
NSRect newFrame;
NSPoint pt;
id ent = [map_i currentEntity];
int count = [ent numPairs];
[superview setFlipped: YES];
// [[self superview] setFlipped: YES];
newFrame = b;
newFrame.size.height = LINEHEIGHT * count + SPACING;
[[self superview] setNeedsDisplayInRect: newFrame];
[self setFrame: newFrame];
[self setNeedsDisplay: YES];
[superview getBounds:&b];
w = b.size.width;
h = LINEHEIGHT*count + SPACING;
[self sizeTo:w :h];
pt.x = pt.y = 0;
[self scrollPoint: &pt];
return self;
[self scrollPoint: pt];
return;
}
- drawSelf:(const NXRect *)rects :(int)rectCount
- (void) drawSelf: (NSRect) aRect
{
epair_t *pair;
int y;
PSsetgray(NXGrayComponent(NX_COLORLTGRAY));
PSrectfill(0,0,bounds.size.width,bounds.size.height);
PSsetgray (NSLightGray);
NSRectFill (aRect);
PSselectfont("Helvetica-Bold",FONTSIZE);
PSrotate(0);
PSsetgray(0);
PSselectfont ("Helvetica-Bold", FONTSIZE);
PSrotate (0);
PSsetgray (0);
pair = [[map_i currentEntity] epairs];
y = bounds.size.height - LINEHEIGHT;
for ( ; pair ; pair=pair->next)
{
PSmoveto(SPACING, y);
PSshow(pair->key);
PSmoveto(100, y);
PSshow(pair->value);
y = [self bounds].size.height - LINEHEIGHT;
for (; pair; pair = pair->next) {
PSmoveto (SPACING, y);
PSshow (pair->key);
PSmoveto (100, y);
PSshow (pair->value);
y -= LINEHEIGHT;
}
PSstroke();
PSstroke ();
return self;
return;
}
- mouseDown:(NXEvent *)theEvent
- (void) mouseDown: (NSEvent *) theEvent
{
NXPoint loc;
NSPoint loc = [theEvent locationInWindow];
NSRect bounds = [self bounds];
int i;
epair_t *p;
loc = theEvent->location;
[self convertPoint:&loc fromView:NULL];
[self convertPoint: loc fromView: NULL];
i = (bounds.size.height - loc.y - 4) / LINEHEIGHT;
p = [[map_i currentEntity] epairs];
while ( i )
{
p=p->next;
while ( i ) {
p = p->next;
if (!p)
return self;
return;
i--;
}
if (p)
[things_i setSelectedKey: p];
return self;
return;
}
@end