//
//  InfoView.m
//  OminoGobo
//
//  Created by David Van Brink on 1/26/14.
//  Copyright (c) 2014 omino. All rights reserved.
//

#import "InfoView.h"
#import "Util.h"
#import "version.h"

@implementation InfoView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    NSString *infoNs = [Util readFileFromBundleDirectory:@"info.txt"];
    
    CGRect r = self.bounds;
    r = CGRectInset(r, 4, 4);
    UITextView *tv = [[UITextView alloc] initWithFrame:r];
    tv.editable = NO;
    tv.backgroundColor = uiColorGray(0.2);
    tv.textColor = uiColorGray(0.7);
    
    infoNs = [NSString stringWithFormat:infoNs,k_product_name,k_version_major,k_version_minor,k_version_date,k_version_build_number];
    tv.text = @"This is helpful information\n"
    "more helpful\n"
    "a more helpful\n"
    "aa more helpful\n"
    "aaa more helpful\n"
    "aaaa more helpful\n"
    "more helpful\n"
    "a more helpful\n"
    "aa more helpful\n"
    "aaa more helpful\n"
    "aaaa more helpful\n"
    "more helpful\n"
    "a more helpful\n"
    "aa more helpful\n"
    "aaa more helpful\n"
    "aaaa more helpful\n"
    "more helpful\n"
    "a more helpful\n"
    "aa more helpful\n"
    "aaa more helpful\n"
    "aaaa more helpful\n"
    "more helpful\n"
    "a more helpful\n"
    "aa more helpful\n"
    "aaa more helpful\n"
    "aaaa more helpful\n"
    ;
    
    tv.text = infoNs;
    [self addSubview:tv];
    return self;
}

- (void)omDrawRect:(CGRect)rect
{
    [self gSetFillColor:0x333333]; // 0.2
    [self gFillRect:rect];
}

@end
