BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / translators / bmp / BMPView.cpp
blobd6eeadc02323659ef497a873d3ef3df4b8c98bfe
1 /*
2 * Copyright 2002-2009, 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 BMPTranslator. */
13 #include "BMPView.h"
14 #include "BMPTranslator.h"
16 #include <Catalog.h>
17 #include <LayoutBuilder.h>
18 #include <StringView.h>
20 #include <stdio.h>
22 #undef B_TRANSLATION_CONTEXT
23 #define B_TRANSLATION_CONTEXT "BMPView"
26 BMPView::BMPView(const BRect &frame, const char *name, uint32 resizeMode,
27 uint32 flags, TranslatorSettings *settings)
28 : BView(frame, name, resizeMode, flags)
30 fSettings = settings;
31 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
33 BStringView *titleView = new BStringView("title",
34 B_TRANSLATE("BMP image translator"));
35 titleView->SetFont(be_bold_font);
37 char version[256];
38 snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"),
39 int(B_TRANSLATION_MAJOR_VERSION(BMP_TRANSLATOR_VERSION)),
40 int(B_TRANSLATION_MINOR_VERSION(BMP_TRANSLATOR_VERSION)),
41 int(B_TRANSLATION_REVISION_VERSION(BMP_TRANSLATOR_VERSION)),
42 __DATE__);
43 BStringView *versionView = new BStringView("version", version);
44 BStringView *copyrightView = new BStringView("Copyright", B_UTF8_COPYRIGHT "2002-2010 Haiku Inc.");
46 BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
47 .SetInsets(B_USE_DEFAULT_SPACING)
48 .Add(titleView)
49 .Add(versionView)
50 .Add(copyrightView)
51 .AddGlue();
53 BFont font;
54 GetFont(&font);
55 SetExplicitPreferredSize(BSize((font.Size() * 300)/12,
56 (font.Size() * 100)/12));
60 BMPView::~BMPView()
62 fSettings->Release();