本文整理汇总了C#中MatterHackers.Agg.UI.CheckBox类的典型用法代码示例。如果您正苦于以下问题:C# CheckBox类的具体用法?C# CheckBox怎么用?C# CheckBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckBox类属于MatterHackers.Agg.UI命名空间,在下文中一共展示了CheckBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: trans_curve1_application
public trans_curve1_application()
{
AnchorAll();
m_poly = new PolygonEditWidget(6, 5);
on_init();
m_poly.Changed += NeedsRedraw;
AddChild(m_poly);
m_num_points = new MatterHackers.Agg.UI.Slider(5, 5, 340, 12);
m_num_points.ValueChanged += new EventHandler(NeedsRedraw);
AddChild(m_num_points);
m_num_points.Text = "Number of intermediate Points = {0:F3}";
m_num_points.SetRange(10, 400);
m_num_points.Value = 200;
m_close = new CheckBox(350, 5.0, "Close");
m_close.CheckedStateChanged += NeedsRedraw;
AddChild(m_close);
m_preserve_x_scale = new CheckBox(460, 5, "Preserve X scale");
m_preserve_x_scale.CheckedStateChanged += NeedsRedraw;
AddChild(m_preserve_x_scale);
m_fixed_len = new CheckBox(350, 25, "Fixed Length");
m_fixed_len.CheckedStateChanged += NeedsRedraw;
AddChild(m_fixed_len);
m_animate = new CheckBox(460, 25, "Animate");
m_animate.CheckedStateChanged += m_animate_CheckedStateChanged;
AddChild(m_animate);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:35,代码来源:trans_curve1.cs
示例2: blur
public blur()
{
m_rbuf2 = new ImageBuffer();
m_shape_bounds = new RectangleDouble();
m_method = new RadioButtonGroup(new Vector2(10.0, 10.0), new Vector2(130.0, 60.0));
m_radius = new Slider(new Vector2(130 + 10.0, 10.0 + 4.0), new Vector2(290, 8.0));
m_shadow_ctrl = new PolygonEditWidget(4);
m_channel_r = new CheckBox(10.0, 80.0, "Red");
m_channel_g = new CheckBox(10.0, 95.0, "Green");
m_channel_b = new CheckBox(10.0, 110.0, "Blue");
m_FlattenCurves = new CheckBox(10, 315, "Convert And Flatten Curves");
m_FlattenCurves.Checked = true;
AddChild(m_method);
m_method.AddRadioButton("Stack Blur");
m_method.AddRadioButton("Recursive Blur");
m_method.AddRadioButton("Channels");
m_method.SelectedIndex = 1;
AddChild(m_radius);
m_radius.SetRange(0.0, 40.0);
m_radius.Value = 15.0;
m_radius.Text = "Blur Radius={0:F2}";
AddChild(m_shadow_ctrl);
AddChild(m_channel_r);
AddChild(m_channel_g);
AddChild(m_channel_b);
AddChild(m_FlattenCurves);
m_channel_g.Checked = true;
m_sl = new ScanlineCachePacked8();
StyledTypeFace typeFaceForLargeA = new StyledTypeFace(LiberationSansFont.Instance, 300, flatenCurves: false);
m_path = typeFaceForLargeA.GetGlyphForCharacter('a');
Affine shape_mtx = Affine.NewIdentity();
shape_mtx *= Affine.NewTranslation(150, 100);
m_path = new VertexSourceApplyTransform(m_path, shape_mtx);
m_shape = new FlattenCurves(m_path);
bounding_rect.bounding_rect_single(m_shape, 0, ref m_shape_bounds);
m_shadow_ctrl.SetXN(0, m_shape_bounds.Left);
m_shadow_ctrl.SetYN(0, m_shape_bounds.Bottom);
m_shadow_ctrl.SetXN(1, m_shape_bounds.Right);
m_shadow_ctrl.SetYN(1, m_shape_bounds.Bottom);
m_shadow_ctrl.SetXN(2, m_shape_bounds.Right);
m_shadow_ctrl.SetYN(2, m_shape_bounds.Top);
m_shadow_ctrl.SetXN(3, m_shape_bounds.Left);
m_shadow_ctrl.SetYN(3, m_shape_bounds.Top);
m_shadow_ctrl.line_color(new RGBA_Floats(0, 0.3, 0.5, 0.3));
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:54,代码来源:blur.cs
示例3: CreateToggleSwitch
public static CheckBox CreateToggleSwitch(bool initialState)
{
ToggleSwitchView toggleView = new ToggleSwitchView("On".Localize(), "Off".Localize(),
60, 24,
ActiveTheme.Instance.PrimaryBackgroundColor,
new RGBA_Bytes(220, 220, 220),
ActiveTheme.Instance.PrimaryAccentColor,
ActiveTheme.Instance.PrimaryTextColor);
CheckBox toggleBox = new CheckBox(toggleView);
toggleBox.Checked = initialState;
return toggleBox;
}
开发者ID:fuding,项目名称:MatterControl,代码行数:12,代码来源:ImageButtonFactory.cs
示例4: ComponentRendering
public ComponentRendering()
: base(320, 320)
{
alphaSlider = new Slider(new Vector2(5, 30), 310, 0, 255);
alphaSlider.ValueChanged += new EventHandler(NeedInvalidate);
alphaSlider.Text = "Alpha={0:F0}";
alphaSlider.Value = 255;
alphaSlider.View.TextColor = new RGBA_Bytes(127, 127, 127);
AddChild(alphaSlider);
useBlackBackgroundCheckbox = new UI.CheckBox(5, 30 + 12, "Draw Black Background");
useBlackBackgroundCheckbox.CheckedStateChanged += NeedInvalidate;
useBlackBackgroundCheckbox.TextColor = new RGBA_Bytes(127, 127, 127);
AddChild(useBlackBackgroundCheckbox);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:15,代码来源:component_rendering.cs
示例5: AddMinimumError
private void AddMinimumError()
{
GuiWidget thingToHide;
{
FlowLayoutWidget twoColumns = new FlowLayoutWidget();
twoColumns.Name = "twoColumns";
{
FlowLayoutWidget leftColumn = new FlowLayoutWidget(FlowDirection.TopToBottom);
leftColumn.Name = "leftColumn";
{
FlowLayoutWidget topLeftStuff = new FlowLayoutWidget(FlowDirection.TopToBottom);
topLeftStuff.Name = "topLeftStuff";
topLeftStuff.AddChild(new TextWidget("Top of Top Stuff"));
thingToHide = new Button("thing to hide");
topLeftStuff.AddChild(thingToHide);
topLeftStuff.AddChild(new TextWidget("Bottom of Top Stuff"));
leftColumn.AddChild(topLeftStuff);
//leftColumn.DebugShowBounds = true;
}
twoColumns.AddChild(leftColumn);
}
{
FlowLayoutWidget rightColumn = new FlowLayoutWidget(FlowDirection.TopToBottom);
rightColumn.Name = "rightColumn";
CheckBox hideCheckBox = new CheckBox("Hide Stuff");
rightColumn.AddChild(hideCheckBox);
hideCheckBox.CheckedStateChanged += (sender, e) =>
{
if (hideCheckBox.Checked)
{
thingToHide.Visible = false;
}
else
{
thingToHide.Visible = true;
}
};
twoColumns.AddChild(rightColumn);
}
this.AddChild(twoColumns);
}
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:48,代码来源:LayoutPage.cs
示例6: SliderControlsPage
public SliderControlsPage()
: base("Slider Widget")
{
horizontalSlider = new Slider(new Vector2(20, 60), 100);
AddChild(horizontalSlider);
horizontalSlider.Text = "{0:0.0}";
changeSliderText = new CheckBox(10, 200, "Show Text");
changeSliderText.Checked = true;
AddChild(changeSliderText);
changeSliderText.CheckedStateChanged += new CheckBox.CheckedStateChangedEventHandler(changeSliderText_CheckedStateChanged);
verticalSlider = new Slider(new Vector2(320, 60), 100, orientation: Orientation.Vertical);
AddChild(verticalSlider);
verticalSlider.Text = "{0:0.0}";
}
开发者ID:jeske,项目名称:agg-sharp,代码行数:16,代码来源:SliderControlsPage.cs
示例7: CreateToggleSwitch
public static CheckBox CreateToggleSwitch(bool initialState)
{
string on = "On";
string off = "Off";
if (StaticData.Instance != null)
{
on = on.Localize();
off = off.Localize();
}
ToggleSwitchView toggleView = new ToggleSwitchView(on, off,
60, 24,
ActiveTheme.Instance.PrimaryBackgroundColor,
new RGBA_Bytes(220, 220, 220),
ActiveTheme.Instance.PrimaryAccentColor,
ActiveTheme.Instance.PrimaryTextColor);
CheckBox toggleBox = new CheckBox(toggleView);
toggleBox.Checked = initialState;
return toggleBox;
}
开发者ID:broettge,项目名称:MatterControl,代码行数:19,代码来源:ImageButtonFactory.cs
示例8: lion_outline
public lion_outline()
{
widthSlider = new MatterHackers.Agg.UI.Slider(new Vector2(5, 5), 498);
renderAsScanlineCheckBox = new MatterHackers.Agg.UI.CheckBox(160, 5, "Use Scanline Rasterizer");
renderAsScanlineCheckBox.Checked = false;
widthSlider.ValueChanged += new EventHandler(NeedsRedraw);
renderAsScanlineCheckBox.CheckedStateChanged += NeedsRedraw;
AddChild(widthSlider);
widthSlider.OriginRelativeParent = Vector2.Zero;
widthSlider.SetRange(0.0, 4.0);
widthSlider.Value = 1.0;
widthSlider.Text = "Width {0:F2}";
AddChild(renderAsScanlineCheckBox);
//renderAsScanlineCheckBox.Transform = Affine.NewIdentity();
renderAccurateJoinsCheckBox = new CheckBox(200 + 10.0, 10.0 + 4.0 + 16.0, "Accurate Joins");
AddChild(renderAccurateJoinsCheckBox);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:19,代码来源:lion_outline.cs
示例9: OnDraw
public override void OnDraw(Graphics2D graphics2D)
{
ImageBuffer widgetsSubImage = ImageBuffer.NewSubImageReference(graphics2D.DestImage, graphics2D.GetClippingRect());
IImageByte backBuffer = widgetsSubImage;
if (firstTime)
{
firstTime = false;
m_SuperFast = new MatterHackers.Agg.UI.CheckBox(10, 10, "Run Super Fast");
AddChild(m_SuperFast);
m_Controller = new CController(backBuffer, 30, 40, .1, .7, .3, 4, 1, 2000);
}
graphics2D.Clear(new RGBA_Floats(1, 1, 1, 1));
graphics2D.Rasterizer.SetVectorClipBox(0, 0, (int)Width, (int)Height);
m_Controller.FastRender(m_SuperFast.Checked);
m_Controller.Render(graphics2D);
//m_SuperFast.Render(graphics2D);
base.OnDraw(graphics2D);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:21,代码来源:SmartSweepers.cs
示例10: ScaleControls
public ScaleControls(View3DWidget view3DWidget)
: base(FlowDirection.TopToBottom)
{
this.view3DWidget = view3DWidget;
{
expandScaleOptions = view3DWidget.ExpandMenuOptionFactory.GenerateCheckBoxButton("Scale".Localize().ToUpper(), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandScaleOptions.Margin = new BorderDouble(bottom: 2);
this.AddChild(expandScaleOptions);
scaleOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
scaleOptionContainer.HAnchor = HAnchor.ParentLeftRight;
scaleOptionContainer.Visible = false;
this.AddChild(scaleOptionContainer);
AddScaleControls(scaleOptionContainer);
}
expandScaleOptions.CheckedStateChanged += expandScaleOptions_CheckedStateChanged;
view3DWidget.SelectedTransformChanged += OnSelectedTransformChanged;
}
开发者ID:broettge,项目名称:MatterControl,代码行数:21,代码来源:ScaleControls.cs
示例11: MirrorControls
public MirrorControls(View3DWidget view3DWidget)
: base(FlowDirection.TopToBottom)
{
this.view3DWidget = view3DWidget;
// put in the mirror options
{
expandMirrorOptions = view3DWidget.ExpandMenuOptionFactory.GenerateCheckBoxButton("Mirror".Localize().ToUpper(), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandMirrorOptions.Margin = new BorderDouble(bottom: 2);
this.AddChild(expandMirrorOptions);
mirrorOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
mirrorOptionContainer.HAnchor = HAnchor.ParentLeftRight;
mirrorOptionContainer.Visible = false;
this.AddChild(mirrorOptionContainer);
AddMirrorControls(mirrorOptionContainer);
}
expandMirrorOptions.CheckedStateChanged += expandMirrorOptions_CheckedStateChanged;
}
开发者ID:broettge,项目名称:MatterControl,代码行数:21,代码来源:MirrorControls.cs
示例12: TopToBottomContainerAppliesExpectedMarginToToggleView
public void TopToBottomContainerAppliesExpectedMarginToToggleView()
{
TestContext.CurrentContext.SetCompatibleWorkingDirectory();
int marginSize = 40;
int dimensions = 300;
GuiWidget outerContainer = new GuiWidget(dimensions, dimensions);
FlowLayoutWidget topToBottomContainer = new FlowLayoutWidget(FlowDirection.TopToBottom)
{
HAnchor = HAnchor.ParentLeftRight,
VAnchor = VAnchor.ParentBottomTop,
};
outerContainer.AddChild(topToBottomContainer);
CheckBox toggleBox = new CheckBox("test");
toggleBox.HAnchor = HAnchor.ParentLeftRight;
toggleBox.VAnchor = VAnchor.ParentBottomTop;
toggleBox.Margin = new BorderDouble(marginSize);
toggleBox.BackgroundColor = RGBA_Bytes.Red;
toggleBox.DebugShowBounds = true;
topToBottomContainer.AddChild(toggleBox);
topToBottomContainer.AnchorAll();
topToBottomContainer.PerformLayout();
outerContainer.DoubleBuffer = true;
outerContainer.BackBuffer.NewGraphics2D().Clear(RGBA_Bytes.White);
outerContainer.OnDraw(outerContainer.NewGraphics2D());
// For troubleshooting or visual validation
OutputImages(outerContainer, outerContainer);
var bounds = toggleBox.BoundsRelativeToParent;
Assert.IsTrue(bounds.Left == marginSize, "Left margin is incorrect");
Assert.IsTrue(bounds.Right == dimensions - marginSize, "Right margin is incorrect");
Assert.IsTrue(bounds.Top == dimensions - marginSize, "Top margin is incorrect");
Assert.IsTrue(bounds.Bottom == marginSize, "Bottom margin is incorrect");
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:40,代码来源:MatterControlUiFeatures.cs
示例13: rounded_rect_application
public rounded_rect_application()
{
AnchorAll();
m_idx = (-1);
m_radius = new MatterHackers.Agg.UI.Slider(new Vector2(10, 10), new Vector2(580, 9));
m_gamma = new MatterHackers.Agg.UI.Slider(new Vector2(10, 10 + 40), new Vector2(580, 9));
m_offset = new MatterHackers.Agg.UI.Slider(new Vector2(10, 10 + 80), new Vector2(580, 9));
m_white_on_black = new CheckBox(10, 10+60, "White on black");
m_DrawAsOutlineCheckBox = new CheckBox(10 + 180, 10 + 60, "Fill Rounded Rect");
m_radius.ValueChanged += new EventHandler(NeedsRedraw);
m_gamma.ValueChanged += new EventHandler(NeedsRedraw);
m_offset.ValueChanged += new EventHandler(NeedsRedraw);
m_white_on_black.CheckedStateChanged += new CheckBox.CheckedStateChangedEventHandler(NeedsRedraw);
m_DrawAsOutlineCheckBox.CheckedStateChanged += new CheckBox.CheckedStateChangedEventHandler(NeedsRedraw);
m_x[0] = 100; m_y[0] = 100;
m_x[1] = 500; m_y[1] = 350;
AddChild(m_radius);
AddChild(m_gamma);
AddChild(m_offset);
AddChild(m_white_on_black);
AddChild(m_DrawAsOutlineCheckBox);
m_gamma.Text = "gamma={0:F3}";
m_gamma.SetRange(0.0, 3.0);
m_gamma.Value = 1.8;
m_radius.Text = "radius={0:F3}";
m_radius.SetRange(0.0, 50.0);
m_radius.Value = 25.0;
m_offset.Text = "subpixel offset={0:F3}";
m_offset.SetRange(-2.0, 3.0);
m_white_on_black.TextColor = new RGBA_Bytes(127, 127, 127);
//m_white_on_black.inactive_color(new RGBA_Bytes(127, 127, 127));
m_DrawAsOutlineCheckBox.TextColor = new RGBA_Floats(.5, .5, .5).GetAsRGBA_Bytes();
//m_DrawAsOutlineCheckBox.inactive_color(new RGBA_Bytes(127, 127, 127));
}
开发者ID:jeske,项目名称:agg-sharp,代码行数:40,代码来源:rounded_rect.cs
示例14: SliceSettingsDetailControl
public SliceSettingsDetailControl()
{
showHelpBox = new CheckBox(0, 0, "Show Help".Localize(), textSize: 10);
showHelpBox.Checked = UserSettings.Instance.get(SliceSettingsShowHelpEntry) == "true";
// add in the ability to turn on and off help text
showHelpBox.TextColor = ActiveTheme.Instance.PrimaryTextColor;
showHelpBox.Margin = new BorderDouble(right: 3);
showHelpBox.VAnchor = VAnchor.ParentCenter;
showHelpBox.Cursor = Cursors.Hand;
showHelpBox.CheckedStateChanged += (s, e) =>
{
UserSettings.Instance.set(SliceSettingsShowHelpEntry, showHelpBox.Checked.ToString().ToLower());
ShowHelpChanged?.Invoke(this, null);
};
this.AddChild(showHelpBox);
settingsDetailSelector = new StyledDropDownList("Basic", maxHeight: 200);
settingsDetailSelector.Name = "User Level Dropdown";
settingsDetailSelector.AddItem("Basic".Localize(), "Simple");
settingsDetailSelector.AddItem("Standard".Localize(), "Intermediate");
settingsDetailSelector.AddItem("Advanced".Localize(), "Advanced");
if (UserSettings.Instance.get(SliceSettingsLevelEntry) != null
&& SliceSettingsOrganizer.Instance.UserLevels.ContainsKey(UserSettings.Instance.get(SliceSettingsLevelEntry)))
{
settingsDetailSelector.SelectedValue = UserSettings.Instance.get(SliceSettingsLevelEntry);
}
settingsDetailSelector.SelectionChanged += new EventHandler(SettingsDetail_SelectionChanged);
settingsDetailSelector.VAnchor = VAnchor.ParentCenter;
settingsDetailSelector.Margin = new BorderDouble(5, 3);
settingsDetailSelector.BorderColor = new RGBA_Bytes(ActiveTheme.Instance.SecondaryTextColor, 100);
this.AddChild(settingsDetailSelector);
this.AddChild(GetSliceOptionsMenuDropList());
}
开发者ID:broettge,项目名称:MatterControl,代码行数:36,代码来源:SliceSettingsDetailControl.cs
示例15: CreateRightButtonPanel
private FlowLayoutWidget CreateRightButtonPanel(double buildHeight)
{
FlowLayoutWidget buttonRightPanel = new FlowLayoutWidget(FlowDirection.TopToBottom);
buttonRightPanel.Width = 200;
{
BorderDouble buttonMargin = new BorderDouble(top: 3);
expandRotateOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Rotate"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandRotateOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandRotateOptions);
rotateOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
rotateOptionContainer.HAnchor = HAnchor.ParentLeftRight;
rotateOptionContainer.Visible = false;
buttonRightPanel.AddChild(rotateOptionContainer);
expandScaleOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Scale"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandScaleOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandScaleOptions);
scaleOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
scaleOptionContainer.HAnchor = HAnchor.ParentLeftRight;
scaleOptionContainer.Visible = false;
buttonRightPanel.AddChild(scaleOptionContainer);
// put in the mirror options
{
expandMirrorOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Mirror"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandMirrorOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandMirrorOptions);
mirrorOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
mirrorOptionContainer.HAnchor = HAnchor.ParentLeftRight;
mirrorOptionContainer.Visible = false;
buttonRightPanel.AddChild(mirrorOptionContainer);
AddMirrorControls(mirrorOptionContainer);
}
// put in the material options
int numberOfExtruders = ActiveSliceSettings.Instance.ExtruderCount;
expandMaterialOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Material"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandMaterialOptions.Margin = new BorderDouble(bottom: 2);
if (numberOfExtruders > 1)
{
buttonRightPanel.AddChild(expandMaterialOptions);
materialOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
materialOptionContainer.HAnchor = HAnchor.ParentLeftRight;
materialOptionContainer.Visible = false;
buttonRightPanel.AddChild(materialOptionContainer);
AddMaterialControls(materialOptionContainer);
}
// put in the view options
{
expandViewOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Display"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandViewOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandViewOptions);
viewOptionContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
viewOptionContainer.HAnchor = HAnchor.ParentLeftRight;
viewOptionContainer.Padding = new BorderDouble(left: 4);
viewOptionContainer.Visible = false;
{
CheckBox showBedCheckBox = new CheckBox(LocalizedString.Get("Show Print Bed"), textColor: ActiveTheme.Instance.PrimaryTextColor);
showBedCheckBox.Checked = true;
showBedCheckBox.CheckedStateChanged += (sender, e) =>
{
meshViewerWidget.RenderBed = showBedCheckBox.Checked;
};
viewOptionContainer.AddChild(showBedCheckBox);
if (buildHeight > 0)
{
CheckBox showBuildVolumeCheckBox = new CheckBox(LocalizedString.Get("Show Print Area"), textColor: ActiveTheme.Instance.PrimaryTextColor);
showBuildVolumeCheckBox.Checked = false;
showBuildVolumeCheckBox.Margin = new BorderDouble(bottom: 5);
showBuildVolumeCheckBox.CheckedStateChanged += (sender, e) =>
{
meshViewerWidget.RenderBuildVolume = showBuildVolumeCheckBox.Checked;
};
viewOptionContainer.AddChild(showBuildVolumeCheckBox);
}
if (ActiveTheme.Instance.IsTouchScreen)
{
UserSettings.Instance.set("defaultRenderSetting", RenderTypes.Shaded.ToString());
}
else
{
CreateRenderTypeRadioButtons(viewOptionContainer);
}
}
buttonRightPanel.AddChild(viewOptionContainer);
}
//.........这里部分代码省略.........
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:101,代码来源:View3DWidget.cs
示例16: AddScaleControls
private void AddScaleControls(FlowLayoutWidget buttonPanel)
{
List<GuiWidget> scaleControls = new List<GuiWidget>();
transformControls.Add("Scale", scaleControls);
// Put in the scale ratio edit field
{
FlowLayoutWidget scaleRatioContainer = new FlowLayoutWidget(FlowDirection.LeftToRight);
scaleRatioContainer.HAnchor = HAnchor.ParentLeftRight;
scaleRatioContainer.Padding = new BorderDouble(5);
string scaleRatioLabelText = "Ratio".Localize();
string scaleRatioLabelTextFull = "{0}:".FormatWith(scaleRatioLabelText);
TextWidget scaleRatioLabel = new TextWidget(scaleRatioLabelTextFull, textColor: ActiveTheme.Instance.PrimaryTextColor);
scaleRatioLabel.Margin = new BorderDouble(0, 0, 3, 0);
scaleRatioLabel.VAnchor = VAnchor.ParentCenter;
scaleRatioContainer.AddChild(scaleRatioLabel);
scaleRatioContainer.AddChild(new HorizontalSpacer());
scaleRatioControl = new MHNumberEdit(1, pixelWidth: 50 * TextWidget.GlobalPointSizeScaleRatio, allowDecimals: true, increment: .05);
scaleRatioControl.SelectAllOnFocus = true;
scaleRatioControl.VAnchor = VAnchor.ParentCenter;
scaleRatioContainer.AddChild(scaleRatioControl);
scaleRatioControl.ActuallNumberEdit.KeyPressed += (sender, e) =>
{
SetApplyScaleVisability(this, null);
};
scaleRatioControl.ActuallNumberEdit.KeyDown += (sender, e) =>
{
SetApplyScaleVisability(this, null);
};
scaleRatioControl.ActuallNumberEdit.EnterPressed += (object sender, KeyEventArgs keyEvent) =>
{
ApplyScaleFromEditField();
};
scaleRatioContainer.AddChild(CreateScaleDropDownMenu());
buttonPanel.AddChild(scaleRatioContainer);
scaleControls.Add(scaleRatioControl);
}
applyScaleButton = whiteButtonFactory.Generate("Apply Scale".Localize(), centerText: true);
applyScaleButton.Visible = false;
applyScaleButton.Cursor = Cursors.Hand;
buttonPanel.AddChild(applyScaleButton);
scaleControls.Add(applyScaleButton);
applyScaleButton.Click += (object sender, EventArgs mouseEvent) =>
{
ApplyScaleFromEditField();
};
// add in the dimensions
{
buttonPanel.AddChild(createAxisScalingControl("x", 0));
buttonPanel.AddChild(createAxisScalingControl("y", 1));
buttonPanel.AddChild(createAxisScalingControl("z", 2));
uniformScale = new CheckBox("Lock Ratio".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor);
uniformScale.Checked = true;
FlowLayoutWidget leftToRight = new FlowLayoutWidget();
leftToRight.Padding = new BorderDouble(5, 3);
leftToRight.AddChild(uniformScale);
buttonPanel.AddChild(leftToRight);
}
buttonPanel.AddChild(generateHorizontalRule());
}
开发者ID:gobrien4418,项目名称:MatterControl,代码行数:75,代码来源:View3DWidget.cs
示例17: AddDisplayControls
private void AddDisplayControls(FlowLayoutWidget buttonPanel)
{
buttonPanel.CloseAllChildren();
double oldWidth = textImageButtonFactory.FixedWidth;
textImageButtonFactory.FixedWidth = 44 * TextWidget.GlobalPointSizeScaleRatio;
FlowLayoutWidget layerInfoContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
layerInfoContainer.HAnchor = HAnchor.ParentLeftRight;
layerInfoContainer.Padding = new BorderDouble(5);
// put in a show grid check box
{
CheckBox showGrid = new CheckBox(LocalizedString.Get("Print Bed"), textColor: ActiveTheme.Instance.PrimaryTextColor);
showGrid.Checked = gcodeViewWidget.RenderGrid;
meshViewerWidget.RenderBed = showGrid.Checked;
showGrid.CheckedStateChanged += (sender, e) =>
{
gcodeViewWidget.RenderGrid = showGrid.Checked;
meshViewerWidget.RenderBed = showGrid.Checked;
};
layerInfoContainer.AddChild(showGrid);
}
// put in a show moves checkbox
{
CheckBox showMoves = new CheckBox(LocalizedString.Get("Moves"), textColor: ActiveTheme.Instance.PrimaryTextColor);
showMoves.Checked = gcodeViewWidget.RenderMoves;
showMoves.CheckedStateChanged += (sender, e) =>
{
gcodeViewWidget.RenderMoves = showMoves.Checked;
};
layerInfoContainer.AddChild(showMoves);
}
// put in a show Retractions checkbox
{
CheckBox showRetractions = new CheckBox(LocalizedString.Get("Retractions"), textColor: ActiveTheme.Instance.PrimaryTextColor);
showRetractions.Checked = gcodeViewWidget.RenderRetractions;
showRetractions.CheckedStateChanged += (sender, e) =>
{
gcodeViewWidget.RenderRetractions = showRetractions.Checked;
};
layerInfoContainer.AddChild(showRetractions);
}
// put in a show speed checkbox
{
showSpeeds = new CheckBox(LocalizedString.Get("Speeds"), textColor: ActiveTheme.Instance.PrimaryTextColor);
showSpeeds.Checked = gcodeViewWidget.RenderSpeeds;
//showSpeeds.Checked = gradient.Visible;
showSpeeds.CheckedStateChanged += (sender, e) =>
{
/* if (!showSpeeds.Checked)
{
gradient.Visible = false;
}
else
{
gradient.Visible = true;
}*/
gradientWidget.Visible = showSpeeds.Checked;
gcodeViewWidget.RenderSpeeds = showSpeeds.Checked;
};
layerInfoContainer.AddChild(showSpeeds);
}
// put in a simulate extrusion checkbox
{
CheckBox simulateExtrusion = new CheckBox(LocalizedString.Get("Extrusion"), textColor: ActiveTheme.Instance.PrimaryTextColor);
simulateExtrusion.Checked = gcodeViewWidget.SimulateExtrusion;
simulateExtrusion.CheckedStateChanged += (sender, e) =>
{
gcodeViewWidget.SimulateExtrusion = simulateExtrusion.Checked;
};
layerInfoContainer.AddChild(simulateExtrusion);
}
// put in a render extrusion transparent checkbox
{
CheckBox transparentExtrusion = new CheckBox(LocalizedString.Get("Transparent"), textColor: ActiveTheme.Instance.PrimaryTextColor)
{
Checked = gcodeViewWidget.TransparentExtrusion,
Margin = new BorderDouble(5, 0, 0, 0) * TextWidget.GlobalPointSizeScaleRatio,
HAnchor = HAnchor.ParentLeft,
};
transparentExtrusion.CheckedStateChanged += (sender, e) =>
{
gcodeViewWidget.TransparentExtrusion = transparentExtrusion.Checked;
};
layerInfoContainer.AddChild(transparentExtrusion);
}
// put in a simulate extrusion checkbox
if (ActiveSliceSettings.Instance.ExtruderCount > 1)
{
//.........这里部分代码省略.........
开发者ID:glocklueng,项目名称:MatterControl,代码行数:101,代码来源:ViewGcodeBasic.cs
示例18: CreateRightButtonPanel
private FlowLayoutWidget CreateRightButtonPanel()
{
FlowLayoutWidget buttonRightPanel = new FlowLayoutWidget(FlowDirection.TopToBottom);
buttonRightPanel.Width = 200;
{
string label = "Model".Localize().ToUpper();
expandModelOptions = expandMenuOptionFactory.GenerateCheckBoxButton(label, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandModelOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandModelOptions);
expandModelOptions.Checked = true;
modelOptionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
modelOptionsContainer.HAnchor = HAnchor.ParentLeftRight;
//modelOptionsContainer.Visible = false;
buttonRightPanel.AddChild(modelOptionsContainer);
expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandDisplayOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandDisplayOptions);
expandDisplayOptions.Checked = false;
displayOptionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
displayOptionsContainer.HAnchor = HAnchor.ParentLeftRight;
displayOptionsContainer.Padding = new BorderDouble(left: 6);
displayOptionsContainer.Visible = false;
buttonRightPanel.AddChild(displayOptionsContainer);
GuiWidget verticalSpacer = new GuiWidget();
verticalSpacer.VAnchor = VAnchor.ParentBottomTop;
buttonRightPanel.AddChild(verticalSpacer);
}
buttonRightPanel.Padding = new BorderDouble(6, 6);
buttonRightPanel.Margin = new BorderDouble(0, 1);
buttonRightPanel.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
buttonRightPanel.VAnchor = VAnchor.ParentBottomTop;
return buttonRightPanel;
}
开发者ID:glocklueng,项目名称:MatterControl,代码行数:39,代码来源:ViewGcodeBasic.cs
示例19: PrintActivePart
public void PrintActivePart(bool overrideAllowGCode = false)
{
try
{
// If leveling is required or is currently on
if (ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.print_leveling_required_to_print)
|| ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.print_leveling_enabled))
{
PrintLevelingData levelingData = ActiveSliceSettings.Instance.Helpers.GetPrintLevelingData();
if (levelingData?.HasBeenRunAndEnabled() != true)
{
LevelWizardBase.ShowPrintLevelWizard();
return;
}
}
if (PrinterConnectionAndCommunication.Instance.ActivePrintItem != null)
{
string pathAndFile = PrinterConnectionAndCommunication.Instance.ActivePrintItem.FileLocation;
if (ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.has_sd_card_reader)
&& pathAndFile == QueueData.SdCardFileName)
{
PrinterConnectionAndCommunication.Instance.StartSdCardPrint();
}
else if (ActiveSliceSettings.Instance.IsValid())
{
if (File.Exists(pathAndFile))
{
// clear the output cache prior to starting a print
PrinterOutputCache.Instance.Clear();
string hideGCodeWarning = ApplicationSettings.Instance.get(ApplicationSettingsKey.HideGCodeWarning);
if (Path.GetExtension(pathAndFile).ToUpper() == ".GCODE"
&& hideGCodeWarning == null
&& !overrideAllowGCode)
{
CheckBox hideGCodeWarningCheckBox = new CheckBox(doNotAskAgainMessage);
hideGCodeWarningCheckBox.TextColor = ActiveTheme.Instance.PrimaryTextColor;
hideGCodeWarningCheckBox.Margin = new BorderDouble(top: 6, left: 6);
hideGCodeWarningCheckBox.HAnchor = Agg.UI.HAnchor.ParentLeft;
hideGCodeWarningCheckBox.Click += (sender, e) =>
{
if (hideGCodeWarningCheckBox.Checked)
{
ApplicationSettings.Instance.set(ApplicationSettingsKey.HideGCodeWarning, "true");
}
else
{
ApplicationSettings.Instance.set(ApplicationSettingsKey.HideGCodeWarning, null);
}
};
UiThread.RunOnIdle(() => StyledMessageBox.ShowMessageBox(onConfirmPrint, gcodeWarningMessage, "Warning - GCode file".Localize(), new GuiWidget[] { new VerticalSpacer(), hideGCodeWarningCheckBox }, StyledMessageBox.MessageType.YES_NO));
}
else
{
PrinterConnectionAndCommunication.Instance.CommunicationState = PrinterConnectionAndCommunication.CommunicationStates.PreparingToPrint;
PrintItemWrapper partToPrint = PrinterConnectionAndCommunication.Instance.ActivePrintItem;
SlicingQueue.Instance.QueuePartForSlicing(partToPrint);
partToPrint.SlicingDone += partToPrint_SliceDone;
}
}
else
{
string message = String.Format(removeFromQueueMessage, pathAndFile);
StyledMessageBox.ShowMessageBox(onRemoveMessageConfirm, message, itemNotFoundMessage, StyledMessageBox.MessageType.YES_NO, "Remove".Localize(), "Cancel".Localize());
}
}
}
}
catch (Exception e)
{
Debug.Print(e.Message);
GuiWidget.BreakInDebugger();
// Let's track this issue if possible.
MatterControlApplication.Instance.ReportException(e, this.GetType().Name, MethodBase.GetCurrentMethod().Name);
}
}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:79,代码来源:PrinterConnectionAndCommunication.cs
示例20: OutputScrollWindow
// private as you can't make one
private OutputScrollWindow()
: base(400, 300)
{
this.BackgroundColor = backgroundColor;
this.Padding = new BorderDouble(5, 0);
FlowLayoutWidget topLeftToRightLayout = new FlowLayoutWidget();
topLeftToRightLayout.AnchorAll();
{
FlowLayoutWidget manualEntryTopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom);
manualEntryTopToBottomLayout.VAnchor |= Agg.UI.VAnchor.ParentTop;
manualEntryTopToBottomLayout.Padding = new BorderDouble(top:8);
{
FlowLayoutWidget topBarControls = new FlowLayoutWidget(FlowDirection.LeftToRight);
topBarControls.HAnchor |= HAnchor.ParentLeft;
string filterOutputChkTxt = LocalizedString.Get("Filter Output");
filterOutput = new CheckBox(filterOutputChkTxt);
filterOutput.Margin = new BorderDouble(5, 5, 5, 2);
filterOutput.Checked = false;
filterOutput.TextColor = this.textColor;
filterOutput.CheckedStateChanged += new CheckBox.CheckedStateChangedEventHandler(SetCorrectFilterOutputBehavior);
filterOutput.VAnchor = Agg.UI.VAnchor.ParentBottom;
topBarControls.AddChild(filterOutput);
string autoUpperCaseChkTxt = LocalizedString.Get("Auto Uppercase");
autoUppercase = new CheckBox(autoUpperCaseChkTxt);
autoUppercase.Margin = new BorderDouble(5, 5, 5, 2);
autoUppercase.Checked = true;
autoUppercase.TextColor = this.textColor;
autoUppercase.VAnchor = Agg.UI.VAnchor.ParentBottom;
topBarControls.AddChild(autoUppercase);
manualEntryTopToBottomLayout.AddChild(topBarControls);
}
{
outputScrollWidget = new OutputScroll();
//outputScrollWidget.Height = 100;
outputScrollWidget.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
outputScrollWidget.TextColor = ActiveTheme.Instance.PrimaryTextColor;
outputScrollWidget.HAnchor = HAnchor.ParentLeftRight;
outputScrollWidget.VAnchor = VAnchor.ParentBottomTop;
outputScrollWidget.Margin = new BorderDouble(0,5);
outputScrollWidget.Padding = new BorderDouble(3, 0);
manualEntryTopToBottomLayout.AddChild(outputScrollWidget);
}
FlowLayoutWidget manualEntryLayout = new FlowLayoutWidget(FlowDirection.LeftToRight);
manualEntryLayout.BackgroundColor = this.backgroundColor;
manualEntryLayout.HAnchor = HAnchor.ParentLeftRight;
{
manualCommandTextEdit = new MHTextEditWidget("");
//manualCommandTextEdit.BackgroundColor = RGBA_Bytes.White;
manualCommandTextEdit.Margin = new BorderDouble(right: 3);
manualCommandTextEdit.HAnchor = HAnchor.ParentLeftRight;
manualCommandTextEdit.VAnchor = VAnchor.ParentBottom;
manualCommandTextEdit.ActualTextEditWidget.EnterPressed += new KeyEventHandler(manualCommandTextEdit_EnterPressed);
manualCommandTextEdit.ActualTextEditWidget.KeyDown += new KeyEventHandler(manualCommandTextEdit_KeyDown);
manualEntryLayout.AddChild(manualCommandTextEdit);
}
manualEntryTopToBottomLayout.AddChild(manualEntryLayout);
Button clearConsoleButton = controlButtonFactory.Generate(LocalizedString.Get("Clear"));
clearConsoleButton.Margin = new BorderDouble(0);
clearConsoleButton.Click += (sender, e) =>
{
outputScrollWidget.Clear();
};
Button closeB
|
请发表评论