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;
Messages = (
(initWithBounds:title::, $rect, "\"Fullscreen\"", $toggle)
(initWithBounds:title::, $rect, "\"Fullscreen\"", $toggle),
);
rect = "[70, 60, 224, 8]";
toggle = {
@ -54,25 +54,32 @@
};
},
{
Class = Text;
Class = ProxyView;
Messages = (
(initWithBounds:, $rect),
(setText:, "\"Crosshair\"")
(initWithBounds:title:view:, $rect, $title, $view),
);
rect = "[70, 70, 224, 8]";
},
{
Class = CrosshairView;
crosshair = {
Class = CrosshairCvar;
title = {
Class = Text;
Messages = (
(initWithCvar:, "\"crosshair\"")
(initWithBounds:, $rect),
(setText:, "\"Crosshair\"")
);
rect = "[0, 0, 224, 8]";
};
view = {
Class = CrosshairView;
crosshair = {
Class = CrosshairCvar;
Messages = (
(initWithCvar:, "\"crosshair\"")
);
};
rect = "[186, -3, 14, 14]";
Messages = (
(initWithBounds::, $rect, $crosshair)
);
};
rect = "[256, 67, 14, 14]";
Messages = (
(initWithBounds::, $rect, $crosshair)
);
},
{
Class = CvarToggleView;

View File

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

View File

@ -428,15 +428,16 @@
}
}
@end
void traceon () = #0;
@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)
return self;
title = aTitle;
view = aView;
return self;
}
@ -446,6 +447,21 @@
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
/*