[Mono-winforms-list] [BUMP] ToolStripDropDown + UserControl

Jonathan Pobst monkey at jpobst.com
Fri Mar 6 11:09:02 EST 2009


I committed the less risky parts of this, hopefully it will fix your 
issues.

There are problems with things like checking ToolStripItem.Owner, 
because of ToolStrip/MenuStrip merging, where items may be owned by one 
ToolStrip, but are actually parented to and showing up on another ToolStrip.

If you have additional changes, please use svn diff, so I can apply them 
better.

Thanks!
Jonathan

Alex Shulgin wrote:
> Alex Shulgin wrote:
>> Jonathan Pobst wrote:
>>> Patch committed.
>>
>> Thanks a lot!
>>
>>> It looks like the arrow is not painted when your sample is run on 
>>> .Net.  I don't see any property or anything that controls that.  I 
>>> guess it simply looks at its parent and only draws it if it is on a 
>>> ToolStripDropDownMenu and not a ToolStripDropDown.
>>
>> Yes, I've noticed this too.
>>
>> Now, I think I finally come up with a correct version which behaves 
>> pretty similar to .Net implementation.
>>
>> Please review a patch (use -p1 if in System.Windows.Forms dir) and 
>> screenshots.
> 
> Oh, I forgot the demo code.  Here's the updated part:
> 
>         public PopupMenu()
>         {
>             ToolStripMenuItem menuItem1 = new 
> ToolStripMenuItem("menuItem1");
> 
>             ToolStripMenuItem subItem1 = new ToolStripMenuItem("subItem1");
>             subItem1.ShortcutKeyDisplayString = "Ctrl+A";
>             subItem1.ShowShortcutKeys = true;
> 
>             ToolStripMenuItem subItem2 = new ToolStripMenuItem("subItem2");
>             subItem2.DropDownItems.Add("subSubItem21");
> 
>             menuItem1.DropDownItems.Add(subItem1);
>             menuItem1.DropDownItems.Add(subItem2);
> 
>             ToolStripMenuItem menuItem2 = new 
> ToolStripMenuItem("menuItem2");
>             menuItem2.ShortcutKeyDisplayString = "Ctrl+Z";
> 
>             ToolStripLabel label1 = new ToolStripLabel("label1");
>             ToolStripButton button1 = new ToolStripButton("button1");
>             ToolStripDropDownButton ddbtn1 = new 
> ToolStripDropDownButton("ddbtn1");
> 
>             this.Items.Add(menuItem1);
>             this.Items.Add(menuItem2);
>             this.Items.Add(label1);
>             this.Items.Add(button1);
>             this.Items.Add(ddbtn1);
>         }
> 
> -- 
> Alex
> 
> 
> 



More information about the Mono-winforms-list mailing list