2 // System.Windows.Forms.DrawItemEventArgs
5 // stubbed out by Richard Baumann (biochem333@nyc.rr.com)
6 // Implemented by Richard Baumann <biochem333@nyc.rr.com>
7 // Dennis Hayes (dennish@Raytek.com)
8 // Gianandrea Terzi (gianandrea.terzi@lario.com)
10 // (C) Ximian, Inc., 2002
16 namespace System
.Windows
.Forms
{
19 /// Provides data for the DrawItem event.
21 public class DrawItemEventArgs
: EventArgs
{
24 private Color backColor
;
25 private Rectangle bounds
;
27 private Color foreColor
;
28 private Graphics graphics
;
30 private DrawItemState state
;
34 // --- Constructors/Destructors
37 public DrawItemEventArgs(Graphics graphics
, Font font
, Rectangle bounds
, int index
, DrawItemState state
) : base()
39 this.graphics
= graphics
;
41 this. bounds
= bounds
;
44 foreColor
= SystemColors
.WindowText
;
45 backColor
= SystemColors
.Window
;
46 //throw new NotImplementedException ();
49 public DrawItemEventArgs(Graphics graphics
, Font font
, Rectangle bounds
, int index
,
50 DrawItemState state
, Color foreColor
, Color backColor
) : base()
52 this.graphics
= graphics
;
54 this. bounds
= bounds
;
57 this.foreColor
= foreColor
;
58 this.backColor
= backColor
;
61 #region Public Methods
63 public virtual void DrawBackground()
65 SolidBrush temp
= new SolidBrush(BackColor
);
66 graphics
.FillRectangle(temp
,bounds
);
70 public virtual void DrawFocusRectangle()
72 if( (DrawItemState
.Focus
== (DrawItemState
.Focus
& state
)) && // check for focus
73 (DrawItemState
.NoFocusRect
!= (DrawItemState
.NoFocusRect
& state
))){ // check if this matters {
75 //ControlPaint.DrawFocusRectangle(graphics,bounds,foreColor,backColor);
81 #region Public Properties
83 public Color BackColor
86 //return (DrawItemState.Selected == (state & DrawItemState.Selected)) ? SystemColors.Highlight : backColor;
87 if(DrawItemState
.Selected
== (state
& DrawItemState
.Selected
)) {
88 return SystemColors
.Highlight
;
94 public Rectangle Bounds
{
106 public Color ForeColor
{
108 //return (DrawItemState.Selected == (state & DrawItemState.Selected)) ? SystemColors.HighlightText : foreColor;
109 if(DrawItemState
.Selected
== (state
& DrawItemState
.Selected
)) {
110 return SystemColors
.HighlightText
;
116 public Graphics Graphics
{
128 public DrawItemState State
{