From b02fb0cfac4e077571103070fe565744bb2a6a8f Mon Sep 17 00:00:00 2001 From: Gregory Diaz Date: Thu, 30 Jul 2015 13:28:07 -0700 Subject: [PATCH] Added list of printers to scrollable widget --- .../PrinterConnections/ChooseConnectionWidget.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs b/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs index d09c96a35..dfc5ef38d 100644 --- a/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs +++ b/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs @@ -69,6 +69,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections this.AnchorAll(); this.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor; this.Padding = new BorderDouble(0); //To be re-enabled once native borders are turned off + GuiWidget mainContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); mainContainer.AnchorAll(); @@ -117,9 +118,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections //ListBox printerListContainer = new ListBox(); { printerListContainer.HAnchor = HAnchor.ParentLeftRight; - printerListContainer.VAnchor = VAnchor.ParentBottomTop; + printerListContainer.VAnchor = VAnchor.FitToChildren; printerListContainer.Padding = new BorderDouble(3); printerListContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor; + printerListContainer.DebugShowBounds = true; //Get a list of printer records and add them to radio button list foreach (Printer printer in GetAllPrinters()) @@ -165,9 +167,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections buttonContainer.AddChild(closeButton); } + ScrollableWidget printerListScrollArea = new ScrollableWidget(true); + printerListScrollArea.ScrollArea.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; + printerListScrollArea.AnchorAll(); + printerListScrollArea.AddChild(printerListContainer); + mainContainer.AddChild(headerRow); mainContainer.AddChild(editButtonRow); - mainContainer.AddChild(printerListContainer); + mainContainer.AddChild(printerListScrollArea); mainContainer.AddChild(buttonContainer); this.AddChild(mainContainer);