0201-05-16 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms.Theming / Default / TabControlPainter.cs
1 // Permission is hereby granted, free of charge, to any person obtaining\r
2 // a copy of this software and associated documentation files (the\r
3 // "Software"), to deal in the Software without restriction, including\r
4 // without limitation the rights to use, copy, modify, merge, publish,\r
5 // distribute, sublicense, and/or sell copies of the Software, and to\r
6 // permit persons to whom the Software is furnished to do so, subject to\r
7 // the following conditions:\r
8 //\r
9 // The above copyright notice and this permission notice shall be\r
10 // included in all copies or substantial portions of the Software.\r
11 //\r
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
19 //\r
20 // Copyright (c) 2007 Novell, Inc.\r
21 //\r
22 // Authors:\r
23 //      Andreia Gaita (avidigal@novell.com)\r
24 \r
25 using System;\r
26 using System.Drawing;\r
27 using System.Drawing.Text;\r
28 using System.Windows.Forms;\r
29 using System.Windows.Forms.VisualStyles;\r
30 \r
31 namespace System.Windows.Forms.Theming.Default\r
32 {\r
33         /// <summary>\r
34         /// Summary description for TabControl.\r
35         /// </summary>\r
36         internal class TabControlPainter {\r
37                 protected SystemResPool ResPool { get { return ThemeEngine.Current.ResPool; } }\r
38 \r
39                 #region private\r
40 \r
41                 private Size    defaultItemSize;\r
42                 private Point   defaultPadding;\r
43                 private int             minimumTabWidth;\r
44                 private Rectangle selectedTabDelta;\r
45 \r
46                 private Point   tabPanelOffset;\r
47                 \r
48                 private int             selectedSpacing;\r
49 \r
50                 private Size    rowSpacingNormal;\r
51                 private Size    rowSpacingButtons;\r
52                 private Size    rowSpacingFlatButtons;\r
53                 private int             scrollerWidth;\r
54                 private Point   focusRectSpacing;\r
55                 private Rectangle tabPageSpacing;\r
56                 private int             colSpacing;\r
57                 private int             flatButtonSpacing;\r
58 \r
59                 private Point   imagePadding;\r
60 \r
61                 private StringFormat defaultFormatting;\r
62 \r
63                 private Rectangle borderThickness;\r
64 \r
65                 #endregion\r
66 \r
67                 #region Properties\r
68 \r
69                 public virtual Size DefaultItemSize {\r
70                         get { return defaultItemSize; }\r
71                         set { defaultItemSize = value; }\r
72                 }\r
73 \r
74                 public virtual Point DefaultPadding {\r
75                         get { return defaultPadding; }\r
76                         set { defaultPadding = value; }\r
77                 }\r
78 \r
79                 public virtual int MinimumTabWidth {\r
80                         get { return minimumTabWidth; }\r
81                         set { minimumTabWidth = value; }\r
82                 }\r
83 \r
84                 public virtual Rectangle SelectedTabDelta {\r
85                         get { return selectedTabDelta; }\r
86                         set { selectedTabDelta = value; }\r
87                 }\r
88 \r
89                 public virtual Point TabPanelOffset {\r
90                         get { return tabPanelOffset; }\r
91                         set { tabPanelOffset = value; }\r
92                 }\r
93 \r
94                 public virtual int SelectedSpacing {\r
95                         get { return selectedSpacing; }\r
96                         set { selectedSpacing = value; }\r
97                 }\r
98 \r
99                 public virtual Size RowSpacingNormal { \r
100                         get { return rowSpacingNormal; }\r
101                         set { rowSpacingNormal = value; }\r
102                 }\r
103 \r
104                 public virtual Size RowSpacingButtons { \r
105                         get { return rowSpacingButtons; }\r
106                         set { rowSpacingButtons = value; }\r
107                 }\r
108 \r
109                 public virtual Size RowSpacingFlatButtons { \r
110                         get { return rowSpacingFlatButtons; }\r
111                         set { rowSpacingFlatButtons = value; }\r
112                 }\r
113 \r
114                 public virtual Point FocusRectSpacing {\r
115                         get { return focusRectSpacing; }\r
116                         set { focusRectSpacing = value; }\r
117                 }\r
118 \r
119                 public virtual int ColSpacing { \r
120                         get { return colSpacing; }\r
121                         set { colSpacing = value; }\r
122                 }\r
123 \r
124                 public virtual int FlatButtonSpacing { \r
125                         get { return flatButtonSpacing; }\r
126                         set { flatButtonSpacing = value; }\r
127                 }\r
128 \r
129                 public virtual Rectangle TabPageSpacing {\r
130                         get { return tabPageSpacing; }\r
131                         set { tabPageSpacing = value; }\r
132                 }\r
133 \r
134                 public virtual Point ImagePadding {\r
135                         get { return imagePadding; }\r
136                         set { imagePadding = value; }\r
137                 }\r
138 \r
139                 public virtual StringFormat DefaultFormatting {\r
140                         get { return defaultFormatting; }\r
141                         set { defaultFormatting = value; }\r
142                 }\r
143 \r
144                 public virtual Rectangle BorderThickness {\r
145                         get { return borderThickness; }\r
146                         set { borderThickness = value; }\r
147                 }\r
148 \r
149                 public virtual int ScrollerWidth {\r
150                         get { return scrollerWidth; }\r
151                         set { scrollerWidth = value; }\r
152                 }\r
153 \r
154                 public virtual Size RowSpacing (System.Windows.Forms.TabControl tab) {\r
155                         switch (tab.Appearance) {\r
156                                 case TabAppearance.Normal:\r
157                                         return rowSpacingNormal;\r
158                                 case TabAppearance.Buttons:\r
159                                         return rowSpacingButtons;\r
160                                 case TabAppearance.FlatButtons:\r
161                                         return rowSpacingFlatButtons;\r
162                                 default:\r
163                                         throw new Exception ("Invalid Appearance value: " + tab.Appearance);\r
164                         }\r
165                 }\r
166                 #endregion\r
167 \r
168                 public TabControlPainter ()\r
169                 {\r
170                         defaultItemSize = new Size (42, 16);\r
171                         defaultPadding = new Point (6, 3);\r
172                         selectedTabDelta = new Rectangle (2, 2, 4, 3);\r
173                         selectedSpacing = 0;\r
174 \r
175                         rowSpacingNormal = new Size (0, 0);\r
176                         rowSpacingButtons = new Size (3, 3);\r
177                         rowSpacingFlatButtons = new Size (9, 3);\r
178                         \r
179                         colSpacing = 0;\r
180 \r
181                         minimumTabWidth = 42;\r
182                         scrollerWidth = 17;\r
183                         focusRectSpacing = new Point (2, 2);\r
184                         tabPanelOffset = new Point (4, 0);\r
185                         flatButtonSpacing = 8;\r
186                         tabPageSpacing = new Rectangle (4, 2, 3, 4);\r
187 \r
188                         imagePadding = new Point (2, 3);\r
189 \r
190                         defaultFormatting = new StringFormat();\r
191                         // Horizontal Alignment is handled in the Draw method\r
192                         defaultFormatting.Alignment = StringAlignment.Near;\r
193                         defaultFormatting.LineAlignment = StringAlignment.Center;\r
194                         defaultFormatting.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.NoClip;\r
195                         defaultFormatting.HotkeyPrefix = HotkeyPrefix.Show;\r
196 \r
197                         borderThickness = new Rectangle (1, 1, 2, 2);\r
198                 }\r
199 \r
200                 public virtual Rectangle GetLeftScrollRect (System.Windows.Forms.TabControl tab)\r
201                 {\r
202                         switch (tab.Alignment) {\r
203                                 case TabAlignment.Top:\r
204                                         return new Rectangle (tab.ClientRectangle.Right - (scrollerWidth * 2), tab.ClientRectangle.Top + 1, scrollerWidth, scrollerWidth);\r
205                                 default:\r
206                                         Rectangle panel_rect = GetTabPanelRect (tab);\r
207                                         return new Rectangle (tab.ClientRectangle.Right - (scrollerWidth * 2), panel_rect.Bottom + 2, scrollerWidth, scrollerWidth);\r
208                         }\r
209                 }\r
210 \r
211                 public virtual Rectangle GetRightScrollRect (System.Windows.Forms.TabControl tab)\r
212                 {\r
213                         switch (tab.Alignment) {\r
214                                 case TabAlignment.Top:\r
215                                         return new Rectangle (tab.ClientRectangle.Right - (scrollerWidth), tab.ClientRectangle.Top + 1, scrollerWidth, scrollerWidth);\r
216                                 default:\r
217                                         Rectangle panel_rect = GetTabPanelRect (tab);\r
218                                         return new Rectangle (tab.ClientRectangle.Right - (scrollerWidth), panel_rect.Bottom + 2, scrollerWidth, scrollerWidth);\r
219                         }\r
220                 }\r
221 \r
222                 public Rectangle GetDisplayRectangle (System.Windows.Forms.TabControl tab)\r
223                 {\r
224                         Rectangle ext = GetTabPanelRect (tab);\r
225                         // Account for border size\r
226                         return new Rectangle (ext.Left + tabPageSpacing.X, ext.Top + tabPageSpacing.Y, \r
227                                 ext.Width - tabPageSpacing.X - tabPageSpacing.Width, ext.Height - tabPageSpacing.Y - tabPageSpacing.Height);\r
228                 }\r
229                 \r
230                 public Rectangle GetTabPanelRect (System.Windows.Forms.TabControl tab)\r
231                 {       \r
232                         // Offset the tab page (panel) from the top corner\r
233                         Rectangle res = new Rectangle (tab.ClientRectangle.X,\r
234                                 tab.ClientRectangle.Y,\r
235                                 tab.ClientRectangle.Width,\r
236                                 tab.ClientRectangle.Height);\r
237 \r
238                         if (tab.TabCount == 0)\r
239                                 return res;\r
240 \r
241                         int spacing = RowSpacing (tab).Height;\r
242                         int tabOffset = (tab.ItemSize.Height + spacing - selectedTabDelta.Height) * tab.RowCount + selectedTabDelta.Y;\r
243                         switch (tab.Alignment) {\r
244                                 case TabAlignment.Top:\r
245                                         res.Y += tabOffset;\r
246                                         res.Height -= tabOffset;\r
247                                         break;\r
248                                 case TabAlignment.Bottom:\r
249                                         res.Height -= tabOffset;\r
250                                         break;\r
251                                 case TabAlignment.Left:\r
252                                         res.X += tabOffset;\r
253                                         res.Width -= tabOffset;\r
254                                         break;\r
255                                 case TabAlignment.Right:\r
256                                         res.Width -= tabOffset;\r
257                                         break;\r
258                         }\r
259 \r
260                         return res;\r
261                 }\r
262 \r
263                 public virtual void Draw (Graphics dc, Rectangle area, TabControl tab)\r
264                 {\r
265                         DrawBackground (dc, area, tab);\r
266 \r
267                         int start = 0;\r
268                         int end = tab.TabPages.Count;\r
269                         int delta = 1;\r
270 \r
271                         if (tab.Alignment == TabAlignment.Top) {\r
272                                 start = end;\r
273                                 end = 0;\r
274                                 delta = -1;\r
275                         }\r
276 \r
277                         if (tab.SizeMode == TabSizeMode.Fixed)\r
278                                 defaultFormatting.Alignment = StringAlignment.Center;\r
279                         else\r
280                                 defaultFormatting.Alignment = StringAlignment.Near;\r
281 \r
282                         int counter = start;\r
283                         for (; counter != end; counter += delta) {\r
284                                 for (int i = tab.SliderPos; i < tab.TabPages.Count; i++) {\r
285                                         if (i == tab.SelectedIndex)\r
286                                                 continue;\r
287                                         if (counter != tab.TabPages[i].Row)\r
288                                                 continue;\r
289                                         Rectangle rect = tab.GetTabRect (i);\r
290                                         if (!rect.IntersectsWith (area))\r
291                                                 continue;\r
292                                         DrawTab (dc, tab.TabPages[i], tab, rect, false);\r
293                                 }\r
294                         }\r
295 \r
296                         if (tab.SelectedIndex != -1 && tab.SelectedIndex >= tab.SliderPos) {\r
297                                 Rectangle rect = tab.GetTabRect (tab.SelectedIndex);\r
298                                 if (rect.IntersectsWith (area))\r
299                                         DrawTab (dc, tab.TabPages[tab.SelectedIndex], tab, rect, true);\r
300                         }\r
301 \r
302                         if (tab.ShowSlider) {\r
303                                 Rectangle right = GetRightScrollRect (tab);\r
304                                 Rectangle left = GetLeftScrollRect (tab);\r
305                                 DrawScrollButton (dc, right, area, ScrollButton.Right, tab.RightSliderState);\r
306                                 DrawScrollButton (dc, left, area, ScrollButton.Left, tab.LeftSliderState);\r
307                         }\r
308                 }\r
309 \r
310                 protected virtual void DrawScrollButton (Graphics dc, Rectangle bounds, Rectangle clippingArea, ScrollButton button, PushButtonState state)\r
311                 {\r
312                         ControlPaint.DrawScrollButton (dc, bounds, button, GetButtonState (state));\r
313                 }\r
314 \r
315                 static ButtonState GetButtonState (PushButtonState state)\r
316                 {\r
317                         switch (state) {\r
318                         case PushButtonState.Pressed:\r
319                                 return ButtonState.Pushed;\r
320                         default:\r
321                                 return ButtonState.Normal;\r
322                         }\r
323                 }\r
324 \r
325                 protected virtual void DrawBackground (Graphics dc, Rectangle area, TabControl tab)\r
326                 {\r
327                         Brush brush = SystemBrushes.Control;\r
328                         dc.FillRectangle (brush, area);\r
329                         Rectangle panel_rect = GetTabPanelRect (tab);\r
330 \r
331                         if (tab.Appearance == TabAppearance.Normal) {\r
332                                 ControlPaint.DrawBorder3D (dc, panel_rect, Border3DStyle.RaisedInner, Border3DSide.Left | Border3DSide.Top);\r
333                                 ControlPaint.DrawBorder3D (dc, panel_rect, Border3DStyle.Raised, Border3DSide.Right | Border3DSide.Bottom);\r
334                         }\r
335                 }\r
336 \r
337                 protected virtual int DrawTab (Graphics dc, System.Windows.Forms.TabPage page, System.Windows.Forms.TabControl tab, Rectangle bounds, bool is_selected)\r
338                 {\r
339                         Rectangle interior;\r
340                         int res = bounds.Width;\r
341 \r
342                         dc.FillRectangle (ResPool.GetSolidBrush (tab.BackColor), bounds);\r
343 \r
344                         if (tab.Appearance == TabAppearance.Buttons || tab.Appearance == TabAppearance.FlatButtons) {\r
345                                 // Separators\r
346                                 if (tab.Appearance == TabAppearance.FlatButtons) {\r
347                                         int width = bounds.Width;\r
348                                         bounds.Width += (flatButtonSpacing - 2);\r
349                                         res = bounds.Width;\r
350                                         if (tab.Alignment == TabAlignment.Top || tab.Alignment == TabAlignment.Bottom)\r
351                                                 ThemeEngine.Current.CPDrawBorder3D (dc, bounds, Border3DStyle.Etched, Border3DSide.Right);\r
352                                         else\r
353                                                 ThemeEngine.Current.CPDrawBorder3D (dc, bounds, Border3DStyle.Etched, Border3DSide.Top);\r
354                                         bounds.Width = width;\r
355                                 }\r
356 \r
357                                 if (is_selected) {\r
358                                         ThemeEngine.Current.CPDrawBorder3D (dc, bounds, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Right | Border3DSide.Top | Border3DSide.Bottom);\r
359                                 } else if (tab.Appearance != TabAppearance.FlatButtons) {\r
360                                         ThemeEngine.Current.CPDrawBorder3D (dc, bounds, Border3DStyle.Raised, Border3DSide.Left | Border3DSide.Right | Border3DSide.Top | Border3DSide.Bottom);\r
361                                 }\r
362 \r
363 \r
364                         } else {\r
365                                 CPColor cpcolor = ResPool.GetCPColor (tab.BackColor);\r
366 \r
367                                 Pen light = ResPool.GetPen (cpcolor.LightLight);\r
368 \r
369                                 switch (tab.Alignment) {\r
370 \r
371                                         case TabAlignment.Top:\r
372 \r
373                                                 dc.DrawLine (light, bounds.Left, bounds.Bottom - 1, bounds.Left, bounds.Top + 3);\r
374                                                 dc.DrawLine (light, bounds.Left, bounds.Top + 3, bounds.Left + 2, bounds.Top);\r
375                                                 dc.DrawLine (light, bounds.Left + 2, bounds.Top, bounds.Right - 3, bounds.Top);\r
376 \r
377                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Right - 2, bounds.Top + 1, bounds.Right - 2, bounds.Bottom - 1);\r
378                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Right - 2, bounds.Top + 1, bounds.Right - 1, bounds.Top + 2);\r
379                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Right - 1, bounds.Top + 2, bounds.Right - 1, bounds.Bottom - 1);\r
380                                                 break;\r
381 \r
382                                         case TabAlignment.Bottom:\r
383 \r
384                                                 dc.DrawLine (light, bounds.Left, bounds.Top, bounds.Left, bounds.Bottom - 2);\r
385                                                 dc.DrawLine (light, bounds.Left, bounds.Bottom - 2, bounds.Left + 3, bounds.Bottom);\r
386                                                 \r
387                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Left + 3, bounds.Bottom, bounds.Right - 3, bounds.Bottom);\r
388                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Left + 3, bounds.Bottom - 1, bounds.Right - 3, bounds.Bottom - 1);\r
389 \r
390                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Right - 2, bounds.Bottom - 1, bounds.Right - 2, bounds.Top + 1);\r
391                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Right - 2, bounds.Bottom - 1, bounds.Right - 1, bounds.Bottom - 2);\r
392                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Right - 1, bounds.Bottom - 2, bounds.Right - 1, bounds.Top + 1);\r
393 \r
394                                                 break;\r
395 \r
396                                         case TabAlignment.Left:\r
397 \r
398                                                 dc.DrawLine (light, bounds.Left - 2, bounds.Top, bounds.Right, bounds.Top);\r
399                                                 dc.DrawLine (light, bounds.Left, bounds.Top + 2, bounds.Left - 2, bounds.Top);\r
400                                                 dc.DrawLine (light, bounds.Left, bounds.Top + 2, bounds.Left, bounds.Bottom - 2);\r
401 \r
402                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Left, bounds.Bottom - 2, bounds.Left + 2, bounds.Bottom - 1);\r
403 \r
404                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Left + 2, bounds.Bottom - 1, bounds.Right, bounds.Bottom - 1);\r
405                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Left + 2, bounds.Bottom, bounds.Right, bounds.Bottom);\r
406 \r
407                                                 break;\r
408 \r
409                                         default: // TabAlignment.Right\r
410 \r
411                                                 dc.DrawLine (light, bounds.Left, bounds.Top, bounds.Right - 3, bounds.Top);\r
412                                                 dc.DrawLine (light, bounds.Right - 3, bounds.Top, bounds.Right, bounds.Top + 3);\r
413 \r
414                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Right - 1, bounds.Top + 1, bounds.Right - 1, bounds.Bottom - 1);\r
415                                                 dc.DrawLine (SystemPens.ControlDark, bounds.Left, bounds.Bottom - 1, bounds.Right - 2, bounds.Bottom - 1);\r
416 \r
417                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Right, bounds.Top + 3, bounds.Right, bounds.Bottom - 3);\r
418                                                 dc.DrawLine (SystemPens.ControlDarkDark, bounds.Left, bounds.Bottom, bounds.Right - 3, bounds.Bottom);\r
419 \r
420                                                 break;\r
421                                 }\r
422                         }\r
423 \r
424                         interior = new Rectangle (bounds.Left + focusRectSpacing.X + borderThickness.Left, \r
425                                 bounds.Top + focusRectSpacing.Y +  + borderThickness.Top,\r
426                                 bounds.Width - (focusRectSpacing.X * 2) - borderThickness.Width + 1, \r
427                                 bounds.Height - (focusRectSpacing.Y * 2) - borderThickness.Height);\r
428 \r
429                         if (tab.DrawMode == TabDrawMode.Normal && page.Text != null) {\r
430                                 if (tab.Alignment == TabAlignment.Left) {\r
431                                         dc.TranslateTransform (bounds.Left, bounds.Bottom);\r
432                                         dc.RotateTransform (-90);\r
433                                         dc.DrawString (page.Text, page.Font,\r
434                                                 SystemBrushes.ControlText, \r
435                                                 tab.Padding.X - 2, // drawstring adds some extra unwanted leading spaces, so trimming\r
436                                                 tab.Padding.Y,\r
437                                                 defaultFormatting);\r
438                                         dc.ResetTransform ();\r
439                                 } else if (tab.Alignment == TabAlignment.Right) {\r
440                                         dc.TranslateTransform (bounds.Right, bounds.Top);\r
441                                         dc.RotateTransform (90);\r
442                                         dc.DrawString (page.Text, page.Font,\r
443                                                 SystemBrushes.ControlText, \r
444                                                 tab.Padding.X - 2, // drawstring adds some extra unwanted leading spaces, so trimming\r
445                                                 tab.Padding.Y,\r
446                                                 defaultFormatting);\r
447                                         dc.ResetTransform ();\r
448                                 } else {\r
449                                         Rectangle str_rect = interior;\r
450 \r
451                                         if (tab.ImageList != null && page.ImageIndex >= 0 && page.ImageIndex < tab.ImageList.Images.Count) {\r
452                                                 int image_y = interior.Y + (interior.Height - tab.ImageList.ImageSize.Height) / 2;\r
453                                                 tab.ImageList.Draw (dc, new Point (interior.X, image_y), page.ImageIndex);\r
454                                                 str_rect.X += tab.ImageList.ImageSize.Width + 2;\r
455                                                 str_rect.Width -= tab.ImageList.ImageSize.Width + 2;\r
456                                         }\r
457                                         dc.DrawString (page.Text, page.Font,\r
458                                                 SystemBrushes.ControlText,\r
459                                                 str_rect, \r
460                                                 defaultFormatting);\r
461 \r
462                                 }\r
463                         } else if (page.Text != null) {\r
464                                 DrawItemState state = DrawItemState.None;\r
465                                 if (page == tab.SelectedTab)\r
466                                         state |= DrawItemState.Selected;\r
467                                 DrawItemEventArgs e = new DrawItemEventArgs (dc,\r
468                                         tab.Font, bounds, tab.IndexForTabPage (page),\r
469                                         state, page.ForeColor, page.BackColor);\r
470                                 tab.OnDrawItemInternal (e);\r
471                                 return res;\r
472                         }\r
473 \r
474                         if (page.Parent.Focused && is_selected && tab.ShowFocusCues) {\r
475                                 interior.Width -= 1;\r
476                                 ThemeEngine.Current.CPDrawFocusRectangle (dc, interior, tab.ForeColor, tab.BackColor);\r
477                         }\r
478 \r
479                         return res;\r
480                 }\r
481 \r
482                 public virtual bool HasHotElementStyles (TabControl tabControl) {\r
483                         return false;\r
484                 }\r
485         }\r
486 }\r