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 = ((int)hatchStyle).ToString () + foreColor.ToString () + backColor.ToString ();
136 lock (hatchbrushes) {
137 HatchBrush brush = (HatchBrush) hatchbrushes[hash];
139 brush = new HatchBrush (hatchStyle, foreColor, backColor);
140 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 MethodInfo update;
201 default_font = SystemFonts.DefaultFont;
203 default_font = new Font (FontFamily.GenericSansSerif, 8.25f);
207 private void SetSystemColors (KnownColor kc, Color value)
209 if (update == null) {
210 Type known_colors = Type.GetType ("System.Drawing.KnownColors, " + Consts.AssemblySystem_Drawing);
211 if (known_colors != null)
212 update = known_colors.GetMethod ("Update", BindingFlags.Static | BindingFlags.Public);
215 update.Invoke (null, new object [2] { (int)kc, value.ToArgb () });
218 /* OS Feature support */
219 public abstract Version Version {
223 /* Default properties */
224 public virtual Color ColorScrollBar {
225 get { return SystemColors.ScrollBar; }
226 set { SetSystemColors (KnownColor.ScrollBar, value); }
229 public virtual Color ColorDesktop {
230 get { return SystemColors.Desktop;}
231 set { SetSystemColors (KnownColor.Desktop, value); }
234 public virtual Color ColorActiveCaption {
235 get { return SystemColors.ActiveCaption;}
236 set { SetSystemColors (KnownColor.ActiveCaption, value); }
239 public virtual Color ColorInactiveCaption {
240 get { return SystemColors.InactiveCaption;}
241 set { SetSystemColors (KnownColor.InactiveCaption, value); }
244 public virtual Color ColorMenu {
245 get { return SystemColors.Menu;}
246 set { SetSystemColors (KnownColor.Menu, value); }
249 public virtual Color ColorWindow {
250 get { return SystemColors.Window;}
251 set { SetSystemColors (KnownColor.Window, value); }
254 public virtual Color ColorWindowFrame {
255 get { return SystemColors.WindowFrame;}
256 set { SetSystemColors (KnownColor.WindowFrame, value); }
259 public virtual Color ColorMenuText {
260 get { return SystemColors.MenuText;}
261 set { SetSystemColors (KnownColor.MenuText, value); }
264 public virtual Color ColorWindowText {
265 get { return SystemColors.WindowText;}
266 set { SetSystemColors (KnownColor.WindowText, value); }
269 public virtual Color ColorActiveCaptionText {
270 get { return SystemColors.ActiveCaptionText;}
271 set { SetSystemColors (KnownColor.ActiveCaptionText, value); }
274 public virtual Color ColorActiveBorder {
275 get { return SystemColors.ActiveBorder;}
276 set { SetSystemColors (KnownColor.ActiveBorder, value); }
279 public virtual Color ColorInactiveBorder{
280 get { return SystemColors.InactiveBorder;}
281 set { SetSystemColors (KnownColor.InactiveBorder, value); }
284 public virtual Color ColorAppWorkspace {
285 get { return SystemColors.AppWorkspace;}
286 set { SetSystemColors (KnownColor.AppWorkspace, value); }
289 public virtual Color ColorHighlight {
290 get { return SystemColors.Highlight;}
291 set { SetSystemColors (KnownColor.Highlight, value); }
294 public virtual Color ColorHighlightText {
295 get { return SystemColors.HighlightText;}
296 set { SetSystemColors (KnownColor.HighlightText, value); }
299 public virtual Color ColorControl {
300 get { return SystemColors.Control;}
301 set { SetSystemColors (KnownColor.Control, value); }
304 public virtual Color ColorControlDark {
305 get { return SystemColors.ControlDark;}
306 set { SetSystemColors (KnownColor.ControlDark, value); }
309 public virtual Color ColorGrayText {
310 get { return SystemColors.GrayText;}
311 set { SetSystemColors (KnownColor.GrayText, value); }
314 public virtual Color ColorControlText {
315 get { return SystemColors.ControlText;}
316 set { SetSystemColors (KnownColor.ControlText, value); }
319 public virtual Color ColorInactiveCaptionText {
320 get { return SystemColors.InactiveCaptionText;}
321 set { SetSystemColors (KnownColor.InactiveCaptionText, value); }
324 public virtual Color ColorControlLight {
325 get { return SystemColors.ControlLight;}
326 set { SetSystemColors (KnownColor.ControlLight, value); }
329 public virtual Color ColorControlDarkDark {
330 get { return SystemColors.ControlDarkDark;}
331 set { SetSystemColors (KnownColor.ControlDarkDark, value); }
334 public virtual Color ColorControlLightLight {
335 get { return SystemColors.ControlLightLight;}
336 set { SetSystemColors (KnownColor.ControlLightLight, value); }
339 public virtual Color ColorInfoText {
340 get { return SystemColors.InfoText;}
341 set { SetSystemColors (KnownColor.InfoText, value); }
344 public virtual Color ColorInfo {
345 get { return SystemColors.Info;}
346 set { SetSystemColors (KnownColor.Info, value); }
349 public virtual Color ColorHotTrack {
350 get { return SystemColors.HotTrack;}
351 set { SetSystemColors (KnownColor.HotTrack, value);}
354 public virtual Color DefaultControlBackColor {
355 get { return ColorControl; }
356 set { ColorControl = value; }
359 public virtual Color DefaultControlForeColor {
360 get { return ColorControlText; }
361 set { ColorControlText = value; }
364 public virtual Font DefaultFont {
365 get { return default_font; }
368 public virtual Color DefaultWindowBackColor {
369 get { return defaultWindowBackColor; }
372 public virtual Color DefaultWindowForeColor {
373 get { return defaultWindowForeColor; }
376 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
378 return (Color) syscolors.GetValue ((int)idx);
381 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
383 syscolors.SetValue (color, (int) idx);
386 // Theme/UI specific defaults
387 public virtual ArrangeDirection ArrangeDirection {
389 return ArrangeDirection.Down;
393 public virtual ArrangeStartingPosition ArrangeStartingPosition {
395 return ArrangeStartingPosition.BottomLeft;
399 public virtual Size BorderSizableSize {
401 return new Size (3, 3);
405 public virtual Size Border3DSize {
407 return XplatUI.Border3DSize;
411 public virtual Size BorderStaticSize {
413 return new Size(1, 1);
417 public virtual Size BorderSize {
419 return XplatUI.BorderSize;
423 public virtual Size CaptionButtonSize {
425 return XplatUI.CaptionButtonSize;
429 public virtual int CaptionHeight {
431 return XplatUI.CaptionHeight;
435 public virtual Size DoubleClickSize {
437 return new Size(4, 4);
441 public virtual int DoubleClickTime {
447 public virtual Size FixedFrameBorderSize {
449 return XplatUI.FixedFrameBorderSize;
453 public virtual Size FrameBorderSize {
455 return XplatUI.FrameBorderSize;
459 public virtual int HorizontalScrollBarArrowWidth {
465 public virtual int HorizontalScrollBarHeight {
471 public virtual int HorizontalScrollBarThumbWidth {
477 public virtual Size IconSpacingSize {
479 return new Size(75, 75);
483 public virtual bool MenuAccessKeysUnderlined {
485 return XplatUI.MenuAccessKeysUnderlined;
489 public virtual Size MenuButtonSize {
491 return new Size(18, 18);
495 public virtual Size MenuCheckSize {
497 return new Size(13, 13);
501 public virtual Font MenuFont {
507 public virtual int MenuHeight {
509 return XplatUI.MenuHeight;
513 public virtual int MouseWheelScrollLines {
519 public virtual bool RightAlignedMenus {
525 public virtual Size ToolWindowCaptionButtonSize {
527 return new Size(15, 15);
531 public virtual int ToolWindowCaptionHeight {
537 public virtual int VerticalScrollBarArrowHeight {
543 public virtual int VerticalScrollBarThumbHeight {
549 public virtual int VerticalScrollBarWidth {
555 public virtual Font WindowBorderFont {
557 return window_border_font;
561 public int Clamp (int value, int lower, int upper)
563 if (value < lower) return lower;
564 else if (value > upper) return upper;
568 [MonoTODO("Figure out where to point for My Network Places")]
569 public virtual string Places(UIIcon index) {
571 case UIIcon.PlacesRecentDocuments: {
572 // Default = "Recent Documents"
573 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
576 case UIIcon.PlacesDesktop: {
577 // Default = "Desktop"
578 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
581 case UIIcon.PlacesPersonal: {
582 // Default = "My Documents"
583 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
586 case UIIcon.PlacesMyComputer: {
587 // Default = "My Computer"
588 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
591 case UIIcon.PlacesMyNetwork: {
592 // Default = "My Network Places"
597 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
603 // This routine fetches images embedded as assembly resources (not
604 // resgen resources). It optionally scales the image to fit the
605 // specified size x dimension (it adjusts y automatically to fit that).
607 private Image GetSizedResourceImage(string name, int width)
609 Image image = ResPool.GetUIImage (name, width);
617 fullname = String.Format("{1}_{0}", name, width);
618 image = ResourceImageLoader.Get (fullname);
620 ResPool.AddUIImage (image, name, width);
626 image = ResourceImageLoader.Get (name);
630 ResPool.AddUIImage (image, name, 0);
631 if (image.Width != width && width != 0){
632 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
633 int height = (image.Height * width)/image.Width;
634 Bitmap b = new Bitmap (width, height);
635 Graphics g = Graphics.FromImage (b);
636 g.DrawImage (image, 0, 0, width, height);
637 ResPool.AddUIImage (b, name, width);
644 public virtual Image Images(UIIcon index) {
645 return Images(index, 0);
648 public virtual Image Images(UIIcon index, int size) {
650 case UIIcon.PlacesRecentDocuments:
651 return GetSizedResourceImage ("document-open.png", size);
652 case UIIcon.PlacesDesktop:
653 return GetSizedResourceImage ("user-desktop.png", size);
654 case UIIcon.PlacesPersonal:
655 return GetSizedResourceImage ("user-home.png", size);
656 case UIIcon.PlacesMyComputer:
657 return GetSizedResourceImage ("computer.png", size);
658 case UIIcon.PlacesMyNetwork:
659 return GetSizedResourceImage ("folder-remote.png", size);
661 // Icons for message boxes
662 case UIIcon.MessageBoxError:
663 return GetSizedResourceImage ("dialog-error.png", size);
664 case UIIcon.MessageBoxInfo:
665 return GetSizedResourceImage ("dialog-information.png", size);
666 case UIIcon.MessageBoxQuestion:
667 return GetSizedResourceImage ("dialog-question.png", size);
668 case UIIcon.MessageBoxWarning:
669 return GetSizedResourceImage ("dialog-warning.png", size);
672 case UIIcon.NormalFolder:
673 return GetSizedResourceImage ("folder.png", size);
676 throw new ArgumentException("Invalid Icon type requested", "index");
681 public virtual Image Images(string mimetype, string extension, int size) {
685 #region Principal Theme Methods
686 // 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)
687 public abstract void ResetDefaults();
689 // If the theme writes directly to a window instead of a device context
690 public abstract bool DoubleBufferingSupported {get;}
691 #endregion // Principal Theme Methods
693 #region OwnerDraw Support
694 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
695 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
696 #endregion // OwnerDraw Support
699 public abstract void CalculateButtonTextAndImageLayout (Button b, out Rectangle textRectangle, out Rectangle imageRectangle);
700 public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
701 public abstract void DrawFlatButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
702 public abstract void DrawPopupButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
707 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
710 public abstract Size ButtonBaseDefaultSize{get;}
711 #endregion // ButtonBase
714 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
715 #endregion // CheckBox
717 #region CheckedListBox
719 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
720 #endregion // CheckedListBox
724 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
725 public abstract void DrawFlatStyleComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
726 #endregion // ComboBox
729 public abstract Font GetLinkFont (Control control);
730 #endregion // Control
733 public abstract int DataGridPreferredColumnWidth { get; }
734 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
735 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
738 public abstract Color DataGridAlternatingBackColor { get; }
739 public abstract Color DataGridBackColor { get; }
740 public abstract Color DataGridBackgroundColor { get; }
741 public abstract Color DataGridCaptionBackColor { get; }
742 public abstract Color DataGridCaptionForeColor { get; }
743 public abstract Color DataGridGridLineColor { get; }
744 public abstract Color DataGridHeaderBackColor { get; }
745 public abstract Color DataGridHeaderForeColor { get; }
746 public abstract Color DataGridLinkColor { get; }
747 public abstract Color DataGridLinkHoverColor { get; }
748 public abstract Color DataGridParentRowsBackColor { get; }
749 public abstract Color DataGridParentRowsForeColor { get; }
750 public abstract Color DataGridSelectionBackColor { get; }
751 public abstract Color DataGridSelectionForeColor { get; }
753 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
754 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
755 public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
756 public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
757 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
758 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
759 public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
760 public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
761 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
762 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
763 public abstract void DataGridPaintRelationRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
765 #endregion // Datagrid
767 #region DateTimePicker
769 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
771 #endregion // DateTimePicker
775 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
778 public abstract Size GroupBoxDefaultSize{get;}
779 #endregion // GroupBox
782 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
783 #endregion // HScrollBar
787 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
790 public abstract Size LabelDefaultSize{get;}
794 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
795 #endregion // LinkLabel
799 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
800 #endregion // ListBox
804 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
805 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
806 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
809 public abstract Size ListViewCheckBoxSize { get; }
810 public abstract int ListViewColumnHeaderHeight { get; }
811 public abstract int ListViewDefaultColumnWidth { get; }
812 public abstract int ListViewVerticalSpacing { get; }
813 public abstract int ListViewEmptyColumnWidth { get; }
814 public abstract int ListViewHorizontalSpacing { get; }
815 public abstract Size ListViewDefaultSize { get; }
816 public abstract int ListViewGroupHeight { get; }
817 public abstract int ListViewTileWidthFactor { get; }
818 public abstract int ListViewTileHeightFactor { get; }
819 #endregion // ListView
822 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
823 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
824 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
825 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
826 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
827 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
830 #region MonthCalendar
831 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
832 #endregion // MonthCalendar
836 public abstract Size PanelDefaultSize{get;}
841 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
844 public abstract Size PictureBoxDefaultSize{get;}
845 #endregion // PictureBox
847 #region PrintPreviewControl
848 public abstract int PrintPreviewControlPadding{get;}
849 public abstract Size PrintPreviewControlGetPageSize (PrintPreviewControl preview);
850 public abstract void PrintPreviewControlPaint (PaintEventArgs pe, PrintPreviewControl preview, Size page_image_size);
851 #endregion // PrintPreviewControl
855 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
858 public abstract Size ProgressBarDefaultSize{get;}
859 #endregion // ProgressBar
863 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
866 public abstract Size RadioButtonDefaultSize{get;}
867 #endregion // RadioButton
871 //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);
872 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
875 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
876 #endregion // ScrollBar
880 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
883 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
884 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
885 public abstract Size StatusBarDefaultSize{get;}
886 #endregion // StatusBar
889 public abstract Size TabControlDefaultItemSize {get; }
890 public abstract Point TabControlDefaultPadding {get; }
891 public abstract int TabControlMinimumTabWidth {get; }
892 public abstract Rectangle TabControlSelectedDelta { get; }
893 public abstract int TabControlSelectedSpacing { get; }
894 public abstract int TabPanelOffsetX { get; }
895 public abstract int TabPanelOffsetY { get; }
896 public abstract int TabControlColSpacing { get; }
897 public abstract Point TabControlImagePadding { get; }
898 public abstract int TabControlScrollerWidth { get; }
900 public abstract Rectangle TabControlGetLeftScrollRect (TabControl tab);
901 public abstract Rectangle TabControlGetRightScrollRect (TabControl tab);
902 public abstract Rectangle TabControlGetDisplayRectangle (TabControl tab);
903 public abstract Rectangle TabControlGetPanelRect (TabControl tab);
904 public abstract Size TabControlGetSpacing (TabControl tab);
905 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
910 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
913 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
914 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
915 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
916 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
917 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
918 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
919 public abstract Size ToolBarDefaultSize{get;}
920 #endregion // ToolBar
923 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
924 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
925 #endregion // ToolTip
927 #region BalloonWindow
929 public abstract void ShowBalloonWindow (IntPtr handle, int timeout, string title, string text, ToolTipIcon icon);
930 public abstract void DrawBalloonWindow (Graphics dc, Rectangle clip, NotifyIcon.BalloonWindow control);
931 public abstract Rectangle BalloonWindowRect (NotifyIcon.BalloonWindow control);
933 #endregion // BalloonWindow
937 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
940 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
942 public abstract int TrackBarValueFromMousePosition (int x, int y, TrackBar tb);
943 #endregion // TrackBar
946 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
947 #endregion // VScrollBar
950 public abstract Size TreeViewDefaultSize { get; }
953 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
955 // Just making virtual for now so all the themes still build.
958 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
960 // Just making virtual for now so all the themes still build.
964 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
966 // Just making virtual for now so all the themes still build.
970 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
972 // Just making virtual for now so all the themes still build.
973 return ManagedWindowTitleBarHeight (wm) - 5;
976 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
978 // Just making virtual for now so all the themes still build.
979 return new Size (10, 10);
982 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
984 // Just making virtual for now so all the themes still build.
987 #region ControlPaint Methods
988 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
989 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
990 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
991 int bottomWidth, ButtonBorderStyle bottomStyle);
993 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
994 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides, Color control_color);
995 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
996 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
997 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
998 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
999 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
1000 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
1001 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
1002 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
1003 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
1004 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
1005 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
1006 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
1007 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
1008 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
1009 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
1010 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
1012 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
1013 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
1014 StringFormat format);
1015 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
1016 #endregion // ControlPaint Methods