f24b03d9bbf4ac1c3fbf7410df33439b5f7eb001
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / Theme.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 //
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2004-2005 Novell, Inc.
21 //
22 // Authors:
23 //      Jordi Mas i Hernandez, jordi@ximian.com
24 //      Peter Dennis Bartok, pbartok@novell.com
25 //
26
27
28 using System.Collections;
29 using System.Drawing;
30 using System.Drawing.Drawing2D;
31 using System.Drawing.Imaging;
32 using System.Reflection;
33
34 namespace System.Windows.Forms
35 {
36         internal enum UIIcon {
37                 PlacesRecentDocuments,
38                 PlacesDesktop,
39                 PlacesPersonal,
40                 PlacesMyComputer,
41                 PlacesMyNetwork,
42                 MessageBoxError,
43                 MessageBoxQuestion,
44                 MessageBoxWarning,
45                 MessageBoxInfo,
46                 
47                 NormalFolder
48         }
49         
50         // Implements a pool of system resources        
51         internal class SystemResPool
52         {
53                 private Hashtable pens = new Hashtable ();
54                 private Hashtable solidbrushes = new Hashtable ();
55                 private Hashtable hatchbrushes = new Hashtable ();
56                 private Hashtable uiImages = new Hashtable();
57                 
58                 public SystemResPool () {}
59                 
60                 public Pen GetPen (Color color)
61                 {
62                         int hash = color.ToArgb ();                     
63
64                         Pen res = pens [hash] as Pen;
65                         if (res != null)
66                                 return res;
67                         
68                         Pen pen = new Pen (color);
69                         pens.Add (hash, pen);
70                         return pen;
71                 }               
72                 
73                 public SolidBrush GetSolidBrush (Color color)
74                 {
75                         int hash = color.ToArgb ();
76
77                         SolidBrush res = solidbrushes [hash] as SolidBrush;
78                         if (res != null)
79                                 return res;
80                         
81                         SolidBrush brush = new SolidBrush (color);
82                         solidbrushes.Add (hash, brush);
83                         return brush;
84                 }               
85                 
86                 public HatchBrush GetHatchBrush (HatchStyle hatchStyle, Color foreColor, Color backColor)
87                 {
88                         string hash = hatchStyle.ToString () + foreColor.ToString () + backColor.ToString ();                   
89                                                 
90                         if (hatchbrushes.Contains (hash))
91                                 return (HatchBrush) hatchbrushes[hash];                                                 
92
93                         HatchBrush brush = new HatchBrush (hatchStyle, foreColor, backColor);
94                         hatchbrushes.Add (hash, brush);
95                         return brush;
96                 }
97                 
98                 public void AddUIImage (Image image, string name, int size)
99                 {
100                         string hash = name + size.ToString();
101                         
102                         if (uiImages.Contains (hash))
103                                 return;
104                         uiImages.Add (hash, image);
105                 }
106                 
107                 public Image GetUIImage(string name, int size)
108                 {
109                         string hash = name + size.ToString();
110                         
111                         Image image = uiImages [hash] as Image;
112                         
113                         return image;
114                 }
115         }
116
117         internal abstract class Theme
118         {               
119                 protected Array syscolors;
120                 protected Font default_font;
121                 protected Color defaultWindowBackColor;
122                 protected Color defaultWindowForeColor;         
123                 protected bool always_draw_hotkeys = true;
124                 internal SystemResPool ResPool = new SystemResPool ();
125                 private Type system_colors = Type.GetType("System.Drawing.SystemColors, System.Drawing");
126
127                 private void SetSystemColors(string name, Color value) {
128                         if (system_colors != null) {
129                                 MethodInfo update;
130
131                                 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
132                                 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
133                                 if (update != null) {
134                                         update.Invoke(null, null);
135                                 }
136                         }
137                 }
138
139
140                 /* OS Feature support */
141                 public abstract Version Version {
142                         get;
143                 }
144
145                 /* Default properties */                
146                 public virtual Color ColorScrollBar {
147                         get { return SystemColors.ScrollBar;}
148                         set { SetSystemColors("scroll_bar", value); }
149                 }
150
151                 public virtual Color ColorDesktop {
152                         get { return SystemColors.Desktop;}
153                         set { SetSystemColors("desktop", value); }
154                 }
155
156                 public virtual Color ColorActiveCaption {
157                         get { return SystemColors.ActiveCaption;}
158                         set { SetSystemColors("active_caption", value); }
159                 }
160
161                 public virtual Color ColorInactiveCaption {
162                         get { return SystemColors.InactiveCaption;}
163                         set { SetSystemColors("inactive_caption", value); }
164                 }
165
166                 public virtual Color ColorMenu {
167                         get { return SystemColors.Menu;}
168                         set { SetSystemColors("menu", value); }
169                 }
170
171                 public virtual Color ColorWindow {
172                         get { return SystemColors.Window;}
173                         set { SetSystemColors("window", value); }
174                 }
175
176                 public virtual Color ColorWindowFrame {
177                         get { return SystemColors.WindowFrame;}
178                         set { SetSystemColors("window_frame", value); }
179                 }
180
181                 public virtual Color ColorMenuText {
182                         get { return SystemColors.MenuText;}
183                         set { SetSystemColors("menu_text", value); }
184                 }
185
186                 public virtual Color ColorWindowText {
187                         get { return SystemColors.WindowText;}
188                         set { SetSystemColors("window_text", value); }
189                 }
190
191                 public virtual Color ColorActiveCaptionText {
192                         get { return SystemColors.ActiveCaptionText;}
193                         set { SetSystemColors("active_caption_text", value); }
194                 }
195
196                 public virtual Color ColorActiveBorder {
197                         get { return SystemColors.ActiveBorder;}
198                         set { SetSystemColors("active_border", value); }
199                 }
200
201                 public virtual Color ColorInactiveBorder{
202                         get { return SystemColors.InactiveBorder;}
203                         set { SetSystemColors("inactive_border", value); }
204                 }
205
206                 public virtual Color ColorAppWorkspace {
207                         get { return SystemColors.AppWorkspace;}
208                         set { SetSystemColors("app_workspace", value); }
209                 }
210
211                 public virtual Color ColorHighlight {
212                         get { return SystemColors.Highlight;}
213                         set { SetSystemColors("highlight", value); }
214                 }
215
216                 public virtual Color ColorHighlightText {
217                         get { return SystemColors.HighlightText;}
218                         set { SetSystemColors("highlight_text", value); }
219                 }
220
221                 public virtual Color ColorControl {
222                         get { return SystemColors.Control;}
223                         set { SetSystemColors("control", value); }
224                 }
225
226                 public virtual Color ColorControlDark {
227                         get { return SystemColors.ControlDark;}
228                         set { SetSystemColors("control_dark", value); }
229                 }
230
231                 public virtual Color ColorGrayText {
232                         get { return SystemColors.GrayText;}
233                         set { SetSystemColors("gray_text", value); }
234                 }
235
236                 public virtual Color ColorControlText {
237                         get { return SystemColors.ControlText;}
238                         set { SetSystemColors("control_text", value); }
239                 }
240
241                 public virtual Color ColorInactiveCaptionText {
242                         get { return SystemColors.InactiveCaptionText;}
243                         set { SetSystemColors("inactive_caption_text", value); }
244                 }
245
246                 public virtual Color ColorControlLight {
247                         get { return SystemColors.ControlLight;}
248                         set { SetSystemColors("control_light", value); }
249                 }
250
251                 public virtual Color ColorControlDarkDark {
252                         get { return SystemColors.ControlDarkDark;}
253                         set { SetSystemColors("control_dark_dark", value); }
254                 }
255
256                 public virtual Color ColorControlLightLight {
257                         get { return SystemColors.ControlLightLight;}
258                         set { SetSystemColors("control_light_light", value); }
259                 }
260
261                 public virtual Color ColorInfoText {
262                         get { return SystemColors.InfoText;}
263                         set { SetSystemColors("info_text", value); }
264                 }
265
266                 public virtual Color ColorInfo {
267                         get { return SystemColors.Info;}
268                         set { SetSystemColors("info", value); }
269                 }
270
271                 public virtual Color ColorHotTrack {
272                         get { return SystemColors.HotTrack;}
273                         set { SetSystemColors("hot_track", value);}
274                 }
275
276                 public virtual Color DefaultControlBackColor {
277                         get { return ColorControl; }
278                         set { ColorControl = value; }
279                 }
280
281                 public virtual Color DefaultControlForeColor {
282                         get { return ColorControlText; }
283                         set { ColorControlText = value; }
284                 }
285
286                 public virtual Font DefaultFont {
287                         get { return default_font; }
288                 }
289
290                 public virtual Color DefaultWindowBackColor {
291                         get { return defaultWindowBackColor; }                  
292                 }
293
294                 public virtual Color DefaultWindowForeColor {
295                         get { return defaultWindowForeColor; }
296                 }
297
298                 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
299                 {
300                         return (Color) syscolors.GetValue ((int)idx);
301                 }
302
303                 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
304                 {
305                         syscolors.SetValue (color, (int) idx);
306                 }
307
308                 // Theme/UI specific defaults
309                 public virtual ArrangeDirection ArrangeDirection  {
310                         get {
311                                 return ArrangeDirection.Down;
312                         }
313                 }
314
315                 public virtual ArrangeStartingPosition ArrangeStartingPosition {
316                         get {
317                                 return ArrangeStartingPosition.BottomLeft;
318                         }
319                 }
320
321                 public virtual Size Border3DSize {
322                         get {
323                                 return new Size(2, 2);
324                         }
325                 }
326
327                 public virtual Size BorderSize {
328                         get {
329                                 return new Size(1, 1);
330                         }
331                 }
332
333                 public virtual Size CaptionButtonSize {
334                         get {
335                                 return new Size(18, 18);
336                         }
337                 }
338
339                 public virtual int CaptionHeight {
340                         get {
341                                 return XplatUI.CaptionHeight;
342                         }
343                 }
344
345                 public virtual Size DoubleClickSize {
346                         get {
347                                 return new Size(4, 4);
348                         }
349                 }
350
351                 public virtual int DoubleClickTime {
352                         get {
353                                 return 500;
354                         }
355                 }
356
357                 public virtual Size FixedFrameBorderSize {
358                         get {
359                                 return new Size(3, 3);
360                         }
361                 }
362
363                 public virtual Size FrameBorderSize {
364                         get {
365                                 return XplatUI.FrameBorderSize;
366                         }
367                 }
368
369                 public virtual int HorizontalScrollBarArrowWidth {
370                         get {
371                                 return 16;
372                         }
373                 }
374
375                 public virtual int HorizontalScrollBarHeight {
376                         get {
377                                 return 16;
378                         }
379                 }
380
381                 public virtual int HorizontalScrollBarThumbWidth {
382                         get {
383                                 return 16;
384                         }
385                 }
386
387                 public virtual Size IconSpacingSize {
388                         get {
389                                 return new Size(75, 75);
390                         }
391                 }
392
393                 public virtual Size MenuButtonSize {
394                         get {
395                                 return new Size(18, 18);
396                         }
397                 }
398
399                 public virtual Size MenuCheckSize {
400                         get {
401                                 return new Size(13, 13);
402                         }
403                 }
404
405                 public virtual Font MenuFont {
406                         get {
407                                 return default_font;
408                         }
409                 }
410
411                 public virtual int MenuHeight {
412                         get {
413                                 return 19;
414                         }
415                 }
416
417                 public virtual int MouseWheelScrollLines {
418                         get {
419                                 return 3;
420                         }
421                 }
422
423                 public virtual bool RightAlignedMenus {
424                         get {
425                                 return false;
426                         }
427                 }
428
429                 public virtual Size ToolWindowCaptionButtonSize {
430                         get {
431                                 return new Size(15, 15);
432                         }
433                 }
434
435                 public virtual int ToolWindowCaptionHeight {
436                         get {
437                                 return 16;
438                         }
439                 }
440
441                 public virtual int VerticalScrollBarArrowHeight {
442                         get {
443                                 return 16;
444                         }
445                 }
446
447                 public virtual int VerticalScrollBarThumbHeight {
448                         get {
449                                 return 16;
450                         }
451                 }
452
453                 public virtual int VerticalScrollBarWidth {
454                         get {
455                                 return 16;
456                         }
457                 }
458                 
459                 [MonoTODO("Figure out where to point for My Network Places")]
460                 public virtual string Places(UIIcon index) {
461                         switch (index) {
462                                 case UIIcon.PlacesRecentDocuments: {
463                                         // Default = "Recent Documents"
464                                         return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
465                                 }
466
467                                 case UIIcon.PlacesDesktop: {
468                                         // Default = "Desktop"
469                                         return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
470                                 }
471
472                                 case UIIcon.PlacesPersonal: {
473                                         // Default = "My Documents"
474                                         return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
475                                 }
476
477                                 case UIIcon.PlacesMyComputer: {
478                                         // Default = "My Computer"
479                                         return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
480                                 }
481
482                                 case UIIcon.PlacesMyNetwork: {
483                                         // Default = "My Network Places"
484                                         return "/tmp";
485                                 }
486
487                                 default: {
488                                         throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
489                                 }
490                         }
491                 }
492
493                 private Image GetSizedResourceImage(string name, int size) {
494                         
495                         Image image = ResPool.GetUIImage (name, size);
496                         if (image != null)
497                                 return image;
498                         
499                         string  fullname;
500
501                         if (size > 0) {
502                                 // Try name name_sizexsize
503                                 fullname = String.Format("{0}_{1}x{1}", name, size);
504                                 image = ResPool.GetUIImage (fullname, size);
505                                 if (image != null)
506                                         return image;
507                                 else {
508                                         image = (Image)Locale.GetResource(fullname);
509                                         if (image != null) {
510                                                 ResPool.AddUIImage (image, fullname, size);
511                                                 return image;
512                                         }
513                                 }
514
515                                 // Try name_size
516                                 fullname = String.Format("{0}_{1}", name, size);
517                                 image = ResPool.GetUIImage (fullname, size);
518                                 if (image != null)
519                                         return image;
520                                 else {
521                                         image = (Image)Locale.GetResource(fullname);
522                                         if (image != null) {
523                                                 ResPool.AddUIImage (image, fullname, size);
524                                                 return image;
525                                         }
526                                 }
527                                 
528                                 image = (Image)Locale.GetResource(name);
529                                 if (image != null) {
530                                         image = new Bitmap (image, new Size (size, size));
531                                         ResPool.AddUIImage (image, name, size);
532                                         return image;
533                                 }
534                         }
535
536                         // Just try name
537                         image = (Image)Locale.GetResource(name);
538                         ResPool.AddUIImage (image, name, size);
539                         return image;
540                 }
541                 
542                 public virtual Image Images(UIIcon index) {
543                         return Images(index, 0);
544                 }
545                         
546                 public virtual Image Images(UIIcon index, int size) {
547                         switch (index) {
548                                 case UIIcon.PlacesRecentDocuments:      return GetSizedResourceImage ("last_open", size);
549                                 case UIIcon.PlacesDesktop:              return GetSizedResourceImage ("desktop", size);
550                                 case UIIcon.PlacesPersonal:             return GetSizedResourceImage ("folder_with_paper", size);
551                                 case UIIcon.PlacesMyComputer:           return GetSizedResourceImage ("monitor-computer", size);
552                                 case UIIcon.PlacesMyNetwork:            return GetSizedResourceImage ("monitor-planet", size);
553
554                                 // Icons for message boxes
555                                 case UIIcon.MessageBoxError:            return GetSizedResourceImage ("mbox_error.png", size);
556                                 case UIIcon.MessageBoxInfo:             return GetSizedResourceImage ("mbox_info.png", size);
557                                 case UIIcon.MessageBoxQuestion:         return GetSizedResourceImage ("mbox_question.png", size);
558                                 case UIIcon.MessageBoxWarning:          return GetSizedResourceImage ("mbox_warn.png", size);
559                                 
560                                 // misc Icons
561                                 case UIIcon.NormalFolder:               return GetSizedResourceImage ("folder", size);
562
563                                 default: {
564                                         throw new ArgumentException("Invalid Icon type requested", "index");
565                                 }
566                         }
567                         return null;
568                 }
569
570                 public virtual Image Images(string mimetype, string extension, int size) {
571                         return null;
572                 }
573
574                 #region Principal Theme Methods
575                 // To let the theme now that a change of defaults (colors, etc) was detected and force a re-read (and possible recreation of cached resources)
576                 public abstract void ResetDefaults();
577
578                 // If the theme writes directly to a window instead of a device context
579                 public abstract bool DoubleBufferingSupported {get;}
580                 #endregion      // Principal Theme Methods
581
582                 #region OwnerDraw Support
583                 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
584                 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
585                 #endregion      // OwnerDraw Support
586
587                 #region Button
588                 #endregion      // Button
589
590                 #region ButtonBase
591                 // Drawing
592                 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
593
594                 // Sizing
595                 public abstract Size ButtonBaseDefaultSize{get;}
596                 #endregion      // ButtonBase
597
598                 #region CheckBox
599                 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
600                 #endregion      // CheckBox
601                 
602                 #region CheckedListBox
603                 // Drawing              
604                 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
605                 public abstract Rectangle CheckedListBoxCheckRectangle ();
606                 #endregion // CheckedListBox
607                 
608                 #region ComboBox
609                 // Drawing
610                 public abstract void DrawComboBoxEditDecorations (Graphics dc, ComboBox ctrl, Rectangle rect);
611                 public abstract void DrawComboListBoxDecorations (Graphics dc, ComboBox ctrl, Rectangle rect);
612                 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
613                 
614                 // Sizing
615                 public abstract int DrawComboBoxEditDecorationTop ();
616                 public abstract int DrawComboBoxEditDecorationBottom ();
617                 public abstract int DrawComboBoxEditDecorationRight ();
618                 public abstract int DrawComboBoxEditDecorationLeft ();
619                 public abstract int DrawComboListBoxDecorationTop (ComboBoxStyle style);
620                 public abstract int DrawComboListBoxDecorationBottom (ComboBoxStyle style);
621                 public abstract int DrawComboListBoxDecorationRight (ComboBoxStyle style);
622                 public abstract int DrawComboListBoxDecorationLeft (ComboBoxStyle style);
623                 #endregion      // ComboBox
624
625                 #region Control
626                 #endregion      // Control
627                 
628                 #region Datagrid
629                 public abstract int DataGridPreferredColumnWidth { get; }
630                 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
631                 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
632                 
633                 // Default colours
634                 public abstract Color DataGridAlternatingBackColor { get; }             
635                 public abstract Color DataGridBackColor { get; }                
636                 public abstract Color DataGridBackgroundColor { get; }
637                 public abstract Color DataGridCaptionBackColor { get; }
638                 public abstract Color DataGridCaptionForeColor { get; }         
639                 public abstract Color DataGridGridLineColor { get; }
640                 public abstract Color DataGridHeaderBackColor { get; }
641                 public abstract Color DataGridHeaderForeColor { get; }
642                 public abstract Color DataGridLinkColor { get; }
643                 public abstract Color DataGridLinkHoverColor { get; }
644                 public abstract Color DataGridParentRowsBackColor { get; }
645                 public abstract Color DataGridParentRowsForeColor { get; }
646                 public abstract Color DataGridSelectionBackColor { get; }
647                 public abstract Color DataGridSelectionForeColor { get; }
648                 // Paint                
649                 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
650                 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
651                 public abstract void DataGridPaintColumnsHdrs (Graphics g, Rectangle clip, DataGrid grid);
652                 public abstract void DataGridPaintRowsHeaders (Graphics g, Rectangle clip, DataGrid grid);
653                 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
654                 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
655                 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
656                 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, DataGrid grid);
657                 
658                 
659                 #endregion // Datagrid
660
661                 #region DateTimePicker
662
663                 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
664
665                 #endregion      // DateTimePicker
666
667                 #region GroupBox
668                 // Drawing
669                 public abstract void DrawGroupBox (Graphics dc,  Rectangle clip_area, GroupBox box);
670
671                 // Sizing
672                 public abstract Size GroupBoxDefaultSize{get;}
673                 #endregion      // GroupBox
674
675                 #region HScrollBar
676                 public abstract Size HScrollBarDefaultSize{get;}        // Default size of the scrollbar
677                 #endregion      // HScrollBar
678
679                 #region Label
680                 // Drawing
681                 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
682
683                 // Sizing
684                 public abstract Size LabelDefaultSize{get;}
685                 #endregion      // Label
686
687                 #region LinkLabel
688                 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
689                 #endregion      // LinkLabel
690                 
691                 #region ListBox
692                 // Drawing
693                 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);               
694                 #endregion      // ListBox              
695                 
696                 #region ListView
697                 // Drawing
698                 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
699                 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
700                 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
701
702                 // Sizing
703                 public abstract Size ListViewCheckBoxSize { get; }
704                 public abstract int ListViewColumnHeaderHeight { get; }
705                 public abstract int ListViewDefaultColumnWidth { get; }
706                 public abstract int ListViewVerticalSpacing { get; }
707                 public abstract int ListViewEmptyColumnWidth { get; }
708                 public abstract int ListViewHorizontalSpacing { get; }
709                 public abstract Size ListViewDefaultSize { get; }
710                 #endregion      // ListView
711                 
712                 #region Menus
713                 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
714                 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
715                 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
716                 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
717                 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
718                 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);                
719                 #endregion      // Menus
720
721                 #region MonthCalendar
722                 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
723                 #endregion      // MonthCalendar
724
725                 #region Panel
726                 // Sizing
727                 public abstract Size PanelDefaultSize{get;}
728                 #endregion      // Panel
729
730                 #region PictureBox
731                 // Drawing
732                 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
733
734                 // Sizing
735                 public abstract Size PictureBoxDefaultSize{get;}
736                 #endregion      // PictureBox
737
738                 #region ProgressBar
739                 // Drawing
740                 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
741
742                 // Sizing
743                 public abstract Size ProgressBarDefaultSize{get;}
744                 #endregion      // ProgressBar
745
746                 #region RadioButton
747                 // Drawing
748                 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
749
750                 // Sizing
751                 public abstract Size RadioButtonDefaultSize{get;}
752                 #endregion      // RadioButton
753
754                 #region ScrollBar
755                 // Drawing
756                 //public abstract void DrawScrollBar (Graphics dc, Rectangle area, ScrollBar bar, ref Rectangle thumb_pos, ref Rectangle first_arrow_area, ref Rectangle second_arrow_area, ButtonState first_arrow, ButtonState second_arrow, ref int scrollbutton_width, ref int scrollbutton_height, bool vert);
757                 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
758
759                 // Sizing
760                 public abstract int ScrollBarButtonSize {get;}          // Size of the scroll button
761                 #endregion      // ScrollBar
762
763                 #region StatusBar
764                 // Drawing
765                 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
766
767                 // Sizing
768                 public abstract int StatusBarSizeGripWidth {get;}               // Size of Resize area
769                 public abstract int StatusBarHorzGapWidth {get;}        // Gap between panels
770                 public abstract Size StatusBarDefaultSize{get;}
771                 #endregion      // StatusBar
772
773                 #region TabControl
774                 public abstract Size TabControlDefaultItemSize { get; }
775                 public abstract Point TabControlDefaultPadding { get; }
776                 public abstract int TabControlMinimumTabWidth { get; }
777
778                 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
779                 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
780                 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
781                 public abstract Size TabControlGetSpacing (TabControl tab);
782                 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
783                 #endregion
784
785                 #region ToolBar
786                 // Drawing
787                 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
788
789                 // Sizing
790                 public abstract int ToolBarGripWidth {get;}              // Grip width for the ToolBar
791                 public abstract int ToolBarImageGripWidth {get;}         // Grip width for the Image on the ToolBarButton
792                 public abstract int ToolBarSeparatorWidth {get;}         // width of the separator
793                 public abstract int ToolBarDropDownWidth { get; }        // width of the dropdown arrow rect
794                 public abstract int ToolBarDropDownArrowWidth { get; }   // width for the dropdown arrow on the ToolBarButton
795                 public abstract int ToolBarDropDownArrowHeight { get; }  // height for the dropdown arrow on the ToolBarButton
796                 public abstract Size ToolBarDefaultSize{get;}
797                 #endregion      // ToolBar
798
799                 #region ToolTip
800                 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
801                 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
802                 #endregion      // ToolTip              
803                 
804
805                 #region TrackBar
806                 // Drawing
807                 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
808
809                 // Sizing
810                 public abstract Size TrackBarDefaultSize{get; }         // Default size for the TrackBar control
811                 #endregion      // TrackBar
812
813                 #region VScrollBar
814                 public abstract Size VScrollBarDefaultSize{get;}        // Default size of the scrollbar
815                 #endregion      // VScrollBar
816
817                 #region TreeView
818                 public abstract Size TreeViewDefaultSize { get; }
819                 #endregion
820
821                 #region ControlPaint Methods
822                 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
823                         ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
824                         Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
825                         int bottomWidth, ButtonBorderStyle bottomStyle);
826
827                 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
828                 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
829                 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
830                 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
831                 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
832                 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
833                 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
834                 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
835                 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
836                 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
837                 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
838                 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph);
839                 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
840                 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
841                 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
842                 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
843                 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
844                         Color backColor);
845                 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
846                 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
847                         StringFormat format);
848                 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
849                 #endregion      // ControlPaint Methods
850         }
851 }