BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / translators / stxt / STXTView.cpp
bloba51114b34f4362b1cc11932c132388a43f48a1fb
1 /*
2 * Copyright 2002-2011, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Michael Wilber
7 * Axel Dörfler, axeld@pinc-software.de
8 */
10 /*! A view with information about the STXTTranslator. */
13 #include "STXTView.h"
14 #include "STXTTranslator.h"
16 #include <Catalog.h>
17 #include <LayoutBuilder.h>
18 #include <StringView.h>
20 #include <stdio.h>
23 #undef B_TRANSLATION_CONTEXT
24 #define B_TRANSLATION_CONTEXT "STXTView"
27 STXTView::STXTView(const BRect &frame, const char *name, uint32 resizeMode,
28 uint32 flags, TranslatorSettings *settings)
29 : BView(frame, name, resizeMode, flags)
31 fSettings = settings;
32 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
34 BStringView *titleView = new BStringView("title",
35 B_TRANSLATE("StyledEdit file translator"));
36 titleView->SetFont(be_bold_font);
38 char version[256];
39 snprintf(version, sizeof(version), "Version %d.%d.%d, %s",
40 int(B_TRANSLATION_MAJOR_VERSION(STXT_TRANSLATOR_VERSION)),
41 int(B_TRANSLATION_MINOR_VERSION(STXT_TRANSLATOR_VERSION)),
42 int(B_TRANSLATION_REVISION_VERSION(STXT_TRANSLATOR_VERSION)),
43 __DATE__);
44 BStringView *versionView = new BStringView("version", version);
45 BStringView *copyrightView = new BStringView("Copyright",
46 B_UTF8_COPYRIGHT "2002-2006 Haiku Inc.");
48 BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
49 .SetInsets(B_USE_DEFAULT_SPACING)
50 .Add(titleView)
51 .Add(versionView)
52 .Add(copyrightView)
53 .AddGlue();
57 STXTView::~STXTView()
59 fSettings->Release();