1 /* 2 * Copyright 2008, Jérôme Duval, korli@users.berlios.de. All rights reserved. 3 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 4 * Distributed under the terms of the MIT License. 5 */ 6 7 8 #include "ConfigView.h" 9 #include "PCXTranslator.h" 10 11 #include <StringView.h> 12 #include <CheckBox.h> 13 14 #include <stdio.h> 15 #include <string.h> 16 17 18 ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags) 19 : BView(frame, "PCXTranslator Settings", resize, flags) 20 { 21 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 22 23 font_height fontHeight; 24 be_bold_font->GetHeight(&fontHeight); 25 float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 26 27 BRect rect(10, 10, 200, 10 + height); 28 BStringView *stringView = new BStringView(rect, "title", "PCX Images"); 29 stringView->SetFont(be_bold_font); 30 stringView->ResizeToPreferred(); 31 AddChild(stringView); 32 33 rect.OffsetBy(0, height + 10); 34 char version[256]; 35 sprintf(version, "Version %d.%d.%d, %s", 36 int(B_TRANSLATION_MAJOR_VERSION(PCX_TRANSLATOR_VERSION)), 37 int(B_TRANSLATION_MINOR_VERSION(PCX_TRANSLATOR_VERSION)), 38 int(B_TRANSLATION_REVISION_VERSION(PCX_TRANSLATOR_VERSION)), 39 __DATE__); 40 stringView = new BStringView(rect, "version", version); 41 stringView->ResizeToPreferred(); 42 AddChild(stringView); 43 44 GetFontHeight(&fontHeight); 45 height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 46 47 rect.OffsetBy(0, height + 5); 48 stringView = new BStringView(rect, "copyright", B_UTF8_COPYRIGHT "2008 Haiku Inc."); 49 stringView->ResizeToPreferred(); 50 AddChild(stringView); 51 } 52 53 54 ConfigView::~ConfigView() 55 { 56 } 57 58