private GuiWidget CreateTerminalControlsContainer()
        {
            GroupBox terminalControlsContainer;

            terminalControlsContainer = new GroupBox(new LocalizedString("Printer Communications").Translated);

            terminalControlsContainer.Margin      = new BorderDouble(top: 10);
            terminalControlsContainer.TextColor   = ActiveTheme.Instance.PrimaryTextColor;
            terminalControlsContainer.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
            terminalControlsContainer.HAnchor     = Agg.UI.HAnchor.ParentLeftRight;
            terminalControlsContainer.Height      = 68;

            {
                FlowLayoutWidget buttonBar = new FlowLayoutWidget();
                buttonBar.HAnchor |= HAnchor.ParentLeftRight;
                buttonBar.VAnchor |= Agg.UI.VAnchor.ParentCenter;
                buttonBar.Margin   = new BorderDouble(3, 0, 3, 6);
                buttonBar.Padding  = new BorderDouble(0);

                this.textImageButtonFactory.FixedHeight = TallButtonHeight;

                Button showTerminal = textImageButtonFactory.Generate(new LocalizedString("SHOW TERMINAL").Translated);
                showTerminal.Margin = new BorderDouble(0);
                showTerminal.Click += (sender, e) =>
                {
                    OutputScrollWindow.Show();
                };
                buttonBar.AddChild(showTerminal);

                terminalControlsContainer.AddChild(buttonBar);
            }

            return(terminalControlsContainer);
        }
        private void AddTerminalControls(FlowLayoutWidget controlsTopToBottomLayout)
        {
            GroupBox terminalControlsContainer;

            terminalControlsContainer = new GroupBox(LocalizedString.Get("Communications"));

            terminalControlsContainer.Margin      = new BorderDouble(0);
            terminalControlsContainer.TextColor   = ActiveTheme.Instance.PrimaryTextColor;
            terminalControlsContainer.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
            terminalControlsContainer.HAnchor     = Agg.UI.HAnchor.ParentLeftRight;
            terminalControlsContainer.Height      = 68;

            OutputScrollWindow.HookupPrinterOutput();

            {
                FlowLayoutWidget buttonBar = new FlowLayoutWidget();
                buttonBar.HAnchor |= HAnchor.ParentCenter;
                buttonBar.VAnchor |= Agg.UI.VAnchor.ParentCenter;
                buttonBar.Margin   = new BorderDouble(3, 0, 3, 6);
                buttonBar.Padding  = new BorderDouble(0);

                this.textImageButtonFactory.FixedHeight = TallButtonHeight;

                Agg.Image.ImageBuffer terminalImage = new Agg.Image.ImageBuffer();
                ImageIO.LoadImageData(Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "Icons", "PrintStatusControls", "terminal-24x24.png"), terminalImage);
                ImageWidget terminalIcon = new ImageWidget(terminalImage);
                terminalIcon.Margin = new BorderDouble(right: 6);

                Button showTerminal = textImageButtonFactory.Generate("Show Terminal".Localize().ToUpper());
                showTerminal.Margin = new BorderDouble(0);
                showTerminal.Click += (sender, e) =>
                {
                    OutputScrollWindow.Show();
                };

                //buttonBar.AddChild(terminalIcon);
                buttonBar.AddChild(showTerminal);

                terminalControlsContainer.AddChild(buttonBar);
            }

            terminalCommunicationsContainer = new DisableableWidget();
            terminalCommunicationsContainer.AddChild(terminalControlsContainer);

            controlsTopToBottomLayout.AddChild(terminalCommunicationsContainer);
        }
 public static void Show()
 {
     if (terminalWindowIsOpen == false)
     {
         connectionWindow = new OutputScrollWindow();
         terminalWindowIsOpen = true;
         connectionWindow.Closed += (parentSender, e) =>
         {
             terminalWindowIsOpen = false;
             connectionWindow = null;
         };
     }
     else
     {
         if (connectionWindow != null)
         {
             connectionWindow.BringToFront();
         }
     }
 }
Exemple #4
0
 public static void Show()
 {
     if (terminalWindowIsOpen == false)
     {
         connectionWindow         = new OutputScrollWindow();
         terminalWindowIsOpen     = true;
         connectionWindow.Closed += (parentSender, e) =>
         {
             terminalWindowIsOpen = false;
             connectionWindow     = null;
         };
     }
     else
     {
         if (connectionWindow != null)
         {
             connectionWindow.BringToFront();
         }
     }
 }