New tests.
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / Theme.cs
index e6f19afdcfde8c39de9f4b0395cb15f2cf32eeb9..e4154e726f197b2595dc28fa8aa0a2ce69a34da2 100644 (file)
@@ -202,6 +202,7 @@ namespace System.Windows.Forms
 #else
                        default_font = new Font (FontFamily.GenericSansSerif, 8.25f);
 #endif
+                       syscolors = null;
                }
 
                private void SetSystemColors (KnownColor kc, Color value)
@@ -442,7 +443,7 @@ namespace System.Windows.Forms
 
                public virtual int DoubleClickTime {
                        get {
-                               return 500;
+                               return XplatUI.DoubleClickTime;
                        }
                }
 
@@ -496,7 +497,7 @@ namespace System.Windows.Forms
                
                public virtual Size MenuButtonSize {
                        get {
-                               return new Size(18, 18);
+                               return XplatUI.MenuButtonSize;
                        }
                }
 
@@ -532,13 +533,13 @@ namespace System.Windows.Forms
 
                public virtual Size ToolWindowCaptionButtonSize {
                        get {
-                               return new Size(15, 15);
+                               return XplatUI.ToolWindowCaptionButtonSize;
                        }
                }
 
                public virtual int ToolWindowCaptionHeight {
                        get {
-                               return 16;
+                               return XplatUI.ToolWindowCaptionHeight;
                        }
                }
 
@@ -575,7 +576,7 @@ namespace System.Windows.Forms
                        else return value;
                }
 
