diff --git a/AboutPage/CheckForUpdateWindow.cs b/AboutPage/CheckForUpdateWindow.cs index 6bdac0d34..6464c6556 100644 --- a/AboutPage/CheckForUpdateWindow.cs +++ b/AboutPage/CheckForUpdateWindow.cs @@ -30,7 +30,7 @@ namespace MatterHackers.MatterControl.AboutPage TextImageButtonFactory textImageButtonFactory = new TextImageButtonFactory(); LinkButtonFactory linkButtonFactory = new LinkButtonFactory(); string pathToStableBuildFeatures; - StyledDropDownList releaseOptionsDropList; + DropDownList releaseOptionsDropList; FlowLayoutWidget additionalInfoContainer; TextWidget stableInfoLabel; TextWidget alphaInfoLabel; @@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.AboutPage feedLabel.VAnchor = VAnchor.ParentCenter; feedLabel.Margin = new BorderDouble(left: 5); - releaseOptionsDropList = new StyledDropDownList("Development", maxHeight: 200); + releaseOptionsDropList = new DropDownList("Development", maxHeight: 200); releaseOptionsDropList.HAnchor = HAnchor.ParentLeftRight; MenuItem releaseOptionsDropDownItem = releaseOptionsDropList.AddItem("Stable".Localize(), "release"); @@ -108,7 +108,7 @@ namespace MatterHackers.MatterControl.AboutPage additionalInfoContainer.HAnchor = HAnchor.ParentLeftRight; additionalInfoContainer.Padding = new BorderDouble(left: 6, top: 6); - string aboutUpdateChannel = "Changing your update channnel will change the version of MatterControl \nthat you recieve when updating:"; + string aboutUpdateChannel = "Changing your update channel will change the version of MatterControl \nthat you receive when updating:"; updateChannelLabel = new TextWidget(aboutUpdateChannel); updateChannelLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; updateChannelLabel.HAnchor = HAnchor.ParentLeftRight; @@ -211,7 +211,7 @@ namespace MatterHackers.MatterControl.AboutPage { //getAdditionalFeedInfo(); - string releaseCode = ((StyledDropDownList)sender).SelectedValue; + string releaseCode = ((DropDownList)sender).SelectedValue; if (releaseCode != UserSettings.Instance.get("UpdateFeedType")) { UserSettings.Instance.set("UpdateFeedType", releaseCode); diff --git a/ActionBar/PrinterSelector.cs b/ActionBar/PrinterSelector.cs index 100d19d64..86449950c 100644 --- a/ActionBar/PrinterSelector.cs +++ b/ActionBar/PrinterSelector.cs @@ -40,7 +40,7 @@ using System; namespace MatterHackers.MatterControl { - public class PrinterSelector : StyledDropDownList + public class PrinterSelector : DropDownList { public event EventHandler AddPrinter; diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index 9c9a44ef0..47331d016 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage { private Button languageRestartButton; private Button configureUpdateFeedButton; - public StyledDropDownList releaseOptionsDropList; + public DropDownList releaseOptionsDropList; private string cannotRestartWhilePrintIsActiveMessage; private string cannotRestartWhileActive; @@ -217,7 +217,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); optionsContainer.Margin = new BorderDouble(bottom: 6); - StyledDropDownList interfaceOptionsDropList = new StyledDropDownList("Development", maxHeight: 200); + DropDownList interfaceOptionsDropList = new DropDownList("Development", maxHeight: 200); interfaceOptionsDropList.HAnchor = HAnchor.ParentLeftRight; optionsContainer.AddChild(interfaceOptionsDropList); @@ -237,7 +237,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage interfaceOptionsDropList.SelectedValue = UserSettings.Instance.get("ApplicationDisplayMode"); interfaceOptionsDropList.SelectionChanged += (sender, e) => { - string releaseCode = ((StyledDropDownList)sender).SelectedValue; + string releaseCode = ((DropDownList)sender).SelectedValue; if (releaseCode != UserSettings.Instance.get("ApplicationDisplayMode")) { UserSettings.Instance.set("ApplicationDisplayMode", releaseCode); @@ -266,7 +266,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); optionsContainer.Margin = new BorderDouble(bottom: 6); - StyledDropDownList interfaceModeDropList = new StyledDropDownList("Standard", maxHeight: 200); + DropDownList interfaceModeDropList = new DropDownList("Standard", maxHeight: 200); interfaceModeDropList.HAnchor = HAnchor.ParentLeftRight; optionsContainer.AddChild(interfaceModeDropList); @@ -302,7 +302,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); optionsContainer.Margin = new BorderDouble(bottom: 6); - releaseOptionsDropList = new StyledDropDownList("Development", maxHeight: 200); + releaseOptionsDropList = new DropDownList("Development", maxHeight: 200); releaseOptionsDropList.HAnchor = HAnchor.ParentLeftRight; optionsContainer.AddChild(releaseOptionsDropList); @@ -431,7 +431,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); optionsContainer.Margin = new BorderDouble(bottom: 6); - StyledDropDownList interfaceOptionsDropList = new StyledDropDownList("Development", maxHeight: 200); + DropDownList interfaceOptionsDropList = new DropDownList("Development", maxHeight: 200); interfaceOptionsDropList.HAnchor = HAnchor.ParentLeftRight; optionsContainer.AddChild(interfaceOptionsDropList); @@ -451,7 +451,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage interfaceOptionsDropList.SelectedValue = UserSettings.Instance.get("ThumbnailRenderingMode"); interfaceOptionsDropList.SelectionChanged += (sender, e) => { - string thumbnailRenderingMode = ((StyledDropDownList)sender).SelectedValue; + string thumbnailRenderingMode = ((DropDownList)sender).SelectedValue; if (thumbnailRenderingMode != UserSettings.Instance.get("ThumbnailRenderingMode")) { UserSettings.Instance.set("ThumbnailRenderingMode", thumbnailRenderingMode); @@ -532,7 +532,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage private void InterfaceModeDropList_SelectionChanged(object sender, EventArgs e) { - string isSimpleMode = ((StyledDropDownList)sender).SelectedValue; + string isSimpleMode = ((DropDownList)sender).SelectedValue; if (isSimpleMode == "True") { UserSettings.Instance.Fields.IsSimpleMode = true; @@ -545,7 +545,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage private void ReleaseOptionsDropList_SelectionChanged(object sender, EventArgs e) { - string releaseCode = ((StyledDropDownList)sender).SelectedValue; + string releaseCode = ((DropDownList)sender).SelectedValue; if (releaseCode != UserSettings.Instance.get("UpdateFeedType")) { UserSettings.Instance.set("UpdateFeedType", releaseCode); @@ -554,7 +554,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage private void LanguageDropList_SelectionChanged(object sender, EventArgs e) { - string languageCode = ((DropDownList)sender).SelectedValue; + string languageCode = ((Agg.UI.DropDownList)sender).SelectedValue; if (languageCode != UserSettings.Instance.get("Language")) { UserSettings.Instance.set("Language", languageCode); diff --git a/ConfigurationPage/LanguageSelector.cs b/ConfigurationPage/LanguageSelector.cs index 559ecdd39..f22ad814d 100644 --- a/ConfigurationPage/LanguageSelector.cs +++ b/ConfigurationPage/LanguageSelector.cs @@ -1,9 +1,10 @@ -using MatterHackers.VectorMath; +using MatterHackers.Agg.UI; +using MatterHackers.VectorMath; using System.Collections.Generic; namespace MatterHackers.MatterControl { - public class LanguageSelector : StyledDropDownList + public class LanguageSelector : DropDownList { private Dictionary languageDict; diff --git a/ConfigurationPage/PrinterConfigurationPage.cs b/ConfigurationPage/PrinterConfigurationPage.cs index 28363f4f0..0877b3a63 100644 --- a/ConfigurationPage/PrinterConfigurationPage.cs +++ b/ConfigurationPage/PrinterConfigurationPage.cs @@ -144,7 +144,7 @@ namespace MatterHackers.MatterControl private void LanguageDropList_SelectionChanged(object sender, EventArgs e) { - string languageCode = ((DropDownList)sender).SelectedLabel; + string languageCode = ((Agg.UI.DropDownList)sender).SelectedLabel; if (languageCode != UserSettings.Instance.get("Language")) { UserSettings.Instance.set("Language", languageCode); @@ -165,7 +165,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget controlsContainer = new FlowLayoutWidget(); controlsContainer.HAnchor |= HAnchor.ParentCenter; - var releaseOptionsDropList = new StyledDropDownList("Development"); + var releaseOptionsDropList = new DropDownList("Development"); releaseOptionsDropList.Margin = new BorderDouble(0, 3); MenuItem releaseOptionsDropDownItem = releaseOptionsDropList.AddItem("Release", "release"); @@ -203,7 +203,7 @@ namespace MatterHackers.MatterControl private void ReleaseOptionsDropList_SelectionChanged(object sender, EventArgs e) { - string releaseCode = ((StyledDropDownList)sender).SelectedValue; + string releaseCode = ((DropDownList)sender).SelectedValue; if (releaseCode != UserSettings.Instance.get("UpdateFeedType")) { UserSettings.Instance.set("UpdateFeedType", releaseCode); diff --git a/CustomWidgets/StyledDropDownList.cs b/CustomWidgets/StyledDropDownList.cs deleted file mode 100644 index 97b362414..000000000 --- a/CustomWidgets/StyledDropDownList.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2015, Kevin Pope -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. -*/ - -using MatterHackers.Agg; -using MatterHackers.Agg.UI; - -namespace MatterHackers.MatterControl -{ - public class StyledDropDownList : DropDownList - { - private static RGBA_Bytes whiteSemiTransparent = new RGBA_Bytes(255, 255, 255, 100); - private static RGBA_Bytes whiteTransparent = new RGBA_Bytes(255, 255, 255, 0); - - public StyledDropDownList(string noSelectionString, Direction direction = Direction.Down, double maxHeight = 0, bool useLeftIcons = false) - : base(noSelectionString, whiteTransparent, whiteSemiTransparent, direction, maxHeight, useLeftIcons) - { - this.TextColor = ActiveTheme.Instance.PrimaryTextColor; - this.MenuItemsBorderWidth = 1; - this.MenuItemsBackgroundColor = RGBA_Bytes.White; - this.MenuItemsBorderColor = ActiveTheme.Instance.SecondaryTextColor; - this.MenuItemsPadding = new BorderDouble(10, 8, 10, 12); - this.MenuItemsBackgroundHoverColor = ActiveTheme.Instance.PrimaryAccentColor; - this.MenuItemsTextHoverColor = RGBA_Bytes.Black; - this.MenuItemsTextColor = RGBA_Bytes.Black; - this.BorderWidth = 1; - this.BorderColor = ActiveTheme.Instance.SecondaryTextColor; - this.HoverColor = whiteSemiTransparent; - this.BackgroundColor = new RGBA_Bytes(255, 255, 255, 0); - } - } -} \ No newline at end of file diff --git a/MatterControl.csproj b/MatterControl.csproj index 49fec4e8f..3f800d91b 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -307,7 +307,6 @@ - diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index 15c95cc46..7c9a1a38b 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -554,7 +554,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow container.AddChild(snapGridLabel); - StyledDropDownList selectableOptions = new StyledDropDownList("Custom", Direction.Up) + DropDownList selectableOptions = new DropDownList("Custom", Direction.Up) { VAnchor = VAnchor.ParentCenter | VAnchor.FitToChildren, }; diff --git a/PrinterControls/PrinterConnections/PrinterChooser.cs b/PrinterControls/PrinterConnections/PrinterChooser.cs index e77188bc4..dae3c1573 100644 --- a/PrinterControls/PrinterConnections/PrinterChooser.cs +++ b/PrinterControls/PrinterConnections/PrinterChooser.cs @@ -37,7 +37,7 @@ using System.Linq; namespace MatterHackers.MatterControl { - public class BoundDropList : StyledDropDownList + public class BoundDropList : DropDownList { private List> listSource; diff --git a/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs b/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs index 54c6b2ff0..a51c565dd 100644 --- a/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs +++ b/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs @@ -136,7 +136,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections return container; } - private FlowLayoutWidget CreateSelectionContainer(string labelText, string validationMessage, DropDownList selector) + private FlowLayoutWidget CreateSelectionContainer(string labelText, string validationMessage, Agg.UI.DropDownList selector) { var sectionLabel = new TextWidget(labelText, 0, 0, 12) { @@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections private void ManufacturerDropList_SelectionChanged(object sender, EventArgs e) { - ActivePrinter.Make = ((DropDownList)sender).SelectedValue; + ActivePrinter.Make = ((Agg.UI.DropDownList)sender).SelectedValue; ActivePrinter.Model = null; List printers; @@ -192,7 +192,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { UiThread.RunOnIdle(() => { - StyledDropDownList dropList = (StyledDropDownList) sender; + DropDownList dropList = (DropDownList) sender; ActivePrinter.Model = dropList.SelectedLabel; SetElementVisibility(); @@ -201,7 +201,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections // Use ManufacturerDropList.SelectedLabel instead of ActivePrinter.Make to ensure the mapped Unicode values are picked up string mappedMakeText = printerManufacturerSelector.SelectedLabel; - string printerInputName = String.Format("{0} {1}", mappedMakeText, this.ActivePrinter.Model); + string printerInputName = string.Format("{0} {1}", mappedMakeText, this.ActivePrinter.Model); var names = ActiveSliceSettings.ProfileData.Profiles.Where(p => p.Name.StartsWith(printerInputName)).Select(p => p.Name).ToList(); if (!names.Contains(printerInputName)) { @@ -215,7 +215,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections do { - possiblePrinterName = String.Format("{0} ({1})", printerInputName, printerModelCount++); + possiblePrinterName = string.Format("{0} ({1})", printerInputName, printerModelCount++); } while (names.Contains(possiblePrinterName)); printerNameInput.Text = possiblePrinterName; diff --git a/SlicerConfiguration/SettingsControlSelectors.cs b/SlicerConfiguration/SettingsControlSelectors.cs index 94cc254f8..7821d2ef9 100644 --- a/SlicerConfiguration/SettingsControlSelectors.cs +++ b/SlicerConfiguration/SettingsControlSelectors.cs @@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { private Button editButton; private NamedSettingsLayers layerType; - private StyledDropDownList dropDownList; + private DropDownList dropDownList; private int extruderIndex; //For multiple materials @@ -195,9 +195,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration }); } - private StyledDropDownList CreateDropdown() + private DropDownList CreateDropdown() { - var dropDownList = new StyledDropDownList("- default -", maxHeight: 300, useLeftIcons: true) + var dropDownList = new DropDownList("- default -", maxHeight: 300, useLeftIcons: true) { HAnchor = HAnchor.ParentLeftRight, MenuItemsPadding = new BorderDouble(10, 4, 10, 6), @@ -278,7 +278,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } - public class SliceEngineSelector : StyledDropDownList + public class SliceEngineSelector : DropDownList { public SliceEngineSelector(string label) : base(label) diff --git a/SlicerConfiguration/SliceSettingsDetailControl.cs b/SlicerConfiguration/SliceSettingsDetailControl.cs index 020e1d95c..d52e19e57 100644 --- a/SlicerConfiguration/SliceSettingsDetailControl.cs +++ b/SlicerConfiguration/SliceSettingsDetailControl.cs @@ -10,7 +10,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public DropDownMenu sliceOptionsMenuDropList; private const string SliceSettingsLevelEntry = "SliceSettingsLevel"; private const string SliceSettingsShowHelpEntry = "SliceSettingsShowHelp"; - private StyledDropDownList settingsDetailSelector; + private DropDownList settingsDetailSelector; private CheckBox showHelpBox; private TupleList> slicerOptionsMenuItems; @@ -31,7 +31,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.AddChild(showHelpBox); - settingsDetailSelector = new StyledDropDownList("Basic", maxHeight: 200); + settingsDetailSelector = new DropDownList("Basic", maxHeight: 200); settingsDetailSelector.Name = "User Level Dropdown"; settingsDetailSelector.AddItem("Basic".Localize(), "Simple"); settingsDetailSelector.AddItem("Standard".Localize(), "Intermediate"); diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 96dda5b99..374ee3069 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -1114,7 +1114,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration // bind to a context that will place it in the SliceSetting view but it binds its values to a machine // specific dictionary key that is not exposed in the UI. At runtime we lookup and store to "MatterControl..ComPort" // ensuring that a single printer can be shared across different devices and we'll select the correct ComPort in each case - var selectableOptions = new StyledDropDownList("None", maxHeight: 200) + var selectableOptions = new DropDownList("None", maxHeight: 200) { ToolTipText = settingData.HelpText, Margin = new BorderDouble() @@ -1167,7 +1167,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration case OrganizerSettingsData.DataEditTypes.LIST: { - var selectableOptions = new StyledDropDownList("None", maxHeight: 200) + var selectableOptions = new DropDownList("None", maxHeight: 200) { ToolTipText = settingData.HelpText, Margin = new BorderDouble() @@ -1466,7 +1466,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration return container; } - private void AddComMenuItems(OrganizerSettingsData settingData, SettingsRow settingsRow, StyledDropDownList selectableOptions) + private void AddComMenuItems(OrganizerSettingsData settingData, SettingsRow settingsRow, DropDownList selectableOptions) { selectableOptions.MenuItems.Clear(); string machineSpecificComPortValue = ActiveSliceSettings.Instance.ComPort(); @@ -1535,7 +1535,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration string sliceSettingValue = GetActiveValue(settingData.SlicerConfigName, layerCascade); FlowLayoutWidget totalContent = new FlowLayoutWidget(); - StyledDropDownList selectableOptions = new StyledDropDownList("Custom", maxHeight: 200); + DropDownList selectableOptions = new DropDownList("Custom", maxHeight: 200); selectableOptions.Margin = new BorderDouble(0, 0, 10, 0); foreach (QuickMenuNameValue nameValue in settingData.QuickMenuSettings) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 48146f626..00bb60780 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 48146f6266d90835c98a10df1533650e78cf47c5 +Subproject commit 00bb607805ce790b1c2f7505d7e2a42ba2658347