1/* 2 * Copyright 2007, Jérôme Duval. All rights reserved. 3 * Copyright 2005-2007, 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 "HPGSTranslator.h" 10 11#include <Catalog.h> 12#include <CheckBox.h> 13#include <StringView.h> 14 15#include <stdio.h> 16#include <string.h> 17 18#undef B_TRANSLATION_CONTEXT 19#define B_TRANSLATION_CONTEXT "ConfigView" 20 21 22ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags) 23 : BView(frame, B_TRANSLATE("HPGSTranslator Settings"), resize, flags) 24{ 25 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 26 27 font_height fontHeight; 28 be_bold_font->GetHeight(&fontHeight); 29 float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 30 31 BRect rect(10, 10, 200, 10 + height); 32 BStringView *stringView = new BStringView(rect, "title", 33 B_TRANSLATE("HPGS images")); 34 stringView->SetFont(be_bold_font); 35 stringView->ResizeToPreferred(); 36 AddChild(stringView); 37 38 rect.OffsetBy(0, height + 10); 39 char version[256]; 40 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), 41 int(B_TRANSLATION_MAJOR_VERSION(HPGS_TRANSLATOR_VERSION)), 42 int(B_TRANSLATION_MINOR_VERSION(HPGS_TRANSLATOR_VERSION)), 43 int(B_TRANSLATION_REVISION_VERSION(HPGS_TRANSLATOR_VERSION)), 44 __DATE__); 45 stringView = new BStringView(rect, "version", version); 46 stringView->ResizeToPreferred(); 47 AddChild(stringView); 48 49 GetFontHeight(&fontHeight); 50 height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 51 52 rect.OffsetBy(0, height + 5); 53 stringView = new BStringView(rect, "copyright", B_UTF8_COPYRIGHT 54 "2007 Haiku Inc."); 55 stringView->ResizeToPreferred(); 56 AddChild(stringView); 57 58 rect.OffsetBy(0, height + 10); 59 stringView = new BStringView(rect, "copyright2", B_TRANSLATE("Based on " 60 "HPGS (http://hpgs.berlios.de)")); 61 stringView->ResizeToPreferred(); 62 AddChild(stringView); 63 64 rect.OffsetBy(0, height + 5); 65 stringView = new BStringView(rect, "copyright3", B_UTF8_COPYRIGHT 66 "2004-2006 ev-i Informationstechnologie GmbH"); 67 stringView->ResizeToPreferred(); 68 AddChild(stringView); 69} 70 71 72ConfigView::~ConfigView() 73{ 74} 75 76