本文整理汇总了C#中MatterHackers.Agg.UI.TextWidget类的典型用法代码示例。如果您正苦于以下问题:C# TextWidget类的具体用法?C# TextWidget怎么用?C# TextWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextWidget类属于MatterHackers.Agg.UI命名空间,在下文中一共展示了TextWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadHTML
public void LoadHTML(string htmlContent)
{
htmlContent = DoTemplateReplacements(htmlContent);
TextWidget textwdigt = new TextWidget("some test text");
textwdigt.AnchorCenter();
AddChild(textwdigt);
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:7,代码来源:AboutPage.cs
示例2: createPrinterConnectionMessageContainer
public FlowLayoutWidget createPrinterConnectionMessageContainer()
{
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
container.Margin = new BorderDouble(5);
BorderDouble elementMargin = new BorderDouble(top: 5);
TextWidget continueMessage = new TextWidget("Would you like to connect to this printer now?", 0, 0, 12);
continueMessage.AutoExpandBoundsToText = true;
continueMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor;
continueMessage.HAnchor = HAnchor.ParentLeftRight;
continueMessage.Margin = elementMargin;
TextWidget continueMessageTwo = new TextWidget("You can always configure this later.", 0, 0, 10);
continueMessageTwo.AutoExpandBoundsToText = true;
continueMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
continueMessageTwo.HAnchor = HAnchor.ParentLeftRight;
continueMessageTwo.Margin = elementMargin;
printerErrorMessage = new TextWidget("", 0, 0, 10);
printerErrorMessage.AutoExpandBoundsToText = true;
printerErrorMessage.TextColor = RGBA_Bytes.Red;
printerErrorMessage.HAnchor = HAnchor.ParentLeftRight;
printerErrorMessage.Margin = elementMargin;
container.AddChild(continueMessage);
container.AddChild(continueMessageTwo);
container.AddChild(printerErrorMessage);
container.HAnchor = HAnchor.ParentLeftRight;
return container;
}
开发者ID:fuding,项目名称:MatterControl,代码行数:31,代码来源:SetupStepConfigureConnection.cs
示例3: PrintProgressBar
public PrintProgressBar()
{
MinimumSize = new Vector2(0, 24);
HAnchor = HAnchor.ParentLeftRight;
BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
Margin = new BorderDouble(0);
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.LeftToRight);
container.AnchorAll();
container.Padding = new BorderDouble(6,0);
printTimeElapsed = new TextWidget("", pointSize:11);
printTimeElapsed.AutoExpandBoundsToText = true;
printTimeElapsed.VAnchor = Agg.UI.VAnchor.ParentCenter;
printTimeRemaining = new TextWidget("", pointSize: 11);
printTimeRemaining.AutoExpandBoundsToText = true;
printTimeRemaining.VAnchor = Agg.UI.VAnchor.ParentCenter;
GuiWidget spacer = new GuiWidget();
spacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
container.AddChild(printTimeElapsed);
container.AddChild(spacer);
container.AddChild(printTimeRemaining);
AddChild(container);
AddHandlers();
SetThemedColors();
UpdatePrintStatus();
UiThread.RunOnIdle(OnIdle);
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:33,代码来源:PrintProgressBarWidget.cs
示例4: createPrinterNameContainer
private FlowLayoutWidget createPrinterNameContainer()
{
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
container.Margin = new BorderDouble(0, 5);
BorderDouble elementMargin = new BorderDouble(top: 3);
string printerNameLabelTxt = new LocalizedString("Printer Name").Translated;
string printerNameLabelTxtFull = string.Format ("{0}:", printerNameLabelTxt);
TextWidget printerNameLabel = new TextWidget(printerNameLabelTxtFull, 0, 0, 12);
printerNameLabel.TextColor = this.defaultTextColor;
printerNameLabel.HAnchor = HAnchor.ParentLeftRight;
printerNameLabel.Margin = new BorderDouble(0, 0, 0, 1);
printerNameInput = new MHTextEditWidget(this.ActivePrinter.Name);
printerNameInput.HAnchor = HAnchor.ParentLeftRight;
printerNameError = new TextWidget(new LocalizedString("Give your printer a name.").Translated, 0, 0, 10);
printerNameError.TextColor = RGBA_Bytes.White;
printerNameError.HAnchor = HAnchor.ParentLeftRight;
printerNameError.Margin = elementMargin;
container.AddChild(printerNameLabel);
container.AddChild(printerNameInput);
container.AddChild(printerNameError);
container.HAnchor = HAnchor.ParentLeftRight;
return container;
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:27,代码来源:SetupStepMakeModelName.cs
示例5: MenuPage
public MenuPage()
: base("Menu Controls")
{
//GuiWidget.DebugBoundsUnderMouse = true;
BackgroundColor = RGBA_Bytes.Green;
lastAction = new TextWidget("Last Menu Action");
lastAction.OriginRelativeParent = new Vector2(100, 250);
AddChild(lastAction);
Menu dropListMenu = new Menu(new TextWidget("gAction v"));
dropListMenu.Name = "ListMenu Down";
AddMenu(dropListMenu, "Walk");
AddMenu(dropListMenu, "Jog");
AddMenu(dropListMenu, "Run");
dropListMenu.OriginRelativeParent = new Vector2(100, 200);
AddChild(dropListMenu);
Menu longMenue = new Menu(new TextWidget("very long"), maxHeight: 50);
longMenue.Name = "ListMenu Down";
for (int i = 0; i < 30; i++)
{
AddMenu(longMenue, "menu {0}".FormatWith(i));
}
longMenue.OriginRelativeParent = new Vector2(100, 300);
AddChild(longMenue);
Menu raiseListMenu = new Menu(new TextWidget("jAction ^"), Direction.Up);
raiseListMenu.Name = "ListMenu Up";
AddMenu(raiseListMenu, "Walk");
AddMenu(raiseListMenu, "Jog");
AddMenu(raiseListMenu, "Run");
raiseListMenu.OriginRelativeParent = new Vector2(200, 200);
AddChild(raiseListMenu);
MenuBar mainMenu = new MenuBar();
mainMenu.VAnchor = UI.VAnchor.ParentTop;
PopupMenu popupMenu = new PopupMenu(new TextWidget("Simple Menu"));
popupMenu.OriginRelativeParent = new Vector2(100, 100);
//AddChild(popupMenu);
DropDownList dropDownList = new DropDownList("- Select Something -", RGBA_Bytes.Black, RGBA_Bytes.Gray);
dropDownList.BackgroundColor = RGBA_Bytes.Black;
dropDownList.TextColor = RGBA_Bytes.White;
dropDownList.MenuItemsPadding = new BorderDouble(13);
dropDownList.MenuItemsBorderWidth = 3;
dropDownList.MenuItemsBorderColor = RGBA_Bytes.Red;
dropDownList.MenuItemsBackgroundColor = RGBA_Bytes.Blue;
dropDownList.MenuItemsTextColor = RGBA_Bytes.White;
dropDownList.MenuItemsTextHoverColor = RGBA_Bytes.Yellow;
dropDownList.Name = "Drop Down List";
dropDownList.AddItem("Item 1", "value1");
dropDownList.AddItem("Item 2 long name");
dropDownList.AddItem("Item 3 realy long name");
dropDownList.OriginRelativeParent = new Vector2(300, 200);
AddChild(dropDownList);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:60,代码来源:MenuPage.cs
示例6: ControlButtonViewBase
public ControlButtonViewBase(string label,
double width,
double height,
double textHeight,
double borderWidth,
double borderRadius,
double padding,
RGBA_Bytes textColor,
RGBA_Bytes fillColor,
RGBA_Bytes borderColor)
: base(width, height)
{
this.borderRadius = borderRadius;
this.borderWidth = borderWidth;
this.fillColor = fillColor;
this.borderColor = borderColor;
this.padding = padding;
TextWidget buttonText = new TextWidget(label, textHeight);
buttonText.VAnchor = VAnchor.ParentCenter;
buttonText.HAnchor = HAnchor.ParentCenter;
buttonText.TextColor = textColor;
//this.AnchorAll();
this.AddChild(buttonText);
}
开发者ID:fuding,项目名称:MatterControl,代码行数:26,代码来源:ActionBarBaseControls.cs
示例7: PresetSelectorWidget
private int extruderIndex; //For multiple materials
public PresetSelectorWidget(string label, RGBA_Bytes accentColor, string tag, int extruderIndex)
: base(FlowDirection.TopToBottom)
{
this.extruderIndex = extruderIndex;
this.filterLabel = label;
this.filterTag = (tag == null) ? label.ToLower() : tag;
this.HAnchor = HAnchor.ParentLeftRight;
this.VAnchor = Agg.UI.VAnchor.Max_FitToChildren_ParentHeight;
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
GuiWidget accentBar = new GuiWidget(7, 5)
{
BackgroundColor = accentColor,
HAnchor = HAnchor.ParentLeftRight
};
TextWidget labelText = new TextWidget(label.Localize().ToUpper())
{
TextColor = ActiveTheme.Instance.PrimaryTextColor,
HAnchor = Agg.UI.HAnchor.ParentCenter,
Margin = new BorderDouble(0, 3, 0, 6)
};
this.AddChild(labelText);
this.AddChild(GetPulldownContainer());
this.AddChild(new VerticalSpacer());
this.AddChild(accentBar);
}
开发者ID:broettge,项目名称:MatterControl,代码行数:31,代码来源:SettingsControlSelectors.cs
示例8: SyncingPrintersPage
public SyncingPrintersPage()
: base("Close")
{
TextWidget syncingText = new TextWidget("Syncing Profiles...".Localize(),textColor: ActiveTheme.Instance.PrimaryTextColor);
syncingDetails = new TextWidget("Retrieving sync information...".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize:10);
syncingDetails.AutoExpandBoundsToText = true;
contentRow.AddChild(syncingText);
contentRow.AddChild(syncingDetails);
Progress<SyncReportType> progress = new Progress<SyncReportType>(ReportProgress);
ApplicationController.SyncPrinterProfiles("SyncingPrintersPage.ctor()", progress).ContinueWith((task) =>
{
if (!ProfileManager.Instance.ActiveProfiles.Any())
{
// Switch to setup wizard if no profiles exist
WizardWindow.ChangeToSetupPrinterForm();
}
else if (ProfileManager.Instance.ActiveProfiles.Count() == 1)
{
//Set as active printer
ActiveSliceSettings.SwitchToProfile(ProfileManager.Instance.ActiveProfiles.First().ID);
// only close the window if we are not switching to the setup printer form
UiThread.RunOnIdle(WizardWindow.Close);
}
else // multiple printers - close the window
{
UiThread.RunOnIdle(WizardWindow.Close);
}
});
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:32,代码来源:SyncingPrintersPage.cs
示例9: SliceSelectorWidget
private int presetIndex; //For multiple materials
public SliceSelectorWidget(string label, RGBA_Bytes accentColor, string tag = null, int presetIndex = 1)
: base(FlowDirection.TopToBottom)
{
this.presetIndex = presetIndex;
this.filterLabel = label;
if (tag == null)
{
this.filterTag = label.ToLower();
}
else
{
this.filterTag = tag;
}
this.HAnchor = HAnchor.ParentLeftRight;
this.VAnchor = Agg.UI.VAnchor.Max_FitToChildren_ParentHeight;
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
GuiWidget accentBar = new GuiWidget(7, 5);
accentBar.BackgroundColor = accentColor;
accentBar.HAnchor = HAnchor.ParentLeftRight;
TextWidget labelText = new TextWidget(LocalizedString.Get(label).ToUpper());
labelText.TextColor = ActiveTheme.Instance.PrimaryTextColor;
labelText.HAnchor = Agg.UI.HAnchor.ParentCenter;
labelText.Margin = new BorderDouble(0, 3, 0, 6);
this.AddChild(labelText);
this.AddChild(GetPulldownContainer());
this.AddChild(new VerticalSpacer());
this.AddChild(accentBar);
}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:35,代码来源:SettingsControlSelectors.cs
示例10: CreateOptionsMenu
GuiWidget CreateOptionsMenu()
{
ImageBuffer gearImage = new ImageBuffer();
string imagePathAndFile = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "gear_icon.png");
ImageBMPIO.LoadImageData(imagePathAndFile, gearImage);
FlowLayoutWidget leftToRight = new FlowLayoutWidget();
leftToRight.Margin = new BorderDouble(5, 0);
string optionsString = new LocalizedString("Options").Translated;
TextWidget optionsText = new TextWidget(optionsString, textColor: RGBA_Bytes.White);
optionsText.VAnchor = Agg.UI.VAnchor.ParentCenter;
optionsText.Margin = new BorderDouble(0, 0, 3, 0);
leftToRight.AddChild(optionsText);
GuiWidget gearWidget = new ImageWidget(gearImage);
gearWidget.VAnchor = Agg.UI.VAnchor.ParentCenter;
leftToRight.AddChild(gearWidget);
leftToRight.HAnchor = HAnchor.FitToChildren;
leftToRight.VAnchor = VAnchor.FitToChildren;
Menu optionMenu = new Menu(leftToRight);
optionMenu.OpenOffset = new Vector2(-2, -10);
optionMenu.VAnchor = Agg.UI.VAnchor.ParentCenter;
optionMenu.MenuItems.Add(new MenuItem(new ThemeColorSelectorWidget()));
return optionMenu;
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:26,代码来源:PrinterActionRow.cs
示例11: createPrinterConnectionMessageContainer
public FlowLayoutWidget createPrinterConnectionMessageContainer()
{
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
container.VAnchor = VAnchor.ParentBottomTop;
container.Margin = new BorderDouble(5);
BorderDouble elementMargin = new BorderDouble(top: 5);
string printerMessageOneText = "MatterControl will now attempt to auto-detect printer.".Localize();
TextWidget printerMessageOne = new TextWidget(printerMessageOneText, 0, 0, 10);
printerMessageOne.Margin = new BorderDouble(0, 10, 0, 5);
printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor;
printerMessageOne.HAnchor = HAnchor.ParentLeftRight;
printerMessageOne.Margin = elementMargin;
string disconnectMessage = string.Format("1.) {0} ({1}).", "Disconnect printer".Localize(), "if currently connected".Localize());
TextWidget printerMessageTwo = new TextWidget(disconnectMessage, 0, 0, 12);
printerMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
printerMessageTwo.HAnchor = HAnchor.ParentLeftRight;
printerMessageTwo.Margin = elementMargin;
string printerMessageThreeBeg = "Power on and connect printer".Localize();
string printerMessageThreeFull = string.Format("2.) {0}.", printerMessageThreeBeg);
TextWidget printerMessageThree = new TextWidget(printerMessageThreeFull, 0, 0, 12);
printerMessageThree.TextColor = ActiveTheme.Instance.PrimaryTextColor;
printerMessageThree.HAnchor = HAnchor.ParentLeftRight;
printerMessageThree.Margin = elementMargin;
string printerMessageFourTxtBeg = "Press".Localize();
string printerMessageFourTxtEnd = "Connect".Localize();
string printerMessageFourTxtFull = string.Format("3.) {0} '{1}'.", printerMessageFourTxtBeg, printerMessageFourTxtEnd);
TextWidget printerMessageFour = new TextWidget(printerMessageFourTxtFull, 0, 0, 12);
printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
printerMessageFour.HAnchor = HAnchor.ParentLeftRight;
printerMessageFour.Margin = elementMargin;
GuiWidget vSpacer = new GuiWidget();
vSpacer.VAnchor = VAnchor.ParentBottomTop;
Button manualLink = linkButtonFactory.Generate("Manual Configuration".Localize());
manualLink.Margin = new BorderDouble(0, 5);
manualLink.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortManual>();
printerErrorMessage = new TextWidget("", 0, 0, 10);
printerErrorMessage.AutoExpandBoundsToText = true;
printerErrorMessage.TextColor = RGBA_Bytes.Red;
printerErrorMessage.HAnchor = HAnchor.ParentLeftRight;
printerErrorMessage.Margin = elementMargin;
container.AddChild(printerMessageOne);
container.AddChild(printerMessageTwo);
container.AddChild(printerMessageThree);
container.AddChild(printerMessageFour);
container.AddChild(printerErrorMessage);
container.AddChild(vSpacer);
container.AddChild(manualLink);
container.HAnchor = HAnchor.ParentLeftRight;
return container;
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:59,代码来源:SetupStepComPortTwo.cs
示例12: TemperatureWidgetBase
public TemperatureWidgetBase(string textValue)
: base(52 * TextWidget.GlobalPointSizeScaleRatio, 52 * TextWidget.GlobalPointSizeScaleRatio)
{
whiteButtonFactory.FixedHeight = 18 * TextWidget.GlobalPointSizeScaleRatio;
whiteButtonFactory.fontSize = 7;
whiteButtonFactory.normalFillColor = RGBA_Bytes.White;
whiteButtonFactory.normalTextColor = RGBA_Bytes.DarkGray;
FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
container.AnchorAll();
this.BackgroundColor = new RGBA_Bytes(255, 255, 255, 200);
this.Margin = new BorderDouble(0, 2) * TextWidget.GlobalPointSizeScaleRatio;
GuiWidget labelContainer = new GuiWidget();
labelContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
labelContainer.Height = 18 * TextWidget.GlobalPointSizeScaleRatio;
labelTextWidget = new TextWidget("", pointSize: 8);
labelTextWidget.AutoExpandBoundsToText = true;
labelTextWidget.HAnchor = HAnchor.ParentCenter;
labelTextWidget.VAnchor = VAnchor.ParentCenter;
labelTextWidget.TextColor = ActiveTheme.Instance.SecondaryAccentColor;
labelTextWidget.Visible = false;
labelContainer.AddChild(labelTextWidget);
GuiWidget indicatorContainer = new GuiWidget();
indicatorContainer.AnchorAll();
indicatorTextWidget = new TextWidget(textValue, pointSize: 11);
indicatorTextWidget.TextColor = ActiveTheme.Instance.PrimaryAccentColor;
indicatorTextWidget.HAnchor = HAnchor.ParentCenter;
indicatorTextWidget.VAnchor = VAnchor.ParentCenter;
indicatorTextWidget.AutoExpandBoundsToText = true;
indicatorContainer.AddChild(indicatorTextWidget);
GuiWidget buttonContainer = new GuiWidget();
buttonContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
buttonContainer.Height = 18 * TextWidget.GlobalPointSizeScaleRatio;
preheatButton = whiteButtonFactory.Generate("Preheat".Localize().ToUpper());
preheatButton.Cursor = Cursors.Hand;
preheatButton.Visible = false;
buttonContainer.AddChild(preheatButton);
container.AddChild(labelContainer);
container.AddChild(indicatorContainer);
container.AddChild(buttonContainer);
this.AddChild(container);
ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);
this.MouseEnterBounds += onEnterBounds;
this.MouseLeaveBounds += onLeaveBounds;
this.preheatButton.Click += onPreheatButtonClick;
}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:59,代码来源:TemperatureWidgetBase.cs
示例13: CreateNextLine
TextWidget CreateNextLine(string startText)
{
TextWidget nextLine = new TextWidget(startText, textColor: RGBA_Bytes.White);
nextLine.Margin = new BorderDouble(0, 2);
nextLine.HAnchor = Agg.UI.HAnchor.ParentLeft;
nextLine.AutoExpandBoundsToText = true;
return nextLine;
}
开发者ID:klewisjohnson,项目名称:MatterControl,代码行数:8,代码来源:ExportToSdCardFeedbackWindow.cs
示例14: CreateNextLine
private TextWidget CreateNextLine(string startText)
{
TextWidget nextLine = new TextWidget(startText, textColor: ActiveTheme.Instance.PrimaryTextColor);
nextLine.Margin = new BorderDouble(0, 2);
nextLine.HAnchor = Agg.UI.HAnchor.ParentLeft;
nextLine.AutoExpandBoundsToText = true;
return nextLine;
}
开发者ID:broettge,项目名称:MatterControl,代码行数:8,代码来源:SavePartsSheetFeedbackWindow.cs
示例15: RunningMacroPage
public RunningMacroPage(string message, bool showOkButton, bool showMaterialSelector, double expectedSeconds, double expectedTemperature)
: base("Close", "Macro Feedback")
{
TextWidget syncingText = new TextWidget(message, textColor: ActiveTheme.Instance.PrimaryTextColor);
contentRow.AddChild(syncingText);
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
if (showMaterialSelector)
{
int extruderIndex = 0;
contentRow.AddChild(new PresetSelectorWidget(string.Format($"{"Material".Localize()} {extruderIndex + 1}"), RGBA_Bytes.Orange, NamedSettingsLayers.Material, extruderIndex));
}
var holder = new FlowLayoutWidget();
progressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale))
{
FillColor = ActiveTheme.Instance.PrimaryAccentColor,
BorderColor = ActiveTheme.Instance.PrimaryTextColor,
//HAnchor = HAnchor.ParentCenter,
Margin = new BorderDouble(3, 0, 0, 10),
};
progressBarText = new TextWidget("", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor)
{
AutoExpandBoundsToText = true,
Margin = new BorderDouble(5, 0, 0, 0),
};
holder.AddChild(progressBar);
holder.AddChild(progressBarText);
contentRow.AddChild(holder);
progressBar.Visible = false;
if (expectedSeconds > 0)
{
timeToWaitMs = (long)(expectedSeconds * 1000);
endTimeMs = UiThread.CurrentTimerMs + timeToWaitMs;
UiThread.RunOnIdle(CountDownTime, 1);
progressBar.Visible = true;
}
PrinterConnectionAndCommunication.Instance.WroteLine.RegisterEvent(LookForTempRequest, ref unregisterEvents);
if (showOkButton)
{
Button okButton = textImageButtonFactory.Generate("Continue".Localize());
okButton.Margin = new BorderDouble(0, 0, 0, 25);
okButton.HAnchor = HAnchor.ParentCenter;
okButton.Click += (s, e) =>
{
PrinterConnectionAndCommunication.Instance.MacroContinue();
UiThread.RunOnIdle(() => WizardWindow?.Close());
};
contentRow.AddChild(okButton);
}
}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:58,代码来源:RunningMacroPage.cs
示例16: LoadHistoryItems
private async void LoadHistoryItems()
{
TextWidget loadingText = new TextWidget("Retrieving History from Web...");
loadingText.TextColor = ActiveTheme.Instance.PrimaryTextColor;
scrollWindow.AddChild(loadingText);
var results = await ApplicationController.GetProfileHistory(ProfileManager.Instance.ActiveProfile.DeviceToken);
printerProfileData = results;
if(printerProfileData != null)
{
loadingText.Visible= false;
List<DateTime> sourceTimes = new List<DateTime>();
foreach (var printerProfile in results.OrderByDescending(d => d.Key))
{
// AppEngine results are current in the form of: "2016-07-21 00:43:30.965830"
sourceTimes.Add(Convert.ToDateTime(printerProfile.Key).ToLocalTime());
}
var groupedTimes = RelativeTime.GroupTimes(DateTime.Now, sourceTimes);
FlowLayoutWidget topToBottomStuff = new FlowLayoutWidget(FlowDirection.TopToBottom);
scrollWindow.AddChild(topToBottomStuff);
foreach (var group in groupedTimes)
{
// add in the group header
topToBottomStuff.AddChild(new TextWidget(RelativeTime.BlockDescriptions[group.Key], textColor: ActiveTheme.Instance.PrimaryTextColor)
{
Margin = new BorderDouble(0, 0, 0, 5),
});
foreach (var time in group.Value)
{
// add in the radio buttons
var profileVersionButton = new RadioButton(time.Value, textColor: ActiveTheme.Instance.PrimaryTextColor)
{
Margin = new BorderDouble(5, 0),
};
profileVersionButton.Checked = false;
radioButtonList.Add(profileVersionButton);
topToBottomStuff.AddChild(profileVersionButton);
}
}
foreach(var printerProfile in results)
{
orderedProfiles.Add(printerProfile.Key.ToString());
}
}
else
{
loadingText.Text = "Failed To Download History!";
loadingText.TextColor = RGBA_Bytes.Red;
}
//remove loading profile text/icon
}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:57,代码来源:PrinterProfileHistoryPage.cs
示例17: AddText
private void AddText(string tabText, GuiWidget widgetState, RGBA_Bytes textColor, RGBA_Bytes backgroundColor, double pointSize)
{
tabTitle = new TextWidget(tabText, pointSize: pointSize, textColor: textColor);
tabTitle.AutoExpandBoundsToText = true;
widgetState.AddChild(tabTitle);
widgetState.Selectable = false;
widgetState.SetBoundsToEncloseChildren();
widgetState.BackgroundColor = backgroundColor;
}
开发者ID:SkightTeam,项目名称:agg-sharp,代码行数:9,代码来源:Tab.cs
示例18: UpdateControl
public UpdateControl()
{
textImageButtonFactory.normalFillColor = ActiveTheme.Instance.PrimaryTextColor;
textImageButtonFactory.normalTextColor = RGBA_Bytes.Black;
HAnchor = HAnchor.ParentLeftRight;
BackgroundColor = ActiveTheme.Instance.TransparentDarkOverlay;
Padding = new BorderDouble(6, 5);
{
updateStatusText = new TextWidget(string.Format(""), textColor: offWhite);
updateStatusText.AutoExpandBoundsToText = true;
updateStatusText.VAnchor = VAnchor.ParentCenter;
GuiWidget horizontalSpacer = new GuiWidget();
horizontalSpacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
checkUpdateLink = textImageButtonFactory.Generate(new LocalizedString("Check for Update").Translated);
checkUpdateLink.VAnchor = VAnchor.ParentCenter;
checkUpdateLink.Click += CheckForUpdate;
checkUpdateLink.Visible = false;
downloadUpdateLink = textImageButtonFactory.Generate(new LocalizedString("Download Update").Translated);
downloadUpdateLink.VAnchor = VAnchor.ParentCenter;
downloadUpdateLink.Click += DownloadUpdate;
downloadUpdateLink.Visible = false;
installUpdateLink = textImageButtonFactory.Generate(new LocalizedString("Install Update").Translated);
installUpdateLink.VAnchor = VAnchor.ParentCenter;
installUpdateLink.Click += InstallUpdate;
installUpdateLink.Visible = false;
AddChild(updateStatusText);
AddChild(horizontalSpacer);
AddChild(checkUpdateLink);
AddChild(downloadUpdateLink);
AddChild(installUpdateLink);
}
CheckVersionStatus();
if (ApplicationSettings.Instance.get("ClientToken") != null)
{
//If we have already requested an update once, check on load
CheckForUpdate(this, null);
}
else
{
DataStorage.ApplicationSession firstSession;
firstSession = DataStorage.Datastore.Instance.dbSQLite.Table<DataStorage.ApplicationSession>().OrderBy(v => v.SessionStart).Take(1).FirstOrDefault();
if (firstSession != null
&& DateTime.Compare(firstSession.SessionStart.AddDays(7), DateTime.Now) < 0)
{
NeedToCheckForUpdateFirstTimeEver = true;
}
}
}
开发者ID:rubenkar,项目名称:MatterControl,代码行数:56,代码来源:AboutPage.cs
示例19: AddMenu
private void AddMenu(Menu listMenuToAddTo, string name)
{
GuiWidget normal = new TextWidget(name);
normal.BackgroundColor = RGBA_Bytes.White;
GuiWidget hover = new TextWidget(name);
hover.BackgroundColor = RGBA_Bytes.LightGray;
MenuItem menuItem = new MenuItem(new MenuItemStatesView(normal, hover));
menuItem.Selected += (sender, e) => { lastAction.Text = name; };
listMenuToAddTo.MenuItems.Add(menuItem);
}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:10,代码来源:MenuPage.cs
示例20: RadioButtonViewText
public RadioButtonViewText(string label)
{
labelTextWidget = new TextWidget(label, 12);
AddChild(labelTextWidget);
LocalBounds = GetLocalBounds();
inactiveColor = new RGBA_Bytes(0.0, 0.0, 0.0);
activeColor = new RGBA_Bytes(0.4, 0.0, 0.0);
}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:10,代码来源:RadioButtonViewText.cs
注:本文中的MatterHackers.Agg.UI.TextWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论