
#import <MiscAppKit/MiscArrowButton.h>
#import <MiscAppKit/MiscGaugeView.h>
#import "MiscArrowButtonAndGaugeView.h"


@implementation MiscArrowButtonAndGaugeView

- (void) finishInstantiate
{
    NSFont* boldFont;
    NSRect textFieldFrame;
    NSRect rotatedFrame;
    NSColor* lightBlueColor;
    
    [super finishInstantiate];

    // Rotate part of the copyright text field and put it in the left corner.
    textFieldFrame = [rotatedText frame];
    // Switch the width and height to take into account the
    // rotation.
    rotatedFrame = NSMakeRect(0.0, 0.0, textFieldFrame.size.height, textFieldFrame.size.width);
    [rotatedText setFrame:rotatedFrame];

    // Do the actual rotation.
    [rotatedText rotateByAngle:90];
    [rotatedText setNeedsDisplay:YES];

    // Give the right arrow button a bold font and change it's
    // titles.
    boldFont = [NSFont boldSystemFontOfSize:12.0];
    [rightButton setFont:boldFont];
    [rightButton setTitle:@"Pick"];
    [rightButton setAlternateTitle:@"Me"];
    [rightButton setState:1];

    // Make the font for the numbers smaller since the
    // gauge is small.
    [rightGauge setFont:[NSFont systemFontOfSize:8.0]];
    [rightGauge setTitleFont:[NSFont systemFontOfSize:8.0]];
    
    // Change the appearance of the second gauge for a little
    // variety.
    [leftGauge setMinValue:0];
    [leftGauge setMaxValue:40];
    [leftGauge setFloatValue:15];
    [leftGauge setTickInterval:5];
    [leftGauge setTickRatio:0.55];
    [leftGauge setHandRatio:0.5];
    [leftGauge setTitlePosition:NSAtBottom];
    lightBlueColor = [NSColor colorWithCalibratedRed:0.0 green:0.5 blue:1.0 alpha:1.0];
    [leftGauge setGaugeColor:lightBlueColor];
    [leftGauge setTitle:@""];    
}

@end
