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 ();
76 Pen res = pens [hash] as Pen;
80 Pen pen = new Pen (color);
85 public Pen GetDashPen (Color color, DashStyle dashStyle)
87 string hash = color.ToString() + dashStyle;
89 Pen res = dashpens [hash] as Pen;
93 Pen pen = new Pen (color);
94 pen.DashStyle = dashStyle;
95 dashpens [hash] = pen;
99 public Pen GetSizedPen (Color color, int size)
101 string hash = color.ToString () + size;
103 Pen res = sizedpens [hash] as Pen;
107 Pen pen = new Pen (color, size);
108 sizedpens [hash] = pen;
112 public SolidBrush GetSolidBrush (Color color)
114 int hash = color.ToArgb ();
116 SolidBrush res = solidbrushes [hash] as SolidBrush;
120 SolidBrush brush = new SolidBrush (color);
121 solidbrushes.Add (hash, brush);
125 public HatchBrush GetHatchBrush (HatchStyle hatchStyle, Color foreColor, Color backColor)
127 string hash = hatchStyle.ToString () + foreColor.ToString () + backColor.ToString ();
129 if (hatchbrushes.Contains (hash))
130 return (HatchBrush) hatchbrushes[hash];
132 HatchBrush brush = new HatchBrush (hatchStyle, foreColor, backColor);
133 hatchbrushes.Add (hash, brush);
137 public void AddUIImage (Image image, string name, int size)
139 string hash = name + size.ToString();
141 if (uiImages.Contains (hash))
143 uiImages.Add (hash, image);
146 public Image GetUIImage(string name, int size)
148 string hash = name + size.ToString();
150 Image image = uiImages [hash] as Image;
155 public CPColor GetCPColor (Color color)
157 object tmp = cpcolors [color];
160 CPColor cpcolor = new CPColor ();
161 cpcolor.Dark = ControlPaint.Dark (color);
162 cpcolor.DarkDark = ControlPaint.DarkDark (color);
163 cpcolor.Light = ControlPaint.Light (color);
164 cpcolor.LightLight = ControlPaint.LightLight (color);
166 cpcolors.Add (color, cpcolor);
175 internal abstract class Theme
177 protected Array syscolors;
178 protected Font default_font;
179 protected Color defaultWindowBackColor;
180 protected Color defaultWindowForeColor;
181 protected bool always_draw_hotkeys = true;
182 internal SystemResPool ResPool = new SystemResPool ();
183 private Type system_colors = Type.GetType("System.Drawing.SystemColors, System.Drawing");
185 private void SetSystemColors(string name, Color value) {
186 if (system_colors != null) {
189 system_colors.GetField(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, value);
190 update = system_colors.GetMethod("UpdateColors", BindingFlags.Static | BindingFlags.NonPublic);
191 if (update != null) {
192 update.Invoke(null, null);
198 /* OS Feature support */
199 public abstract Version Version {
203 /* Default properties */
204 public virtual Color ColorScrollBar {
205 get { return SystemColors.ScrollBar;}
206 set { SetSystemColors("scroll_bar", value); }
209 public virtual Color ColorDesktop {
210 get { return SystemColors.Desktop;}
211 set { SetSystemColors("desktop", value); }
214 public virtual Color ColorActiveCaption {
215 get { return SystemColors.ActiveCaption;}
216 set { SetSystemColors("active_caption", value); }
219 public virtual Color ColorInactiveCaption {
220 get { return SystemColors.InactiveCaption;}
221 set { SetSystemColors("inactive_caption", value); }
224 public virtual Color ColorMenu {
225 get { return SystemColors.Menu;}
226 set { SetSystemColors("menu", value); }
229 public virtual Color ColorWindow {
230 get { return SystemColors.Window;}
231 set { SetSystemColors("window", value); }
234 public virtual Color ColorWindowFrame {
235 get { return SystemColors.WindowFrame;}
236 set { SetSystemColors("window_frame", value); }
239 public virtual Color ColorMenuText {
240 get { return SystemColors.MenuText;}
241 set { SetSystemColors("menu_text", value); }
244 public virtual Color ColorWindowText {
245 get { return SystemColors.WindowText;}
246 set { SetSystemColors("window_text", value); }
249 public virtual Color ColorActiveCaptionText {
250 get { return SystemColors.ActiveCaptionText;}
251 set { SetSystemColors("active_caption_text", value); }
254 public virtual Color ColorActiveBorder {
255 get { return SystemColors.ActiveBorder;}
256 set { SetSystemColors("active_border", value); }
259 public virtual Color ColorInactiveBorder{
260 get { return SystemColors.InactiveBorder;}
261 set { SetSystemColors("inactive_border", value); }
264 public virtual Color ColorAppWorkspace {
265 get { return SystemColors.AppWorkspace;}
266 set { SetSystemColors("app_workspace", value); }
269 public virtual Color ColorHighlight {
270 get { return SystemColors.Highlight;}
271 set { SetSystemColors("highlight", value); }
274 public virtual Color ColorHighlightText {
275 get { return SystemColors.HighlightText;}
276 set { SetSystemColors("highlight_text", value); }
279 public virtual Color ColorControl {
280 get { return SystemColors.Control;}
281 set { SetSystemColors("control", value); }
284 public virtual Color ColorControlDark {
285 get { return SystemColors.ControlDark;}
286 set { SetSystemColors("control_dark", value); }
289 public virtual Color ColorGrayText {
290 get { return SystemColors.GrayText;}
291 set { SetSystemColors("gray_text", value); }
294 public virtual Color ColorControlText {
295 get { return SystemColors.ControlText;}
296 set { SetSystemColors("control_text", value); }
299 public virtual Color ColorInactiveCaptionText {
300 get { return SystemColors.InactiveCaptionText;}
301 set { SetSystemColors("inactive_caption_text", value); }
304 public virtual Color ColorControlLight {
305 get { return SystemColors.ControlLight;}
306 set { SetSystemColors("control_light", value); }
309 public virtual Color ColorControlDarkDark {
310 get { return SystemColors.ControlDarkDark;}
311 set { SetSystemColors("control_dark_dark", value); }
314 public virtual Color ColorControlLightLight {
315 get { return SystemColors.ControlLightLight;}
316 set { SetSystemColors("control_light_light", value); }
319 public virtual Color ColorInfoText {
320 get { return SystemColors.InfoText;}
321 set { SetSystemColors("info_text", value); }
324 public virtual Color ColorInfo {
325 get { return SystemColors.Info;}
326 set { SetSystemColors("info", value); }
329 public virtual Color ColorHotTrack {
330 get { return SystemColors.HotTrack;}
331 set { SetSystemColors("hot_track", value);}
334 public virtual Color DefaultControlBackColor {
335 get { return ColorControl; }
336 set { ColorControl = value; }
339 public virtual Color DefaultControlForeColor {
340 get { return ColorControlText; }
341 set { ColorControlText = value; }
344 public virtual Font DefaultFont {
345 get { return default_font; }
348 public virtual Color DefaultWindowBackColor {
349 get { return defaultWindowBackColor; }
352 public virtual Color DefaultWindowForeColor {
353 get { return defaultWindowForeColor; }
356 public virtual Color GetColor (XplatUIWin32.GetSysColorIndex idx)
358 return (Color) syscolors.GetValue ((int)idx);
361 public virtual void SetColor (XplatUIWin32.GetSysColorIndex idx, Color color)
363 syscolors.SetValue (color, (int) idx);
366 // Theme/UI specific defaults
367 public virtual ArrangeDirection ArrangeDirection {
369 return ArrangeDirection.Down;
373 public virtual ArrangeStartingPosition ArrangeStartingPosition {
375 return ArrangeStartingPosition.BottomLeft;
379 public virtual Size Border3DSize {
381 return new Size(2, 2);
385 public virtual Size BorderSize {
387 return new Size(1, 1);
391 public virtual Size CaptionButtonSize {
393 return new Size(18, 18);
397 public virtual int CaptionHeight {
399 return XplatUI.CaptionHeight;
403 public virtual Size DoubleClickSize {
405 return new Size(4, 4);
409 public virtual int DoubleClickTime {
415 public virtual Size FixedFrameBorderSize {
417 return new Size(3, 3);
421 public virtual Size FrameBorderSize {
423 return XplatUI.FrameBorderSize;
427 public virtual int HorizontalScrollBarArrowWidth {
433 public virtual int HorizontalScrollBarHeight {
439 public virtual int HorizontalScrollBarThumbWidth {
445 public virtual Size IconSpacingSize {
447 return new Size(75, 75);
451 public virtual Size MenuButtonSize {
453 return new Size(18, 18);
457 public virtual Size MenuCheckSize {
459 return new Size(13, 13);
463 public virtual Font MenuFont {
469 public virtual int MenuHeight {
471 return XplatUI.MenuHeight;
475 public virtual int MouseWheelScrollLines {
481 public virtual bool RightAlignedMenus {
487 public virtual Size ToolWindowCaptionButtonSize {
489 return new Size(15, 15);
493 public virtual int ToolWindowCaptionHeight {
499 public virtual int VerticalScrollBarArrowHeight {
505 public virtual int VerticalScrollBarThumbHeight {
511 public virtual int VerticalScrollBarWidth {
517 [MonoTODO("Figure out where to point for My Network Places")]
518 public virtual string Places(UIIcon index) {
520 case UIIcon.PlacesRecentDocuments: {
521 // Default = "Recent Documents"
522 return Environment.GetFolderPath(Environment.SpecialFolder.Recent);
525 case UIIcon.PlacesDesktop: {
526 // Default = "Desktop"
527 return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
530 case UIIcon.PlacesPersonal: {
531 // Default = "My Documents"
532 return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
535 case UIIcon.PlacesMyComputer: {
536 // Default = "My Computer"
537 return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);
540 case UIIcon.PlacesMyNetwork: {
541 // Default = "My Network Places"
546 throw new ArgumentOutOfRangeException("index", index, "Unsupported place");
552 // This routine fetches images embedded as assembly resources (not
553 // resgen resources). It optionally scales the image to fit the
554 // specified size x dimension (it adjusts y automatically to fit that).
556 private Image GetSizedResourceImage(string name, int width)
558 Image image = ResPool.GetUIImage (name, width);
566 fullname = String.Format("{1}_{0}", name, width);
567 image = ResourceImageLoader.Get (fullname);
569 ResPool.AddUIImage (image, name, width);
575 image = ResourceImageLoader.Get (name);
579 ResPool.AddUIImage (image, name, 0);
580 if (image.Width != width && width != 0){
581 Console.Error.WriteLine ("warning: requesting icon that not been tuned {0}_{1} {2}", width, name, image.Width);
582 int height = (image.Height * width)/image.Width;
583 Bitmap b = new Bitmap (width, height);
584 Graphics g = Graphics.FromImage (b);
585 g.DrawImage (image, 0, 0, width, height);
586 ResPool.AddUIImage (b, name, width);
593 public virtual Image Images(UIIcon index) {
594 return Images(index, 0);
597 public virtual Image Images(UIIcon index, int size) {
599 case UIIcon.PlacesRecentDocuments:
600 return GetSizedResourceImage ("document-open.png", size);
601 case UIIcon.PlacesDesktop:
602 return GetSizedResourceImage ("user-desktop.png", size);
603 case UIIcon.PlacesPersonal:
604 return GetSizedResourceImage ("document-open.png", size);
605 case UIIcon.PlacesMyComputer:
606 return GetSizedResourceImage ("computer.png", size);
607 case UIIcon.PlacesMyNetwork:
608 return GetSizedResourceImage ("folder-remote.png", size);
610 // Icons for message boxes
611 case UIIcon.MessageBoxError:
612 return GetSizedResourceImage ("dialog-error.png", size);
613 case UIIcon.MessageBoxInfo:
614 return GetSizedResourceImage ("dialog-information.png", size);
615 case UIIcon.MessageBoxQuestion:
616 return GetSizedResourceImage ("dialog-question.png", size);
617 case UIIcon.MessageBoxWarning:
618 return GetSizedResourceImage ("dialog-warning.png", size);
621 case UIIcon.NormalFolder:
622 return GetSizedResourceImage ("folder.png", size);
625 throw new ArgumentException("Invalid Icon type requested", "index");
630 public virtual Image Images(string mimetype, string extension, int size) {
634 #region Principal Theme Methods
635 // 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)
636 public abstract void ResetDefaults();
638 // If the theme writes directly to a window instead of a device context
639 public abstract bool DoubleBufferingSupported {get;}
640 #endregion // Principal Theme Methods
642 #region OwnerDraw Support
643 public abstract void DrawOwnerDrawBackground (DrawItemEventArgs e);
644 public abstract void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
645 #endregion // OwnerDraw Support
652 public abstract void DrawButtonBase(Graphics dc, Rectangle clip_area, ButtonBase button);
655 public abstract Size ButtonBaseDefaultSize{get;}
656 #endregion // ButtonBase
659 public abstract void DrawCheckBox(Graphics dc, Rectangle clip_area, CheckBox checkbox);
660 #endregion // CheckBox
662 #region CheckedListBox
664 public abstract void DrawCheckedListBoxItem (CheckedListBox ctrl, DrawItemEventArgs e);
665 #endregion // CheckedListBox
669 public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
670 #endregion // ComboBox
673 #endregion // Control
676 public abstract int DataGridPreferredColumnWidth { get; }
677 public abstract int DataGridMinimumColumnCheckBoxHeight { get; }
678 public abstract int DataGridMinimumColumnCheckBoxWidth { get; }
681 public abstract Color DataGridAlternatingBackColor { get; }
682 public abstract Color DataGridBackColor { get; }
683 public abstract Color DataGridBackgroundColor { get; }
684 public abstract Color DataGridCaptionBackColor { get; }
685 public abstract Color DataGridCaptionForeColor { get; }
686 public abstract Color DataGridGridLineColor { get; }
687 public abstract Color DataGridHeaderBackColor { get; }
688 public abstract Color DataGridHeaderForeColor { get; }
689 public abstract Color DataGridLinkColor { get; }
690 public abstract Color DataGridLinkHoverColor { get; }
691 public abstract Color DataGridParentRowsBackColor { get; }
692 public abstract Color DataGridParentRowsForeColor { get; }
693 public abstract Color DataGridSelectionBackColor { get; }
694 public abstract Color DataGridSelectionForeColor { get; }
696 public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
697 public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
698 public abstract void DataGridPaintColumnsHdrs (Graphics g, Rectangle clip, DataGrid grid);
699 public abstract void DataGridPaintRowsHeaders (Graphics g, Rectangle clip, DataGrid grid);
700 public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
701 public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
702 public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
703 public abstract void DataGridPaintRow (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
706 #endregion // Datagrid
708 #region DateTimePicker
710 public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
712 #endregion // DateTimePicker
716 public abstract void DrawGroupBox (Graphics dc, Rectangle clip_area, GroupBox box);
719 public abstract Size GroupBoxDefaultSize{get;}
720 #endregion // GroupBox
723 public abstract Size HScrollBarDefaultSize{get;} // Default size of the scrollbar
724 #endregion // HScrollBar
728 public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
731 public abstract Size LabelDefaultSize{get;}
735 public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
736 #endregion // LinkLabel
740 public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
741 #endregion // ListBox
745 public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
746 public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
747 public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
750 public abstract Size ListViewCheckBoxSize { get; }
751 public abstract int ListViewColumnHeaderHeight { get; }
752 public abstract int ListViewDefaultColumnWidth { get; }
753 public abstract int ListViewVerticalSpacing { get; }
754 public abstract int ListViewEmptyColumnWidth { get; }
755 public abstract int ListViewHorizontalSpacing { get; }
756 public abstract Size ListViewDefaultSize { get; }
757 #endregion // ListView
760 public abstract void CalcItemSize (Graphics dc, MenuItem item, int y, int x, bool menuBar);
761 public abstract void CalcPopupMenuSize (Graphics dc, Menu menu);
762 public abstract int CalcMenuBarSize (Graphics dc, Menu menu, int width);
763 public abstract void DrawMenuBar (Graphics dc, Menu menu, Rectangle rect);
764 public abstract void DrawMenuItem (MenuItem item, DrawItemEventArgs e);
765 public abstract void DrawPopupMenu (Graphics dc, Menu menu, Rectangle cliparea, Rectangle rect);
768 #region MonthCalendar
769 public abstract void DrawMonthCalendar(Graphics dc, Rectangle clip_rectangle, MonthCalendar month_calendar);
770 #endregion // MonthCalendar
774 public abstract Size PanelDefaultSize{get;}
779 public abstract void DrawPictureBox (Graphics dc, Rectangle clip, PictureBox pb);
782 public abstract Size PictureBoxDefaultSize{get;}
783 #endregion // PictureBox
787 public abstract void DrawProgressBar (Graphics dc, Rectangle clip_rectangle, ProgressBar progress_bar);
790 public abstract Size ProgressBarDefaultSize{get;}
791 #endregion // ProgressBar
795 public abstract void DrawRadioButton (Graphics dc, Rectangle clip_rectangle, RadioButton radio_button);
798 public abstract Size RadioButtonDefaultSize{get;}
799 #endregion // RadioButton
803 //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);
804 public abstract void DrawScrollBar (Graphics dc, Rectangle clip_rectangle, ScrollBar bar);
807 public abstract int ScrollBarButtonSize {get;} // Size of the scroll button
808 #endregion // ScrollBar
812 public abstract void DrawStatusBar (Graphics dc, Rectangle clip_rectangle, StatusBar sb);
815 public abstract int StatusBarSizeGripWidth {get;} // Size of Resize area
816 public abstract int StatusBarHorzGapWidth {get;} // Gap between panels
817 public abstract Size StatusBarDefaultSize{get;}
818 #endregion // StatusBar
821 public abstract Size TabControlDefaultItemSize { get; }
822 public abstract Point TabControlDefaultPadding { get; }
823 public abstract int TabControlMinimumTabWidth { get; }
825 public abstract Rectangle GetTabControlLeftScrollRect (TabControl tab);
826 public abstract Rectangle GetTabControlRightScrollRect (TabControl tab);
827 public abstract Rectangle GetTabControlDisplayRectangle (TabControl tab);
828 public abstract Size TabControlGetSpacing (TabControl tab);
829 public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
834 public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
837 public abstract int ToolBarGripWidth {get;} // Grip width for the ToolBar
838 public abstract int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
839 public abstract int ToolBarSeparatorWidth {get;} // width of the separator
840 public abstract int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
841 public abstract int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
842 public abstract int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
843 public abstract Size ToolBarDefaultSize{get;}
844 #endregion // ToolBar
847 public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
848 public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
849 #endregion // ToolTip
854 public abstract void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb);
857 public abstract Size TrackBarDefaultSize{get; } // Default size for the TrackBar control
858 #endregion // TrackBar
861 public abstract Size VScrollBarDefaultSize{get;} // Default size of the scrollbar
862 #endregion // VScrollBar
865 public abstract Size TreeViewDefaultSize { get; }
868 public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
870 // Just making virtual for now so all the themes still build.
873 public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
875 // Just making virtual for now so all the themes still build.
879 public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
881 // Just making virtual for now so all the themes still build.
885 public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
887 // Just making virtual for now so all the themes still build.
888 return ManagedWindowTitleBarHeight (wm) - 5;
891 public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
893 // Just making virtual for now so all the themes still build.
894 return new Size (10, 10);
897 public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
899 // Just making virtual for now so all the themes still build.
902 #region ControlPaint Methods
903 public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
904 ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
905 Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
906 int bottomWidth, ButtonBorderStyle bottomStyle);
908 public abstract void CPDrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
909 public abstract void CPDrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
910 public abstract void CPDrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
911 public abstract void CPDrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
912 public abstract void CPDrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
913 public abstract void CPDrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
914 public abstract void CPDrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
915 public abstract void CPDrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
916 public abstract void CPDrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
917 public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
918 public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
919 public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color);
920 public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
921 public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
922 public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);
923 public abstract void CPDrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
924 public abstract void CPDrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
926 public abstract void CPDrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
927 public abstract void CPDrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
928 StringFormat format);
929 public abstract void CPDrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style);
930 #endregion // ControlPaint Methods