finish ProxyView and get crosshair toggle working properly in the video

options menu.
This commit is contained in:
Bill Currie 2005-04-24 15:26:30 +00:00
parent 10232acdfe
commit a35c33b397
3 changed files with 42 additions and 18 deletions

View File

@ -43,7 +43,7 @@
{ {
Class = CvarToggleView; Class = CvarToggleView;
Messages = ( Messages = (
(initWithBounds:title::, $rect, "\"Fullscreen\"", $toggle) (initWithBounds:title::, $rect, "\"Fullscreen\"", $toggle),
); );
rect = "[70, 60, 224, 8]"; rect = "[70, 60, 224, 8]";
toggle = { toggle = {
@ -54,14 +54,20 @@
}; };
}, },
{ {
Class = ProxyView;
Messages = (
(initWithBounds:title:view:, $rect, $title, $view),
);
rect = "[70, 70, 224, 8]";
title = {
Class = Text; Class = Text;
Messages = ( Messages = (
(initWithBounds:, $rect), (initWithBounds:, $rect),
(setText:, "\"Crosshair\"") (setText:, "\"Crosshair\"")
); );
rect = "[70, 70, 224, 8]"; rect = "[0, 0, 224, 8]";
}, };
{ view = {
Class = CrosshairView; Class = CrosshairView;
crosshair = { crosshair = {
Class = CrosshairCvar; Class = CrosshairCvar;
@ -69,10 +75,11 @@
(initWithCvar:, "\"crosshair\"") (initWithCvar:, "\"crosshair\"")
); );
}; };
rect = "[256, 67, 14, 14]"; rect = "[186, -3, 14, 14]";
Messages = ( Messages = (
(initWithBounds::, $rect, $crosshair) (initWithBounds::, $rect, $crosshair)
); );
};
}, },
{ {
Class = CvarToggleView; Class = CvarToggleView;

View File

@ -95,9 +95,10 @@
@interface ProxyView : View @interface ProxyView : View
{ {
View title;
View view; View view;
} }
-(id)initWithBounds:(Rect)aRect title:(string)_title view:(View)aView; -(id)initWithBounds:(Rect)aRect title:(View)aTitle view:(View)aView;
@end @end

View File

@ -428,15 +428,16 @@
} }
} }
@end @end
void traceon () = #0;
@implementation ProxyView @implementation ProxyView
-(id)initWithBounds:(Rect)aRect title:(string)_title view:(View)aView -(id)initWithBounds:(Rect)aRect title:(View)aTitle view:(View)aView
{ {
self = [super initWidthBounds:aRect text:_title]; self = [super initWithBounds:aRect];
if (!self) if (!self)
return self; return self;
title = aTitle;
view = aView; view = aView;
return self; return self;
} }
@ -446,6 +447,21 @@
return [view keyEvent:key unicode:unicode down:down]; return [view keyEvent:key unicode:unicode down:down];
} }
- (void) draw
{
[title draw];
[view draw];
}
- (void) setBasePos: (Point) pos
{
[super setBasePos:pos];
local Point point = [[Point alloc] initWithComponents:xabs :yabs];
[title setBasePos:point];
[view setBasePos:point];
[point release];
}
@end @end
/* /*