[Mono-bugs] [Bug 438811] New: ToolStripDropDown shows dynamically built menu in wrong position under Mac OS X

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Oct 24 12:16:26 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=438811

User aypetrov at yandex.ru added comment
https://bugzilla.novell.com/show_bug.cgi?id=438811#c438772

           Summary: ToolStripDropDown shows dynamically built menu in wrong
                    position under Mac OS X
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: aypetrov at yandex.ru
         QAContact: mono-bugs at lists.ximian.com
                CC: aypetrov at yandex.ru
          Found By: Development


Created an attachment (id=247892)
 --> (https://bugzilla.novell.com/attachment.cgi?id=247892)
Sample code and two s/shots

Description of Problem:
Dynamic menu building cause wrong drop-down menu positioning under Mac OS X.
In fact, first time menu opens correct. From second time it is shown a little
bit lower than it should.
I guess, the Mac OS menu height is added one more while calculating absolute
position.
Relative position (DropDownLocation) is right and not changing.

Steps to reproduce the problem:
1. Use, for example, ToolStripDropDownButton in your project.

2. Add ToolStripDropDownButton.DropDownOpening handler.
      toolStripDropDownButton.DropDownOpening += new
EventHandler(toolStripDropDownButton_DropDownOpening);

Note: Add a dummy item into drop-down:
   toolStripDropDownButton.DropDownItems.Add("dummy");
Otherwise DropDownOpening handler won't be called my Mono up to 2.0 at least
(reported as bug #438772).

3. Build a menu in the handler. For example:
    void toolStripDropDownButton_DropDownOpening(object sender, EventArgs e)
    {
      toolStripDropDownButton.DropDownItems.Clear();
      toolStripDropDownButton.DropDownItems.Add("Dynamic Item 1");
      toolStripDropDownButton.DropDownItems.Add("Dynamic Item 2");
    }

4. Compile and run under Mac OS X.

Actual Results:
Click drop-down first time - it is shown well.
Click again - it is shifted down.

Expected Results:
Should be shown in right place each time.

How often does this happen? 
Always.

Additional Information:
This is about Mac OS only.
This is not reproduced with static (once built and not changing) menu.

Sample code and two screen shots are attached.


-- 
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