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>
13*b5118c36SJanus #include <LayoutBuilder.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
ConfigView()23361babfbSAlex Wilson ConfigView::ConfigView()
24361babfbSAlex Wilson :
2503901b6cSJérôme Duval BGroupView(B_TRANSLATE("ICOTranslator Settings"), B_VERTICAL, 0)
269949213aSStephan Aßmus {
27*b5118c36SJanus BStringView* titleView = new BStringView("title",
28e8eb40f7SHumdinger B_TRANSLATE("Windows icon translator"));
29*b5118c36SJanus titleView->SetFont(be_bold_font);
30361babfbSAlex Wilson
319949213aSStephan Aßmus char version[256];
3203901b6cSJérôme Duval sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
339949213aSStephan Aßmus int(B_TRANSLATION_MAJOR_VERSION(ICO_TRANSLATOR_VERSION)),
349949213aSStephan Aßmus int(B_TRANSLATION_MINOR_VERSION(ICO_TRANSLATOR_VERSION)),
359949213aSStephan Aßmus int(B_TRANSLATION_REVISION_VERSION(ICO_TRANSLATOR_VERSION)),
369949213aSStephan Aßmus __DATE__);
379949213aSStephan Aßmus
38*b5118c36SJanus BStringView* versionView = new BStringView("version", version);
39*b5118c36SJanus
40*b5118c36SJanus BStringView *copyrightView = new BStringView("copyright",
41361babfbSAlex Wilson B_UTF8_COPYRIGHT "2005-2006 Haiku Inc.");
429949213aSStephan Aßmus
43*b5118c36SJanus BCheckBox *colorCheckBox = new BCheckBox("color",
4403901b6cSJérôme Duval B_TRANSLATE("Write 32 bit images on true color input"), NULL);
459949213aSStephan Aßmus
46*b5118c36SJanus BCheckBox *sizeCheckBox = new BCheckBox("size",
47*b5118c36SJanus B_TRANSLATE("Enforce valid icon sizes"), NULL);
48*b5118c36SJanus sizeCheckBox->SetValue(1);
499949213aSStephan Aßmus
50*b5118c36SJanus BStringView* infoView = new BStringView("valid1",
5103901b6cSJérôme Duval B_TRANSLATE("Valid icon sizes are 16, 32, or 48"));
529949213aSStephan Aßmus
53*b5118c36SJanus BStringView* info2View = new BStringView("valid2",
5470d59669SSiarzhuk Zharski B_TRANSLATE("pixels in either direction."));
55361babfbSAlex Wilson
56*b5118c36SJanus BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
57*b5118c36SJanus .SetInsets(B_USE_DEFAULT_SPACING)
58*b5118c36SJanus .Add(titleView)
59*b5118c36SJanus .Add(versionView)
60*b5118c36SJanus .Add(copyrightView)
61*b5118c36SJanus .AddGlue()
62*b5118c36SJanus .Add(colorCheckBox)
63*b5118c36SJanus .Add(sizeCheckBox)
64*b5118c36SJanus .Add(infoView)
65*b5118c36SJanus .Add(info2View)
66*b5118c36SJanus .AddGlue();
679949213aSStephan Aßmus }
689949213aSStephan Aßmus
699949213aSStephan Aßmus
~ConfigView()709949213aSStephan Aßmus ConfigView::~ConfigView()
719949213aSStephan Aßmus {
729949213aSStephan Aßmus }
739949213aSStephan Aßmus
74