-               [MonoTODO("Figure out where to point for My Network Places")]
+               [MonoInternalNote ("Figure out where to point for My Network Places")]
                public virtual string Places(UIIcon index) {
                        switch (index) {
                                case UIIcon.PlacesRecentDocuments: {
@@ -585,7 +586,7 @@ namespace System.Windows.Forms
 
                                case UIIcon.PlacesDesktop: {
                                        // Default = "Desktop"
-                                       return Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
+                                       return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
                                }
 
                                case UIIcon.PlacesPersonal: {
@@ -711,7 +712,7 @@ namespace System.Windows.Forms
 #endif
                public abstract void CalculateButtonTextAndImageLayout (ButtonBase b, out Rectangle textRectangle, out Rectangle imageRectangle);
                public abstract void DrawButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
-               public abstract void DrawFlatButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
+               public abstract void DrawFlatButton (Graphics g, ButtonBase b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
                public abstract void DrawPopupButton (Graphics g, Button b, Rectangle textBounds, Rectangle imageBounds, Rectangle clipRectangle);
                #endregion      // Button
 
@@ -742,6 +743,11 @@ namespace System.Windows.Forms
                // Drawing
                public abstract void DrawComboBoxItem (ComboBox ctrl, DrawItemEventArgs e);
                public abstract void DrawFlatStyleComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
+               public abstract void ComboBoxDrawNormalDropDownButton (ComboBox comboBox, Graphics g, Rectangle clippingArea, Rectangle area, ButtonState state);
+               public abstract bool ComboBoxNormalDropDownButtonHasTransparentBackground (ComboBox comboBox, ButtonState state);
+               public abstract bool ComboBoxDropDownButtonHasHotElementStyle (ComboBox comboBox);
+               public abstract void ComboBoxDrawBackground (ComboBox comboBox, Graphics g, Rectangle clippingArea, FlatStyle style);
+               public abstract bool CombBoxBackgroundHasHotElementStyle (ComboBox comboBox);
                #endregion      // ComboBox
 
                #region Control
@@ -772,9 +778,11 @@ namespace System.Windows.Forms
                public abstract void DataGridPaint (PaintEventArgs pe, DataGrid grid);
                public abstract void DataGridPaintCaption (Graphics g, Rectangle clip, DataGrid grid);
                public abstract void DataGridPaintColumnHeaders (Graphics g, Rectangle clip, DataGrid grid);
+               public abstract void DataGridPaintColumnHeader (Graphics g, Rectangle bounds, DataGrid grid, int col);
                public abstract void DataGridPaintRowContents (Graphics g, int row, Rectangle row_rect, bool is_newrow, Rectangle clip, DataGrid grid);
                public abstract void DataGridPaintRowHeader (Graphics g, Rectangle bounds, int row, DataGrid grid);
                public abstract void DataGridPaintRowHeaderArrow (Graphics g, Rectangle bounds, DataGrid grid);
+               public abstract void DataGridPaintRowHeaderStar (Graphics g, Rectangle bounds, DataGrid grid);
                public abstract void DataGridPaintParentRows (Graphics g, Rectangle bounds, DataGrid grid);
                public abstract void DataGridPaintParentRow (Graphics g, Rectangle bounds, DataGridDataSource row, DataGrid grid);
                public abstract void DataGridPaintRows (Graphics g, Rectangle cells, Rectangle clip, DataGrid grid);
@@ -783,10 +791,30 @@ namespace System.Windows.Forms
                
                #endregion // Datagrid
 
-               #region DateTimePicker
+#if NET_2_0
+               #region DataGridView
+               #region DataGridViewHeaderCell
+               #region DataGridViewRowHeaderCell
+               public abstract bool DataGridViewRowHeaderCellDrawBackground (DataGridViewRowHeaderCell cell, Graphics g, Rectangle bounds);
+               public abstract bool DataGridViewRowHeaderCellDrawSelectionBackground (DataGridViewRowHeaderCell cell);
+               public abstract bool DataGridViewRowHeaderCellDrawBorder (DataGridViewRowHeaderCell cell, Graphics g, Rectangle bounds);
+               #endregion
+               #region DataGridViewColumnHeaderCell
+               public abstract bool DataGridViewColumnHeaderCellDrawBackground (DataGridViewColumnHeaderCell cell, Graphics g, Rectangle bounds);
+               public abstract bool DataGridViewColumnHeaderCellDrawBorder (DataGridViewColumnHeaderCell cell, Graphics g, Rectangle bounds);
+               #endregion
+               public abstract bool DataGridViewHeaderCellHasPressedStyle (DataGridView dataGridView);
+               public abstract bool DataGridViewHeaderCellHasHotStyle (DataGridView dataGridView);
+               #endregion
+               #endregion
+#endif
 
+               #region DateTimePicker
                public abstract void DrawDateTimePicker(Graphics dc, Rectangle clip_rectangle, DateTimePicker dtp);
-
+               public abstract bool DateTimePickerBorderHasHotElementStyle { get; }
+               public abstract Rectangle DateTimePickerGetDropDownButtonArea (DateTimePicker dateTimePicker);
+               public abstract Rectangle DateTimePickerGetDateArea (DateTimePicker dateTimePicker);
+               public abstract bool DateTimePickerDropDownButtonHasHotElementStyle { get; }
                #endregion      // DateTimePicker
 
                #region GroupBox
@@ -801,18 +829,6 @@ namespace System.Windows.Forms
                public abstract Size HScrollBarDefaultSize{get;}        // Default size of the scrollbar
                #endregion      // HScrollBar
 
-               #region Label
-               // Drawing
-               public abstract void DrawLabel (Graphics dc, Rectangle clip_rectangle, Label label);
-
-               // Sizing
-               public abstract Size LabelDefaultSize{get;}
-               #endregion      // Label
-
-               #region LinkLabel
-               public abstract void DrawLinkLabel (Graphics dc, Rectangle clip_rectangle, LinkLabel label);
-               #endregion      // LinkLabel
-               
                #region ListBox
                // Drawing
                public abstract void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e);
@@ -823,8 +839,10 @@ namespace System.Windows.Forms
                public abstract void DrawListViewItems (Graphics dc, Rectangle clip_rectangle, ListView control);
                public abstract void DrawListViewHeader (Graphics dc, Rectangle clip_rectangle, ListView control);
                public abstract void DrawListViewHeaderDragDetails (Graphics dc, ListView control, ColumnHeader drag_column, int target_x);
+               public abstract bool ListViewHasHotHeaderStyle { get; }
 
                // Sizing
+               public abstract int ListViewGetHeaderHeight (ListView listView, Font font);
                public abstract Size ListViewCheckBoxSize { get; }
                public abstract int ListViewColumnHeaderHeight { get; }
                public abstract int ListViewDefaultColumnWidth { get; }
@@ -833,6 +851,7 @@ namespace System.Windows.Forms
                public abstract int ListViewHorizontalSpacing { get; }
                public abstract Size ListViewDefaultSize { get; }
                public abstract int ListViewGroupHeight { get; }
+               public abstract int ListViewItemPaddingWidth { get; }
                public abstract int ListViewTileWidthFactor { get; }
                public abstract int ListViewTileHeightFactor { get; }
                #endregion      // ListView
@@ -897,6 +916,12 @@ namespace System.Windows.Forms
 
                // Sizing
                public abstract int ScrollBarButtonSize {get;}          // Size of the scroll button
+
+               public abstract bool ScrollBarHasHotElementStyles { get; }
+
+               public abstract bool ScrollBarHasPressedThumbStyle { get; }
+
+               public abstract bool ScrollBarHasHoverArrowButtonStyle { get; }
                #endregion      // ScrollBar
 
                #region StatusBar
@@ -921,14 +946,18 @@ namespace System.Windows.Forms
                public abstract Point TabControlImagePadding { get; }
                public abstract int TabControlScrollerWidth { get; }
 
-               public abstract Rectangle TabControlGetLeftScrollRect (TabControl tab);
-               public abstract Rectangle TabControlGetRightScrollRect (TabControl tab);
                public abstract Rectangle TabControlGetDisplayRectangle (TabControl tab);
                public abstract Rectangle TabControlGetPanelRect (TabControl tab);
                public abstract Size TabControlGetSpacing (TabControl tab);
                public abstract void DrawTabControl (Graphics dc, Rectangle area, TabControl tab);
                #endregion
 
+               #region TextBoxBase
+               public abstract void TextBoxBaseFillBackground (TextBoxBase textBoxBase, Graphics g, Rectangle clippingArea);
+               public abstract bool TextBoxBaseHandleWmNcPaint (TextBoxBase textBoxBase, ref Message m);
+               public abstract bool TextBoxBaseShouldPaintBackground (TextBoxBase textBoxBase);
+               #endregion
+
                #region ToolBar
                // Drawing
                public abstract void DrawToolBar (Graphics dc, Rectangle clip_rectangle, ToolBar control);
@@ -941,16 +970,21 @@ namespace System.Windows.Forms
                public abstract int ToolBarDropDownArrowWidth { get; }   // width for the dropdown arrow on the ToolBarButton
                public abstract int ToolBarDropDownArrowHeight { get; }  // height for the dropdown arrow on the ToolBarButton
                public abstract Size ToolBarDefaultSize{get;}
+
+               public abstract bool ToolBarHasHotElementStyles (ToolBar toolBar);
+               public abstract bool ToolBarHasHotCheckedElementStyles { get; }
                #endregion      // ToolBar
 
                #region ToolTip
                public abstract void DrawToolTip(Graphics dc, Rectangle clip_rectangle, ToolTip.ToolTipWindow control);
                public abstract Size ToolTipSize(ToolTip.ToolTipWindow tt, string text);
+               public abstract bool ToolTipTransparentBackground { get; }
                #endregion      // ToolTip
                
                #region BalloonWindow
 #if NET_2_0
                public abstract void ShowBalloonWindow (IntPtr handle, int timeout, string title, string text, ToolTipIcon icon);
+               public abstract void HideBalloonWindow (IntPtr handle);
                public abstract void DrawBalloonWindow (Graphics dc, Rectangle clip, NotifyIcon.BalloonWindow control);
                public abstract Rectangle BalloonWindowRect (NotifyIcon.BalloonWindow control);
 #endif
@@ -964,49 +998,38 @@ namespace System.Windows.Forms
                public abstract Size TrackBarDefaultSize{get; }         // Default size for the TrackBar control
                
                public abstract int TrackBarValueFromMousePosition (int x, int y, TrackBar tb);
+
+               public abstract bool TrackBarHasHotThumbStyle { get; }
                #endregion      // TrackBar
 
+               #region UpDownBase
+               public abstract void UpDownBaseDrawButton (Graphics g, Rectangle bounds, bool top, VisualStyles.PushButtonState state);
+               public abstract bool UpDownBaseHasHotButtonStyle { get; }
+               #endregion
+
                #region VScrollBar
                public abstract Size VScrollBarDefaultSize{get;}        // Default size of the scrollbar
                #endregion      // VScrollBar
 
                #region TreeView
                public abstract Size TreeViewDefaultSize { get; }
+               public abstract void TreeViewDrawNodePlusMinus (TreeView treeView, TreeNode node, Graphics dc, int x, int middle);
                #endregion
 
-               public virtual void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm)
-               {
-                       // Just making virtual for now so all the themes still build.
-               }
-
-               public virtual int ManagedWindowTitleBarHeight (InternalWindowManager wm)
-               {
-                       // Just making virtual for now so all the themes still build.
-                       return 15;
-               }
-
-               public virtual int ManagedWindowBorderWidth (InternalWindowManager wm)
-               {
-                       // Just making virtual for now so all the themes still build.
-                       return 3;
-               }
-
-               public virtual int ManagedWindowIconWidth (InternalWindowManager wm)
-               {
-                       // Just making virtual for now so all the themes still build.
-                       return ManagedWindowTitleBarHeight (wm) - 5;
-               }
-
-               public virtual Size ManagedWindowButtonSize (InternalWindowManager wm)
-               {
-                       // Just making virtual for now so all the themes still build.
-                       return new Size (10, 10);
-               }
-
-               public virtual void ManagedWindowSetButtonLocations (InternalWindowManager wm)
-               {
-                       // Just making virtual for now so all the themes still build.
-               }
+               #region Managed window
+               public abstract void DrawManagedWindowDecorations (Graphics dc, Rectangle clip, InternalWindowManager wm);
+               public abstract int ManagedWindowTitleBarHeight (InternalWindowManager wm);
+               public abstract int ManagedWindowBorderWidth (InternalWindowManager wm);
+               public abstract int ManagedWindowIconWidth (InternalWindowManager wm);
+               public abstract Size ManagedWindowButtonSize (InternalWindowManager wm);
+               public abstract void ManagedWindowSetButtonLocations (InternalWindowManager wm);
+               public abstract Rectangle ManagedWindowGetTitleBarIconArea (InternalWindowManager wm);
+               public abstract Size ManagedWindowGetMenuButtonSize (InternalWindowManager wm);
+               public abstract bool ManagedWindowTitleButtonHasHotElementStyle (TitleButton button, Form form);
+               public abstract void ManagedWindowDrawMenuButton (Graphics dc, TitleButton button, Rectangle clip, InternalWindowManager wm);
+               public abstract void ManagedWindowOnSizeInitializedOrChanged (Form form);
+               public const int ManagedWindowSpacingAfterLastTitleButton = 2;
+               #endregion
 
                #region ControlPaint Methods
                public abstract void CPDrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
@@ -1032,6 +1055,7 @@ namespace System.Windows.Forms
                public abstract void CPDrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
                public abstract void CPDrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
                public abstract void CPDrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph, Color color, Color backColor);
+               public abstract void CPDrawMixedCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
                public abstract void CPDrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
                public abstract void CPDrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
                public abstract void CPDrawReversibleLine (Point start, Point end, Color backColor);