public void Init(GUIHost host)
        {
            X                    = 0;
            Y                    = 0;
            RelativeWidth        = 1f;
            RelativeHeight       = 1f;
            calibration_settings = new ButtonWidget(0, null)
            {
                Text          = "Calibration",
                TextColor     = new Color4(0.71f, 0.71f, 0.71f, 1f),
                TextOverColor = new Color4(1f, 1f, 1f, 1f),
                TextDownColor = new Color4(1f, 1f, 1f, 1f),
                Size          = FontSize.Medium
            };
            calibration_settings.SetCallback(new ButtonCallback(MyButtonCallback));
            calibration_settings.Init(host, "guicontrols", 513f, 64f, 575f, sbyte.MaxValue, 513f, 128f, 575f, 191f, 513f, 192f, 575f, byte.MaxValue);
            calibration_settings.SetGrowableWidth(16, 16, 48);
            calibration_settings.DontMove = true;
            calibration_settings.SetPosition(10, 10);
            calibration_settings.SetSize(200, 32);
            calibration_settings.ClickType = ButtonType.Checkable;
            calibration_settings.GroupID   = 1234;
            advancedcalibration_button     = new ButtonWidget(1, null)
            {
                Text          = "Advanced Calibration",
                TextColor     = new Color4(0.71f, 0.71f, 0.71f, 1f),
                TextOverColor = new Color4(1f, 1f, 1f, 1f),
                TextDownColor = new Color4(1f, 1f, 1f, 1f),
                Size          = FontSize.Medium
            };
            advancedcalibration_button.SetCallback(new ButtonCallback(MyButtonCallback));
            advancedcalibration_button.Init(host, "guicontrols", 576f, 64f, 639f, sbyte.MaxValue, 576f, 128f, 639f, 191f, 576f, 192f, 639f, byte.MaxValue);
            advancedcalibration_button.SetGrowableWidth(16, 16, 48);
            advancedcalibration_button.DontMove  = true;
            advancedcalibration_button.ClickType = ButtonType.Checkable;
            advancedcalibration_button.GroupID   = 1234;
            advancedcalibration_button.SetPosition(210, 10);
            advancedcalibration_button.SetSize(200, 32);
            AddChildElement(calibration_settings);
            AddChildElement(advancedcalibration_button);
            var frame = new Frame(3)
            {
                X              = 0,
                Y              = 50,
                RelativeWidth  = 1f,
                RelativeHeight = 0.85f,
                Enabled        = true,
                IgnoreMouse    = false
            };

            advanced_calibration_tab = new AdvancedCalibrationTab(1001, main_controller, messagebox, spooler_connection);
            advanced_calibration_tab.Init(host);
            advanced_calibration_tab.Visible        = false;
            advanced_calibration_tab.Enabled        = false;
            advanced_calibration_tab.RelativeWidth  = 1f;
            advanced_calibration_tab.RelativeHeight = 1f;
            advanced_calibration_tab.BGColor        = new Color4(246, 246, 246, byte.MaxValue);
            advanced_calibration_tab.BorderColor    = new Color4(220, 220, 220, byte.MaxValue);
            frame.AddChildElement(advanced_calibration_tab);
            calibration_tab = new CatScreenTab(1002, main_controller, spooler_connection, messagebox);
            calibration_tab.Init(host);
            calibration_tab.Visible        = true;
            calibration_tab.Enabled        = true;
            calibration_tab.RelativeWidth  = 1f;
            calibration_tab.RelativeHeight = 1f;
            frame.AddChildElement(calibration_tab);
            calibration_tab.BGColor     = new Color4(246, 246, 246, byte.MaxValue);
            calibration_tab.BorderColor = new Color4(220, 220, 220, byte.MaxValue);
            AddChildElement(frame);
            calibration_settings.SetChecked(true);
            active_frame = calibration_tab;
        }
