Fixed the layout bug with the repetier eeprom window.

This commit is contained in:
larsbrubaker 2014-02-25 09:34:59 -08:00
parent ccdedb5886
commit 8b44d69fab
3 changed files with 29 additions and 1 deletions

View file

@ -26,6 +26,7 @@ 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.
*/
//#define SIMULATE_CONNECTION
using System;
using System.Collections.Generic;
@ -119,8 +120,26 @@ namespace MatterHackers.MatterControl.EeProm
PrinterCommunication.Instance.CommunicationUnconditionalFromPrinter.RegisterEvent(currentEePromSettings.Add, ref unregisterEvents);
currentEePromSettings.eventAdded += NewSettingReadFromPrinter;
currentEePromSettings.AskPrinterForSettings();
#if SIMULATE_CONNECTION
UiThread.RunOnIdle(AddSimulatedItems);
#endif
}
#if SIMULATE_CONNECTION
int count;
void AddSimulatedItems(object state)
{
NewSettingReadFromPrinter(this, new EePromRepetierParameter("this is a test line " + count.ToString()));
count++;
if (count < 30)
{
UiThread.RunOnIdle(AddSimulatedItems);
}
}
#endif
private static void CreateSpacer(FlowLayoutWidget buttonBar)
{
GuiWidget spacer = new GuiWidget(1, 1);
@ -186,6 +205,12 @@ namespace MatterHackers.MatterControl.EeProm
settingsColmun.AddChild(row);
}
// TODO: fix the flow layout so we don't need this.
// This is correcting a bug in flow layout widgets not setting sizes correctly.
double oldWidth = Width;
Width = Width + 1;
Width = oldWidth;
}
private GuiWidget AddDescription(string description)

View file

@ -306,6 +306,9 @@ namespace MatterHackers.MatterControl
Button openEePromWindow = textImageButtonFactory.Generate(new LocalizedString("CONFIGURE").Translated);
openEePromWindow.Click += (sender, e) =>
{
#if false // This is to force the creation of the repetier window for testing when we don't have repetier firmware.
new MatterHackers.MatterControl.EeProm.EePromRepetierWidget();
#else
switch(PrinterCommunication.Instance.FirmwareType)
{
case PrinterCommunication.FirmwareTypes.Repetier:
@ -325,6 +328,7 @@ namespace MatterHackers.MatterControl
);
break;
}
#endif
};
//eePromControlsLayout.AddChild(eePromIcon);
eePromControlsLayout.AddChild(openEePromWindow);

View file

@ -12,7 +12,6 @@ build_height = 0
complete_objects = 0
cool_extruder_lift = 0
cooling = 1
cool_extruder_lift = 0
default_acceleration = 0
disable_fan_first_layers = 1
end_gcode = M104 S0 ; turn off temperature\nG28 X0 ; home X axis\nM84 ; disable motors