1 /* 2 * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "ConfigView.h" 8 #include "RTFTranslator.h" 9 10 #include <Catalog.h> 11 #include <LayoutBuilder.h> 12 #include <StringView.h> 13 14 #include <stdio.h> 15 16 #undef B_TRANSLATION_CONTEXT 17 #define B_TRANSLATION_CONTEXT "ConfigView" 18 19 20 ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags) 21 : BView(frame, B_TRANSLATE("RTF-Translator Settings"), resize, flags) 22 { 23 SetViewUIColor(B_PANEL_BACKGROUND_COLOR); 24 25 BStringView *titleView = new BStringView("title", 26 B_TRANSLATE("Rich Text Format (RTF) translator")); 27 titleView->SetFont(be_bold_font); 28 29 30 char version[256]; 31 snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"), 32 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)), 33 static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)), 34 static_cast<int>(B_TRANSLATION_REVISION_VERSION( 35 RTF_TRANSLATOR_VERSION)), __DATE__); 36 BStringView *versionView = new BStringView("version", version); 37 BStringView *copyrightView = new BStringView( 38 "Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc."); 39 BLayoutBuilder::Group<>(this, B_VERTICAL, 0) 40 .SetInsets(B_USE_DEFAULT_SPACING) 41 .Add(titleView) 42 .Add(versionView) 43 .Add(copyrightView) 44 .AddGlue(); 45 } 46 47 48 ConfigView::~ConfigView() 49 { 50 } 51 52