public UILine() { SetStyleFlags(true, false); Size = new Size(360, 29); MinimumSize = new Size(2, 2); foreColor = UIStyles.GetStyleColor(UIStyle.Blue).LineForeColor; fillColor = UIStyles.GetStyleColor(UIStyle.Blue).PlainColor; }
public UIRadioButton() { SetStyleFlags(); Cursor = Cursors.Hand; ShowRect = false; Size = new Size(150, 29); foreColor = UIStyles.GetStyleColor(UIStyle.Blue).CheckBoxForeColor; fillColor = UIStyles.GetStyleColor(UIStyle.Blue).CheckBoxColor; }
public void SetStyle(UIStyle style) { UIBaseStyle uiColor = UIStyles.GetStyleColor(style); if (!uiColor.IsCustom()) { SetStyleColor(uiColor); } _style = style; }
/// <summary> /// 构造函数 /// </summary> public UIAvatar() { SetStyleFlags(true, false); Width = Height = 60; ShowText = false; ShowRect = false; fillColor = UIStyles.GetStyleColor(UIStyle.Blue).AvatarFillColor; foreColor = UIStyles.GetStyleColor(UIStyle.Blue).AvatarForeColor; }
public UIScrollingText() { SetStyleFlags(true, false); fillColor = UIStyles.GetStyleColor(UIStyle.Blue).PlainColor; foreColor = UIStyles.GetStyleColor(UIStyle.Blue).RectColor; Reset(); timer.Interval = interval; timer.Tick += Timer_Tick; }
public UICheckBox() { SetStyleFlags(); base.Cursor = Cursors.Hand; ShowRect = false; Size = new Size(150, 29); foreColor = UIStyles.GetStyleColor(UIStyle.Blue).CheckBoxForeColor; fillColor = UIStyles.GetStyleColor(UIStyle.Blue).CheckBoxColor; SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick); }
public UIHeaderButton() { SetStyleFlags(); Size = new Size(100, 88); ShowText = false; ShowRect = false; Radius = 0; RadiusSides = UICornerRadiusSides.None; RectSides = ToolStripStatusLabelBorderSides.None; Padding = new Padding(0, 8, 0, 3); foreHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForeHoverColor; forePressColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForePressColor; foreSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForeSelectedColor; fillHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillHoverColor; fillPressColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillPressColor; fillSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillSelectedColor; SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick); }
public UIButton() { SetStyleFlags(); TabStop = true; Width = 100; Height = 35; Cursor = Cursors.Hand; foreHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForeHoverColor; forePressColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForePressColor; foreSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForeSelectedColor; rectHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).RectHoverColor; rectPressColor = UIStyles.GetStyleColor(UIStyle.Blue).RectPressColor; rectSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).RectSelectedColor; fillHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillHoverColor; fillPressColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillPressColor; fillSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillSelectedColor; SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick); }
public void SetStyle(UIStyle style) { SetStyleColor(UIStyles.GetStyleColor(style)); _style = style; }
//------------------------------------------------------------------------------------------------------------------------------- // Create the Note and handle its location //------------------------------------------------------------------------------------------------------------------------------- private void setNotifier(string description, UINotifierType noteType, string title, bool isUpdate = false) { Title = title; Description = description; _uiNotifierType = noteType; noteTitle.Text = title; // Fill the UINotifier data title noteContent.Text = description; // Fill the UINotifier data description noteDate.Text = DateTime.Now + ""; // Fill the UINotifier data Timestamp #region ADJUST COLORS switch (noteType) { case UINotifierType.ERROR: icon.Symbol = 61527; icon.SymbolColor = UIStyles.GetStyleColor(UIStyle.Red).ButtonFillColor; LeaveColor = UIStyles.GetStyleColor(UIStyle.Red).ButtonFillColor; HoverColor = UIStyles.GetStyleColor(UIStyle.Red).ButtonFillHoverColor; break; case UINotifierType.INFO: icon.Symbol = 61530; icon.SymbolColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillColor; LeaveColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillColor; HoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillHoverColor; break; case UINotifierType.WARNING: icon.Symbol = 61553; icon.SymbolColor = UIStyles.GetStyleColor(UIStyle.Orange).ButtonFillColor; LeaveColor = UIStyles.GetStyleColor(UIStyle.Orange).ButtonFillColor; HoverColor = UIStyles.GetStyleColor(UIStyle.Orange).ButtonFillHoverColor; break; case UINotifierType.OK: icon.Symbol = 61528; icon.SymbolColor = UIStyles.GetStyleColor(UIStyle.Green).ButtonFillColor; LeaveColor = UIStyles.GetStyleColor(UIStyle.Green).ButtonFillColor; HoverColor = UIStyles.GetStyleColor(UIStyle.Green).ButtonFillHoverColor; break; } buttonClose.BackColor = LeaveColor; // Init colors buttonMenu.BackColor = LeaveColor; noteTitle.BackColor = LeaveColor; buttonClose.MouseHover += (s, e) => // Mouse hover { buttonClose.BackColor = HoverColor; buttonMenu.BackColor = HoverColor; noteTitle.BackColor = HoverColor; }; buttonMenu.MouseHover += (s, e) => { buttonMenu.BackColor = HoverColor; buttonClose.BackColor = HoverColor; noteTitle.BackColor = HoverColor; }; noteTitle.MouseHover += (s, e) => { buttonMenu.BackColor = HoverColor; buttonClose.BackColor = HoverColor; noteTitle.BackColor = HoverColor; }; buttonClose.MouseLeave += (s, e) => // Mouse leave { buttonClose.BackColor = LeaveColor; buttonMenu.BackColor = LeaveColor; noteTitle.BackColor = LeaveColor; }; buttonMenu.MouseLeave += (s, e) => { buttonMenu.BackColor = LeaveColor; buttonClose.BackColor = LeaveColor; noteTitle.BackColor = LeaveColor; }; noteTitle.MouseLeave += (s, e) => { buttonMenu.BackColor = LeaveColor; buttonClose.BackColor = LeaveColor; noteTitle.BackColor = LeaveColor; }; #endregion ADJUST COLORS #region DIALOG NOTE if (IsDialog) { Button ok_button = new Button(); // Dialog note comes with a simple Ok button ok_button.FlatStyle = FlatStyle.Flat; ok_button.BackColor = LeaveColor; ok_button.ForeColor = Color.White; Size = new Size(Size.Width, // Resize the note to contain the button Size.Height + 50); ok_button.Size = new Size(120, 40); ok_button.Location = new Point(Size.Width / 2 - ok_button.Size.Width / 2, Size.Height - 50); ok_button.Text = UILocalize.OK; ok_button.Click += onOkButtonClick; Controls.Add(ok_button); noteDate.Location = new Point(noteDate.Location.X, // Shift down the date location noteDate.Location.Y + 44); noteLocation = new NoteLocation(Left, Top); // Default Center Location } #endregion DIALOG NOTE #region NOTE LOCATION if (!IsDialog && !isUpdate) { NoteLocation location = adjustLocation(this); // Set the note location Left = location.X; // UINotifier position X Top = location.Y; // UINotifier position Y } #endregion NOTE LOCATION }
/// <summary> /// 主题的调色板 /// </summary> /// <param name="style"></param> /// <returns></returns> public static UIBaseStyle Colors(this UIStyle style) { return(UIStyles.GetStyleColor(style)); }