xref: /haiku/src/add-ons/translators/ico/ConfigView.cpp (revision e8eb40f7777e595c44f7148d072fb542c7b49ffa)
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 
1003901b6cSJé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 
19546208a5SOliver Tappe #undef B_TRANSLATION_CONTEXT
20546208a5SOliver Tappe #define B_TRANSLATION_CONTEXT "ConfigView"
2103901b6cSJérôme Duval 
229949213aSStephan Aßmus 
23361babfbSAlex Wilson ConfigView::ConfigView()
24361babfbSAlex Wilson 	:
2503901b6cSJé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 
2903901b6cSJérôme Duval 	BStringView* stringView = new BStringView("title",
30*e8eb40f7SHumdinger 		B_TRANSLATE("Windows icon translator"));
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];
3903901b6cSJé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 
5503901b6cSJérôme Duval 	BCheckBox *checkBox = new BCheckBox("color",
5603901b6cSJé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 
6003901b6cSJérôme Duval 	checkBox = new BCheckBox("size", B_TRANSLATE("Enforce valid icon sizes"),
6103901b6cSJé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 
6803901b6cSJérôme Duval 	stringView = new BStringView("valid1",
6903901b6cSJé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 
7303901b6cSJérôme Duval 	stringView = new BStringView("valid2",
7470d59669SSiarzhuk Zharski 		B_TRANSLATE("pixels 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