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 Font window_border_font;
194 protected Color defaultWindowBackColor;
195 protected Color defaultWindowForeColor;
196 protected bool always_draw_hotkeys = true;
197 internal SystemResPool ResPool = new SystemResPool ();
198 private Type system_colors = Type.GetType("System.Drawing.SystemColors, System.Drawing");
200 private void SetSystemColors(string name, Color value) {
201 if (system_colors != null) {
204 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
205 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
206 if (update != null) {
207 update.Invoke(null, null);
213 /* OS Feature support */
214 public abstract Version Version {
218 /* Default properties */
219 public virtual Color ColorScrollBar {
220 get { return SystemColors.ScrollBar;}
221 set { SetSystemColors("scroll_bar", value); }
224 public virtual Color ColorDesktop {
225 get { return SystemColors.Desktop;}
226 set { SetSystemColors("desktop", value); }
229 public virtual Color ColorActiveCaption {
230 get { return SystemColors.ActiveCaption;}
231 set { SetSystemColors("active_caption", value); }
234 public virtual Color ColorInactiveCaption {
235 get { return SystemColors.InactiveCaption;}
236 set { SetSystemColors("inactive_caption", value); }
239 public virtual Color ColorMenu {
240 get { return SystemColors.Menu;}
241 set { SetSystemColors("menu", value); }
244 public virtual Color ColorWindow {
245 get { return SystemColors.Window;}
246 set { SetSystemColors("window", value); }
249 public virtual Color ColorWindowFrame {
250 get { return SystemColors.WindowFrame;}
251 set { SetSystemColors("window_frame", value); }
254 public virtual Color ColorMenuText {
255 get { return SystemColors.MenuText;}
256 set { SetSystemColors("menu_text", value); }
259 public virtual Color ColorWindowText {
260 get { return SystemColors.WindowText;}
261 set { SetSystemColors("window_text", value); }
264 public virtual Color ColorActiveCaptionText {
265 get { return SystemColors.ActiveCaptionText;}
266 set { SetSystemColors("active_caption_text", value); }
269 public virtual Color ColorActiveBorder {
270 get { return SystemColors.ActiveBorder;}
271 set { SetSystemColors("active_border", value); }
274 public virtual Color ColorInactiveBorder{
275 get { return SystemColors.InactiveBorder;}
276 set { SetSystemColors("inactive_border", value); }
279 public virtual Color ColorAppWorkspace {
280 get { return SystemColors.AppWorkspace;}
281 set { SetSystemColors("app_workspace", value); }
284 public virtual Color ColorHighlight {
285 get { return SystemColors.Highlight;}
286 set { SetSystemColors("highlight", value); }
289 public virtual Color ColorHighlightText {
290 get { return SystemColors.HighlightText;}
291 set { SetSystemColors("highlight_text", value); }
294 public virtual Color ColorControl {
295 get { return SystemColors.Control;}
296 set { SetSystemColors("control", value); }
299 public virtual Color ColorControlDark {
300 get { return SystemColors.ControlDark;}
301 set { SetSystemColors("control_dark", value); }
304 public virtual Color ColorGrayText {
305 get { return SystemColors.GrayText;}
306 set { SetSystemColors("gray_text", value); }
309 public virtual Color ColorControlText {
310 get { return SystemColors.ControlText;}
311 set { SetSystemColors("control_text", value); }
314 public virtual Color ColorInactiveCaptionText {
315 get { return SystemColors.InactiveCaptionText;}
316 set { SetSystemColors("inactive_caption_text", value); }
319 public virtual Color ColorControlLight {
320 get { return SystemColors.ControlLight;}
321 set { SetSystemColors("control_light", value); }
324 public virtual Color ColorControlDarkDark {
325 get { return SystemColors.ControlDarkDark;}
326 set { SetSystemColors("control_dark_dark", value); }
329 public virtual Color ColorControlLightLight {
330 get { return SystemColors.ControlLightLight;}
331 set { SetSystemColors("control_light_light", value); }
334 public virtual Color ColorInfoText {
335 get { return SystemColors.InfoText;}
336 set { SetSystemColors("info_text", value); }
339 public virtual Color ColorInfo {
340 get { return SystemColors.Info;}
341 set { SetSystemColors("info", value); }
344 public virtual Color ColorHotTrack {
345 get { return SystemColors.HotTrack;}
346 set { SetSystemColors("hot_track", value);}
349 public virtual Color DefaultControlBackColor {
350 get { return ColorControl; }
351 set { ColorControl = value; }
354 public virtual Color DefaultControlForeColor {
355 get { return ColorControlText; }
356 set { ColorControlText = value; }
359 public virtual Font DefaultFont {
360 get { return default_font; }
363 public virtual Color DefaultWindowBackColor {
364 get { return defaultWindowBackColor; }
367 public virtual Color DefaultWindowForeColor {
368 get { return defaultWindowForeColor; }
371 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
373 return (Color) syscolors.GetValue ((int)idx);
376 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
378 syscolors.SetValue (color, (int) idx);
381 // Theme/UI specific defaults
382 public virtual ArrangeDirection ArrangeDirection {
384 return ArrangeDirection.Down;
388 public virtual ArrangeStartingPosition ArrangeStartingPosition {
390 return ArrangeStartingPosition.BottomLeft;
394 public virtual Size Border3DSize {
396 return new Size(2, 2);
400 public virtual Size BorderSize {
402 return new Size(1, 1);
406 public virtual Size CaptionButtonSize {
408 return new Size(18, 18);
412 public virtual int CaptionHeight {
414 return XplatUI.CaptionHeight;
418 public virtual Size DoubleClickSize {
420 return new Size(4, 4);
424 public virtual int DoubleClickTime {
430 public virtual Size FixedFrameBorderSize {
432 return new Size(3, 3);
436 public virtual Size FrameBorderSize {
438 return XplatUI.FrameBorderSize;
442 public virtual int HorizontalScrollBarArrowWidth {
448 public virtual int HorizontalScrollBarHeight {
454 public virtual int HorizontalScrollBarThumbWidth {
460 public virtual Size IconSpacingSize {
462 return new Size(75, 75);
466 public virtual Size MenuButtonSize {
468 return new Size(18, 18);
472 public virtual Size MenuCheckSize {
474 return new Size(13, 13);
478 public virtual Font MenuFont {
484 public virtual int MenuHeight {
486 return XplatUI.MenuHeight;
490 public virtual int MouseWheelScrollLines {
496 public virtual bool RightAlignedMenus {
502 public virtual Size ToolWindowCaptionButtonSize {
504 return new Size(15, 15);
508 public virtual int ToolWindowCaptionHeight {
514 public virtual int VerticalScrollBarArrowHeight {
520 public virtual int VerticalScrollBarThumbHeight {
526 public virtual int VerticalScrollBarWidth {
532 public virtual Font WindowBorderFont {
534 return window_border_font;
538 public int Clamp (int value, int lower, int upper)
540 if (value < lower) return lower;
541 else if (value > upper) return upper;
545 [MonoTODO("Figure out where to point for My Network Places")]
546 public virtual string Places(UIIcon index) {
548 case UIIcon.PlacesRecentDocuments: {
549 // Default = "Recent Documents"
550 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
553 case UIIcon.PlacesDesktop: {
554 // Default = "Desktop"
555 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
558 case UIIcon.PlacesPersonal: {
559 // Default = "My Documents"
560 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
563 case UIIcon.PlacesMyComputer: {
564 // Default = "My Computer"
565 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
568 case UIIcon.PlacesMyNetwork: {
569 // Default = "My Network Places"
574 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
580 // This routine fetches images embedded as assembly resources (not
581 // resgen resources). It optionally scales the image to fit the
582 // specified size x dimension (it adjusts y automatically to fit that).
584 private Image GetSizedResourceImage(string name, int width)
586 Image image = ResPool.GetUIImage (name, width);
594 fullname = String.Format("{1}_{0}", name, width);
595 image = ResourceImageLoader.Get (fullname);
597 ResPool.AddUIImage (image, name, width);
603 image = ResourceImageLoader.Get (name);
607 ResPool.AddUIImage (image, name, 0);
608 if (image.Width != width && width != 0){
609 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
610 int height = (image.Height * width)/image.Width;
611 Bitmap b = new Bitmap (width, height);
612 Graphics g = Graphics.FromImage (b);
613 g.DrawImage (image, 0, 0, width, height);
614 ResPool.AddUIImage (b, name, width);
621 public virtual Image Images(UIIcon index) {
622 return Images(index, 0);
625 public virtual Image Images(UIIcon index, int size) {
627 case UIIcon.PlacesRecentDocuments:
628 return GetSizedResourceImage ("document-open.png", size);
629 case UIIcon.PlacesDesktop:
630 return GetSizedResourceImage ("user-desktop.png", size);
631 case UIIcon.PlacesPersonal:
632 return GetSizedResourceImage ("user-home.png", size);
633 case UIIcon.PlacesMyComputer:
634 return GetSizedResourceImage ("computer.png", size);
635 case UIIcon.PlacesMyNetwork:
636 return GetSizedResourceImage ("folder-remote.png", size);
638 // Icons for message boxes
639 case UIIcon.MessageBoxError:
640 return GetSizedResourceImage ("dialog-error.png", size);
641 case UIIcon.MessageBoxInfo:
642 return GetSizedResourceImage ("dialog-information.png", size);
643 case UIIcon.MessageBoxQuestion:
644 return GetSizedResourceImage ("dialog-question.png", size);
645 case UIIcon.MessageBoxWarning:
646 return GetSizedResourceImage ("dialog-warning.png", size);
649 case UIIcon.NormalFolder:
650 return GetSizedResourceImage ("folder.png", size);
653 throw new ArgumentException("Invalid Icon type requested", "index");
658 public virtual Image Images(string mimetype, string extension, int size) {
662 #region Principal Theme Methods
663 // 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)
664 public abstract void ResetDefaults();
666 // If the theme writes directly to a window instead of a device context
667 public abstract bool DoubleBufferingSupported {get;}
668 #endregion // Principal Theme Methods
670 #region OwnerDraw Support
671 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
672 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
673 #endregion // OwnerDraw Support
680 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
683 public abstract Size ButtonBaseDefaultSize{get;}
684 #endregion // ButtonBase
687 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
688 #endregion // CheckBox
690 #region CheckedListBox
692 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
693 #endregion // CheckedListBox
697 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
698 #endregion // ComboBox
701 #endregion // Control
704 public abstract int DataGridPreferredColumnWidth { get; }
705 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
706 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
709 public abstract Color DataGridAlternatingBackColor { get; }
710 public abstract Color DataGridBackColor { get; }
711 public abstract Color DataGridBackgroundColor { get; }
712 public abstract Color DataGridCaptionBackColor { get; }
713 public abstract Color DataGridCaptionForeColor { get; }
714 public abstract Color DataGridGridLineColor { get; }
715 public abstract Color DataGridHeaderBackColor { get; }
716 public abstract Color DataGridHeaderForeColor { get; }
717 public abstract Color DataGridLinkColor { get; }
718 public abstract Color DataGridLinkHoverColor { get; }
719 public abstract Color DataGridParentRowsBackColor { get; }
720 public abstract Color DataGridParentRowsForeColor { get; }
721 public abstract Color DataGridSelectionBackColor { get; }
722 public abstract Color DataGridSelectionForeColor { get; }
724 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
725 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
726 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
727 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
728 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
729 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
730 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
731 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
732 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
733 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
734 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
736 #endregion // Datagrid
738 #region DateTimePicker
740 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
742 #endregion // DateTimePicker
746 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
749 public abstract Size GroupBoxDefaultSize{get;}
750 #endregion // GroupBox
753 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
754 #endregion // HScrollBar
758 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
761 public abstract Size LabelDefaultSize{get;}
765 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
766 #endregion // LinkLabel
770 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
771 #endregion // ListBox
775 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
776 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
777 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
780 public abstract Size ListViewCheckBoxSize { get; }
781 public abstract int ListViewColumnHeaderHeight { get; }
782 public abstract int ListViewDefaultColumnWidth { get; }
783 public abstract int ListViewVerticalSpacing { get; }
784 public abstract int ListViewEmptyColumnWidth { get; }
785 public abstract int ListViewHorizontalSpacing { get; }
786 public abstract Size ListViewDefaultSize { get; }
787 public abstract int ListViewGroupHeight { get; }
788 public abstract int ListViewTileWidthFactor { get; }
789 public abstract int ListViewTileHeightFactor { get; }
790 #endregion // ListView
793 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
794 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
795 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
796 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
797 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
798 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
801 #region MonthCalendar
802 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
803 #endregion // MonthCalendar
807 public abstract Size PanelDefaultSize{get;}
812 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
815 public abstract Size PictureBoxDefaultSize{get;}
816 #endregion // PictureBox
818 #region PrintPreviewControl
819 public abstract int PrintPreviewControlPadding{get;}
820 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
821 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
822 #endregion // PrintPreviewControl
826 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
829 public abstract Size ProgressBarDefaultSize{get;}
830 #endregion // ProgressBar
834 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
837 public abstract Size RadioButtonDefaultSize{get;}
838 #endregion // RadioButton
842 //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);
843 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
846 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
847 #endregion // ScrollBar
851 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
854 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
855 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
856 public abstract Size StatusBarDefaultSize{get;}
857 #endregion // StatusBar
860 public abstract Size TabControlDefaultItemSize { get; }
861 public abstract Point TabControlDefaultPadding { get; }
862 public abstract int TabControlMinimumTabWidth { get; }
864 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
865 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
866 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
867 public abstract Size TabControlGetSpacing (TabControl tab);
868 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
873 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
876 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
877 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
878 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
879 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
880 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
881 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
882 public abstract Size ToolBarDefaultSize{get;}
883 public abstract bool ToolBarInvalidateEntireButton { get; }
884 #endregion // ToolBar
887 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
888 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
889 #endregion // ToolTip
894 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
897 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
898 #endregion // TrackBar
901 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
902 #endregion // VScrollBar
905 public abstract Size TreeViewDefaultSize { get; }
908 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
910 // Just making virtual for now so all the themes still build.
913 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
915 // Just making virtual for now so all the themes still build.
919 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
921 // Just making virtual for now so all the themes still build.
925 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
927 // Just making virtual for now so all the themes still build.
928 return ManagedWindowTitleBarHeight (wm) - 5;
931 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
933 // Just making virtual for now so all the themes still build.
934 return new Size (10, 10);
937 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
939 // Just making virtual for now so all the themes still build.
942 #region ControlPaint Methods
943 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
944 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
945 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
946 int bottomWidth, ButtonBorderStyle bottomStyle);
948 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
949 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
950 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
951 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
952 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
953 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
954 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
955 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
956 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
957 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
958 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
959 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
960 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
961 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
962 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
963 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
964 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
966 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
967 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
968 StringFormat format);
969 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
970 #endregion // ControlPaint Methods