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 private readonly 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");
204 default_font = SystemFonts.DefaultFont;
206 default_font = new Font (FontFamily.GenericSansSerif, 8.25f);
209 default_font = new Font (FontFamily.GenericSansSerif, 8f);
212 private void SetSystemColors(string name, Color value) {
213 if (system_colors != null) {
216 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
217 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
218 if (update != null) {
219 update.Invoke(null, null);
225 /* OS Feature support */
226 public abstract Version Version {
230 /* Default properties */
231 public virtual Color ColorScrollBar {
232 get { return SystemColors.ScrollBar;}
233 set { SetSystemColors("scroll_bar", value); }
236 public virtual Color ColorDesktop {
237 get { return SystemColors.Desktop;}
238 set { SetSystemColors("desktop", value); }
241 public virtual Color ColorActiveCaption {
242 get { return SystemColors.ActiveCaption;}
243 set { SetSystemColors("active_caption", value); }
246 public virtual Color ColorInactiveCaption {
247 get { return SystemColors.InactiveCaption;}
248 set { SetSystemColors("inactive_caption", value); }
251 public virtual Color ColorMenu {
252 get { return SystemColors.Menu;}
253 set { SetSystemColors("menu", value); }
256 public virtual Color ColorWindow {
257 get { return SystemColors.Window;}
258 set { SetSystemColors("window", value); }
261 public virtual Color ColorWindowFrame {
262 get { return SystemColors.WindowFrame;}
263 set { SetSystemColors("window_frame", value); }
266 public virtual Color ColorMenuText {
267 get { return SystemColors.MenuText;}
268 set { SetSystemColors("menu_text", value); }
271 public virtual Color ColorWindowText {
272 get { return SystemColors.WindowText;}
273 set { SetSystemColors("window_text", value); }
276 public virtual Color ColorActiveCaptionText {
277 get { return SystemColors.ActiveCaptionText;}
278 set { SetSystemColors("active_caption_text", value); }
281 public virtual Color ColorActiveBorder {
282 get { return SystemColors.ActiveBorder;}
283 set { SetSystemColors("active_border", value); }
286 public virtual Color ColorInactiveBorder{
287 get { return SystemColors.InactiveBorder;}
288 set { SetSystemColors("inactive_border", value); }
291 public virtual Color ColorAppWorkspace {
292 get { return SystemColors.AppWorkspace;}
293 set { SetSystemColors("app_workspace", value); }
296 public virtual Color ColorHighlight {
297 get { return SystemColors.Highlight;}
298 set { SetSystemColors("highlight", value); }
301 public virtual Color ColorHighlightText {
302 get { return SystemColors.HighlightText;}
303 set { SetSystemColors("highlight_text", value); }
306 public virtual Color ColorControl {
307 get { return SystemColors.Control;}
308 set { SetSystemColors("control", value); }
311 public virtual Color ColorControlDark {
312 get { return SystemColors.ControlDark;}
313 set { SetSystemColors("control_dark", value); }
316 public virtual Color ColorGrayText {
317 get { return SystemColors.GrayText;}
318 set { SetSystemColors("gray_text", value); }
321 public virtual Color ColorControlText {
322 get { return SystemColors.ControlText;}
323 set { SetSystemColors("control_text", value); }
326 public virtual Color ColorInactiveCaptionText {
327 get { return SystemColors.InactiveCaptionText;}
328 set { SetSystemColors("inactive_caption_text", value); }
331 public virtual Color ColorControlLight {
332 get { return SystemColors.ControlLight;}
333 set { SetSystemColors("control_light", value); }
336 public virtual Color ColorControlDarkDark {
337 get { return SystemColors.ControlDarkDark;}
338 set { SetSystemColors("control_dark_dark", value); }
341 public virtual Color ColorControlLightLight {
342 get { return SystemColors.ControlLightLight;}
343 set { SetSystemColors("control_light_light", value); }
346 public virtual Color ColorInfoText {
347 get { return SystemColors.InfoText;}
348 set { SetSystemColors("info_text", value); }
351 public virtual Color ColorInfo {
352 get { return SystemColors.Info;}
353 set { SetSystemColors("info", value); }
356 public virtual Color ColorHotTrack {
357 get { return SystemColors.HotTrack;}
358 set { SetSystemColors("hot_track", value);}
361 public virtual Color DefaultControlBackColor {
362 get { return ColorControl; }
363 set { ColorControl = value; }
366 public virtual Color DefaultControlForeColor {
367 get { return ColorControlText; }
368 set { ColorControlText = value; }
371 public virtual Font DefaultFont {
372 get { return default_font; }
375 public virtual Color DefaultWindowBackColor {
376 get { return defaultWindowBackColor; }
379 public virtual Color DefaultWindowForeColor {
380 get { return defaultWindowForeColor; }
383 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
385 return (Color) syscolors.GetValue ((int)idx);
388 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
390 syscolors.SetValue (color, (int) idx);
393 // Theme/UI specific defaults
394 public virtual ArrangeDirection ArrangeDirection {
396 return ArrangeDirection.Down;
400 public virtual ArrangeStartingPosition ArrangeStartingPosition {
402 return ArrangeStartingPosition.BottomLeft;
406 public virtual Size Border3DSize {
408 return new Size(2, 2);
412 public virtual Size BorderSize {
414 return new Size(1, 1);
418 public virtual Size CaptionButtonSize {
420 return new Size(18, 18);
424 public virtual int CaptionHeight {
426 return XplatUI.CaptionHeight;
430 public virtual Size DoubleClickSize {
432 return new Size(4, 4);
436 public virtual int DoubleClickTime {
442 public virtual Size FixedFrameBorderSize {
444 return new Size(3, 3);
448 public virtual Size FrameBorderSize {
450 return XplatUI.FrameBorderSize;
454 public virtual int HorizontalScrollBarArrowWidth {
460 public virtual int HorizontalScrollBarHeight {
466 public virtual int HorizontalScrollBarThumbWidth {
472 public virtual Size IconSpacingSize {
474 return new Size(75, 75);
478 public virtual Size MenuButtonSize {
480 return new Size(18, 18);
484 public virtual Size MenuCheckSize {
486 return new Size(13, 13);
490 public virtual Font MenuFont {
496 public virtual int MenuHeight {
498 return XplatUI.MenuHeight;
502 public virtual int MouseWheelScrollLines {
508 public virtual bool RightAlignedMenus {
514 public virtual Size ToolWindowCaptionButtonSize {
516 return new Size(15, 15);
520 public virtual int ToolWindowCaptionHeight {
526 public virtual int VerticalScrollBarArrowHeight {
532 public virtual int VerticalScrollBarThumbHeight {
538 public virtual int VerticalScrollBarWidth {
544 public virtual Font WindowBorderFont {
546 return window_border_font;
550 public int Clamp (int value, int lower, int upper)
552 if (value < lower) return lower;
553 else if (value > upper) return upper;
557 [MonoTODO("Figure out where to point for My Network Places")]
558 public virtual string Places(UIIcon index) {
560 case UIIcon.PlacesRecentDocuments: {
561 // Default = "Recent Documents"
562 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
565 case UIIcon.PlacesDesktop: {
566 // Default = "Desktop"
567 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
570 case UIIcon.PlacesPersonal: {
571 // Default = "My Documents"
572 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
575 case UIIcon.PlacesMyComputer: {
576 // Default = "My Computer"
577 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
580 case UIIcon.PlacesMyNetwork: {
581 // Default = "My Network Places"
586 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
592 // This routine fetches images embedded as assembly resources (not
593 // resgen resources). It optionally scales the image to fit the
594 // specified size x dimension (it adjusts y automatically to fit that).
596 private Image GetSizedResourceImage(string name, int width)
598 Image image = ResPool.GetUIImage (name, width);
606 fullname = String.Format("{1}_{0}", name, width);
607 image = ResourceImageLoader.Get (fullname);
609 ResPool.AddUIImage (image, name, width);
615 image = ResourceImageLoader.Get (name);
619 ResPool.AddUIImage (image, name, 0);
620 if (image.Width != width && width != 0){
621 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
622 int height = (image.Height * width)/image.Width;
623 Bitmap b = new Bitmap (width, height);
624 Graphics g = Graphics.FromImage (b);
625 g.DrawImage (image, 0, 0, width, height);
626 ResPool.AddUIImage (b, name, width);
633 public virtual Image Images(UIIcon index) {
634 return Images(index, 0);
637 public virtual Image Images(UIIcon index, int size) {
639 case UIIcon.PlacesRecentDocuments:
640 return GetSizedResourceImage ("document-open.png", size);
641 case UIIcon.PlacesDesktop:
642 return GetSizedResourceImage ("user-desktop.png", size);
643 case UIIcon.PlacesPersonal:
644 return GetSizedResourceImage ("user-home.png", size);
645 case UIIcon.PlacesMyComputer:
646 return GetSizedResourceImage ("computer.png", size);
647 case UIIcon.PlacesMyNetwork:
648 return GetSizedResourceImage ("folder-remote.png", size);
650 // Icons for message boxes
651 case UIIcon.MessageBoxError:
652 return GetSizedResourceImage ("dialog-error.png", size);
653 case UIIcon.MessageBoxInfo:
654 return GetSizedResourceImage ("dialog-information.png", size);
655 case UIIcon.MessageBoxQuestion:
656 return GetSizedResourceImage ("dialog-question.png", size);
657 case UIIcon.MessageBoxWarning:
658 return GetSizedResourceImage ("dialog-warning.png", size);
661 case UIIcon.NormalFolder:
662 return GetSizedResourceImage ("folder.png", size);
665 throw new ArgumentException("Invalid Icon type requested", "index");
670 public virtual Image Images(string mimetype, string extension, int size) {
674 #region Principal Theme Methods
675 // 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)
676 public abstract void ResetDefaults();
678 // If the theme writes directly to a window instead of a device context
679 public abstract bool DoubleBufferingSupported {get;}
680 #endregion // Principal Theme Methods
682 #region OwnerDraw Support
683 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
684 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
685 #endregion // OwnerDraw Support
692 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
695 public abstract Size ButtonBaseDefaultSize{get;}
696 #endregion // ButtonBase
699 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
700 #endregion // CheckBox
702 #region CheckedListBox
704 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
705 #endregion // CheckedListBox
709 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
710 #endregion // ComboBox
713 #endregion // Control
716 public abstract int DataGridPreferredColumnWidth { get; }
717 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
718 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
721 public abstract Color DataGridAlternatingBackColor { get; }
722 public abstract Color DataGridBackColor { get; }
723 public abstract Color DataGridBackgroundColor { get; }
724 public abstract Color DataGridCaptionBackColor { get; }
725 public abstract Color DataGridCaptionForeColor { get; }
726 public abstract Color DataGridGridLineColor { get; }
727 public abstract Color DataGridHeaderBackColor { get; }
728 public abstract Color DataGridHeaderForeColor { get; }
729 public abstract Color DataGridLinkColor { get; }
730 public abstract Color DataGridLinkHoverColor { get; }
731 public abstract Color DataGridParentRowsBackColor { get; }
732 public abstract Color DataGridParentRowsForeColor { get; }
733 public abstract Color DataGridSelectionBackColor { get; }
734 public abstract Color DataGridSelectionForeColor { get; }
736 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
737 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
738 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
739 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
740 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
741 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
742 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
743 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
744 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
745 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
746 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
748 #endregion // Datagrid
750 #region DateTimePicker
752 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
754 #endregion // DateTimePicker
758 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
761 public abstract Size GroupBoxDefaultSize{get;}
762 #endregion // GroupBox
765 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
766 #endregion // HScrollBar
770 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
773 public abstract Size LabelDefaultSize{get;}
777 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
778 #endregion // LinkLabel
782 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
783 #endregion // ListBox
787 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
788 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
789 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
792 public abstract Size ListViewCheckBoxSize { get; }
793 public abstract int ListViewColumnHeaderHeight { get; }
794 public abstract int ListViewDefaultColumnWidth { get; }
795 public abstract int ListViewVerticalSpacing { get; }
796 public abstract int ListViewEmptyColumnWidth { get; }
797 public abstract int ListViewHorizontalSpacing { get; }
798 public abstract Size ListViewDefaultSize { get; }
799 public abstract int ListViewGroupHeight { get; }
800 public abstract int ListViewTileWidthFactor { get; }
801 public abstract int ListViewTileHeightFactor { get; }
802 #endregion // ListView
805 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
806 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
807 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
808 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
809 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
810 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
813 #region MonthCalendar
814 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
815 #endregion // MonthCalendar
819 public abstract Size PanelDefaultSize{get;}
824 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
827 public abstract Size PictureBoxDefaultSize{get;}
828 #endregion // PictureBox
830 #region PrintPreviewControl
831 public abstract int PrintPreviewControlPadding{get;}
832 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
833 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
834 #endregion // PrintPreviewControl
838 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
841 public abstract Size ProgressBarDefaultSize{get;}
842 #endregion // ProgressBar
846 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
849 public abstract Size RadioButtonDefaultSize{get;}
850 #endregion // RadioButton
854 //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);
855 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
858 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
859 #endregion // ScrollBar
863 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
866 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
867 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
868 public abstract Size StatusBarDefaultSize{get;}
869 #endregion // StatusBar
872 public abstract Size TabControlDefaultItemSize { get; }
873 public abstract Point TabControlDefaultPadding { get; }
874 public abstract int TabControlMinimumTabWidth { get; }
876 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
877 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
878 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
879 public abstract Size TabControlGetSpacing (TabControl tab);
880 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
885 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
888 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
889 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
890 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
891 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
892 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
893 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
894 public abstract Size ToolBarDefaultSize{get;}
895 public abstract bool ToolBarInvalidateEntireButton { get; }
896 #endregion // ToolBar
899 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
900 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
901 #endregion // ToolTip
906 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
909 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
910 #endregion // TrackBar
913 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
914 #endregion // VScrollBar
917 public abstract Size TreeViewDefaultSize { get; }
920 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
922 // Just making virtual for now so all the themes still build.
925 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
927 // Just making virtual for now so all the themes still build.
931 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
933 // Just making virtual for now so all the themes still build.
937 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
939 // Just making virtual for now so all the themes still build.
940 return ManagedWindowTitleBarHeight (wm) - 5;
943 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
945 // Just making virtual for now so all the themes still build.
946 return new Size (10, 10);
949 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
951 // Just making virtual for now so all the themes still build.
954 #region ControlPaint Methods
955 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
956 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
957 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
958 int bottomWidth, ButtonBorderStyle bottomStyle);
960 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
961 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
962 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
963 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
964 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
965 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
966 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
967 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
968 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
969 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
970 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
971 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
972 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
973 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
974 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
975 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
976 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
978 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
979 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
980 StringFormat format);
981 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
982 #endregion // ControlPaint Methods