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:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
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.
20 // Copyright (c) 2004-2005 Novell, Inc.
23 // Jordi Mas i Hernandez, jordi@ximian.com
24 // Peter Dennis Bartok, pbartok@novell.com
28 using System.Collections;
30 using System.Drawing.Drawing2D;
31 using System.Drawing.Imaging;
32 using System.Reflection;
34 namespace System.Windows.Forms
36 internal enum UIIcon {
37 PlacesRecentDocuments,
50 internal struct CPColor {
52 internal Color DarkDark;
54 internal Color LightLight;
56 internal static CPColor Empty;
59 // Implements a pool of system resources
60 internal class SystemResPool
62 private Hashtable pens = new Hashtable ();
63 private Hashtable dashpens = new Hashtable ();
64 private Hashtable sizedpens = new Hashtable ();
65 private Hashtable solidbrushes = new Hashtable ();
66 private Hashtable hatchbrushes = new Hashtable ();
67 private Hashtable uiImages = new Hashtable();
68 private Hashtable cpcolors = new Hashtable ();
70 public SystemResPool () {}
72 public Pen GetPen (Color color)
74 int hash = color.ToArgb ();
77 Pen res = pens [hash] as Pen;
81 Pen pen = new Pen (color);
87 public Pen GetDashPen (Color color, DashStyle dashStyle)
89 string hash = color.ToString() + dashStyle;
92 Pen res = dashpens [hash] as Pen;
96 Pen pen = new Pen (color);
97 pen.DashStyle = dashStyle;
98 dashpens [hash] = pen;
103 public Pen GetSizedPen (Color color, int size)
105 string hash = color.ToString () + size;
108 Pen res = sizedpens [hash] as Pen;
112 Pen pen = new Pen (color, size);
113 sizedpens [hash] = pen;
118 public SolidBrush GetSolidBrush (Color color)
120 int hash = color.ToArgb ();
122 lock (solidbrushes) {
123 SolidBrush res = solidbrushes [hash] as SolidBrush;
127 SolidBrush brush = new SolidBrush (color);
128 solidbrushes.Add (hash, brush);
133 public HatchBrush GetHatchBrush (HatchStyle hatchStyle, Color foreColor, Color backColor)
135 string hash = hatchStyle.ToString () + foreColor.ToString () + backColor.ToString ();
137 lock (hatchbrushes) {
138 if (hatchbrushes.Contains (hash))
139 return (HatchBrush) hatchbrushes[hash];
141 HatchBrush brush = new HatchBrush (hatchStyle, foreColor, backColor);
142 hatchbrushes.Add (hash, brush);
147 public void AddUIImage (Image image, string name, int size)
149 string hash = name + size.ToString();
152 if (uiImages.Contains (hash))
154 uiImages.Add (hash, image);
158 public Image GetUIImage(string name, int size)
160 string hash = name + size.ToString();
162 Image image = uiImages [hash] as Image;
167 public CPColor GetCPColor (Color color)
170 object tmp = cpcolors [color];
173 CPColor cpcolor = new CPColor ();
174 cpcolor.Dark = ControlPaint.Dark (color);
175 cpcolor.DarkDark = ControlPaint.DarkDark (color);
176 cpcolor.Light = ControlPaint.Light (color);
177 cpcolor.LightLight = ControlPaint.LightLight (color);
179 cpcolors.Add (color, cpcolor);
189 internal abstract class Theme
191 protected Array syscolors;
192 protected Font default_font;
193 protected Color defaultWindowBackColor;
194 protected Color defaultWindowForeColor;
195 protected bool always_draw_hotkeys = true;
196 internal SystemResPool ResPool = new SystemResPool ();
197 private Type system_colors = Type.GetType("System.Drawing.SystemColors, System.Drawing");
199 private void SetSystemColors(string name, Color value) {
200 if (system_colors != null) {
203 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
204 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
205 if (update != null) {
206 update.Invoke(null, null);
212 /* OS Feature support */
213 public abstract Version Version {
217 /* Default properties */
218 public virtual Color ColorScrollBar {
219 get { return SystemColors.ScrollBar;}
220 set { SetSystemColors("scroll_bar", value); }
223 public virtual Color ColorDesktop {
224 get { return SystemColors.Desktop;}
225 set { SetSystemColors("desktop", value); }
228 public virtual Color ColorActiveCaption {
229 get { return SystemColors.ActiveCaption;}
230 set { SetSystemColors("active_caption", value); }
233 public virtual Color ColorInactiveCaption {
234 get { return SystemColors.InactiveCaption;}
235 set { SetSystemColors("inactive_caption", value); }
238 public virtual Color ColorMenu {
239 get { return SystemColors.Menu;}
240 set { SetSystemColors("menu", value); }
243 public virtual Color ColorWindow {
244 get { return SystemColors.Window;}
245 set { SetSystemColors("window", value); }
248 public virtual Color ColorWindowFrame {
249 get { return SystemColors.WindowFrame;}
250 set { SetSystemColors("window_frame", value); }
253 public virtual Color ColorMenuText {
254 get { return SystemColors.MenuText;}
255 set { SetSystemColors("menu_text", value); }
258 public virtual Color ColorWindowText {
259 get { return SystemColors.WindowText;}
260 set { SetSystemColors("window_text", value); }
263 public virtual Color ColorActiveCaptionText {
264 get { return SystemColors.ActiveCaptionText;}
265 set { SetSystemColors("active_caption_text", value); }
268 public virtual Color ColorActiveBorder {
269 get { return SystemColors.ActiveBorder;}
270 set { SetSystemColors("active_border", value); }
273 public virtual Color ColorInactiveBorder{
274 get { return SystemColors.InactiveBorder;}
275 set { SetSystemColors("inactive_border", value); }
278 public virtual Color ColorAppWorkspace {
279 get { return SystemColors.AppWorkspace;}
280 set { SetSystemColors("app_workspace", value); }
283 public virtual Color ColorHighlight {
284 get { return SystemColors.Highlight;}
285 set { SetSystemColors("highlight", value); }
288 public virtual Color ColorHighlightText {
289 get { return SystemColors.HighlightText;}
290 set { SetSystemColors("highlight_text", value); }
293 public virtual Color ColorControl {
294 get { return SystemColors.Control;}
295 set { SetSystemColors("control", value); }
298 public virtual Color ColorControlDark {
299 get { return SystemColors.ControlDark;}
300 set { SetSystemColors("control_dark", value); }
303 public virtual Color ColorGrayText {
304 get { return SystemColors.GrayText;}
305 set { SetSystemColors("gray_text", value); }
308 public virtual Color ColorControlText {
309 get { return SystemColors.ControlText;}
310 set { SetSystemColors("control_text", value); }
313 public virtual Color ColorInactiveCaptionText {
314 get { return SystemColors.InactiveCaptionText;}
315 set { SetSystemColors("inactive_caption_text", value); }
318 public virtual Color ColorControlLight {
319 get { return SystemColors.ControlLight;}
320 set { SetSystemColors("control_light", value); }
323 public virtual Color ColorControlDarkDark {
324 get { return SystemColors.ControlDarkDark;}
325 set { SetSystemColors("control_dark_dark", value); }
328 public virtual Color ColorControlLightLight {
329 get { return SystemColors.ControlLightLight;}
330 set { SetSystemColors("control_light_light", value); }
333 public virtual Color ColorInfoText {
334 get { return SystemColors.InfoText;}
335 set { SetSystemColors("info_text", value); }
338 public virtual Color ColorInfo {
339 get { return SystemColors.Info;}
340 set { SetSystemColors("info", value); }
343 public virtual Color ColorHotTrack {
344 get { return SystemColors.HotTrack;}
345 set { SetSystemColors("hot_track", value);}
348 public virtual Color DefaultControlBackColor {
349 get { return ColorControl; }
350 set { ColorControl = value; }
353 public virtual Color DefaultControlForeColor {
354 get { return ColorControlText; }
355 set { ColorControlText = value; }
358 public virtual Font DefaultFont {
359 get { return default_font; }
362 public virtual Color DefaultWindowBackColor {
363 get { return defaultWindowBackColor; }
366 public virtual Color DefaultWindowForeColor {
367 get { return defaultWindowForeColor; }
370 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
372 return (Color) syscolors.GetValue ((int)idx);
375 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
377 syscolors.SetValue (color, (int) idx);
380 // Theme/UI specific defaults
381 public virtual ArrangeDirection ArrangeDirection {
383 return ArrangeDirection.Down;
387 public virtual ArrangeStartingPosition ArrangeStartingPosition {
389 return ArrangeStartingPosition.BottomLeft;
393 public virtual Size Border3DSize {
395 return new Size(2, 2);
399 public virtual Size BorderSize {
401 return new Size(1, 1);
405 public virtual Size CaptionButtonSize {
407 return new Size(18, 18);
411 public virtual int CaptionHeight {
413 return XplatUI.CaptionHeight;
417 public virtual Size DoubleClickSize {
419 return new Size(4, 4);
423 public virtual int DoubleClickTime {
429 public virtual Size FixedFrameBorderSize {
431 return new Size(3, 3);
435 public virtual Size FrameBorderSize {
437 return XplatUI.FrameBorderSize;
441 public virtual int HorizontalScrollBarArrowWidth {
447 public virtual int HorizontalScrollBarHeight {
453 public virtual int HorizontalScrollBarThumbWidth {
459 public virtual Size IconSpacingSize {
461 return new Size(75, 75);
465 public virtual Size MenuButtonSize {
467 return new Size(18, 18);
471 public virtual Size MenuCheckSize {
473 return new Size(13, 13);
477 public virtual Font MenuFont {
483 public virtual int MenuHeight {
485 return XplatUI.MenuHeight;
489 public virtual int MouseWheelScrollLines {
495 public virtual bool RightAlignedMenus {
501 public virtual Size ToolWindowCaptionButtonSize {
503 return new Size(15, 15);
507 public virtual int ToolWindowCaptionHeight {
513 public virtual int VerticalScrollBarArrowHeight {
519 public virtual int VerticalScrollBarThumbHeight {
525 public virtual int VerticalScrollBarWidth {
531 [MonoTODO("Figure out where to point for My Network Places")]
532 public virtual string Places(UIIcon index) {
534 case UIIcon.PlacesRecentDocuments: {
535 // Default = "Recent Documents"
536 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
539 case UIIcon.PlacesDesktop: {
540 // Default = "Desktop"
541 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
544 case UIIcon.PlacesPersonal: {
545 // Default = "My Documents"
546 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
549 case UIIcon.PlacesMyComputer: {
550 // Default = "My Computer"
551 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
554 case UIIcon.PlacesMyNetwork: {
555 // Default = "My Network Places"
560 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
566 // This routine fetches images embedded as assembly resources (not
567 // resgen resources). It optionally scales the image to fit the
568 // specified size x dimension (it adjusts y automatically to fit that).
570 private Image GetSizedResourceImage(string name, int width)
572 Image image = ResPool.GetUIImage (name, width);
580 fullname = String.Format("{1}_{0}", name, width);
581 image = ResourceImageLoader.Get (fullname);
583 ResPool.AddUIImage (image, name, width);
589 image = ResourceImageLoader.Get (name);
593 ResPool.AddUIImage (image, name, 0);
594 if (image.Width != width && width != 0){
595 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
596 int height = (image.Height * width)/image.Width;
597 Bitmap b = new Bitmap (width, height);
598 Graphics g = Graphics.FromImage (b);
599 g.DrawImage (image, 0, 0, width, height);
600 ResPool.AddUIImage (b, name, width);
607 public virtual Image Images(UIIcon index) {
608 return Images(index, 0);
611 public virtual Image Images(UIIcon index, int size) {
613 case UIIcon.PlacesRecentDocuments:
614 return GetSizedResourceImage ("document-open.png", size);
615 case UIIcon.PlacesDesktop:
616 return GetSizedResourceImage ("user-desktop.png", size);
617 case UIIcon.PlacesPersonal:
618 return GetSizedResourceImage ("user-home.png", size);
619 case UIIcon.PlacesMyComputer:
620 return GetSizedResourceImage ("computer.png", size);
621 case UIIcon.PlacesMyNetwork:
622 return GetSizedResourceImage ("folder-remote.png", size);
624 // Icons for message boxes
625 case UIIcon.MessageBoxError:
626 return GetSizedResourceImage ("dialog-error.png", size);
627 case UIIcon.MessageBoxInfo:
628 return GetSizedResourceImage ("dialog-information.png", size);
629 case UIIcon.MessageBoxQuestion:
630 return GetSizedResourceImage ("dialog-question.png", size);
631 case UIIcon.MessageBoxWarning:
632 return GetSizedResourceImage ("dialog-warning.png", size);
635 case UIIcon.NormalFolder:
636 return GetSizedResourceImage ("folder.png", size);
639 throw new ArgumentException("Invalid Icon type requested", "index");
644 public virtual Image Images(string mimetype, string extension, int size) {
648 #region Principal Theme Methods
649 // 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)
650 public abstract void ResetDefaults();
652 // If the theme writes directly to a window instead of a device context
653 public abstract bool DoubleBufferingSupported {get;}
654 #endregion // Principal Theme Methods
656 #region OwnerDraw Support
657 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
658 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
659 #endregion // OwnerDraw Support
666 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
669 public abstract Size ButtonBaseDefaultSize{get;}
670 #endregion // ButtonBase
673 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
674 #endregion // CheckBox
676 #region CheckedListBox
678 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
679 #endregion // CheckedListBox
683 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
684 #endregion // ComboBox
687 #endregion // Control
690 public abstract int DataGridPreferredColumnWidth { get; }
691 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
692 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
695 public abstract Color DataGridAlternatingBackColor { get; }
696 public abstract Color DataGridBackColor { get; }
697 public abstract Color DataGridBackgroundColor { get; }
698 public abstract Color DataGridCaptionBackColor { get; }
699 public abstract Color DataGridCaptionForeColor { get; }
700 public abstract Color DataGridGridLineColor { get; }
701 public abstract Color DataGridHeaderBackColor { get; }
702 public abstract Color DataGridHeaderForeColor { get; }
703 public abstract Color DataGridLinkColor { get; }
704 public abstract Color DataGridLinkHoverColor { get; }
705 public abstract Color DataGridParentRowsBackColor { get; }
706 public abstract Color DataGridParentRowsForeColor { get; }
707 public abstract Color DataGridSelectionBackColor { get; }
708 public abstract Color DataGridSelectionForeColor { get; }
710 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
711 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
712 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
713 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
714 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
715 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
716 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
717 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
718 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
719 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
720 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
722 #endregion // Datagrid
724 #region DateTimePicker
726 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
728 #endregion // DateTimePicker
732 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
735 public abstract Size GroupBoxDefaultSize{get;}
736 #endregion // GroupBox
739 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
740 #endregion // HScrollBar
744 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
747 public abstract Size LabelDefaultSize{get;}
751 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
752 #endregion // LinkLabel
756 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
757 #endregion // ListBox
761 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
762 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
763 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
766 public abstract Size ListViewCheckBoxSize { get; }
767 public abstract int ListViewColumnHeaderHeight { get; }
768 public abstract int ListViewDefaultColumnWidth { get; }
769 public abstract int ListViewVerticalSpacing { get; }
770 public abstract int ListViewEmptyColumnWidth { get; }
771 public abstract int ListViewHorizontalSpacing { get; }
772 public abstract Size ListViewDefaultSize { get; }
773 #endregion // ListView
776 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
777 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
778 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
779 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
780 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
781 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
784 #region MonthCalendar
785 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
786 #endregion // MonthCalendar
790 public abstract Size PanelDefaultSize{get;}
795 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
798 public abstract Size PictureBoxDefaultSize{get;}
799 #endregion // PictureBox
801 #region PrintPreviewControl
802 public abstract int PrintPreviewControlPadding{get;}
803 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
804 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
805 #endregion // PrintPreviewControl
809 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
812 public abstract Size ProgressBarDefaultSize{get;}
813 #endregion // ProgressBar
817 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
820 public abstract Size RadioButtonDefaultSize{get;}
821 #endregion // RadioButton
825 //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);
826 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
829 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
830 #endregion // ScrollBar
834 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
837 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
838 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
839 public abstract Size StatusBarDefaultSize{get;}
840 #endregion // StatusBar
843 public abstract Size TabControlDefaultItemSize { get; }
844 public abstract Point TabControlDefaultPadding { get; }
845 public abstract int TabControlMinimumTabWidth { get; }
847 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
848 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
849 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
850 public abstract Size TabControlGetSpacing (TabControl tab);
851 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
856 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
859 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
860 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
861 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
862 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
863 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
864 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
865 public abstract Size ToolBarDefaultSize{get;}
866 public abstract bool ToolBarInvalidateEntireButton { get; }
867 #endregion // ToolBar
870 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
871 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
872 #endregion // ToolTip
877 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
880 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
881 #endregion // TrackBar
884 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
885 #endregion // VScrollBar
888 public abstract Size TreeViewDefaultSize { get; }
891 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
893 // Just making virtual for now so all the themes still build.
896 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
898 // Just making virtual for now so all the themes still build.
902 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
904 // Just making virtual for now so all the themes still build.
908 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
910 // Just making virtual for now so all the themes still build.
911 return ManagedWindowTitleBarHeight (wm) - 5;
914 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
916 // Just making virtual for now so all the themes still build.
917 return new Size (10, 10);
920 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
922 // Just making virtual for now so all the themes still build.
925 #region ControlPaint Methods
926 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
927 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
928 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
929 int bottomWidth, ButtonBorderStyle bottomStyle);
931 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
932 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
933 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
934 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
935 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
936 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
937 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
938 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
939 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
940 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
941 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
942 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
943 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
944 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
945 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
946 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
947 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
949 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
950 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
951 StringFormat format);
952 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
953 #endregion // ControlPaint Methods