xref: /haiku/src/add-ons/translators/ico/ConfigView.cpp (revision 03901b6caef292719d42a1f355e63bcf9d73ac06)
19949213aSStephan Aßmus /*
29949213aSStephan Aßmus  * Copyright 2005, 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 "ICOTranslator.h"
99949213aSStephan Aßmus 
10*03901b6cSJérôme Duval #include <Catalog.h>
119949213aSStephan Aßmus #include <CheckBox.h>
12361babfbSAlex Wilson #include <ControlLook.h>
13361babfbSAlex Wilson #include <SpaceLayoutItem.h>
14361babfbSAlex Wilson #include <StringView.h>
159949213aSStephan Aßmus 
169949213aSStephan Aßmus #include <stdio.h>
179949213aSStephan Aßmus #include <string.h>
189949213aSStephan Aßmus 
19*03901b6cSJérôme Duval #undef B_TRANSLATE_CONTEXT
20*03901b6cSJérôme Duval #define B_TRANSLATE_CONTEXT "ConfigView"
21*03901b6cSJérôme Duval 
229949213aSStephan Aßmus 
23361babfbSAlex Wilson ConfigView::ConfigView()
24361babfbSAlex Wilson 	:
25*03901b6cSJérôme Duval 	BGroupView(B_TRANSLATE("ICOTranslator Settings"), B_VERTICAL, 0)
269949213aSStephan Aßmus {
27361babfbSAlex Wilson 	BAlignment leftAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET);
289949213aSStephan Aßmus 
29*03901b6cSJérôme Duval 	BStringView* stringView = new BStringView("title",
30*03901b6cSJérôme Duval 		B_TRANSLATE("Windows icon images"));
319949213aSStephan Aßmus 	stringView->SetFont(be_bold_font);
32361babfbSAlex Wilson 	stringView->SetExplicitAlignment(leftAlignment);
339949213aSStephan Aßmus 	AddChild(stringView);
349949213aSStephan Aßmus 
35361babfbSAlex Wilson 	float spacing = be_control_look->DefaultItemSpacing();
36361babfbSAlex Wilson 	AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
37361babfbSAlex Wilson 
389949213aSStephan Aßmus 	char version[256];
39*03901b6cSJérôme Duval 	sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
409949213aSStephan Aßmus 		int(B_TRANSLATION_MAJOR_VERSION(ICO_TRANSLATOR_VERSION)),
419949213aSStephan Aßmus 		int(B_TRANSLATION_MINOR_VERSION(ICO_TRANSLATOR_VERSION)),
429949213aSStephan Aßmus 		int(B_TRANSLATION_REVISION_VERSION(ICO_TRANSLATOR_VERSION)),
439949213aSStephan Aßmus 		__DATE__);
44361babfbSAlex Wilson 	stringView = new BStringView("version", version);
45361babfbSAlex Wilson 	stringView->SetExplicitAlignment(leftAlignment);
469949213aSStephan Aßmus 	AddChild(stringView);
479949213aSStephan Aßmus 
48361babfbSAlex Wilson 	stringView = new BStringView("copyright",
49361babfbSAlex Wilson 		B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
50361babfbSAlex Wilson 	stringView->SetExplicitAlignment(leftAlignment);
519949213aSStephan Aßmus 	AddChild(stringView);
529949213aSStephan Aßmus 
53361babfbSAlex Wilson 	AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
54361babfbSAlex Wilson 
55*03901b6cSJérôme Duval 	BCheckBox *checkBox = new BCheckBox("color",
56*03901b6cSJérôme Duval 		B_TRANSLATE("Write 32 bit images on true color input"), NULL);
57361babfbSAlex Wilson 	checkBox->SetExplicitAlignment(leftAlignment);
589949213aSStephan Aßmus 	AddChild(checkBox);
599949213aSStephan Aßmus 
60*03901b6cSJérôme Duval 	checkBox = new BCheckBox("size", B_TRANSLATE("Enforce valid icon sizes"),
61*03901b6cSJérôme Duval 		NULL);
629949213aSStephan Aßmus 	checkBox->SetValue(1);
63361babfbSAlex Wilson 	checkBox->SetExplicitAlignment(leftAlignment);
649949213aSStephan Aßmus 	AddChild(checkBox);
659949213aSStephan Aßmus 
66361babfbSAlex Wilson 	AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
67361babfbSAlex Wilson 
68*03901b6cSJérôme Duval 	stringView = new BStringView("valid1",
69*03901b6cSJérôme Duval 		B_TRANSLATE("Valid icon sizes are 16, 32, or 48"));
70361babfbSAlex Wilson 	stringView->SetExplicitAlignment(leftAlignment);
719949213aSStephan Aßmus 	AddChild(stringView);
729949213aSStephan Aßmus 
73*03901b6cSJérôme Duval 	stringView = new BStringView("valid2",
74*03901b6cSJérôme Duval 		B_TRANSLATE("pixel in either direction."));
75361babfbSAlex Wilson 	stringView->SetExplicitAlignment(leftAlignment);
769949213aSStephan Aßmus 	AddChild(stringView);
77361babfbSAlex Wilson 
78361babfbSAlex Wilson 	AddChild(BSpaceLayoutItem::CreateGlue());
79361babfbSAlex Wilson 	GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
80361babfbSAlex Wilson 		B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
81361babfbSAlex Wilson 
82361babfbSAlex Wilson 	SetExplicitPreferredSize(GroupLayout()->MinSize());
839949213aSStephan Aßmus }
849949213aSStephan Aßmus 
859949213aSStephan Aßmus 
869949213aSStephan Aßmus ConfigView::~ConfigView()
879949213aSStephan Aßmus {
889949213aSStephan Aßmus }
899949213aSStephan Aßmus 
90