1 /* 2 * Copyright 2005, 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 "ICOTranslator.h" 9 10 #include <Catalog.h> 11 #include <CheckBox.h> 12 #include <ControlLook.h> 13 #include <LayoutBuilder.h> 14 #include <StringView.h> 15 16 #include <stdio.h> 17 #include <string.h> 18 19 #undef B_TRANSLATION_CONTEXT 20 #define B_TRANSLATION_CONTEXT "ConfigView" 21 22 23 ConfigView::ConfigView() 24 : 25 BGroupView(B_TRANSLATE("ICOTranslator Settings"), B_VERTICAL, 0) 26 { 27 BStringView* titleView = new BStringView("title", 28 B_TRANSLATE("Windows icon translator")); 29 titleView->SetFont(be_bold_font); 30 31 char version[256]; 32 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), 33 int(B_TRANSLATION_MAJOR_VERSION(ICO_TRANSLATOR_VERSION)), 34 int(B_TRANSLATION_MINOR_VERSION(ICO_TRANSLATOR_VERSION)), 35 int(B_TRANSLATION_REVISION_VERSION(ICO_TRANSLATOR_VERSION)), 36 __DATE__); 37 38 BStringView* versionView = new BStringView("version", version); 39 40 BStringView *copyrightView = new BStringView("copyright", 41 B_UTF8_COPYRIGHT "2005-2006 Haiku Inc."); 42 43 BCheckBox *colorCheckBox = new BCheckBox("color", 44 B_TRANSLATE("Write 32 bit images on true color input"), NULL); 45 46 BCheckBox *sizeCheckBox = new BCheckBox("size", 47 B_TRANSLATE("Enforce valid icon sizes"), NULL); 48 sizeCheckBox->SetValue(1); 49 50 BStringView* infoView = new BStringView("valid1", 51 B_TRANSLATE("Valid icon sizes are 16, 32, or 48")); 52 53 BStringView* info2View = new BStringView("valid2", 54 B_TRANSLATE("pixels in either direction.")); 55 56 BLayoutBuilder::Group<>(this, B_VERTICAL, 0) 57 .SetInsets(B_USE_DEFAULT_SPACING) 58 .Add(titleView) 59 .Add(versionView) 60 .Add(copyrightView) 61 .AddGlue() 62 .Add(colorCheckBox) 63 .Add(sizeCheckBox) 64 .Add(infoView) 65 .Add(info2View) 66 .AddGlue(); 67 } 68 69 70 ConfigView::~ConfigView() 71 { 72 } 73 74