/// <summary> /// Override to create the CSS class that component need. /// </summary> /// <param name="style">The instance of <see cref="T:YoiBlazor.Style" /> class.</param> protected override void CreateComponentStyle(Style style) { style.Add("transition-duration:300ms") .Add("display:block") .Add($"width:{Percent}%") ; if (Parent != null && Parent.Bars != null) { var barList = Parent.BarList; if (Index == 0) { style.Add("border-top-right-radius", "0px") .Add("border-bottom-right-radius", "0px"); } else if (Index == barList.Count - 1) { style.Add("border-top-left-radius", "0px") .Add("border-bottom-left-radius", "0px"); } else { style.Add("border-radius", "0px;"); } } }
private static Style GetStyle(byte[] data) { var groups = GetGroups(data); var style = new Style(); style.Name = Get <string>(groups[string.Empty], "Nm TEXT"); var overlay = Overlay.Parse(groups); style.Add(ShadowValue.Parse(overlay, groups)); style.Add(BorderValue.Parse(groups)); style.Add(GradientValue.Parse(overlay, groups)); return(style); }
public static void Initialize() { if (initialized) { return; } initialized = true; var platform = Platform.Instance; if (platform == null) { platform = new Eto.Wpf.Platform(); Platform.Initialize(platform); } Style.Add <FormHandler>("eto.vstheme", h => ThemeWindow(h.Control)); Style.Add <DialogHandler>("eto.vstheme", h => ThemeWindow(h.Control)); platform.LoadAssembly(typeof(EtoInitializer).Assembly); if (Application.Instance == null) { new Eto.Forms.Application().Attach(); } Eto.Designer.Builders.BaseCompiledInterfaceBuilder.InitializeAssembly = typeof(EtoInitializer).Assembly.FullName; }
static void AddStyles() { // support full screen mode! Style.Add <FormHandler> ("main", handler => { handler.Control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; }); Style.Add <ApplicationHandler> ("application", handler => { handler.EnableFullScreen(); }); // other styles Style.Add <TreeGridViewHandler> ("sectionList", handler => { handler.ScrollView.BorderType = NSBorderType.NoBorder; handler.Control.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); Style.Add <ToolBarButtonHandler> (null, handler => { // use standard textured/round buttons, and make the image grayscale handler.UseStandardButton(grayscale: true); }); Style.Add <ToolBarHandler> (null, handler => { // change display mode or other options //handler.Control.DisplayMode = NSToolbarDisplayMode.Icon; }); }
static void Start() { var generator = Platform.Get(Platforms.Gtk2); generator.Add <TabControlPlus.IHandler>(() => new TabControlPlusHandler()); Style.Add <ButtonHandler>(null, h => { h.Size = new Eto.Drawing.Size(80, 27); }); Style.Add <DropDownHandler>(null, h => { h.Size = new Eto.Drawing.Size(120, 25); }); Style.Add <ComboBoxHandler>(null, h => { h.Size = new Eto.Drawing.Size(120, 25); }); Style.Add <TextBoxHandler>(null, h => { h.Size = new Eto.Drawing.Size(120, 25); }); var app = new AltmanApplication(generator); app.Run(); }
public static void ApplyAll() { Style.Add <Panel>(null, item => item.Padding = new Padding(2)); Style.Add <TabPage>(null, item => item.Padding = new Padding(4)); Style.Add <TableLayout>(null, item => item.Spacing = new Size(4, 8)); Style.Add <Scrollable>(null, item => item.Border = BorderType.None); Style.Add <Scrollable>(null, (item) => item.Border = BorderType.None); Style.Add <Button>("icon", item => { Size size = new Size(32, 32); item.Size = size; item.Width = size.Width; }); Style.Add <Panel>("no-padding", item => item.Padding = Padding.Empty); Style.Add <StackLayout>("vertical", item => { item.Orientation = Orientation.Vertical; item.HorizontalContentAlignment = HorizontalAlignment.Stretch; }); Style.Add <StackLayout>("horizontal", item => { item.Orientation = Orientation.Horizontal; item.VerticalContentAlignment = VerticalAlignment.Stretch; }); Style.Add <Label>(null, (item) => item.VerticalAlignment = VerticalAlignment.Center); }
public static void Main(string[] args) { var generator = new global::Eto.Platform.Wpf.Generator(); generator.Add <IDialog> (() => new Controls.CustomDialog()); generator.Add <IForm> (() => new Controls.CustomForm()); //generator.Add<IWebView>(() => new Controls.CefSharpWebViewHandler()); generator.Add <IWebView>(() => new Controls.CefGlueWebViewHandler()); generator.Add <IJabbRApplication>(() => new Controls.JabbRApplicationHandler()); Style.Add <Controls.CustomForm> (null, handler => { AddResources(handler.Control); }); Style.Add <Controls.CustomDialog> (null, handler => { AddResources(handler.Control); }); Style.Add <TreeViewHandler> ("channelList", handler => { handler.Control.BorderThickness = new sw.Thickness(0); }); Style.Add <TreeViewHandler> ("userList", handler => { handler.Control.BorderThickness = new sw.Thickness(0); }); var app = new JabbRApplication(generator); app.Initialized += CheckForNewVersion; app.Run(args); }
static void AddStyles() { // support full screen mode! Style.Add <FormHandler> ("main", handler => { handler.Control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; }); Style.Add <ApplicationHandler> ("application", handler => { handler.EnableFullScreen(); }); // other styles Style.Add <TreeGridViewHandler> ("sectionList", handler => { handler.ScrollView.BorderType = NSBorderType.NoBorder; handler.Control.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); Style.Add <ButtonToolItemHandler> (null, handler => { // use standard textured/round buttons, and make the image grayscale handler.UseStandardButton(grayscale: true); }); Style.Add <DropDownHandler> (null, handler => { handler.Size = new Eto.Drawing.Size(120, 26); }); Style.Add <ComboBoxHandler> (null, handler => { handler.Size = new Eto.Drawing.Size(120, 26); }); }
/// /// <summary> /// Raises the <see cref="Control.Init"/> event. /// </summary> /// <remarks> /// When notified by this method, server controls must perform any initialization steps that are required /// to create and set up an instance. In this stage of the server control's lifecycle, the control's view /// state has yet to be populated. Additionally, you can not access other server controls when this method /// is called either, regardless of whether it is a child or parent to this control. Other server controls /// are not certain to be created and ready for access. /// </remarks> /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param> /// protected override void OnInit(EventArgs e) { base.OnInit(e); PowerPack.EnsureIdSet(this); Page.RegisterRequiresPostBack(this); EnsureChildControls(); base.TabIndex = -1; if ((Style ["position"] == null) && (Style ["POSITION"] == null)) { Style.Add("position", "absolute"); } else { _explicitlyAbsolutelyPositioned = true; } if (!IsInDesignMode) { Style.Add("display", "none"); } _realField.Text = Text; return; }
public static void Main(string[] args) { Toolkit opentk = Core.InitOpenTK(); Platform platform = new Eto.Mac.Platform(); platform.Add <GLSurface.IHandler>(() => new MacGLSurfaceHandler()); Style.Add <View>( "hidecursor", view => { CG.DisplayHideCursor((CGDirectDisplayID)0); CG.AssociateMouseAndMouseCursorPosition(false); }); Style.Add <View>( "showcursor", view => { CG.AssociateMouseAndMouseCursorPosition(true); CG.DisplayShowCursor((CGDirectDisplayID)0); }); var application = new Application(platform); application.UnhandledException += Core.UnhandledExceptionHandler; using (opentk) { application.Run(new MainForm()); } }
static void AddStyles() { // support full screen mode! Style.Add <FormHandler>("main", handler => { handler.Control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; }); Style.Add <ApplicationHandler>("application", handler => { handler.EnableFullScreen(); }); // other styles Style.Add <TreeGridViewHandler>("sectionList", handler => { handler.ScrollView.BorderType = NSBorderType.NoBorder; handler.Control.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); Style.Add <ButtonToolItemHandler>(null, handler => { // tint the images in grayscale handler.Tint = Colors.Gray; }); Style.Add <ToolBarHandler>(null, handler => { // change display mode or other options //handler.Control.DisplayMode = NSToolbarDisplayMode.Icon; }); }
static void Start() { var generator = Platform.Get(Platforms.Gtk2); generator.Add <TabControlPlus.IHandler>(() => new TabControlPlusHandler()); //Style.Add<ButtonHandler>(null, h => //{ // h.Size = new Eto.Drawing.Size(80, 27); //}); //Style.Add<DropDownHandler>(null, h => //{ // h.Size = new Eto.Drawing.Size(120, 25); //}); //Style.Add<ComboBoxHandler>(null, h => //{ // h.Size = new Eto.Drawing.Size(120, 25); //}); //Style.Add<TextBoxHandler>(null, h => //{ // h.Size = new Eto.Drawing.Size(120, 25); //}); //Temporary Solutions, Eto.Form's bug Style.Add <Dialog>(null, h => { h.Resizable = true; }); var app = new AltmanApplication(generator); app.Run(); }
private static void ConfigureStyles() { Style.Add <FormHandler>(EtoStyles.FormMain, handler => { var control = handler.Control; control.WindowPosition = Gtk.WindowPosition.Center; }); Style.Add <DialogHandler>(EtoStyles.DeviceBotDialog, handler => { var control = handler.Control; control.WindowPosition = Gtk.WindowPosition.Center; }); Style.Add <SyntaxHightlightTextAreaHandler>(EtoStyles.SourceEditor, handler => { var control = handler.Control; control.ModifyFont(Pango.FontDescription.FromString($"Courier {handler.Font.Size}")); }); Style.Add <TextAreaHandler>(EtoStyles.SendCommandText, handler => { var control = handler.Control; control.ModifyFont(Pango.FontDescription.FromString($"Courier {handler.Font.Size}")); }); }
public static void Load() { Style.Add <MenuBarHandler>("MenuBar", h => { h.Control.Background = System.Windows.SystemColors.ControlLightLightBrush; }); Style.Add <ToolBarHandler>("ToolBar", h => { h.Control.Background = System.Windows.SystemColors.ControlLightLightBrush; h.Control.Loaded += delegate { if (h.Control.Template.FindName("OverflowGrid", h.Control) is System.Windows.FrameworkElement overflowGrid) { overflowGrid.Visibility = System.Windows.Visibility.Collapsed; } foreach (var item in h.Control.Items) { if (item is System.Windows.Controls.Button i) { i.Opacity = i.IsEnabled ? 1.0 : 0.2; i.IsEnabledChanged += (sender, e) => i.Opacity = i.IsEnabled ? 1.0 : 0.2; } } }; }); }
protected override void Render(HtmlTextWriter writer) { writer.RenderBeginTag(HtmlTextWriterTag.Div); //Attributes["fID"] = ClientID + "_filter"; Style.Add("display", "none"); Style.Add("visibility", "hidden"); Style.Add("width", "0px"); Attributes["fClearID"] = ClientID + "_filterClear"; base.Render(writer); RenderLinkFilter(writer, Themes.IconUrlFilter, "OpenFilterAsLookup(this);", ClientID + "_filter", false); RenderLinkFilter(writer, Themes.IconUrlFilterCancel, "OpenFilterAsLookupClear(this);", ClientID + "_filterClear", string.IsNullOrEmpty(Text)); #region browse values writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID + "_values"); writer.AddAttribute("isIgnoreVisible", "true"); writer.RenderBeginTag(HtmlTextWriterTag.Span); var browseFilterParameters = new BrowseFilterParameters(); OnGetFilterParameters(browseFilterParameters); writer.Write(browseFilterParameters.GetClientParameters()); writer.RenderEndTag(); #endregion writer.RenderEndTag(); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (UseHistory) { Page.ClientScript.RegisterClientScriptBlock(GetType(), "pageloadfunction", "<script type=\"text/javascript\">function histcallback(hash) {if (hash) {" + Page.ClientScript.GetPostBackEventReference(this, "{0}"). Replace("\'{0}\'", "hash") + "}else{" + Page.ClientScript.GetPostBackClientHyperlink(this, "1") + "}}</script>"); Page.ClientScript.RegisterClientScriptBlock(GetType(), "documentready", "<script type=\"text/javascript\">$(document).ready(function() {$.historyInit(histcallback);});</script>"); } if (PageCount < DisplayedPages) { var width = 114 + PageCount * 34; Style.Add(HtmlTextWriterStyle.Width, width + "px"); } else { Style.Remove("width"); } Style.Add("height", "26px"); }
static void Main(string[] args) { Style.Add <ListBox, NSScrollView>("ListNative", (widget, control) => { control.BorderType = NSBorderType.NoBorder; var list = control.DocumentView as NSTableView; list.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); Style.Add <TextArea, NSScrollView>("TextConsole", (widget, control) => { control.BorderType = NSBorderType.NoBorder; var textbox = control.DocumentView as NSTextView; textbox.RichText = false; textbox.Font = NSFont.FromFontName("Monaco", 12); }); Style.Add <ToolBar, NSToolbar>("ToolBar", (widget, control) => { control.DisplayMode = NSToolbarDisplayMode.Icon; }); Style.Add <Window, NSWindow> ("MainWindow", (widget, control) => { control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; }); var generator = Generator.GetGenerator("Eto.Platform.Mac.Generator, Eto.Platform.Mac"); var app = new Program(generator); app.Run(); }
static void Main(string[] args) { Style.Add <ListBoxHandler>("ListNative", handler => { handler.Scroll.BorderType = NSBorderType.NoBorder; handler.Control.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList; }); Style.Add <TextAreaHandler>("TextConsole", handler => { handler.Scroll.BorderType = NSBorderType.NoBorder; handler.Control.RichText = false; handler.Control.Font = NSFont.FromFontName("Monaco", 12); }); Style.Add <ToolBarHandler>("ToolBar", handler => { handler.Control.DisplayMode = NSToolbarDisplayMode.Icon; }); Style.Add <FormHandler> ("MainWindow", handler => { handler.Control.CollectionBehavior |= NSWindowCollectionBehavior.FullScreenPrimary; }); var app = new Program(Eto.Platforms.Mac); app.Run(); }
protected override void OnLoad(EventArgs EventArguments) { Height = Unit.Pixel(21); Style.Add("border", "0px"); Attributes.Add("class", "editorIconSplit"); ImageUrl = "/Umbraco_client/menuicon/images/split.gif"; }
/// <summary> /// Initializes a new instance of the <see cref="OdcTreeViewContextMenuContainer"/> class. /// </summary> public OdcTreeViewContextMenuContainer() : base(HtmlTextWriterTag.Span) { // make the control hidden with no gap: Style.Add(HtmlTextWriterStyle.Display, "none"); Style.Add(HtmlTextWriterStyle.Visibility, "collapse"); }
private static void SetComboBoxStyle(OS platform) { Style.Add <ComboBox>("FormComboBoxStyle", comboBox => { comboBox.Height = 26; }); }
private static void ConfigureStyles() { Style.Add <FormHandler>(EtoStyles.FormMain, handler => { var control = handler.Control; control.StartPosition = FormStartPosition.CenterScreen; }); Style.Add <DialogHandler>(EtoStyles.DeviceBotDialog, handler => { var control = handler.Control; control.StartPosition = FormStartPosition.CenterScreen; }); Style.Add <SyntaxHightlightTextAreaHandler>(EtoStyles.SourceEditor, handler => { var txtBotEditor = handler.Control; txtBotEditor.AutoCompleteBracketsList = new char[] { '(', ')', '{', '}', '[', ']', '\"', '\"', '\'', '\'' }; txtBotEditor.AutoIndentCharsPatterns = "\r\n^\\s*[\\w\\.]+(\\s\\w+)?\\s*(?<range>=)\\s*(?<range>[^;]+);\r\n^\\s*(case|default)\\s*[^:]" + "*(?<range>:)\\s*(?<range>[^;]+);\r\n"; txtBotEditor.AutoScrollMinSize = new System.Drawing.Size(227, 70); txtBotEditor.BackBrush = null; txtBotEditor.BracketsHighlightStrategy = FastColoredTextBoxNS.BracketsHighlightStrategy.Strategy2; txtBotEditor.CharHeight = 14; txtBotEditor.CharWidth = 8; txtBotEditor.Cursor = System.Windows.Forms.Cursors.IBeam; txtBotEditor.DisabledColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); txtBotEditor.Font = new System.Drawing.Font("Consolas", 9.75F); txtBotEditor.IsReplaceMode = false; txtBotEditor.LeftBracket = '('; txtBotEditor.LeftBracket2 = '{'; txtBotEditor.Location = new System.Drawing.Point(12, 33); txtBotEditor.Name = "txtBotEditor"; txtBotEditor.Paddings = new System.Windows.Forms.Padding(0); txtBotEditor.RightBracket = ')'; txtBotEditor.RightBracket2 = '}'; txtBotEditor.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255))))); txtBotEditor.Size = new System.Drawing.Size(529, 345); txtBotEditor.TabIndex = 4; txtBotEditor.Zoom = 100; }); Style.Add <TextAreaHandler>(EtoStyles.SendCommandText, handler => { var control = handler.Control; control.Font = new Font(FontFamily.GenericMonospace, control.Font.Size); }); }
private static void SetLabelStyles(OS platform) { Style.Add <Label>("FormLabelStyle", lbl => { lbl.Font = new Font("Microsoft Sans Serif", 14f); lbl.TextColor = Colors.Black; }); }
protected virtual void AddContainerAttributesToRender(HtmlTextWriter writer) { if (RenderMode == ComboBoxRenderMode.Inline) { Style.Add(HtmlTextWriterStyle.Display, GetInlineDisplayStyle()); } base.AddAttributesToRender(writer); }
protected override void OnInit(EventArgs e) { base.OnInit(e); Style.Add(HtmlTextWriterStyle.Height, Unit.Percentage(100).ToString()); Style.Add(HtmlTextWriterStyle.Width, Unit.Percentage(100).ToString()); Style.Add(HtmlTextWriterStyle.Display, "none"); }
public void Styles_aggregate_properties_when_add_is_called_repeatedly_using_the_same_selector() { var style = new Style(); style.Add("apple", ("color", "red")); style.Add("apple", ("text-align", "center")); style.ToString() .Should() .BeExceptingWhitespace(@" <style> apple { color: red; text-align: center; } </style>"); }
private void MakeStyle() { Style.Clear(); Style.Add("height", "130px"); Style.Add("width", "350px"); Style.Add("display", "block"); Style.Add("overflow", "hidden"); }
public static void Main(string[] args) { Style.Add <Eto.Wpf.Forms.Controls.GridViewHandler>(null, h => { h.Control.EnableColumnVirtualization = true; }); new Application(Eto.Platforms.Wpf).Run(new MainForm()); }
/// /// <summary> /// Notifies server controls that use composition-based implementation to create any child controls /// they contain in preparation for posting back or rendering. /// </summary> /// <remarks> /// If you override this method in a derived class, make sure you call this method as part of your /// base class's CreateChildControls. /// </remarks> /// protected override void CreateChildControls() { BorderWidth = 0; BackColor = Color.FromArgb(0xFF, 0xFF, 0xCC); Style.Add("border-style", "outset"); Style.Add("border-width", "2px"); return; }
private static void SetButtonStyles(OS platform) { Style.Add <Button>("MainExecuteButtonStyle", button => { button.Font = new Font("Microsoft Sans Serif", 15.75f); button.Size = new Size(110, 50); button.BackgroundColor = new Color(79, 28, 232); }); }