diff options
author | Carlos Alberto Cortez <calberto.cortez@gmail.com> | 2010-01-19 10:26:53 +0300 |
---|---|---|
committer | Carlos Alberto Cortez <calberto.cortez@gmail.com> | 2010-01-19 10:26:53 +0300 |
commit | 5bd00fa8fb8bf0fa509df251cee3f6c5c162ef12 (patch) | |
tree | 6ceb1e824bec2ea4d1e8b0a44d9f7ddf4272286a /mcs | |
parent | c744d2d438c7d37e70ac4042bb33791cc31f836b (diff) |
* ComboBox.cs: When use manually setting DropDownHeight, ignore the
MaxDropDownHeight property - also rename our field 'count' to
'visible_items_count' to avoid confusion as much as possible.
Fixes an issue with several items, showing an incorrect layout.
2010-01-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
svn path=/trunk/mcs/; revision=149786
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs | 11 |
2 files changed, 13 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 7c11e2470ea..4130c08d1e6 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,5 +1,12 @@ 2010-01-18 Carlos Alberto Cortez <calberto.cortez@gmail.com> + * ComboBox.cs: When use manually setting DropDownHeight, ignore the + MaxDropDownHeight property - also rename our field 'count' to + 'visible_items_count' to avoid confusion as much as possible. + Fixes an issue with several items, showing an incorrect layout. + +2010-01-18 Carlos Alberto Cortez <calberto.cortez@gmail.com> + * RichTextBox.cs: SelectedText should set Modified to true. Observe that this is happening just here, not for the Text property, and neither for the TextBoxBase impl. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs index 2e1fde53b85..8bdcce0b696 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs @@ -2522,11 +2522,11 @@ namespace System.Windows.Forms else { // DropDown or DropDownList width = owner.DropDownWidth; - int count = (owner.Items.Count <= owner.MaxDropDownItems) ? owner.Items.Count : owner.MaxDropDownItems; + int visible_items_count = (owner.Items.Count <= owner.MaxDropDownItems) ? owner.Items.Count : owner.MaxDropDownItems; if (owner.DrawMode == DrawMode.OwnerDrawVariable) { height = 0; - for (int i = 0; i < count; i++) { + for (int i = 0; i < visible_items_count; i++) { height += owner.GetItemHeight (i); } @@ -2535,14 +2535,15 @@ namespace System.Windows.Forms } else { #if NET_2_0 if (owner.DropDownHeight == default_drop_down_height) { // ignore DropDownHeight - height = owner.ItemHeight * count; + height = owner.ItemHeight * visible_items_count; show_scrollbar = owner.Items.Count > owner.MaxDropDownItems; } else { + // ignore visible items count, and use manual height instead height = owner.DropDownHeight; - show_scrollbar = (count * owner.ItemHeight) > height; + show_scrollbar = (owner.Items.Count * owner.ItemHeight) > height; } #else - height = owner.ItemHeight * count; + height = owner.ItemHeight * visible_items_count; show_scrollbar = owner.Items.Count > owner.MaxDropDownItems; #endif } |