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
27 using System.Collections;
29 using System.Drawing.Drawing2D;
30 using System.Drawing.Imaging;
31 using System.Reflection;
33 namespace System.Windows.Forms
35 internal enum UIIcon {
36 PlacesRecentDocuments,
49 internal struct CPColor {
51 internal Color DarkDark;
53 internal Color LightLight;
55 internal static CPColor Empty;
58 // Implements a pool of system resources
59 internal class SystemResPool
61 private Hashtable pens = new Hashtable ();
62 private Hashtable dashpens = new Hashtable ();
63 private Hashtable sizedpens = new Hashtable ();
64 private Hashtable solidbrushes = new Hashtable ();
65 private Hashtable hatchbrushes = new Hashtable ();
66 private Hashtable uiImages = new Hashtable();
67 private Hashtable cpcolors = new Hashtable ();
69 public SystemResPool () {}
71 public Pen GetPen (Color color)
73 int hash = color.ToArgb ();
76 Pen res = pens [hash] as Pen;
80 Pen pen = new Pen (color);
86 public Pen GetDashPen (Color color, DashStyle dashStyle)
88 string hash = color.ToString() + dashStyle;
91 Pen res = dashpens [hash] as Pen;
95 Pen pen = new Pen (color);
96 pen.DashStyle = dashStyle;
97 dashpens [hash] = pen;
102 public Pen GetSizedPen (Color color, int size)
104 string hash = color.ToString () + size;
107 Pen res = sizedpens [hash] as Pen;
111 Pen pen = new Pen (color, size);
112 sizedpens [hash] = pen;
117 public SolidBrush GetSolidBrush (Color color)
119 int hash = color.ToArgb ();
121 lock (solidbrushes) {
122 SolidBrush res = solidbrushes [hash] as SolidBrush;
126 SolidBrush brush = new SolidBrush (color);
127 solidbrushes.Add (hash, brush);
132 public HatchBrush GetHatchBrush (HatchStyle hatchStyle, Color foreColor, Color backColor)
134 string hash = hatchStyle.ToString () + foreColor.ToString () + backColor.ToString ();
136 lock (hatchbrushes) {
137 if (hatchbrushes.Contains (hash))
138 return (HatchBrush) hatchbrushes[hash];
140 HatchBrush brush = new HatchBrush (hatchStyle, foreColor, backColor);
141 hatchbrushes.Add (hash, brush);
146 public void AddUIImage (Image image, string name, int size)
148 string hash = name + size.ToString();
151 if (uiImages.Contains (hash))
153 uiImages.Add (hash, image);
157 public Image GetUIImage(string name, int size)
159 string hash = name + size.ToString();
161 Image image = uiImages [hash] as Image;
166 public CPColor GetCPColor (Color color)
169 object tmp = cpcolors [color];
172 CPColor cpcolor = new CPColor ();
173 cpcolor.Dark = ControlPaint.Dark (color);
174 cpcolor.DarkDark = ControlPaint.DarkDark (color);
175 cpcolor.Light = ControlPaint.Light (color);
176 cpcolor.LightLight = ControlPaint.LightLight (color);
178 cpcolors.Add (color, cpcolor);
188 internal abstract class Theme
190 protected Array syscolors;
191 private readonly Font default_font;
192 protected Font window_border_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, " + Consts.AssemblySystem_Drawing);
202 default_font = SystemFonts.DefaultFont;
204 default_font = new Font (FontFamily.GenericSansSerif, 8.25f);
208 private void SetSystemColors(string name, Color value) {
209 if (system_colors != null) {
212 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
213 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
214 if (update != null) {
215 update.Invoke(null, null);
221 /* OS Feature support */
222 public abstract Version Version {
226 /* Default properties */
227 public virtual Color ColorScrollBar {
228 get { return SystemColors.ScrollBar;}
229 set { SetSystemColors("scroll_bar", value); }
232 public virtual Color ColorDesktop {
233 get { return SystemColors.Desktop;}
234 set { SetSystemColors("desktop", value); }
237 public virtual Color ColorActiveCaption {
238 get { return SystemColors.ActiveCaption;}
239 set { SetSystemColors("active_caption", value); }
242 public virtual Color ColorInactiveCaption {
243 get { return SystemColors.InactiveCaption;}
244 set { SetSystemColors("inactive_caption", value); }
247 public virtual Color ColorMenu {
248 get { return SystemColors.Menu;}
249 set { SetSystemColors("menu", value); }
252 public virtual Color ColorWindow {
253 get { return SystemColors.Window;}
254 set { SetSystemColors("window", value); }
257 public virtual Color ColorWindowFrame {
258 get { return SystemColors.WindowFrame;}
259 set { SetSystemColors("window_frame", value); }
262 public virtual Color ColorMenuText {
263 get { return SystemColors.MenuText;}
264 set { SetSystemColors("menu_text", value); }
267 public virtual Color ColorWindowText {
268 get { return SystemColors.WindowText;}
269 set { SetSystemColors("window_text", value); }
272 public virtual Color ColorActiveCaptionText {
273 get { return SystemColors.ActiveCaptionText;}
274 set { SetSystemColors("active_caption_text", value); }
277 public virtual Color ColorActiveBorder {
278 get { return SystemColors.ActiveBorder;}
279 set { SetSystemColors("active_border", value); }
282 public virtual Color ColorInactiveBorder{
283 get { return SystemColors.InactiveBorder;}
284 set { SetSystemColors("inactive_border", value); }
287 public virtual Color ColorAppWorkspace {
288 get { return SystemColors.AppWorkspace;}
289 set { SetSystemColors("app_workspace", value); }
292 public virtual Color ColorHighlight {
293 get { return SystemColors.Highlight;}
294 set { SetSystemColors("highlight", value); }
297 public virtual Color ColorHighlightText {
298 get { return SystemColors.HighlightText;}
299 set { SetSystemColors("highlight_text", value); }
302 public virtual Color ColorControl {
303 get { return SystemColors.Control;}
304 set { SetSystemColors("control", value); }
307 public virtual Color ColorControlDark {
308 get { return SystemColors.ControlDark;}
309 set { SetSystemColors("control_dark", value); }
312 public virtual Color ColorGrayText {
313 get { return SystemColors.GrayText;}
314 set { SetSystemColors("gray_text", value); }
317 public virtual Color ColorControlText {
318 get { return SystemColors.ControlText;}
319 set { SetSystemColors("control_text", value); }
322 public virtual Color ColorInactiveCaptionText {
323 get { return SystemColors.InactiveCaptionText;}
324 set { SetSystemColors("inactive_caption_text", value); }
327 public virtual Color ColorControlLight {
328 get { return SystemColors.ControlLight;}
329 set { SetSystemColors("control_light", value); }
332 public virtual Color ColorControlDarkDark {
333 get { return SystemColors.ControlDarkDark;}
334 set { SetSystemColors("control_dark_dark", value); }
337 public virtual Color ColorControlLightLight {
338 get { return SystemColors.ControlLightLight;}
339 set { SetSystemColors("control_light_light", value); }
342 public virtual Color ColorInfoText {
343 get { return SystemColors.InfoText;}
344 set { SetSystemColors("info_text", value); }
347 public virtual Color ColorInfo {
348 get { return SystemColors.Info;}
349 set { SetSystemColors("info", value); }
352 public virtual Color ColorHotTrack {
353 get { return SystemColors.HotTrack;}
354 set { SetSystemColors("hot_track", value);}
357 public virtual Color DefaultControlBackColor {
358 get { return ColorControl; }
359 set { ColorControl = value; }
362 public virtual Color DefaultControlForeColor {
363 get { return ColorControlText; }
364 set { ColorControlText = value; }
367 public virtual Font DefaultFont {
368 get { return default_font; }
371 public virtual Color DefaultWindowBackColor {
372 get { return defaultWindowBackColor; }
375 public virtual Color DefaultWindowForeColor {
376 get { return defaultWindowForeColor; }
379 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
381 return (Color) syscolors.GetValue ((int)idx);
384 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
386 syscolors.SetValue (color, (int) idx);
389 // Theme/UI specific defaults
390 public virtual ArrangeDirection ArrangeDirection {
392 return ArrangeDirection.Down;
396 public virtual ArrangeStartingPosition ArrangeStartingPosition {
398 return ArrangeStartingPosition.BottomLeft;
402 public virtual Size Border3DSize {
404 return new Size(2, 2);
408 public virtual Size BorderSize {
410 return new Size(1, 1);
414 public virtual Size CaptionButtonSize {
416 return new Size(18, 18);
420 public virtual int CaptionHeight {
422 return XplatUI.CaptionHeight;
426 public virtual Size DoubleClickSize {
428 return new Size(4, 4);
432 public virtual int DoubleClickTime {
438 public virtual Size FixedFrameBorderSize {
440 return new Size(3, 3);
444 public virtual Size FrameBorderSize {
446 return XplatUI.FrameBorderSize;
450 public virtual int HorizontalScrollBarArrowWidth {
456 public virtual int HorizontalScrollBarHeight {
462 public virtual int HorizontalScrollBarThumbWidth {
468 public virtual Size IconSpacingSize {
470 return new Size(75, 75);
474 public virtual Size MenuButtonSize {
476 return new Size(18, 18);
480 public virtual Size MenuCheckSize {
482 return new Size(13, 13);
486 public virtual Font MenuFont {
492 public virtual int MenuHeight {
494 return XplatUI.MenuHeight;
498 public virtual int MouseWheelScrollLines {
504 public virtual bool RightAlignedMenus {
510 public virtual Size ToolWindowCaptionButtonSize {
512 return new Size(15, 15);
516 public virtual int ToolWindowCaptionHeight {
522 public virtual int VerticalScrollBarArrowHeight {
528 public virtual int VerticalScrollBarThumbHeight {
534 public virtual int VerticalScrollBarWidth {
540 public virtual Font WindowBorderFont {
542 return window_border_font;
546 public int Clamp (int value, int lower, int upper)
548 if (value < lower) return lower;
549 else if (value > upper) return upper;
553 [MonoTODO("Figure out where to point for My Network Places")]
554 public virtual string Places(UIIcon index) {
556 case UIIcon.PlacesRecentDocuments: {
557 // Default = "Recent Documents"
558 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
561 case UIIcon.PlacesDesktop: {
562 // Default = "Desktop"
563 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
566 case UIIcon.PlacesPersonal: {
567 // Default = "My Documents"
568 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
571 case UIIcon.PlacesMyComputer: {
572 // Default = "My Computer"
573 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
576 case UIIcon.PlacesMyNetwork: {
577 // Default = "My Network Places"
582 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
588 // This routine fetches images embedded as assembly resources (not
589 // resgen resources). It optionally scales the image to fit the
590 // specified size x dimension (it adjusts y automatically to fit that).
592 private Image GetSizedResourceImage(string name, int width)
594 Image image = ResPool.GetUIImage (name, width);
602 fullname = String.Format("{1}_{0}", name, width);
603 image = ResourceImageLoader.Get (fullname);
605 ResPool.AddUIImage (image, name, width);
611 image = ResourceImageLoader.Get (name);
615 ResPool.AddUIImage (image, name, 0);
616 if (image.Width != width && width != 0){
617 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
618 int height = (image.Height * width)/image.Width;
619 Bitmap b = new Bitmap (width, height);
620 Graphics g = Graphics.FromImage (b);
621 g.DrawImage (image, 0, 0, width, height);
622 ResPool.AddUIImage (b, name, width);
629 public virtual Image Images(UIIcon index) {
630 return Images(index, 0);
633 public virtual Image Images(UIIcon index, int size) {
635 case UIIcon.PlacesRecentDocuments:
636 return GetSizedResourceImage ("document-open.png", size);
637 case UIIcon.PlacesDesktop:
638 return GetSizedResourceImage ("user-desktop.png", size);
639 case UIIcon.PlacesPersonal:
640 return GetSizedResourceImage ("user-home.png", size);
641 case UIIcon.PlacesMyComputer:
642 return GetSizedResourceImage ("computer.png", size);
643 case UIIcon.PlacesMyNetwork:
644 return GetSizedResourceImage ("folder-remote.png", size);
646 // Icons for message boxes
647 case UIIcon.MessageBoxError:
648 return GetSizedResourceImage ("dialog-error.png", size);
649 case UIIcon.MessageBoxInfo:
650 return GetSizedResourceImage ("dialog-information.png", size);
651 case UIIcon.MessageBoxQuestion:
652 return GetSizedResourceImage ("dialog-question.png", size);
653 case UIIcon.MessageBoxWarning:
654 return GetSizedResourceImage ("dialog-warning.png", size);
657 case UIIcon.NormalFolder:
658 return GetSizedResourceImage ("folder.png", size);
661 throw new ArgumentException("Invalid Icon type requested", "index");
666 public virtual Image Images(string mimetype, string extension, int size) {
670 #region Principal Theme Methods
671 // 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)
672 public abstract void ResetDefaults();
674 // If the theme writes directly to a window instead of a device context
675 public abstract bool DoubleBufferingSupported {get;}
676 #endregion // Principal Theme Methods
678 #region OwnerDraw Support
679 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
680 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
681 #endregion // OwnerDraw Support
688 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
691 public abstract Size ButtonBaseDefaultSize{get;}
692 #endregion // ButtonBase
695 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
696 #endregion // CheckBox
698 #region CheckedListBox
700 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
701 #endregion // CheckedListBox
705 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
706 #endregion // ComboBox
709 #endregion // Control
712 public abstract int DataGridPreferredColumnWidth { get; }
713 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
714 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
717 public abstract Color DataGridAlternatingBackColor { get; }
718 public abstract Color DataGridBackColor { get; }
719 public abstract Color DataGridBackgroundColor { get; }
720 public abstract Color DataGridCaptionBackColor { get; }
721 public abstract Color DataGridCaptionForeColor { get; }
722 public abstract Color DataGridGridLineColor { get; }
723 public abstract Color DataGridHeaderBackColor { get; }
724 public abstract Color DataGridHeaderForeColor { get; }
725 public abstract Color DataGridLinkColor { get; }
726 public abstract Color DataGridLinkHoverColor { get; }
727 public abstract Color DataGridParentRowsBackColor { get; }
728 public abstract Color DataGridParentRowsForeColor { get; }
729 public abstract Color DataGridSelectionBackColor { get; }
730 public abstract Color DataGridSelectionForeColor { get; }
732 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
733 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
734 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
735 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
736 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
737 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
738 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
739 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
740 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
741 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
742 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
744 #endregion // Datagrid
746 #region DateTimePicker
748 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
750 #endregion // DateTimePicker
754 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
757 public abstract Size GroupBoxDefaultSize{get;}
758 #endregion // GroupBox
761 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
762 #endregion // HScrollBar
766 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
769 public abstract Size LabelDefaultSize{get;}
773 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
774 #endregion // LinkLabel
778 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
779 #endregion // ListBox
783 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
784 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
785 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
788 public abstract Size ListViewCheckBoxSize { get; }
789 public abstract int ListViewColumnHeaderHeight { get; }
790 public abstract int ListViewDefaultColumnWidth { get; }
791 public abstract int ListViewVerticalSpacing { get; }
792 public abstract int ListViewEmptyColumnWidth { get; }
793 public abstract int ListViewHorizontalSpacing { get; }
794 public abstract Size ListViewDefaultSize { get; }
795 public abstract int ListViewGroupHeight { get; }
796 public abstract int ListViewTileWidthFactor { get; }
797 public abstract int ListViewTileHeightFactor { get; }
798 #endregion // ListView
801 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
802 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
803 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
804 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
805 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
806 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
809 #region MonthCalendar
810 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
811 #endregion // MonthCalendar
815 public abstract Size PanelDefaultSize{get;}
820 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
823 public abstract Size PictureBoxDefaultSize{get;}
824 #endregion // PictureBox
826 #region PrintPreviewControl
827 public abstract int PrintPreviewControlPadding{get;}
828 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
829 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
830 #endregion // PrintPreviewControl
834 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
837 public abstract Size ProgressBarDefaultSize{get;}
838 #endregion // ProgressBar
842 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
845 public abstract Size RadioButtonDefaultSize{get;}
846 #endregion // RadioButton
850 //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);
851 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
854 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
855 #endregion // ScrollBar
859 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
862 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
863 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
864 public abstract Size StatusBarDefaultSize{get;}
865 #endregion // StatusBar
868 public abstract Size TabControlDefaultItemSize { get; }
869 public abstract Point TabControlDefaultPadding { get; }
870 public abstract int TabControlMinimumTabWidth { get; }
872 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
873 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
874 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
875 public abstract Size TabControlGetSpacing (TabControl tab);
876 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
881 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
884 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
885 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
886 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
887 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
888 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
889 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
890 public abstract Size ToolBarDefaultSize{get;}
891 public abstract bool ToolBarInvalidateEntireButton { get; }
892 #endregion // ToolBar
895 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
896 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
897 #endregion // ToolTip
902 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
905 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
906 #endregion // TrackBar
909 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
910 #endregion // VScrollBar
913 public abstract Size TreeViewDefaultSize { get; }
916 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
918 // Just making virtual for now so all the themes still build.
921 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
923 // Just making virtual for now so all the themes still build.
927 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
929 // Just making virtual for now so all the themes still build.
933 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
935 // Just making virtual for now so all the themes still build.
936 return ManagedWindowTitleBarHeight (wm) - 5;
939 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
941 // Just making virtual for now so all the themes still build.
942 return new Size (10, 10);
945 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
947 // Just making virtual for now so all the themes still build.
950 #region ControlPaint Methods
951 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
952 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
953 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
954 int bottomWidth, ButtonBorderStyle bottomStyle);
956 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
957 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
958 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
959 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
960 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
961 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
962 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
963 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
964 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
965 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
966 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
967 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
968 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
969 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
970 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
971 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
972 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
974 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
975 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
976 StringFormat format);
977 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
978 #endregion // ControlPaint Methods