Working on better printer editing behavior

This commit is contained in:
Lars Brubaker 2016-05-16 17:11:49 -07:00
parent 9102a03dc6
commit c4d53d054f
8 changed files with 25 additions and 15 deletions

View file

@ -237,7 +237,6 @@ namespace MatterHackers.MatterControl.ActionBar
imageButtonFactory.InvertImageColor = false;
ImageBuffer levelingImage = StaticData.Instance.LoadIcon("leveling_32x32.png", 16, 16).InvertLightness();
Button autoLevelButton = imageButtonFactory.Generate(levelingImage, levelingImage);
autoLevelButton.Cursor = Cursors.Hand;
autoLevelButton.Margin = new Agg.BorderDouble(top: 3);
autoLevelButton.ToolTipText = "Print leveling is enabled.".Localize();
autoLevelButton.Visible = ActiveSliceSettings.Instance.DoPrintLeveling();

View file

@ -188,10 +188,13 @@ namespace MatterHackers.MatterControl.ActionBar
private void AutomationTest()
{
AutomationRunner testRunner = new AutomationRunner(inputType: AutomationRunner.InputType.Simulated);
//AutomationRunner testRunner = new AutomationRunner(inputType: AutomationRunner.InputType.Simulated, drawSimulatedMouse: false);
//testRunner.TimeToMoveMouse = 0;
//testRunner.UpDelaySeconds = 0;
if (testRunner.NameExists("SettingsAndControls"))
{
testRunner.ClickByName("SettingsAndControls", 5);
testRunner.Wait(.5);
testRunner.Wait(.2);
}
testRunner.ClickByName("Slice Settings Tab", .1);
testRunner.ClickByName("Slice Settings Tab", .1);
@ -205,7 +208,6 @@ namespace MatterHackers.MatterControl.ActionBar
testRunner.Dispose();
}
protected override void AddHandlers()
{
ActiveSliceSettings.ActivePrinterChanged.RegisterEvent(onActivePrinterChanged, ref unregisterEvents);

View file

@ -443,7 +443,9 @@
<None Include="StaticData\PrinterSettings\config.ini" />
<None Include="StaticData\SliceSettings\Properties.json" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="SlicerConfiguration\SettingsEditors\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Submodules\agg-sharp\clipper_library\clipper_library.csproj">
<Project>{9B062971-A88E-4A3D-B3C9-12B78D15FA66}</Project>

View file

@ -48,6 +48,7 @@ namespace MatterHackers.MatterControl
public EditLevelingSettingsWindow()
: base(400, 370)
{
AlwaysOnTopOfMain = true;
Title = LocalizedString.Get("Leveling Settings".Localize());
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);

View file

@ -117,7 +117,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.textImageButtonFactory.normalTextColor = ActiveTheme.Instance.SecondaryTextColor;
this.textImageButtonFactory.pressedTextColor = ActiveTheme.Instance.PrimaryTextColor;
int rightContentWidth = (int)(280 * GuiWidget.DeviceScale + .5);
buttonFactory.FixedHeight = 20 * GuiWidget.DeviceScale;
buttonFactory.fontSize = 10;
buttonFactory.normalFillColor = RGBA_Bytes.White;
@ -171,7 +170,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
categoryPage.AnchorAll();
topCategoryTabs.AddTab(textTabWidget);
TabControl sideTabs = CreateSideTabsAndPages(rightContentWidth, category);
TabControl sideTabs = CreateSideTabsAndPages(category);
sideTabBarsListForLayout.Add(sideTabs.TabBar);
categoryPage.AddChild(sideTabs);
@ -187,7 +186,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
extraSettingsPage.AnchorAll();
int count;
TabControl extraSettingsSideTabs = CreateExtraSettingsSideTabsAndPages(rightContentWidth, topCategoryTabs, out count);
TabControl extraSettingsSideTabs = CreateExtraSettingsSideTabsAndPages(topCategoryTabs, out count);
if (count > 0)
{
topCategoryTabs.AddTab(extraSettingsTextTabWidget);
@ -329,7 +328,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
private int tabIndexForItem = 0;
private TabControl CreateSideTabsAndPages(int rightContentWidth, OrganizerCategory category)
private TabControl CreateSideTabsAndPages(OrganizerCategory category)
{
TabControl leftSideGroupTabs = new TabControl(Orientation.Vertical);
leftSideGroupTabs.Margin = new BorderDouble(0, 0, 0, 5);
@ -371,6 +370,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
FlowLayoutWidget topToBottomSettings = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomSettings.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
this.HAnchor = HAnchor.ParentLeftRight;
foreach (OrganizerSettingsData settingInfo in subGroup.SettingDataList)
{
bool settingShouldBeShown = CheckIfShouldBeShown(settingInfo);
@ -379,7 +380,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
&& settingShouldBeShown)
{
addedSettingToSubGroup = true;
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, rightContentWidth, copyIndex);
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, copyIndex);
topToBottomSettings.AddChild(controlsForThisSetting);
GuiWidget helpBox = AddInHelpText(topToBottomSettings, settingInfo);
@ -507,8 +508,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
return allText;
}
private TabControl CreateExtraSettingsSideTabsAndPages(int rightContentWidth, TabControl categoryTabs, out int count)
private TabControl CreateExtraSettingsSideTabsAndPages(TabControl categoryTabs, out int count)
{
int rightContentWidth = (int)(280 * GuiWidget.DeviceScale + .5);
count = 0;
TabControl leftSideGroupTabs = new TabControl(Orientation.Vertical);
leftSideGroupTabs.Margin = new BorderDouble(0, 0, 0, 5);
@ -526,6 +528,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
FlowLayoutWidget topToBottomSettings = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomSettings.HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth;
this.HAnchor = HAnchor.ParentLeftRight;
foreach (var keyValue in ActiveSliceSettings.Instance.BaseLayer)
{
if (!SliceSettingsOrganizer.Instance.Contains(UserLevel, keyValue.Key))
@ -533,7 +537,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
OrganizerSettingsData settingInfo = new OrganizerSettingsData(keyValue.Key, keyValue.Key, OrganizerSettingsData.DataEditTypes.STRING);
if (ActiveSliceSettings.Instance.ActiveSliceEngine().MapContains(settingInfo.SlicerConfigName))
{
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, rightContentWidth, 0);
GuiWidget controlsForThisSetting = CreateSettingInfoUIControls(settingInfo, 0);
topToBottomSettings.AddChild(controlsForThisSetting);
count++;
}
@ -619,10 +623,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
private static readonly RGBA_Bytes userSettingBackgroundColor = new RGBA_Bytes(68, 95, 220, 108);
private static readonly RGBA_Bytes qualitySettingBackgroundColor = new RGBA_Bytes(255, 255, 0, 108);
private GuiWidget CreateSettingInfoUIControls(OrganizerSettingsData settingData, double rightContentWidth, int extruderIndex)
private GuiWidget CreateSettingInfoUIControls(OrganizerSettingsData settingData, int extruderIndex)
{
GuiWidget container = new GuiWidget();
this.HAnchor = HAnchor.ParentLeftRight;
string sliceSettingValue = ActiveSliceSettings.Instance.ActiveValue(settingData.SlicerConfigName);

View file

@ -4861,3 +4861,6 @@ Translated:Edit Selected Setting
English:Edit Current Printer Settings
Translated:Edit Current Printer Settings
English:Printer Settings
Translated:Printer Settings

@ -1 +1 @@
Subproject commit b126d5a55d25ab9ee5853ecbb7e374f3bada78ae
Subproject commit 834a361f4870e9dd32d6fc3eb225970418bf46c9

@ -1 +1 @@
Subproject commit fe51518649cfd8207cccab18ee9f1dc262eb71b5
Subproject commit 84c5c90de775204d6f8e44bced3e6a840430f196