private void AppCommandTheme_Executed(object sender, EventArgs e) { ICommandSource source = sender as ICommandSource; if (source.CommandParameter is string) { eStyle style = (eStyle)Enum.Parse(typeof(eStyle), source.CommandParameter.ToString()); // Using StyleManager change the style and color tinting if (style == eStyle.Metro) { StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.DarkBlue; StyleManager.Style = eStyle.Metro; // BOOM } else { // If previous style was Metro we need to update other properties as well StyleManager.ChangeStyle(style, Color.Empty); } } else if (source.CommandParameter is Color) { if (StyleManager.Style == eStyle.Metro) { StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Color.White, (Color)source.CommandParameter); } else { StyleManager.ColorTint = (Color)source.CommandParameter; } } }
//this constructor is used only for DBm_Image and DBm_Document table trees public Column(Column c,SQLTable DBm_owner_Table,List<SQLTable> lTable) { obj = SetObject(c.obj); nulltype = c.nulltype; Style = c.Style; flags = c.flags; IsIdentity = c.IsIdentity; ownerTable = c.ownerTable; Name = c.Name; // Value = c.Value; //SetType = c.SetType; if (c.fKey != null) { fKey = new ForeignKey(c.fKey, DBm_owner_Table, lTable); } Name_in_language = c.Name_in_language; //Name_in_language = new ltext(); //int iCount = c.Name_in_language.sText.Length; //for (int i = 0; i < iCount;i++) //{ // Name_in_language.sText(i) = c.Name_in_language.sText(i); //} }
void sti_Click(object sender, EventArgs e) { eStyle es = (eStyle)Enum.Parse(typeof(eStyle), ((ButtonItem)sender).Text); StyleMgr.ManagerStyle = es; SunCreate.Common.ConfigHelper.SetConfigValue("SysStyle", es.ToString()); }
private void cbStyle_SelectedIndexChanged(object sender, EventArgs e) { KeyValuePair <string, eStyle> item = (KeyValuePair <string, eStyle>)cbStyle.SelectedItem; this.m_Style = item.Value; this.updateStickyOSD(); }
private void SetMainFormStyle(eStyle estyle, eTabStripStyle etabStripStyle, eDotNetBarStyle edotNetBarStyle) { this.styleManager.ManagerStyle = estyle; this.tabControlMain.Style = etabStripStyle; this.navigationBar.Style = edotNetBarStyle; this.dotNetBarManager.Style = edotNetBarStyle; }
public void Copy(GridLayer acopy) { enabled = acopy.enabled; spacing = acopy.spacing; minSize = acopy.minSize; gridStyle = acopy.gridStyle; color = acopy.color; }
public void Copy(GridLayer acopy) { m_enabled = acopy.m_enabled; m_spacing = acopy.m_spacing; m_minSize = acopy.m_minSize; m_gridStyle = acopy.m_gridStyle; m_color = acopy.m_color; }
private _IButton PositionAndCreateButton(Vector2 pos, float border_padding, float spacing, float button_size_y, eStyle button_style, int button_num, String text) { Vector2 button_pos = pos; button_pos.X += border_padding; button_pos.Y += border_padding + (spacing + button_size_y) * button_num; return(XUI.Instance()._CreateRectangularButton(button_pos, text, button_style)); }
public _ISelector CreateSelector(_Position pos, String title, eStyle style, eStyle button_style, eStyle title_style, String[] texts) { _ISelector selector = new Selector(pos, title, style, button_style, title_style, NextUID(), texts); mSelectors.Add(selector.GetID(), selector); return(selector); }
private void AppCommandTheme_Executed(object sender, EventArgs e) { ICommandSource source = sender as ICommandSource; if (source.CommandParameter is string) { eStyle style = (eStyle)Enum.Parse(typeof(eStyle), source.CommandParameter.ToString()); // Using StyleManager change the style and color tinting if (style == eStyle.Metro) { foreach (BaseItem item in RibbonControl.Items) { // Ribbon Control may contain items other than tabs so that needs to be taken in account RibbonTabItem tab = item as RibbonTabItem; if (tab != null) { tab.Text = tab.Text.ToUpper(); } } ribbonControl1.RibbonStripFont = new System.Drawing.Font("Segoe UI", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.DarkBlue; // Adjust size of switch button to match Metro styling switchButtonItem1.SwitchWidth = 12; switchButtonItem1.ButtonWidth = 42; switchButtonItem1.ButtonHeight = 19; StyleManager.Style = eStyle.Metro; // BOOM } else { // If previous style was Metro we need to update other properties as well if (StyleManager.Style == eStyle.Metro) { ribbonControl1.RibbonStripFont = null; foreach (BaseItem item in RibbonControl.Items) { // Ribbon Control may contain items other than tabs so that needs to be taken in account RibbonTabItem tab = item as RibbonTabItem; if (tab != null) { tab.Text = ToTitleCase(tab.Text); } } // Adjust size of switch button to match Office styling switchButtonItem1.SwitchWidth = 28; switchButtonItem1.ButtonWidth = 62; switchButtonItem1.ButtonHeight = 20; } StyleManager.ChangeStyle(style, Color.Empty); } } }
private void AppCommandTheme_Executed(object sender, EventArgs e) { ICommandSource source = sender as ICommandSource; if (source.CommandParameter is string) { eStyle style = (eStyle)Enum.Parse(typeof(eStyle), source.CommandParameter.ToString()); // Using StyleManager change the style and color tinting if (StyleManager.IsMetro(style)) { ribbonControl1.RibbonStripFont = new System.Drawing.Font("Segoe UI", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); if (style == eStyle.Metro) { StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.DarkBlue; } // Adjust size of switch button to match Metro styling switchButtonItem1.SwitchWidth = 12; switchButtonItem1.ButtonWidth = 42; switchButtonItem1.ButtonHeight = 19; // Adjust tab strip style tabStrip1.Style = eTabStripStyle.Metro; StyleManager.Style = style; // BOOM } else { // If previous style was Metro we need to update other properties as well if (StyleManager.IsMetro(StyleManager.Style)) { ribbonControl1.RibbonStripFont = null; // Adjust size of switch button to match Office styling switchButtonItem1.SwitchWidth = 28; switchButtonItem1.ButtonWidth = 62; switchButtonItem1.ButtonHeight = 20; } // Adjust tab strip style tabStrip1.Style = eTabStripStyle.Office2007Document; StyleManager.ChangeStyle(style, Color.Empty); } } else if (source.CommandParameter is Color) { if (StyleManager.IsMetro(StyleManager.Style)) { StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Color.White, (Color)source.CommandParameter); } else { StyleManager.ColorTint = (Color)source.CommandParameter; } } }
public Style(eStyle enum_value, eFont normal, Color text, Color background, Color border, float button_padding_scalar, float placement_padding_scalar) { mEnumValue = enum_value; mNormalFont = normal; mTextColor = text; mBackgroundColor = background; mBorderColor = border; CalcPadding(button_padding_scalar, placement_padding_scalar); }
private void selectStyleCb(eStyle i_Style) { foreach (KeyValuePair <string, eStyle> item in cbStyle.Items) { if (item.Value == i_Style) { cbStyle.SelectedItem = item; break; } } }
/// <summary> /// 改变UI风格。 /// </summary> /// <param name="uiStyle"></param> protected virtual void ChangeUIStyle(eStyle uiStyle) { PrepareBeforeChangeUIStyle(uiStyle); if (StyleManager.IsMetro(uiStyle)) { StyleManager.Style = uiStyle; } else { StyleManager.ChangeStyle(uiStyle, Color.Empty); } }
public _IButton _CreateRectangularButton(Vector2 pos, String text, eStyle style) { Style s = XUI.Instance().GetStyle(style); XFontDraw.FontInfo info = XFontDraw.Instance().GetFontInfo(s.mNormalFont); Vector2 font_size = info.mSize; _IButton button = new _RectangularButton(pos, text, s, NextUID(), font_size); _mButtons.Add(button.GetID(), button); return(button); }
private void comboBoxEx1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxEx1.SelectedItem == null) { return; } eStyle style = (eStyle)comboBoxEx1.SelectedItem; if (styleManager1.ManagerStyle != style) { styleManager1.ManagerStyle = style; } }
public FrmLogin() { InitializeComponent(); Login = this; this.lbVersion.Text = "版本:v" + Assembly.GetExecutingAssembly().GetName().Version.ToString(); cbRememberUser.Checked = SunCreate.Common.ConfigHelper.GetConfigBool("RememberUser"); if (cbRememberUser.Checked) { this.tbUserName.Text = SunCreate.Common.ConfigHelper.GetConfigString("LastLoginUser"); } cbRememberPwd.Checked = SunCreate.Common.ConfigHelper.GetConfigBool("RememberPwd"); if (cbRememberPwd.Checked) { string pwd = SunCreate.Common.ConfigHelper.GetConfigString("LastLoginPwd"); if (!string.IsNullOrWhiteSpace(pwd)) { try { this.tbPwd.Text = EncryptUtils.DESDecrypt(pwd, "yjdd@@!!", "djifd##c"); } catch (Exception ex) { log.Error("加载密码失败:", ex); } } } string style = SunCreate.Common.ConfigHelper.GetConfigString("SysStyle"); eStyle es = eStyle.Office2010Black; Enum.TryParse <eStyle>(style, out es); styleManager.ManagerStyle = es; //加载登陆背景 string logo = Path.Combine(Application.StartupPath, "Images\\登陆背景.png"); if (File.Exists(logo)) { try { this.BackgroundImage = Image.FromFile(logo); } catch (Exception ex) { log.Error("登陆背景加载失败!", ex); } } }
private void buttonStyleCustom_ExpandChange(object sender, EventArgs e) { if (buttonStyleCustom.Expanded) { // Remember the starting color scheme to apply if no color is selected during live-preview m_ColorSelected = false; m_BaseStyle = StyleManager.Style; } else { if (!m_ColorSelected) { StyleManager.ChangeStyle(m_BaseStyle, Color.Empty); } } }
private void comboBoxEx1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxEx1.SelectedItem == null) { return; } eStyle style = (eStyle)(10 + comboBoxEx1.SelectedIndex); if (styleManager1.ManagerStyle != style) { styleManager1.ManagerStyle = style; } if (comboBoxEx1.SelectedIndex != Settings.Default.Diseño) { Settings.Default.Diseño = comboBoxEx1.SelectedIndex; Settings.Default.Save(); MessageBoxEx.Show("Te recomendamos reiniciar el programa para aplicar los cambios completamente", "Cambio de estilo"); } }
public Settings(IntPtr Handle) { //设置为默认值 this.Category = new Category(); this.FirstRun = true; this.Location = new Point(0, 0); this.ManagerStyle = eStyle.Metro; this.ManagerColorTint = Color.White; this.ButtonCheckedIndex = 0; this.LoadPlugin = true; this.DoubleClickRun = false; this.LinkDragRemove = true; this.TopMost = true; this.LCID = 0; this.HotKey = new HotKey(); this.HotKey.Modifiers = WinHotKey.KeyModifiers.Alt; this.HotKey.Key = Keys.D1; this.WinHotKey = new WinHotKey(Handle); this.WinHotKey.SetHotKey(this.HotKey); this.MainPanelItems = new List <ItemSubInfo>(); }
private void AppCommandTheme_Executed(object sender, EventArgs e) { ICommandSource source = sender as ICommandSource; if (source.CommandParameter is string) { SystemInfo.CurrentStyle = source.CommandParameter.ToString(); eStyle style = (eStyle)Enum.Parse(typeof(eStyle), SystemInfo.CurrentStyle); // Using StyleManager change the style and color tinting StyleManager.ChangeStyle(style, Color.Empty); //if (style == eStyle.Office2007Black || style == eStyle.Office2007Blue || style == eStyle.Office2007Silver || style == eStyle.Office2007VistaGlass) // buttonFile.BackstageTabEnabled = false; //else // buttonFile.BackstageTabEnabled = true; UserConfigHelper.SaveConfig(); } else if (source.CommandParameter is Color) { StyleManager.ColorTint = (Color)source.CommandParameter; } }
private void ThemeChanged(string param) { switch (param) { case "Metro": StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.DarkBlue; StyleManager.Style = eStyle.Metro; // BOOM break; case "Office2007Blue": case "Office2007Silver": case "Office2007Black": case "Office2007VistaGlass": case "Office2010Silver": case "Office2010Blue": case "Office2010Black": case "Windows7Blue": case "VisualStudio2010Blue": eStyle style = (eStyle)Enum.Parse(typeof(eStyle), param); StyleManager.ChangeStyle(style, Color.Empty); break; default: if (param.StartsWith("#")) { string colorstr = param.TrimStart('#'); System.Drawing.Color color = System.Drawing.Color.FromArgb(Convert.ToInt32(colorstr, 16)); if (StyleManager.Style == eStyle.Metro) { StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Color.White, color); } else { StyleManager.ColorTint = color; } } break; } }
private void buttonStyleCustom_ExpandChange(object sender, System.EventArgs e) { if (buttonStyleCustom.Expanded) { // Remember the starting color scheme to apply if no color is selected during live-preview m_ColorSelected = false; m_BaseStyle = StyleManager.Style; } else { if (!m_ColorSelected) { if (StyleManager.IsMetro(StyleManager.Style)) { StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.Default; } else { StyleManager.ChangeStyle(m_BaseStyle, Color.Empty); } } } }
private void PositionAndCreateButtons(String[] strings, _IButton[] dest, float border_padding, float spacing, float button_size_y, eStyle style, int offset) { String spacer = XUI.Instance().GetSpacerString(); const String spacer_replacement = " "; for (int i = 0; i < strings.Length; ++i) { bool is_spacer = spacer == strings[i]; if (is_spacer) { dest[i] = PositionAndCreateButton(mPos, border_padding, spacing, button_size_y, style, i + offset, spacer_replacement); dest[i].SetActive(false); } else { dest[i] = PositionAndCreateButton(mPos, border_padding, spacing, button_size_y, style, i + offset, strings[i]); } } }
private void SetMainFormStyle(eStyle estyle, eTabStripStyle etabStripStyle, eDotNetBarStyle edotNetBarStyle) { this.styleManager.ManagerStyle = estyle; this.tabControlMain.Style = etabStripStyle; this.navigationBar.Style = edotNetBarStyle; this.dotNetBarManager.Style = edotNetBarStyle; }
private void buttonStyleCustom_ExpandChange(object sender, System.EventArgs e) { if (buttonStyleCustom.Expanded) { // Remember the starting color scheme to apply if no color is selected during live-preview m_ColorSelected = false; m_BaseStyle = StyleManager.Style; } else { if (!m_ColorSelected) { if (StyleManager.IsMetro(StyleManager.Style)) StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.Default; else StyleManager.ChangeStyle(m_BaseStyle, Color.Empty); } } }
public void ChangeStyle(eStyle style) { styleManager1.ManagerStyle = style; }
private static eDotNetBarStyle DotNetBarStyleFromStyle(eStyle value) { if (value == eStyle.Windows7Blue) return eDotNetBarStyle.Windows7; else if (value == eStyle.Office2010Silver || value == eStyle.Office2010Blue || value == eStyle.Office2010Black || value == eStyle.VisualStudio2010Blue) return eDotNetBarStyle.Office2010; else if (value == eStyle.Metro) return eDotNetBarStyle.Metro; return eDotNetBarStyle.Office2007; }
public void ChangeStyle(eStyle style) { styleManager1.ManagerStyle = style; }
public Selector(_Position pos, String title, eStyle style, eStyle button_style, eStyle title_style, long id, String[] texts) { mRenderEnabled = true; mID = id; mPos = pos.GetPosition(); mPosition = pos; mTitle = title; mStyle = style; mButtonStyle = button_style; mTitleStyle = title_style; this.mSelections = new _IButton[texts.Length]; // create a default button to see how big it is vertically // size and position border accordingly, factoring in width of largest button including title // destroy that button // create all the proper buttons in the right spot // create title 'button' as disabled button XUI xui_inst = XUI.Instance(); _IButton test = xui_inst._CreateRectangularButton(Vector2.Zero, "Test", style); xAABB2 button_size = test.GetAABB(); float button_size_y = button_size.GetSize().Y; xui_inst._DestroyButton(test); const float k_border_padding_scalar = 0.5f; float border_padding = k_border_padding_scalar * button_size_y; const float k_spacing_scalar = 0.2f; float spacing = k_spacing_scalar * button_size_y; // pad out the text strings so the buttons can be wide if the text is small int longest = GetLongestString(texts); PadButtonTexts(texts, longest); // create buttons PositionAndCreateButtons(texts, mSelections, border_padding, spacing, button_size_y, button_style, 0); // track largest float largest_x = GetWidest(mSelections); // create title button (non-functional) and see if it's the largest Vector2 title_pos = mPos + new Vector2(border_padding, border_padding); mTitleButton = xui_inst._CreateRectangularButton(title_pos, title, title_style); mTitleButton.SetActive(false); largest_x = Math.Max(largest_x, mTitleButton.GetAABB().GetSize().X); // calculate aabb const float title_padding_scalar = 4.0f; float title_padding = border_padding * title_padding_scalar; Vector2 title_padding_v = new Vector2(0, title_padding); float full_width = largest_x + 2 * border_padding; float full_height = button_size_y * (mSelections.Length) + (mSelections.Length - 1) * spacing + 2 * border_padding + title_padding; mAABB.Set(mPos, mPos + new Vector2(full_width, full_height)); // translate each button to be centered, and account for title CenterButtons(mSelections, largest_x, title_padding); CenterButton(mTitleButton, largest_x, 0); // if the selector has a non-trivial Position, fix it if (mPosition.IsCentered()) { // see where it is now, figure out where it should be, translate. // apply to aabb for selector plus translate all the buttons xCoord screen_dim = XRenderManager.Instance().GetScreenDim(); Vector2 span = mAABB.GetSize(); Vector2 screen_dim_vec = new Vector2(screen_dim.x, screen_dim.y); Vector2 edge = 0.5f * (screen_dim_vec - span); Translate(edge); } }
private static void setStyle(StyleManager oStyleManager, eStyle oStyle) { oStyleManager.ManagerStyle = oStyle; }
private static eOffice2007ColorScheme ColorSchemeFromStyle(eStyle style) { eOffice2007ColorScheme colorScheme = eOffice2007ColorScheme.Blue; if (style == eStyle.Office2007Silver) colorScheme = eOffice2007ColorScheme.Silver; else if (style == eStyle.Office2007Black) colorScheme = eOffice2007ColorScheme.Black; else if (style == eStyle.Office2007VistaGlass) colorScheme = eOffice2007ColorScheme.VistaGlass; return colorScheme; }
private static void OnStyleChanged(eStyle oldValue, eStyle newValue) { ChangeColorTable(newValue, !_ColorTint.IsEmpty); NotifyOnStyleChange(); }
private static void ChangeColorTable(eStyle style, bool colorBlendChanged) { if (style == eStyle.Office2010Silver) { // Ensure that proper color table is selected. if (GlobalManager.Renderer is Office2007Renderer) { Office2007Renderer renderer = (Office2007Renderer)GlobalManager.Renderer; if (colorBlendChanged || !(renderer.ColorTable is Office2010ColorTable) || renderer.ColorTable is Office2010ColorTable && ((Office2010ColorTable)renderer.ColorTable).ColorScheme != eOffice2010ColorScheme.Silver) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2010ColorTable(eOffice2010ColorScheme.Silver, _ColorTint); } } } else if (style == eStyle.Office2010Blue) { // Ensure that proper color table is selected. if (GlobalManager.Renderer is Office2007Renderer) { Office2007Renderer renderer = (Office2007Renderer)GlobalManager.Renderer; if (colorBlendChanged || !(renderer.ColorTable is Office2010ColorTable) || renderer.ColorTable is Office2010ColorTable && ((Office2010ColorTable)renderer.ColorTable).ColorScheme != eOffice2010ColorScheme.Blue) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2010ColorTable(eOffice2010ColorScheme.Blue, _ColorTint); } } } else if (style == eStyle.Office2010Black) { // Ensure that proper color table is selected. if (GlobalManager.Renderer is Office2007Renderer) { Office2007Renderer renderer = (Office2007Renderer)GlobalManager.Renderer; if (colorBlendChanged || !(renderer.ColorTable is Office2010ColorTable) || renderer.ColorTable is Office2010ColorTable && ((Office2010ColorTable)renderer.ColorTable).ColorScheme != eOffice2010ColorScheme.Black) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2010ColorTable(eOffice2010ColorScheme.Black, _ColorTint); } } } else if (style == eStyle.VisualStudio2010Blue) { // Ensure that proper color table is selected. if (GlobalManager.Renderer is Office2007Renderer) { Office2007Renderer renderer = (Office2007Renderer)GlobalManager.Renderer; if (colorBlendChanged || !(renderer.ColorTable is Office2010ColorTable) || renderer.ColorTable is Office2010ColorTable && ((Office2010ColorTable)renderer.ColorTable).ColorScheme != eOffice2010ColorScheme.VS2010) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2010ColorTable(eOffice2010ColorScheme.VS2010, _ColorTint); } } } else if (style == eStyle.Windows7Blue) { // Ensure that proper color table is selected. if (GlobalManager.Renderer is Office2007Renderer) { if (colorBlendChanged || !(((Office2007Renderer)GlobalManager.Renderer).ColorTable is Windows7ColorTable)) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Windows7ColorTable(eWindows7ColorScheme.Blue, _ColorTint); } } } else if (style == eStyle.Office2007Blue || style == eStyle.Office2007Silver || style == eStyle.Office2007Black || style == eStyle.Office2007VistaGlass) { // Ensure that proper color table is selected. if (GlobalManager.Renderer is Office2007Renderer) { if (colorBlendChanged || (((Office2007Renderer)GlobalManager.Renderer).ColorTable is Office2010ColorTable) || (((Office2007Renderer)GlobalManager.Renderer).ColorTable is Windows7ColorTable) || (((Office2007Renderer)GlobalManager.Renderer).ColorTable.InitialColorScheme != ColorSchemeFromStyle(style)) || _PreviousStyle != style) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2007ColorTable(ColorSchemeFromStyle(style), _ColorTint); } } } else if (style == eStyle.Metro) { DevComponents.DotNetBar.Metro.Rendering.MetroRender.UpdateColorTable(_MetroColorGeneratorParameters); } }
private static void ChangeColorTable(eStyle style) { ChangeColorTable(style, false); }
/// <summary> /// Changes the StyleManager style and color tint in one step. Use this method if you need to change style and color tint simultaneously in single step for better performance. /// </summary> /// <param name="newStyle">New style.</param> /// <param name="colorTint">Color tint for the style.</param> public static void ChangeStyle(eStyle newStyle, Color colorTint) { _ColorTint = colorTint; Style = newStyle; }
private void AppCommandTheme_Executed(object sender, EventArgs e) { ICommandSource source = sender as ICommandSource; if (source.CommandParameter is string) { eStyle style = (eStyle)Enum.Parse(typeof(eStyle), source.CommandParameter.ToString()); // Using StyleManager change the style and color tinting if (StyleManager.IsMetro(style)) { // More customization is needed for Metro // Capitalize App Button and tab buttonFile.Text = buttonFile.Text.ToUpper(); foreach (BaseItem item in RibbonControl.Items) { // Ribbon Control may contain items other than tabs so that needs to be taken in account RibbonTabItem tab = item as RibbonTabItem; if (tab != null) { tab.Text = tab.Text.ToUpper(); } } buttonFile.BackstageTabEnabled = true; // Use Backstage for Metro ribbonControl1.RibbonStripFont = new System.Drawing.Font("Segoe UI", 9.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); if (style == eStyle.Metro) { StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.DarkBlue; } // Adjust size of switch button to match Metro styling switchButtonItem1.SwitchWidth = 16; switchButtonItem1.ButtonWidth = 48; switchButtonItem1.ButtonHeight = 19; // Adjust tab strip style //tabStrip1.Style = eTabStripStyle.Metro; StyleManager.Style = style; // BOOM } else { // If previous style was Metro we need to update other properties as well if (StyleManager.IsMetro(StyleManager.Style)) { ribbonControl1.RibbonStripFont = null; // Fix capitalization App Button and tab buttonFile.Text = ToTitleCase(buttonFile.Text); foreach (BaseItem item in RibbonControl.Items) { // Ribbon Control may contain items other than tabs so that needs to be taken in account RibbonTabItem tab = item as RibbonTabItem; if (tab != null) { tab.Text = ToTitleCase(tab.Text); } } // Adjust size of switch button to match Office styling switchButtonItem1.SwitchWidth = 28; switchButtonItem1.ButtonWidth = 62; switchButtonItem1.ButtonHeight = 20; } // Adjust tab strip style // tabStrip1.Style = eTabStripStyle.Office2007Document; StyleManager.ChangeStyle(style, Color.Empty); if (style == eStyle.Office2007Black || style == eStyle.Office2007Blue || style == eStyle.Office2007Silver || style == eStyle.Office2007VistaGlass) { buttonFile.BackstageTabEnabled = false; } else { buttonFile.BackstageTabEnabled = true; } } } else if (source.CommandParameter is Color) { if (StyleManager.IsMetro(StyleManager.Style)) { StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Color.White, (Color)source.CommandParameter); } else { StyleManager.ColorTint = (Color)source.CommandParameter; } } }
public static void setStyle(StyleManager oStyleManager, String strStyleName) { eStyle oStyle = EnumUtils.getEnumByKey <eStyle>(strStyleName); setStyle(oStyleManager, oStyle); }
private void cb_themes_SelectionChangeCommitted(object sender, EventArgs e) { eStyle style = (eStyle)(cb_themes.SelectedValue); ChangeStyle(style); }
public void Copy(GridLayer acopy) { m_enabled = acopy.m_enabled; m_spacing = acopy.m_spacing; m_minSize = acopy.m_minSize; m_gridStyle = acopy.m_gridStyle; m_color = acopy.m_color; }
/// <summary> /// 改变界面风格前的准备工作。 /// </summary> /// <param name="uiStyle"></param> protected virtual void PrepareBeforeChangeUIStyle(eStyle uiStyle) { }
public Column(SQLTable owner,Object xObj, nullTYPE xType, Flags xflags, eStyle styl, ltext Name_in_lang) { Style = styl; fKey = null; obj = xObj; nulltype = xType; flags = xflags; // int i = 0; int iCount = Name_in_lang.sText_Length; this.ownerTable = owner; Name = StaticLib.Func.GetNameFromObjectType(obj); if (obj.GetType() == typeof(ID)) { IsIdentity = true; } Name_in_language = Name_in_lang; //Name_in_language = new ltext(); //for (i = 0; i < iCount; i++) //{ // Name_in_language.sText(i)=Name_in_lang.sText(i); //} }