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 <Catalog.h> 12 #include <StringView.h> 13 #include <CheckBox.h> 14 15 #include <stdio.h> 16 #include <string.h> 17 18 19 #undef B_TRANSLATE_CONTEXT 20 #define B_TRANSLATE_CONTEXT "ConfigView" 21 22 23 ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags) 24 : BView(frame, B_TRANSLATE("PCXTranslator Settings"), resize, flags) 25 { 26 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 27 28 font_height fontHeight; 29 be_bold_font->GetHeight(&fontHeight); 30 float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 31 32 BRect rect(10, 10, 200, 10 + height); 33 BStringView *stringView = new BStringView(rect, "title", 34 B_TRANSLATE("PCX images")); 35 stringView->SetFont(be_bold_font); 36 stringView->ResizeToPreferred(); 37 AddChild(stringView); 38 39 rect.OffsetBy(0, height + 10); 40 char version[256]; 41 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), 42 int(B_TRANSLATION_MAJOR_VERSION(PCX_TRANSLATOR_VERSION)), 43 int(B_TRANSLATION_MINOR_VERSION(PCX_TRANSLATOR_VERSION)), 44 int(B_TRANSLATION_REVISION_VERSION(PCX_TRANSLATOR_VERSION)), 45 __DATE__); 46 stringView = new BStringView(rect, "version", version); 47 stringView->ResizeToPreferred(); 48 AddChild(stringView); 49 50 GetFontHeight(&fontHeight); 51 height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 52 53 rect.OffsetBy(0, height + 5); 54 stringView = new BStringView(rect, "copyright", B_UTF8_COPYRIGHT "2008 Haiku Inc."); 55 stringView->ResizeToPreferred(); 56 AddChild(stringView); 57 } 58 59 60 ConfigView::~ConfigView() 61 { 62 } 63 64