Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
comparison FrmMain.cs @ 137:ce63500e0ec1
Re #260: New panels don't work perfectly in Linux through Mono
* Debug ToolStrip width and button widths
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 03 Apr 2010 20:06:33 +0000 |
parents | c095c57a56f9 |
children | 60c795eca8de |
comparison
equal
deleted
inserted
replaced
136:b1741be290c5 | 137:ce63500e0ec1 |
---|---|
946 private void AddCategoryButtons(Category[] cats) | 946 private void AddCategoryButtons(Category[] cats) |
947 { | 947 { |
948 int catCount = cats.Length; | 948 int catCount = cats.Length; |
949 Category cat; | 949 Category cat; |
950 IBBToolStripButton[] categoryButtons = new IBBToolStripButton[catCount]; | 950 IBBToolStripButton[] categoryButtons = new IBBToolStripButton[catCount]; |
951 int buttonWidths = 0; | |
951 | 952 |
952 for (int i = 0; i < catCount; i++) | 953 for (int i = 0; i < catCount; i++) |
953 { | 954 { |
954 cat = cats[i]; | 955 cat = cats[i]; |
955 IBBToolStripButton button = new IBBToolStripButton(); | 956 IBBToolStripButton button = new IBBToolStripButton(); |
957 button.Tag = cat; | 958 button.Tag = cat; |
958 button.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.list_add; | 959 button.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.list_add; |
959 button.Enabled = false; | 960 button.Enabled = false; |
960 button.Click += new EventHandler(CreateUnitForCategoryButtonClick); | 961 button.Click += new EventHandler(CreateUnitForCategoryButtonClick); |
961 categoryButtons[i] = button; | 962 categoryButtons[i] = button; |
962 } | 963 buttonWidths += button.Width; |
964 } | |
965 | |
966 log.Debug("Toolstrip width: " + catToolStrip.Width); | |
967 log.Debug("Button widths: " + buttonWidths); | |
963 | 968 |
964 this.Invoke(new ArrayMethodInvoker<IBBToolStripButton>(catToolStrip.Items.AddRange), new object[]{ categoryButtons }); | 969 this.Invoke(new ArrayMethodInvoker<IBBToolStripButton>(catToolStrip.Items.AddRange), new object[]{ categoryButtons }); |
965 } | 970 } |
966 | 971 |
967 private void CreateUnitForCategoryButtonClick(object sender, EventArgs e) | 972 private void CreateUnitForCategoryButtonClick(object sender, EventArgs e) |