[Mono-bugs] [Bug 363367] New: TreeView plus/minus box fails with owner drawn checkboxes

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 20 13:18:35 EST 2008


           Summary: TreeView plus/minus box fails with owner drawn
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: derekd at omni-ts.com
         QAContact: mono-bugs at lists.ximian.com
                CC: stephane at omni-ts.com
          Found By: ---

If you have an owner drawn checkbox the plus minus is treated as if it is where
the checkbox is located.

To reproduce:
1. Create a TreeView
2. Set CheckBoxes = false
3. Create an ImageList with 2 images
4. Set TreeView.StateImageList to the ImageList created above
5. Create some nodes with children and set the StateImageIndex to 0 for each of
6. Run
7. Click on a plus/minus box next to a node.

(NOTE: see bug 363353 if the above setup causes an exception in Mono.)

Actual Result:
Clicking on plus/minus does nothing. However click the checkbox does
expand/collapse the tree.

Expectant Result:
Clicking on plus/minus expands/collapses tree. Click checkbox won't do anything
unless coded explicitly to do so.

It is just detecting the plus/minus box at the wrong location. See the code
below from TreeView:

                private bool IsPlusMinusArea (TreeNode node, int x)
                        int l = node.Bounds.Left + 5;

                        if (show_root_lines || node.Parent != null)
                                l -= indent;
                        if (ImageList != null)
                                l -= ImageList.ImageSize.Width + 3;
*see here: >>>>>        if (checkboxes)
                                l -= 19;
                        return (x > l && x < l + 8);

                *maybe should be "if (checkboxes || StateImageList !=null)

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list