19949213aSStephan Aßmus /*
24316cb15SAxel Dörfler * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
39949213aSStephan Aßmus * Distributed under the terms of the MIT License.
49949213aSStephan Aßmus */
59949213aSStephan Aßmus
69949213aSStephan Aßmus
79949213aSStephan Aßmus #include "ConfigView.h"
89949213aSStephan Aßmus #include "RTFTranslator.h"
99949213aSStephan Aßmus
1070d59669SSiarzhuk Zharski #include <Catalog.h>
11b70b9a38SJanus #include <LayoutBuilder.h>
129949213aSStephan Aßmus #include <StringView.h>
139949213aSStephan Aßmus
149949213aSStephan Aßmus #include <stdio.h>
159949213aSStephan Aßmus
16546208a5SOliver Tappe #undef B_TRANSLATION_CONTEXT
17546208a5SOliver Tappe #define B_TRANSLATION_CONTEXT "ConfigView"
1870d59669SSiarzhuk Zharski
199949213aSStephan Aßmus
ConfigView(const BRect & frame,uint32 resize,uint32 flags)209949213aSStephan Aßmus ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
2170d59669SSiarzhuk Zharski : BView(frame, B_TRANSLATE("RTF-Translator Settings"), resize, flags)
229949213aSStephan Aßmus {
23*f0650dc9Slooncraz SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
249949213aSStephan Aßmus
25b70b9a38SJanus BStringView *titleView = new BStringView("title",
26e8eb40f7SHumdinger B_TRANSLATE("Rich Text Format (RTF) translator"));
27b70b9a38SJanus titleView->SetFont(be_bold_font);
289949213aSStephan Aßmus
294316cb15SAxel Dörfler
309949213aSStephan Aßmus char version[256];
3170d59669SSiarzhuk Zharski snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"),
3270d59669SSiarzhuk Zharski static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),
3370d59669SSiarzhuk Zharski static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),
3470d59669SSiarzhuk Zharski static_cast<int>(B_TRANSLATION_REVISION_VERSION(
3570d59669SSiarzhuk Zharski RTF_TRANSLATOR_VERSION)), __DATE__);
36b70b9a38SJanus BStringView *versionView = new BStringView("version", version);
37b70b9a38SJanus BStringView *copyrightView = new BStringView(
3870d59669SSiarzhuk Zharski "Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc.");
39b70b9a38SJanus BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
40b70b9a38SJanus .SetInsets(B_USE_DEFAULT_SPACING)
41b70b9a38SJanus .Add(titleView)
42b70b9a38SJanus .Add(versionView)
43b70b9a38SJanus .Add(copyrightView)
44b70b9a38SJanus .AddGlue();
459949213aSStephan Aßmus }
469949213aSStephan Aßmus
479949213aSStephan Aßmus
~ConfigView()489949213aSStephan Aßmus ConfigView::~ConfigView()
499949213aSStephan Aßmus {
509949213aSStephan Aßmus }
519949213aSStephan Aßmus
52