[Mono-bugs] [Bug 82182][Maj] New - Submenus don't display in response to clicks
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Jul 25 05:21:26 EDT 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by chuck.esterbrook at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=82182
--- shadow/82182 2007-07-25 05:21:25.000000000 -0400
+++ shadow/82182.tmp.5530 2007-07-25 05:21:25.000000000 -0400
@@ -0,0 +1,115 @@
+Bug#: 82182
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Mac OS X 10.3
+OS Details: Mac OS X 10.4
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com
+ReportedBy: Chuck.Esterbrook at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Submenus don't display in response to clicks
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+This program creates one menu with one submenu item (and a dock filling
+rich text box). It's shortcut key works, but the submenu item cannot be
+seen by clicking the menu. Works on Microsoft.
+
+File: bug-menu-items.cs
+----------------------------------------------------------------------
+/*
+1. gmcs -r:System.Windows.Forms -r:System.Drawing.dll bug-menu-items.cs
+2. mono bug-menu-items.exe
+3. Click the Application menu.
+Results:
+On Mono 1.2.4 on X11 1.1.3 on Mac OS X 10.4.10, the "Exit" menu item will
+not appear, although it's shortcut key does work.
+On .NET 2.0 on Microsoft Windows XP, you will see the "Exit" menu item as
+you should.
+*/
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+class Program {
+ [STAThread]
+ static void Main() {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+}
+
+class MainForm : Form {
+
+ public MainForm() {
+ Text = "";
+ WindowState = FormWindowState.Maximized;
+ RichTextBox eb = MakeRichTextBox();
+ eb.Parent = this;
+ MakeMenu();
+ }
+
+ public void MakeMenu() {
+ MenuStrip menu = new MenuStrip();
+ menu.Parent = this;
+
+ ToolStripMenuItem appItem = MakeMenuItem("&Application", null, null);
+ menu.Items.Add(appItem);
+
+ appItem.DropDownItems.Add(MakeMenuItem("E&xit", Keys.Control | Keys.Q,
+exitItem_Click));
+ }
+
+ ToolStripMenuItem MakeMenuItem(string text, Keys? keys, EventHandler
+handler) {
+ ToolStripMenuItem item = new ToolStripMenuItem();
+ item.Text = text;
+ if (keys != null)
+ item.ShortcutKeys = (Keys)keys;
+ if (handler != null)
+ item.Click += handler;
+ return item;
+ }
+
+ void exitItem_Click(object sender, EventArgs e) {
+ Close();
+ }
+
+ RichTextBox MakeRichTextBox() {
+ RichTextBox eb = new RichTextBox();
+ eb.Multiline = true;
+ eb.WordWrap = false;
+ eb.AcceptsTab = true;
+ eb.ScrollBars = RichTextBoxScrollBars.ForcedBoth;
+ eb.Dock = DockStyle.Fill;
+ eb.SelectionFont = new Font("Courier New", 10, FontStyle.Regular);
+ eb.SelectionColor = Color.Black;
+ eb.Dock = DockStyle.Fill;
+ return eb;
+ }
+
+}
+----------------------------------------------------------------------
+
+
+How often does this happen?
+
+Always.
+
+
+Additional Information:
+
+As usual, if you need me to email the source as a file, or you need more
+information, contact me at Chuck.Esterbrook at gmail.com.
+
+Thanks.
More information about the mono-bugs
mailing list