/// <summary> /// Returns copy of CustomizeItem item /// </summary> public override BaseItem Copy() { MDISystemItem objCopy=new MDISystemItem(); this.CopyToItem(objCopy); objCopy.MinimizeEnabled=m_MinimizeEnabled; objCopy.RestoreEnabled=m_RestoreEnabled; objCopy.CloseEnabled=m_CloseEnabled; return objCopy; }
private Office2007ButtonItemStateColorTable GetColorTable(MDISystemItem mdi, SystemButton button) { Office2007ButtonItemColorTable colors = m_ColorTable.ButtonItemColors[eButtonColor.Orange.ToString()]; Office2007ButtonItemStateColorTable ct = colors.Default; if (mdi.MouseDownButton == button) ct = colors.Pressed; else if (mdi.MouseOverButton == button) ct = colors.MouseOver; return ct; }
private void PaintButton(Graphics g, MDISystemItem mdi , SystemButton button, Rectangle r, Office2007ButtonItemStateColorTable ct, ColorScheme colorScheme) { Region oldClip = g.Clip; g.SetClip(r); Office2007ButtonItemPainter.PaintBackground(g, ct, r, RoundRectangleShapeDescriptor.RoundCorner2); r.Inflate(-1, -1); r.Offset(1, 0); using (Bitmap bmp = mdi.GetButtonBitmap(g, button, r, colorScheme)) { if (button == SystemButton.Minimize && !mdi.MinimizeEnabled || button == SystemButton.Restore && !mdi.RestoreEnabled || button == SystemButton.Close && !mdi.CloseEnabled) { float[][] array = new float[5][]; array[0] = new float[5] { 0, 0, 0, 0, 0 }; array[1] = new float[5] { 0, 0, 0, 0, 0 }; array[2] = new float[5] { 0, 0, 0, 0, 0 }; array[3] = new float[5] { .5f, .5f, .5f, .5f, 0 }; array[4] = new float[5] { 0, 0, 0, 0, 0 }; System.Drawing.Imaging.ColorMatrix grayMatrix = new System.Drawing.Imaging.ColorMatrix(array); System.Drawing.Imaging.ImageAttributes disabledImageAttr = new System.Drawing.Imaging.ImageAttributes(); disabledImageAttr.ClearColorKey(); disabledImageAttr.SetColorMatrix(grayMatrix); g.DrawImage(bmp, r, 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, disabledImageAttr); } else { if (button == mdi.MouseDownButton) r.Offset(1, 1); g.DrawImageUnscaled(bmp, r); } } g.Clip = oldClip; }
internal void ShowMDIChildSystemItems(System.Windows.Forms.Form objMdiChild, bool bRecalcLayout) { ClearMDIChildSystemItems(bRecalcLayout); if (objMdiChild == null) return; MDISystemItem mdi = new MDISystemItem("dotnetbarsysmenuitem"); if (!objMdiChild.ControlBox) mdi.CloseEnabled = false; if (!objMdiChild.MinimizeBox) mdi.MinimizeEnabled = false; if (!objMdiChild.MaximizeBox) { mdi.RestoreEnabled = false; } mdi.ItemAlignment = eItemAlignment.Far; mdi.Click += new System.EventHandler(this.MDISysItemClick); this.Items.Add(mdi); if (bRecalcLayout) this.RecalcLayout(); }
/// <summary> /// Creates new instance of the class and initializes it with default values. /// </summary> /// <param name="g">Reference to graphics object.</param> /// <param name="mdi">Reference to MdiSystemItem being rendered.</param> public MdiSystemItemRendererEventArgs(Graphics g, MDISystemItem mdi) { this.Graphics = g; this.MdiSystemItem = mdi; }
public static MdiSystemItemPainter CreateMdiSystemItemPainter(MDISystemItem mdiSystemItem) { if (BarFunctions.IsOffice2007Style(mdiSystemItem.EffectiveStyle)) return m_Office2007MdiSystemItemPainter; return null; }