1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2004-2005 Novell, Inc.
23 // Jordi Mas i Hernandez, jordi@ximian.com
24 // Peter Dennis Bartok, pbartok@novell.com
28 using System.Collections;
30 using System.Drawing.Drawing2D;
31 using System.Drawing.Imaging;
32 using System.Reflection;
34 namespace System.Windows.Forms
36 internal enum UIIcon {
37 PlacesRecentDocuments,
50 internal struct CPColor {
52 internal Color DarkDark;
54 internal Color LightLight;
56 internal static CPColor Empty;
59 // Implements a pool of system resources
60 internal class SystemResPool
62 private Hashtable pens = new Hashtable ();
63 private Hashtable dashpens = new Hashtable ();
64 private Hashtable sizedpens = new Hashtable ();
65 private Hashtable solidbrushes = new Hashtable ();
66 private Hashtable hatchbrushes = new Hashtable ();
67 private Hashtable uiImages = new Hashtable();
68 private Hashtable cpcolors = new Hashtable ();
70 public SystemResPool () {}
72 public Pen GetPen (Color color)
74 int hash = color.ToArgb ();
77 Pen res = pens [hash] as Pen;
81 Pen pen = new Pen (color);
87 public Pen GetDashPen (Color color, DashStyle dashStyle)
89 string hash = color.ToString() + dashStyle;
92 Pen res = dashpens [hash] as Pen;
96 Pen pen = new Pen (color);
97 pen.DashStyle = dashStyle;
98 dashpens [hash] = pen;
103 public Pen GetSizedPen (Color color, int size)
105 string hash = color.ToString () + size;
108 Pen res = sizedpens [hash] as Pen;
112 Pen pen = new Pen (color, size);
113 sizedpens [hash] = pen;
118 public SolidBrush GetSolidBrush (Color color)
120 int hash = color.ToArgb ();
122 lock (solidbrushes) {
123 SolidBrush res = solidbrushes [hash] as SolidBrush;
127 SolidBrush brush = new SolidBrush (color);
128 solidbrushes.Add (hash, brush);
133 public HatchBrush GetHatchBrush (HatchStyle hatchStyle, Color foreColor, Color backColor)
135 string hash = hatchStyle.ToString () + foreColor.ToString () + backColor.ToString ();
137 lock (hatchbrushes) {
138 if (hatchbrushes.Contains (hash))
139 return (HatchBrush) hatchbrushes[hash];
141 HatchBrush brush = new HatchBrush (hatchStyle, foreColor, backColor);
142 hatchbrushes.Add (hash, brush);
147 public void AddUIImage (Image image, string name, int size)
149 string hash = name + size.ToString();
152 if (uiImages.Contains (hash))
154 uiImages.Add (hash, image);
158 public Image GetUIImage(string name, int size)
160 string hash = name + size.ToString();
162 Image image = uiImages [hash] as Image;
167 public CPColor GetCPColor (Color color)
170 object tmp = cpcolors [color];
173 CPColor cpcolor = new CPColor ();
174 cpcolor.Dark = ControlPaint.Dark (color);
175 cpcolor.DarkDark = ControlPaint.DarkDark (color);
176 cpcolor.Light = ControlPaint.Light (color);
177 cpcolor.LightLight = ControlPaint.LightLight (color);
179 cpcolors.Add (color, cpcolor);
189 internal abstract class Theme
191 protected Array syscolors;
192 protected Font default_font;
193 protected Color defaultWindowBackColor;
194 protected Color defaultWindowForeColor;
195 protected bool always_draw_hotkeys = true;
196 internal SystemResPool ResPool = new SystemResPool ();
197 private Type system_colors = Type.GetType("System.Drawing.SystemColors, System.Drawing");
199 private void SetSystemColors(string name, Color value) {
200 if (system_colors != null) {
203 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
204 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
205 if (update != null) {
206 update.Invoke(null, null);
212 /* OS Feature support */
213 public abstract Version Version {
217 /* Default properties */
218 public virtual Color ColorScrollBar {
219 get { return SystemColors.ScrollBar;}
220 set { SetSystemColors("scroll_bar", value); }
223 public virtual Color ColorDesktop {
224 get { return SystemColors.Desktop;}
225 set { SetSystemColors("desktop", value); }
228 public virtual Color ColorActiveCaption {
229 get { return SystemColors.ActiveCaption;}
230 set { SetSystemColors("active_caption", value); }
233 public virtual Color ColorInactiveCaption {
234 get { return SystemColors.InactiveCaption;}
235 set { SetSystemColors("inactive_caption", value); }
238 public virtual Color ColorMenu {
239 get { return SystemColors.Menu;}
240 set { SetSystemColors("menu", value); }
243 public virtual Color ColorWindow {
244 get { return SystemColors.Window;}
245 set { SetSystemColors("window", value); }
248 public virtual Color ColorWindowFrame {
249 get { return SystemColors.WindowFrame;}
250 set { SetSystemColors("window_frame", value); }
253 public virtual Color ColorMenuText {
254 get { return SystemColors.MenuText;}
255 set { SetSystemColors("menu_text", value); }
258 public virtual Color ColorWindowText {
259 get { return SystemColors.WindowText;}
260 set { SetSystemColors("window_text", value); }
263 public virtual Color ColorActiveCaptionText {
264 get { return SystemColors.ActiveCaptionText;}
265 set { SetSystemColors("active_caption_text", value); }
268 public virtual Color ColorActiveBorder {
269 get { return SystemColors.ActiveBorder;}
270 set { SetSystemColors("active_border", value); }
273 public virtual Color ColorInactiveBorder{
274 get { return SystemColors.InactiveBorder;}
275 set { SetSystemColors("inactive_border", value); }
278 public virtual Color ColorAppWorkspace {
279 get { return SystemColors.AppWorkspace;}
280 set { SetSystemColors("app_workspace", value); }
283 public virtual Color ColorHighlight {
284 get { return SystemColors.Highlight;}
285 set { SetSystemColors("highlight", value); }
288 public virtual Color ColorHighlightText {
289 get { return SystemColors.HighlightText;}
290 set { SetSystemColors("highlight_text", value); }
293 public virtual Color ColorControl {
294 get { return SystemColors.Control;}
295 set { SetSystemColors("control", value); }
298 public virtual Color ColorControlDark {
299 get { return SystemColors.ControlDark;}
300 set { SetSystemColors("control_dark", value); }
303 public virtual Color ColorGrayText {
304 get { return SystemColors.GrayText;}
305 set { SetSystemColors("gray_text", value); }
308 public virtual Color ColorControlText {
309 get { return SystemColors.ControlText;}
310 set { SetSystemColors("control_text", value); }
313 public virtual Color ColorInactiveCaptionText {
314 get { return SystemColors.InactiveCaptionText;}
315 set { SetSystemColors("inactive_caption_text", value); }
318 public virtual Color ColorControlLight {
319 get { return SystemColors.ControlLight;}
320 set { SetSystemColors("control_light", value); }
323 public virtual Color ColorControlDarkDark {
324 get { return SystemColors.ControlDarkDark;}
325 set { SetSystemColors("control_dark_dark", value); }
328 public virtual Color ColorControlLightLight {
329 get { return SystemColors.ControlLightLight;}
330 set { SetSystemColors("control_light_light", value); }
333 public virtual Color ColorInfoText {
334 get { return SystemColors.InfoText;}
335 set { SetSystemColors("info_text", value); }
338 public virtual Color ColorInfo {
339 get { return SystemColors.Info;}
340 set { SetSystemColors("info", value); }
343 public virtual Color ColorHotTrack {
344 get { return SystemColors.HotTrack;}
345 set { SetSystemColors("hot_track", value);}
348 public virtual Color DefaultControlBackColor {
349 get { return ColorControl; }
350 set { ColorControl = value; }
353 public virtual Color DefaultControlForeColor {
354 get { return ColorControlText; }
355 set { ColorControlText = value; }
358 public virtual Font DefaultFont {
359 get { return default_font; }
362 public virtual Color DefaultWindowBackColor {
363 get { return defaultWindowBackColor; }
366 public virtual Color DefaultWindowForeColor {
367 get { return defaultWindowForeColor; }
370 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
372 return (Color) syscolors.GetValue ((int)idx);
375 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
377 syscolors.SetValue (color, (int) idx);
380 // Theme/UI specific defaults
381 public virtual ArrangeDirection ArrangeDirection {
383 return ArrangeDirection.Down;
387 public virtual ArrangeStartingPosition ArrangeStartingPosition {
389 return ArrangeStartingPosition.BottomLeft;
393 public virtual Size Border3DSize {
395 return new Size(2, 2);
399 public virtual Size BorderSize {
401 return new Size(1, 1);
405 public virtual Size CaptionButtonSize {
407 return new Size(18, 18);
411 public virtual int CaptionHeight {
413 return XplatUI.CaptionHeight;
417 public virtual Size DoubleClickSize {
419 return new Size(4, 4);
423 public virtual int DoubleClickTime {
429 public virtual Size FixedFrameBorderSize {
431 return new Size(3, 3);
435 public virtual Size FrameBorderSize {
437 return XplatUI.FrameBorderSize;
441 public virtual int HorizontalScrollBarArrowWidth {
447 public virtual int HorizontalScrollBarHeight {
453 public virtual int HorizontalScrollBarThumbWidth {
459 public virtual Size IconSpacingSize {
461 return new Size(75, 75);
465 public virtual Size MenuButtonSize {
467 return new Size(18, 18);
471 public virtual Size MenuCheckSize {
473 return new Size(13, 13);
477 public virtual Font MenuFont {
483 public virtual int MenuHeight {
485 return XplatUI.MenuHeight;
489 public virtual int MouseWheelScrollLines {
495 public virtual bool RightAlignedMenus {
501 public virtual Size ToolWindowCaptionButtonSize {
503 return new Size(15, 15);
507 public virtual int ToolWindowCaptionHeight {
513 public virtual int VerticalScrollBarArrowHeight {
519 public virtual int VerticalScrollBarThumbHeight {
525 public virtual int VerticalScrollBarWidth {
531 public int Clamp (int value, int lower, int upper)
533 if (value < lower) return lower;
534 else if (value > upper) return upper;
538 [MonoTODO("Figure out where to point for My Network Places")]
539 public virtual string Places(UIIcon index) {
541 case UIIcon.PlacesRecentDocuments: {
542 // Default = "Recent Documents"
543 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
546 case UIIcon.PlacesDesktop: {
547 // Default = "Desktop"
548 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
551 case UIIcon.PlacesPersonal: {
552 // Default = "My Documents"
553 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
556 case UIIcon.PlacesMyComputer: {
557 // Default = "My Computer"
558 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
561 case UIIcon.PlacesMyNetwork: {
562 // Default = "My Network Places"
567 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
573 // This routine fetches images embedded as assembly resources (not
574 // resgen resources). It optionally scales the image to fit the
575 // specified size x dimension (it adjusts y automatically to fit that).
577 private Image GetSizedResourceImage(string name, int width)
579 Image image = ResPool.GetUIImage (name, width);
587 fullname = String.Format("{1}_{0}", name, width);
588 image = ResourceImageLoader.Get (fullname);
590 ResPool.AddUIImage (image, name, width);
596 image = ResourceImageLoader.Get (name);
600 ResPool.AddUIImage (image, name, 0);
601 if (image.Width != width && width != 0){
602 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
603 int height = (image.Height * width)/image.Width;
604 Bitmap b = new Bitmap (width, height);
605 Graphics g = Graphics.FromImage (b);
606 g.DrawImage (image, 0, 0, width, height);
607 ResPool.AddUIImage (b, name, width);
614 public virtual Image Images(UIIcon index) {
615 return Images(index, 0);
618 public virtual Image Images(UIIcon index, int size) {
620 case UIIcon.PlacesRecentDocuments:
621 return GetSizedResourceImage ("document-open.png", size);
622 case UIIcon.PlacesDesktop:
623 return GetSizedResourceImage ("user-desktop.png", size);
624 case UIIcon.PlacesPersonal:
625 return GetSizedResourceImage ("user-home.png", size);
626 case UIIcon.PlacesMyComputer:
627 return GetSizedResourceImage ("computer.png", size);
628 case UIIcon.PlacesMyNetwork:
629 return GetSizedResourceImage ("folder-remote.png", size);
631 // Icons for message boxes
632 case UIIcon.MessageBoxError:
633 return GetSizedResourceImage ("dialog-error.png", size);
634 case UIIcon.MessageBoxInfo:
635 return GetSizedResourceImage ("dialog-information.png", size);
636 case UIIcon.MessageBoxQuestion:
637 return GetSizedResourceImage ("dialog-question.png", size);
638 case UIIcon.MessageBoxWarning:
639 return GetSizedResourceImage ("dialog-warning.png", size);
642 case UIIcon.NormalFolder:
643 return GetSizedResourceImage ("folder.png", size);
646 throw new ArgumentException("Invalid Icon type requested", "index");
651 public virtual Image Images(string mimetype, string extension, int size) {
655 #region Principal Theme Methods
656 // 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)
657 public abstract void ResetDefaults();
659 // If the theme writes directly to a window instead of a device context
660 public abstract bool DoubleBufferingSupported {get;}
661 #endregion // Principal Theme Methods
663 #region OwnerDraw Support
664 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
665 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
666 #endregion // OwnerDraw Support
673 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
676 public abstract Size ButtonBaseDefaultSize{get;}
677 #endregion // ButtonBase
680 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
681 #endregion // CheckBox
683 #region CheckedListBox
685 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
686 #endregion // CheckedListBox
690 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
691 #endregion // ComboBox
694 #endregion // Control
697 public abstract int DataGridPreferredColumnWidth { get; }
698 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
699 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
702 public abstract Color DataGridAlternatingBackColor { get; }
703 public abstract Color DataGridBackColor { get; }
704 public abstract Color DataGridBackgroundColor { get; }
705 public abstract Color DataGridCaptionBackColor { get; }
706 public abstract Color DataGridCaptionForeColor { get; }
707 public abstract Color DataGridGridLineColor { get; }
708 public abstract Color DataGridHeaderBackColor { get; }
709 public abstract Color DataGridHeaderForeColor { get; }
710 public abstract Color DataGridLinkColor { get; }
711 public abstract Color DataGridLinkHoverColor { get; }
712 public abstract Color DataGridParentRowsBackColor { get; }
713 public abstract Color DataGridParentRowsForeColor { get; }
714 public abstract Color DataGridSelectionBackColor { get; }
715 public abstract Color DataGridSelectionForeColor { get; }
717 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
718 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
719 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
720 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
721 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
722 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
723 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
724 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
725 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
726 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
727 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
729 #endregion // Datagrid
731 #region DateTimePicker
733 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
735 #endregion // DateTimePicker
739 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
742 public abstract Size GroupBoxDefaultSize{get;}
743 #endregion // GroupBox
746 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
747 #endregion // HScrollBar
751 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
754 public abstract Size LabelDefaultSize{get;}
758 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
759 #endregion // LinkLabel
763 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
764 #endregion // ListBox
768 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
769 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
770 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
773 public abstract Size ListViewCheckBoxSize { get; }
774 public abstract int ListViewColumnHeaderHeight { get; }
775 public abstract int ListViewDefaultColumnWidth { get; }
776 public abstract int ListViewVerticalSpacing { get; }
777 public abstract int ListViewEmptyColumnWidth { get; }
778 public abstract int ListViewHorizontalSpacing { get; }
779 public abstract Size ListViewDefaultSize { get; }
780 #endregion // ListView
783 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
784 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
785 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
786 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
787 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
788 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
791 #region MonthCalendar
792 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
793 #endregion // MonthCalendar
797 public abstract Size PanelDefaultSize{get;}
802 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
805 public abstract Size PictureBoxDefaultSize{get;}
806 #endregion // PictureBox
808 #region PrintPreviewControl
809 public abstract int PrintPreviewControlPadding{get;}
810 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
811 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
812 #endregion // PrintPreviewControl
816 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
819 public abstract Size ProgressBarDefaultSize{get;}
820 #endregion // ProgressBar
824 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
827 public abstract Size RadioButtonDefaultSize{get;}
828 #endregion // RadioButton
832 //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);
833 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
836 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
837 #endregion // ScrollBar
841 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
844 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
845 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
846 public abstract Size StatusBarDefaultSize{get;}
847 #endregion // StatusBar
850 public abstract Size TabControlDefaultItemSize { get; }
851 public abstract Point TabControlDefaultPadding { get; }
852 public abstract int TabControlMinimumTabWidth { get; }
854 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
855 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
856 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
857 public abstract Size TabControlGetSpacing (TabControl tab);
858 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
863 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
866 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
867 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
868 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
869 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
870 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
871 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
872 public abstract Size ToolBarDefaultSize{get;}
873 public abstract bool ToolBarInvalidateEntireButton { get; }
874 #endregion // ToolBar
877 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
878 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
879 #endregion // ToolTip
884 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
887 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
888 #endregion // TrackBar
891 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
892 #endregion // VScrollBar
895 public abstract Size TreeViewDefaultSize { get; }
898 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
900 // Just making virtual for now so all the themes still build.
903 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
905 // Just making virtual for now so all the themes still build.
909 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
911 // Just making virtual for now so all the themes still build.
915 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
917 // Just making virtual for now so all the themes still build.
918 return ManagedWindowTitleBarHeight (wm) - 5;
921 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
923 // Just making virtual for now so all the themes still build.
924 return new Size (10, 10);
927 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
929 // Just making virtual for now so all the themes still build.
932 #region ControlPaint Methods
933 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
934 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
935 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
936 int bottomWidth, ButtonBorderStyle bottomStyle);
938 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
939 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
940 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
941 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
942 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
943 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
944 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
945 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
946 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
947 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
948 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
949 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
950 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
951 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
952 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
953 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
954 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
956 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
957 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
958 StringFormat format);
959 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
960 #endregion // ControlPaint Methods