Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>2006-03-09 03:58:31 +0300
committerPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>2006-03-09 03:58:31 +0300
commitd49f2b2582027ba186268c9cd824f798e10124aa (patch)
tree595d20442b2d082b85e57e775c4598adc5025411 /mcs
parent28cfa7ce42f9b509097d0557339efd8207c18f14 (diff)
2006-03-08 Peter Dennis Bartok <pbartok@novell.com>
* Control.cs: - We now only destroy our double-buffering buffers when the control is resized or disposed, but not when visibility changes. (The code even re-created them twice every time) - Now requiring a redraw of the buffer on visibility changes (fixes bug 77654 part 2) - Not passing OnParentVisibleChanged up unless the control is visible - CanFocus: Fixed to match MS documentation - Focus: Fixed to return actual focus state and to check if setting focus is legal before setting it * ThemeWin32Classic.cs: TabPages cannot have focus. Determine when to draw focus rectangle by looking at parent focus and selected state instead. This fixes TabPages on Linux sometimes having none or multiple focus rectangles. * XplatUIX11.cs (SetFocus): - Don't set the focus if the same window already has focus - Use SendMessage instead of PostMessage (like it's Win32 equivalent) and send the WM_SETFOCUS before the WM_KILLFOCUS to match MS behaviour * TabControl.cs(SelectedIndex): Don't set Focus on TabPage, TabPages are not selectable. svn path=/trunk/mcs/; revision=57713
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog25
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs4
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs2
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs8
4 files changed, 34 insertions, 5 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
index e8b528e8b03..c5cb85c6b56 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,28 @@
+2006-03-08 Peter Dennis Bartok <pbartok@novell.com>
+
+ * Control.cs:
+ - We now only destroy our double-buffering buffers when the
+ control is resized or disposed, but not when visibility
+ changes. (The code even re-created them twice every time)
+ - Now requiring a redraw of the buffer on visibility changes
+ (fixes bug 77654 part 2)
+ - Not passing OnParentVisibleChanged up unless the control
+ is visible
+ - CanFocus: Fixed to match MS documentation
+ - Focus: Fixed to return actual focus state and to check if
+ setting focus is legal before setting it
+ * ThemeWin32Classic.cs: TabPages cannot have focus. Determine
+ when to draw focus rectangle by looking at parent focus and
+ selected state instead. This fixes TabPages on Linux sometimes
+ having none or multiple focus rectangles.
+ * XplatUIX11.cs (SetFocus):
+ - Don't set the focus if the same window already has focus
+ - Use SendMessage instead of PostMessage (like it's Win32
+ equivalent) and send the WM_SETFOCUS before the WM_KILLFOCUS
+ to match MS behaviour
+ * TabControl.cs(SelectedIndex): Don't set Focus on TabPage, TabPages
+ are not selectable.
+
2006-03-07 Jackson Harper <jackson@ximian.com>
* PictureBox.cs: Revert line I accidently committed last week.
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
index 4124c3ed259..bcec0a8fd30 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
@@ -249,7 +249,6 @@ namespace System.Windows.Forms {
if (selected_index != -1) {
invalid = Rectangle.Union (invalid, GetTabRect (selected_index));
selected.Visible = true;
- selected.Focus ();
}
ResumeLayout ();
@@ -267,8 +266,9 @@ namespace System.Windows.Forms {
SizeTabs ();
// The lines are drawn on the edges of the tabs so the invalid area should
// needs to include the extra pixels of line width.
- if (appearance == TabAppearance.Normal)
+ if (appearance == TabAppearance.Normal) {
invalid.Inflate (6, 4);
+ }
Invalidate (invalid);
}
}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
index d61b0fa371b..3d5ad4c5865 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
@@ -3494,7 +3494,7 @@ namespace System.Windows.Forms
return res;
}
- if (page.Focused) {
+ if (page.parent.Focused && is_selected) {
CPDrawFocusRectangle (dc, interior, tab.ForeColor, tab.BackColor);
}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
index 67b3b1f0713..e7f39b05c3d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
@@ -3703,10 +3703,14 @@ namespace System.Windows.Forms {
hwnd = Hwnd.ObjectFromHandle(handle);
+ if (hwnd.client_window == FocusWindow) {
+ return;
+ }
+
+ SendMessage(hwnd.client_window, Msg.WM_SETFOCUS, FocusWindow, IntPtr.Zero);
if (FocusWindow != IntPtr.Zero) {
- PostMessage(FocusWindow, Msg.WM_KILLFOCUS, hwnd.client_window, IntPtr.Zero);
+ SendMessage(FocusWindow, Msg.WM_KILLFOCUS, hwnd.client_window, IntPtr.Zero);
}
- PostMessage(hwnd.client_window, Msg.WM_SETFOCUS, FocusWindow, IntPtr.Zero);
FocusWindow = hwnd.client_window;
//XSetInputFocus(DisplayHandle, Hwnd.ObjectFromHandle(handle).client_window, RevertTo.None, IntPtr.Zero);