xref: /haiku/src/add-ons/translators/raw/ConfigView.cpp (revision b028e77473189065f2baefc6f5e10d451cf591e2)
1 /*
2  * Copyright 2005-2007, 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 "RAWTranslator.h"
9 
10 #include <StringView.h>
11 #include <CheckBox.h>
12 
13 #include <stdio.h>
14 #include <string.h>
15 
16 
17 ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
18 	: BView(frame, "RAWTranslator Settings", resize, flags)
19 {
20 	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
21 
22 	font_height fontHeight;
23 	be_bold_font->GetHeight(&fontHeight);
24 	float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
25 
26 	BRect rect(10, 10, 200, 10 + height);
27 	BStringView *stringView = new BStringView(rect, "title", "RAW Images");
28 	stringView->SetFont(be_bold_font);
29 	stringView->ResizeToPreferred();
30 	AddChild(stringView);
31 
32 	rect.OffsetBy(0, height + 10);
33 	char version[256];
34 	sprintf(version, "Version %d.%d.%d, %s",
35 		int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)),
36 		int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)),
37 		int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)),
38 		__DATE__);
39 	stringView = new BStringView(rect, "version", version);
40 	stringView->ResizeToPreferred();
41 	AddChild(stringView);
42 
43 	GetFontHeight(&fontHeight);
44 	height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
45 
46 	rect.OffsetBy(0, height + 5);
47 	stringView = new BStringView(rect, "copyright", B_UTF8_COPYRIGHT "2007 Haiku Inc.");
48 	stringView->ResizeToPreferred();
49 	AddChild(stringView);
50 
51 	rect.OffsetBy(0, height + 10);
52 	stringView = new BStringView(rect, "copyright2", "Based on Dave Coffin's dcraw 8.63");
53 	stringView->ResizeToPreferred();
54 	AddChild(stringView);
55 
56 	rect.OffsetBy(0, height + 5);
57 	stringView = new BStringView(rect, "copyright3", B_UTF8_COPYRIGHT "1997-2007 Dave Coffin");
58 	stringView->ResizeToPreferred();
59 	AddChild(stringView);
60 }
61 
62 
63 ConfigView::~ConfigView()
64 {
65 }
66 
67