Exemple #2
0
        public LibraryView(int ID, Element2D parent, GLControl glControl, GUIHost host, MessagePopUp infobox, ModelLoadingManager model_loading_manager)
            : base(ID, parent)
        {
            bUpdateWhenNotVisible        = true;
            m_gui_host                   = host;
            Sprite.texture_height_pixels = 1024;
            Sprite.texture_width_pixels  = 1024;
            m_gui_host.SetFontProperty(FontSize.VeryLarge, 20f);
            m_gui_host.SetFontProperty(FontSize.Large, 14f);
            m_gui_host.SetFontProperty(FontSize.Medium, 11f);
            m_gui_host.SetFontProperty(FontSize.Small, 8f);
            RelativeX      = 0.51f;
            RelativeY      = 0.11f;
            RelativeWidth  = 0.423f;
            RelativeHeight = 0.83f;
            var imageWidget1 = new ImageWidget(1008, null);

            imageWidget1.Init(host, "extendedcontrols3", 3f, 288f, 84f, 374f, 3f, 288f, 84f, 374f, 3f, 288f, 84f, 374f);
            imageWidget1.Text           = "Remove From List";
            imageWidget1.Color          = new Color4(0.5f, 0.5f, 0.5f, 1f);
            imageWidget1.VAlignment     = TextVerticalAlignment.Bottom;
            imageWidget1.TextAreaHeight = 32;
            imageWidget1.ImageAreaWidth = 80;
            imageWidget1.SetSize(80, 115);
            imageWidget1.Visible = false;
            AddChildElement(imageWidget1);
            imageWidget1.SetPosition(-12, -115);
            var imageWidget2 = new ImageWidget(1009, null);

            imageWidget2.Init(host, "extendedcontrols3", 92f, 285f, 173f, 346f, 92f, 285f, 173f, 346f, 92f, 285f, 173f, 346f);
            imageWidget2.Text           = "Save";
            imageWidget2.Color          = new Color4(0.5f, 0.5f, 0.5f, 1f);
            imageWidget2.VAlignment     = TextVerticalAlignment.Bottom;
            imageWidget2.TextAreaHeight = 20;
            imageWidget2.ImageAreaWidth = 81;
            imageWidget2.SetSize(81, 85);
            imageWidget2.Visible = false;
            AddChildElement(imageWidget2);
            imageWidget2.SetPosition(-12, -240);
            search_filter = "";
            var editBoxWidget = new EditBoxWidget(1001, null);

            editBoxWidget.Init(host, "guicontrols", 513f, 0.0f, 608f, 63f);
            editBoxWidget.SetGrowableWidth(40, 16, 64);
            editBoxWidget.Size  = FontSize.Large;
            editBoxWidget.Color = new Color4(0.71f, 0.71f, 0.71f, 1f);
            editBoxWidget.SetTextWindowBorders(48, 16, 22, 16);
            editBoxWidget.SetToolTipRegion(0, 48, 0, 60);
            editBoxWidget.ToolTipMessage = host.Locale.T("T_TOOLTIP_SEARCH");
            editBoxWidget.Hint           = m_gui_host.Locale.T("T_SEARCH");
            tabsFrame = new HorizontalLayout(0, null)
            {
                FixedColumnWidth = true,
                BorderWidth      = 0,
                BorderHeight     = 0,
                RelativeWidth    = 1f
            };
            navigation      = new Frame(0, null);
            navigation_left = new ButtonWidget(1005, null)
            {
                Text   = "",
                X      = 16,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_left.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_left.Init(host, "guicontrols", 608f, 0.0f, 639f, 31f, 640f, 0.0f, 671f, 31f, 672f, 0.0f, 703f, 31f, 704f, 0.0f, 735f, 31f);
            navigation_right = new ButtonWidget(1006, null)
            {
                Text   = "",
                X      = -48,
                Y      = 0,
                Width  = 32,
                Height = 32
            };
            navigation_right.SetCallback(new ButtonCallback(MyButtonCallback));
            navigation_right.Init(host, "guicontrols", 608f, 32f, 639f, 63f, 640f, 32f, 671f, 63f, 672f, 32f, 703f, 63f, 704f, 32f, 735f, 63f);
            pagebuttons = new ButtonWidget[32];
            for (var ID1 = 1032; ID1 <= 1063; ++ID1)
            {
                var index = ID1 - 1032;
                pagebuttons[index] = new ButtonWidget(ID1, null)
                {
                    Text   = "",
                    X      = 48 + (ID1 - 1032) * 24,
                    Y      = 8,
                    Width  = 16,
                    Height = 16
                };
                pagebuttons[index].SetCallback(new ButtonCallback(MyButtonCallback));
                pagebuttons[index].Init(host, "guicontrols", 448f, 192f, 463f, 208f, 480f, 192f, 495f, 208f, 464f, 192f, 479f, 208f);
                pagebuttons[index].DontMove  = true;
                pagebuttons[index].GroupID   = 1;
                pagebuttons[index].ClickType = ButtonType.Checkable;
                pagebuttons[index].Visible   = false;
                navigation.AddChildElement(pagebuttons[index]);
            }
            navigation.AddChildElement(navigation_left);
            navigation.AddChildElement(navigation_right);
            LibraryGrid = new GridLayout(1)
            {
                ColumnWidth  = 130,
                RowHeight    = 150,
                BorderWidth  = 0,
                BorderHeight = 0
            };
            var verticalLayout = new VerticalLayout(0)
            {
                RelativeHeight = 1f,
                RelativeWidth  = 1f,
                BorderHeight   = 10
            };

            verticalLayout.AddChildElement(editBoxWidget, 0, 64 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(tabsFrame, 1, 64 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(navigation, 2, 32 + verticalLayout.BorderHeight);
            verticalLayout.AddChildElement(LibraryGrid, 3, -1);
            AddChildElement(verticalLayout);
            library_status = new TextWidget(1007)
            {
                Text           = m_gui_host.Locale.T("T_NOMODELS"),
                Size           = FontSize.VeryLarge,
                Alignment      = QFontAlignment.Centre,
                RelativeHeight = 1f,
                RelativeWidth  = 1f,
                X     = 0,
                Y     = 0,
                Color = new Color4(0.9922f, 0.3765f, 0.2471f, 1f)
            };
            AddChildElement(library_status);
            recentModelsTab = new RecentModelTab(this, model_loading_manager, infobox, glControl);
            ButtonWidget buttonWidget = AddTabButton(host, recentModelsTab, LibraryView.TabButtonStyle.Left, m_gui_host.Locale.T("T_RECENT_MODELS"), 1002);

            recentPrintsTab = new RecentPrintsTab(this, model_loading_manager);
            AddTabButton(host, recentPrintsTab, LibraryView.TabButtonStyle.Right, m_gui_host.Locale.T("T_RECENT_PRINTS"), 1004);
            var num = 1;

            buttonWidget.SetChecked(num != 0);
            ShowView(true);
            viewstate = ViewState.Active;
        }
 protected override void OnUnhide()
 {
     calibration_settings.SetChecked(true);
     base.OnUnhide();
 }