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 internal SystemResPool ResPool = new SystemResPool ();
196 private Type system_colors = Type.GetType ("System.Drawing.SystemColors, " + Consts.AssemblySystem_Drawing);
201 default_font = SystemFonts.DefaultFont;
203 default_font = new Font (FontFamily.GenericSansSerif, 8.25f);
207 private void SetSystemColors(string name, Color value) {
208 if (system_colors != null) {
211 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
212 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
213 if (update != null) {
214 update.Invoke(null, null);
220 /* OS Feature support */
221 public abstract Version Version {
225 /* Default properties */
226 public virtual Color ColorScrollBar {
227 get { return SystemColors.ScrollBar;}
228 set { SetSystemColors("scroll_bar", value); }
231 public virtual Color ColorDesktop {
232 get { return SystemColors.Desktop;}
233 set { SetSystemColors("desktop", value); }
236 public virtual Color ColorActiveCaption {
237 get { return SystemColors.ActiveCaption;}
238 set { SetSystemColors("active_caption", value); }
241 public virtual Color ColorInactiveCaption {
242 get { return SystemColors.InactiveCaption;}
243 set { SetSystemColors("inactive_caption", value); }
246 public virtual Color ColorMenu {
247 get { return SystemColors.Menu;}
248 set { SetSystemColors("menu", value); }
251 public virtual Color ColorWindow {
252 get { return SystemColors.Window;}
253 set { SetSystemColors("window", value); }
256 public virtual Color ColorWindowFrame {
257 get { return SystemColors.WindowFrame;}
258 set { SetSystemColors("window_frame", value); }
261 public virtual Color ColorMenuText {
262 get { return SystemColors.MenuText;}
263 set { SetSystemColors("menu_text", value); }
266 public virtual Color ColorWindowText {
267 get { return SystemColors.WindowText;}
268 set { SetSystemColors("window_text", value); }
271 public virtual Color ColorActiveCaptionText {
272 get { return SystemColors.ActiveCaptionText;}
273 set { SetSystemColors("active_caption_text", value); }
276 public virtual Color ColorActiveBorder {
277 get { return SystemColors.ActiveBorder;}
278 set { SetSystemColors("active_border", value); }
281 public virtual Color ColorInactiveBorder{
282 get { return SystemColors.InactiveBorder;}
283 set { SetSystemColors("inactive_border", value); }
286 public virtual Color ColorAppWorkspace {
287 get { return SystemColors.AppWorkspace;}
288 set { SetSystemColors("app_workspace", value); }
291 public virtual Color ColorHighlight {
292 get { return SystemColors.Highlight;}
293 set { SetSystemColors("highlight", value); }
296 public virtual Color ColorHighlightText {
297 get { return SystemColors.HighlightText;}
298 set { SetSystemColors("highlight_text", value); }
301 public virtual Color ColorControl {
302 get { return SystemColors.Control;}
303 set { SetSystemColors("control", value); }
306 public virtual Color ColorControlDark {
307 get { return SystemColors.ControlDark;}
308 set { SetSystemColors("control_dark", value); }
311 public virtual Color ColorGrayText {
312 get { return SystemColors.GrayText;}
313 set { SetSystemColors("gray_text", value); }
316 public virtual Color ColorControlText {
317 get { return SystemColors.ControlText;}
318 set { SetSystemColors("control_text", value); }
321 public virtual Color ColorInactiveCaptionText {
322 get { return SystemColors.InactiveCaptionText;}
323 set { SetSystemColors("inactive_caption_text", value); }
326 public virtual Color ColorControlLight {
327 get { return SystemColors.ControlLight;}
328 set { SetSystemColors("control_light", value); }
331 public virtual Color ColorControlDarkDark {
332 get { return SystemColors.ControlDarkDark;}
333 set { SetSystemColors("control_dark_dark", value); }
336 public virtual Color ColorControlLightLight {
337 get { return SystemColors.ControlLightLight;}
338 set { SetSystemColors("control_light_light", value); }
341 public virtual Color ColorInfoText {
342 get { return SystemColors.InfoText;}
343 set { SetSystemColors("info_text", value); }
346 public virtual Color ColorInfo {
347 get { return SystemColors.Info;}
348 set { SetSystemColors("info", value); }
351 public virtual Color ColorHotTrack {
352 get { return SystemColors.HotTrack;}
353 set { SetSystemColors("hot_track", value);}
356 public virtual Color DefaultControlBackColor {
357 get { return ColorControl; }
358 set { ColorControl = value; }
361 public virtual Color DefaultControlForeColor {
362 get { return ColorControlText; }
363 set { ColorControlText = value; }
366 public virtual Font DefaultFont {
367 get { return default_font; }
370 public virtual Color DefaultWindowBackColor {
371 get { return defaultWindowBackColor; }
374 public virtual Color DefaultWindowForeColor {
375 get { return defaultWindowForeColor; }
378 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
380 return (Color) syscolors.GetValue ((int)idx);
383 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
385 syscolors.SetValue (color, (int) idx);
388 // Theme/UI specific defaults
389 public virtual ArrangeDirection ArrangeDirection {
391 return ArrangeDirection.Down;
395 public virtual ArrangeStartingPosition ArrangeStartingPosition {
397 return ArrangeStartingPosition.BottomLeft;
401 public virtual Size Border3DSize {
403 return new Size(2, 2);
407 public virtual Size BorderStaticSize {
409 return new Size(1, 1);
413 public virtual Size BorderSize {
415 return new Size(1, 1);
419 public virtual Size CaptionButtonSize {
421 return new Size(18, 18);
425 public virtual int CaptionHeight {
427 return XplatUI.CaptionHeight;
431 public virtual Size DoubleClickSize {
433 return new Size(4, 4);
437 public virtual int DoubleClickTime {
443 public virtual Size FixedFrameBorderSize {
445 return new Size(3, 3);
449 public virtual Size FrameBorderSize {
451 return XplatUI.FrameBorderSize;
455 public virtual int HorizontalScrollBarArrowWidth {
461 public virtual int HorizontalScrollBarHeight {
467 public virtual int HorizontalScrollBarThumbWidth {
473 public virtual Size IconSpacingSize {
475 return new Size(75, 75);
479 public virtual bool MenuAccessKeysUnderlined {
485 public virtual Size MenuButtonSize {
487 return new Size(18, 18);
491 public virtual Size MenuCheckSize {
493 return new Size(13, 13);
497 public virtual Font MenuFont {
503 public virtual int MenuHeight {
505 return XplatUI.MenuHeight;
509 public virtual int MouseWheelScrollLines {
515 public virtual bool RightAlignedMenus {
521 public virtual Size ToolWindowCaptionButtonSize {
523 return new Size(15, 15);
527 public virtual int ToolWindowCaptionHeight {
533 public virtual int VerticalScrollBarArrowHeight {
539 public virtual int VerticalScrollBarThumbHeight {
545 public virtual int VerticalScrollBarWidth {
551 public virtual Font WindowBorderFont {
553 return window_border_font;
557 public int Clamp (int value, int lower, int upper)
559 if (value < lower) return lower;
560 else if (value > upper) return upper;
564 [MonoTODO("Figure out where to point for My Network Places")]
565 public virtual string Places(UIIcon index) {
567 case UIIcon.PlacesRecentDocuments: {
568 // Default = "Recent Documents"
569 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
572 case UIIcon.PlacesDesktop: {
573 // Default = "Desktop"
574 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
577 case UIIcon.PlacesPersonal: {
578 // Default = "My Documents"
579 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
582 case UIIcon.PlacesMyComputer: {
583 // Default = "My Computer"
584 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
587 case UIIcon.PlacesMyNetwork: {
588 // Default = "My Network Places"
593 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
599 // This routine fetches images embedded as assembly resources (not
600 // resgen resources). It optionally scales the image to fit the
601 // specified size x dimension (it adjusts y automatically to fit that).
603 private Image GetSizedResourceImage(string name, int width)
605 Image image = ResPool.GetUIImage (name, width);
613 fullname = String.Format("{1}_{0}", name, width);
614 image = ResourceImageLoader.Get (fullname);
616 ResPool.AddUIImage (image, name, width);
622 image = ResourceImageLoader.Get (name);
626 ResPool.AddUIImage (image, name, 0);
627 if (image.Width != width && width != 0){
628 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
629 int height = (image.Height * width)/image.Width;
630 Bitmap b = new Bitmap (width, height);
631 Graphics g = Graphics.FromImage (b);
632 g.DrawImage (image, 0, 0, width, height);
633 ResPool.AddUIImage (b, name, width);
640 public virtual Image Images(UIIcon index) {
641 return Images(index, 0);
644 public virtual Image Images(UIIcon index, int size) {
646 case UIIcon.PlacesRecentDocuments:
647 return GetSizedResourceImage ("document-open.png", size);
648 case UIIcon.PlacesDesktop:
649 return GetSizedResourceImage ("user-desktop.png", size);
650 case UIIcon.PlacesPersonal:
651 return GetSizedResourceImage ("user-home.png", size);
652 case UIIcon.PlacesMyComputer:
653 return GetSizedResourceImage ("computer.png", size);
654 case UIIcon.PlacesMyNetwork:
655 return GetSizedResourceImage ("folder-remote.png", size);
657 // Icons for message boxes
658 case UIIcon.MessageBoxError:
659 return GetSizedResourceImage ("dialog-error.png", size);
660 case UIIcon.MessageBoxInfo:
661 return GetSizedResourceImage ("dialog-information.png", size);
662 case UIIcon.MessageBoxQuestion:
663 return GetSizedResourceImage ("dialog-question.png", size);
664 case UIIcon.MessageBoxWarning:
665 return GetSizedResourceImage ("dialog-warning.png", size);
668 case UIIcon.NormalFolder:
669 return GetSizedResourceImage ("folder.png", size);
672 throw new ArgumentException("Invalid Icon type requested", "index");
677 public virtual Image Images(string mimetype, string extension, int size) {
681 #region Principal Theme Methods
682 // 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)
683 public abstract void ResetDefaults();
685 // If the theme writes directly to a window instead of a device context
686 public abstract bool DoubleBufferingSupported {get;}
687 #endregion // Principal Theme Methods
689 #region OwnerDraw Support
690 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
691 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
692 #endregion // OwnerDraw Support
695 public abstract void CalculateButtonTextAndImageLayout (Button b, out Rectangle textRectangle, out Rectangle imageRectangle);
696 public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
697 public abstract void DrawFlatButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
698 public abstract void DrawPopupButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
703 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
706 public abstract Size ButtonBaseDefaultSize{get;}
707 #endregion // ButtonBase
710 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
711 #endregion // CheckBox
713 #region CheckedListBox
715 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
716 #endregion // CheckedListBox
720 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
721 public abstract void DrawFlatStyleComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
722 #endregion // ComboBox
725 #endregion // Control
728 public abstract int DataGridPreferredColumnWidth { get; }
729 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
730 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
733 public abstract Color DataGridAlternatingBackColor { get; }
734 public abstract Color DataGridBackColor { get; }
735 public abstract Color DataGridBackgroundColor { get; }
736 public abstract Color DataGridCaptionBackColor { get; }
737 public abstract Color DataGridCaptionForeColor { get; }
738 public abstract Color DataGridGridLineColor { get; }
739 public abstract Color DataGridHeaderBackColor { get; }
740 public abstract Color DataGridHeaderForeColor { get; }
741 public abstract Color DataGridLinkColor { get; }
742 public abstract Color DataGridLinkHoverColor { get; }
743 public abstract Color DataGridParentRowsBackColor { get; }
744 public abstract Color DataGridParentRowsForeColor { get; }
745 public abstract Color DataGridSelectionBackColor { get; }
746 public abstract Color DataGridSelectionForeColor { get; }
748 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
749 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
750 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
751 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
752 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
753 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
754 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
755 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
756 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
757 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
758 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
760 #endregion // Datagrid
762 #region DateTimePicker
764 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
766 #endregion // DateTimePicker
770 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
773 public abstract Size GroupBoxDefaultSize{get;}
774 #endregion // GroupBox
777 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
778 #endregion // HScrollBar
782 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
785 public abstract Size LabelDefaultSize{get;}
789 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
790 #endregion // LinkLabel
794 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
795 #endregion // ListBox
799 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
800 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
801 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
804 public abstract Size ListViewCheckBoxSize { get; }
805 public abstract int ListViewColumnHeaderHeight { get; }
806 public abstract int ListViewDefaultColumnWidth { get; }
807 public abstract int ListViewVerticalSpacing { get; }
808 public abstract int ListViewEmptyColumnWidth { get; }
809 public abstract int ListViewHorizontalSpacing { get; }
810 public abstract Size ListViewDefaultSize { get; }
811 public abstract int ListViewGroupHeight { get; }
812 public abstract int ListViewTileWidthFactor { get; }
813 public abstract int ListViewTileHeightFactor { get; }
814 #endregion // ListView
817 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
818 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
819 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
820 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
821 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
822 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
825 #region MonthCalendar
826 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
827 #endregion // MonthCalendar
831 public abstract Size PanelDefaultSize{get;}
836 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
839 public abstract Size PictureBoxDefaultSize{get;}
840 #endregion // PictureBox
842 #region PrintPreviewControl
843 public abstract int PrintPreviewControlPadding{get;}
844 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
845 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
846 #endregion // PrintPreviewControl
850 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
853 public abstract Size ProgressBarDefaultSize{get;}
854 #endregion // ProgressBar
858 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
861 public abstract Size RadioButtonDefaultSize{get;}
862 #endregion // RadioButton
866 //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);
867 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
870 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
871 #endregion // ScrollBar
875 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
878 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
879 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
880 public abstract Size StatusBarDefaultSize{get;}
881 #endregion // StatusBar
884 public abstract Size TabControlDefaultItemSize { get; }
885 public abstract Point TabControlDefaultPadding { get; }
886 public abstract int TabControlMinimumTabWidth { get; }
888 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
889 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
890 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
891 public abstract Size TabControlGetSpacing (TabControl tab);
892 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
897 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
900 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
901 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
902 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
903 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
904 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
905 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
906 public abstract Size ToolBarDefaultSize{get;}
907 #endregion // ToolBar
910 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
911 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
912 #endregion // ToolTip
917 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
920 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
921 #endregion // TrackBar
924 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
925 #endregion // VScrollBar
928 public abstract Size TreeViewDefaultSize { get; }
931 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
933 // Just making virtual for now so all the themes still build.
936 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
938 // Just making virtual for now so all the themes still build.
942 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
944 // Just making virtual for now so all the themes still build.
948 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
950 // Just making virtual for now so all the themes still build.
951 return ManagedWindowTitleBarHeight (wm) - 5;
954 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
956 // Just making virtual for now so all the themes still build.
957 return new Size (10, 10);
960 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
962 // Just making virtual for now so all the themes still build.
965 #region ControlPaint Methods
966 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
967 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
968 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
969 int bottomWidth, ButtonBorderStyle bottomStyle);
971 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
972 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
973 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
974 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
975 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
976 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
977 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
978 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
979 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
980 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
981 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
982 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
983 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
984 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
985 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
986 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
987 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
989 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
990 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
991 StringFormat format);
992 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
993 #endregion // ControlPaint Methods