protected override void OnSwitchStyle_Click(object sender, ItemClickEventArgs e) { base.OnSwitchStyle_Click(sender, e); ActiveLookAndFeelStyle style = ((CheckBarItem)e.Item).Style; RaiseSwitchStyle(); }
private void DrawButton(GraphicsCache cache, Rectangle bounds, ActiveLookAndFeelStyle lookAndFeel, AppearanceObject appearance, ObjectState state, string caption, bool drawIcon) { EditorButtonObjectInfoArgs args = new EditorButtonObjectInfoArgs(cache, Button, appearance); BaseLookAndFeelPainters painters = LookAndFeelPainterHelper.GetPainter(lookAndFeel); // Create some margin bounds.Inflate(-BUTTONMARGIN, -BUTTONMARGIN); args.Bounds = bounds; args.State = state; painters.Button.DrawObject(args); if (drawIcon) { Image calcIcon = Microsoft.Dynamics.Retail.Pos.Dialog.Properties.Resources.PriceCalc; if (calcIcon != null) { // Determine origin point to draw centered int x = args.Bounds.Left + ((args.Bounds.Width - calcIcon.Width) / 2); int y = args.Bounds.Top + ((args.Bounds.Height - calcIcon.Height) / 2); if (state == ObjectState.Disabled) { ControlPaint.DrawImageDisabled(cache.Graphics, calcIcon, x, y, Color.Transparent); } else { cache.Graphics.DrawImageUnscaled(calcIcon, x, y); } } } else { // Draw the text // DO NOT dispose of the brush, as it is owned by the cache Brush brush = GetButtonForeBrush(state, cache); StringFormat sf = appearance.GetStringFormat(appearance.GetTextOptions()); painters.Button.DrawCaption(args, caption, appearance.Font, brush, args.Bounds, sf); } }
private void DrawButton(GraphicsCache cache, Rectangle bounds, ActiveLookAndFeelStyle lookAndFeel, AppearanceObject appearance, ObjectState state, string caption) { EditorButtonObjectInfoArgs args = new EditorButtonObjectInfoArgs(cache, Button, appearance); BaseLookAndFeelPainters painters = LookAndFeelPainterHelper.GetPainter(lookAndFeel); // Create some margin bounds.Inflate(-BUTTONMARGIN, -BUTTONMARGIN); args.Bounds = bounds; args.State = state; painters.Button.DrawObject(args); // Draw the text // DO NOT dispose of Brush, as it is owned by the cache. Brush brush = gridView.Appearance.HeaderPanel.GetForeBrush(cache); StringFormat sf = appearance.GetStringFormat(appearance.GetTextOptions()); painters.Button.DrawCaption(args, caption, appearance.Font, brush, args.Bounds, sf); }
public BarLookAndFeelStyleItem(BarManager manager, bool privateItem, ActiveLookAndFeelStyle activeStyle, LookAndFeelStyle style) : base(manager, privateItem) { this.style = style; this.activeStyle = activeStyle; }
protected override DevExpress.XtraNavBar.ViewInfo.BaseViewInfoRegistrator GetExplorerView(ActiveLookAndFeelStyle activeStyle) { if (activeStyle != ActiveLookAndFeelStyle.Skin) return AvailableNavBarViews[NoExpandButtonViewInfoRegistrator.CustomViewName]; return base.GetExplorerView(activeStyle); }
public CheckBarItemWithStyle(BarManager manager, string text, ItemClickEventHandler handler, ActiveLookAndFeelStyle style, LookAndFeelStyle lfStyle) : base(manager, text, handler, style) { this.lfStyle = lfStyle; }
public CheckBarItem(BarManager manager, string text, ItemClickEventHandler handler, ActiveLookAndFeelStyle style) : base(manager, text, handler, false) { this.style = style; }
DialogResult ShowMessageBoxDialog() { if (Message.GetLookAndFeel() != null) { LookAndFeel.Assign(Message.GetLookAndFeel()); } if (!AllowCustomLookAndFeel) { if (LookAndFeel.ActiveStyle != ActiveLookAndFeelStyle.Skin) { ActiveLookAndFeelStyle active = UserLookAndFeel.Default.ActiveStyle; if (active == ActiveLookAndFeelStyle.Office2003) { LookAndFeel.SetStyle(LookAndFeelStyle.Office2003, true, false, ""); } else { LookAndFeel.SetDefaultStyle(); } } } this.Text = Message.Caption; FormBorderStyle = FormBorderStyle.FixedSingle; MinimizeBox = false; MaximizeBox = false; IWin32Window owner = Message.Owner; if (owner == null) { Form activeForm = Form.ActiveForm; if (activeForm != null && !activeForm.InvokeRequired) { owner = activeForm; } } if (owner != null) { Control ownerControl = owner as Control; if (ownerControl != null) { if (!ownerControl.Visible) { owner = null; } else { Form ownerForm = ownerControl.FindForm(); if (ownerForm != null) { if ((!ownerForm.Visible) || ownerForm.WindowState == FormWindowState.Minimized || ownerForm.Right <= 0 || ownerForm.Bottom <= 0) { owner = null; } } } } } if (owner == null) { ShowInTaskbar = true; StartPosition = FormStartPosition.CenterScreen; } else { ShowInTaskbar = false; StartPosition = FormStartPosition.CenterParent; } CreateButtons(); CalcIconBounds(); CalcMessageBounds(); CalcFinalSizes(); Form frm = owner as Form; if (frm != null && frm.TopMost) { this.TopMost = true; } return(DoShowDialog(owner)); return(this.ShowDialog(owner)); }