List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:February 3 2011 5:51pm
Subject:bzr commit into wex-installer-1.0 branch (reggie.burnett:295)
View as plain text  
#At file:///C:/Users/Reggie/work/wex/installer-updated/ based on revid:reggie.burnett@strippedrcg96prpnpojkh

  295 Reggie Burnett	2011-02-03
      now using ListViewWex in remove and installprogress panels

    modified:
      WexInstaller/Core/ListViewWex.cs
      WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs
      WexInstaller/InstallWizard/InstallProgressPanel.cs
      WexInstaller/InstallWizard/InstallProgressPanel.resx
      WexInstaller/RemovePanels/RemoveProgress.Designer.cs
      WexInstaller/RemovePanels/RemoveProgress.cs
=== modified file 'WexInstaller/Core/ListViewWex.cs'
=== modified file 'WexInstaller/Core/ListViewWex.cs'
--- a/WexInstaller/Core/ListViewWex.cs	2011-02-03 15:10:06 +0000
+++ b/WexInstaller/Core/ListViewWex.cs	2011-02-03 17:51:37 +0000
@@ -22,10 +22,13 @@
             // we really should be querying the size of the product images instead
             // of using 32 but this will do for now.
             dummyList = new ImageList();
-            dummyList.ImageSize = new Size(32, 32);
+            dummyList.ImageSize = new Size(24, 24);
             SmallImageList = dummyList;
+            GhostProductImages = true;
         }
 
+        public bool GhostProductImages { get; set; }
+
         private void PositionProgressBar()
         {
             Rectangle rowRect = this.GetItemRect(ProgressBarRow, ItemBoundsPortion.Entire);
@@ -126,14 +129,15 @@
         {
 
             e.DrawDefault = false;
-            e.Graphics.FillRectangle(new SolidBrush(e.Item.BackColor), e.Bounds);
-            if (e.Item.StateImageIndex >= 0)
-            {
-                Point pt = e.Bounds.Location;
-                pt.X += (e.Bounds.Width - StateImageList.ImageSize.Width) / 2;
-                pt.Y += (e.Bounds.Height - StateImageList.ImageSize.Height) / 2;
-                StateImageList.Draw(e.Graphics, pt, e.Item.StateImageIndex);
-            }
+            e.DrawBackground();
+            //e.Graphics.FillRectangle(new SolidBrush(e.Item.BackColor), e.Bounds);
+            //if (e.Item.StateImageIndex >= 0)
+            //{
+            //    Point pt = e.Bounds.Location;
+            //    pt.X += (e.Bounds.Width - StateImageList.ImageSize.Width) / 2;
+            //    pt.Y += (e.Bounds.Height - StateImageList.ImageSize.Height) / 2;
+            //    StateImageList.Draw(e.Graphics, pt, e.Item.StateImageIndex);
+            //}
 
             base.OnDrawItem(e);
         }
@@ -147,17 +151,21 @@
                 Product product = e.Item.Tag as Product;
 
                 Image icon = product.Icon;
-                if (e.Item.StateImageIndex != 0)
+                if (GhostProductImages && e.Item.StateImageIndex != 0)
                     icon = GhostIcon(product.Icon);
-                e.Graphics.DrawImage(icon, e.Bounds.Location);
                 Point pt = e.Bounds.Location;
+                pt.Y += (e.Bounds.Height - SmallImageList.ImageSize.Height) / 2;
+                e.Graphics.DrawImage(icon, pt.X, pt.Y, 
+                    SmallImageList.ImageSize.Width, 
+                    SmallImageList.ImageSize.Height);
 
+                pt = e.Bounds.Location;
                 Size stringSize = e.Graphics.MeasureString(e.SubItem.Text, e.SubItem.Font).ToSize();
                 pt.Y += (e.Bounds.Height - stringSize.Height) / 2;
 
                 e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font,
                     new SolidBrush(e.SubItem.ForeColor),
-                    pt.X + product.Icon.Width + 5, pt.Y);
+                    pt.X + SmallImageList.ImageSize.Width + 5, pt.Y);
             }
             else
             {

=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs	2010-11-30 20:23:23 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.Designer.cs	2011-02-03 17:51:37 +0000
@@ -1,4 +1,5 @@
-namespace WexInstaller
+using WexInstaller.Core;
+namespace WexInstaller
 {
     partial class InstallProgress
     {
@@ -30,7 +31,7 @@
         {
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallProgress));
-            this.productList = new System.Windows.Forms.ListView();
+            this.productList = new ListViewWex();
             this.productColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.statusColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.progressColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@@ -40,11 +41,14 @@
             this.subTitleLabel = new System.Windows.Forms.Label();
             this.enableDetails = new System.Windows.Forms.Button();
             this.detailsText = new System.Windows.Forms.TextBox();
+            this.stateHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.SuspendLayout();
             // 
             // productList
             // 
+            this.productList.GhostProductImages = false;
             this.productList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.stateHeader,
             this.productColumn,
             this.statusColumn,
             this.progressColumn,
@@ -63,7 +67,7 @@
             // productColumn
             // 
             this.productColumn.Text = "Product";
-            this.productColumn.Width = 244;
+            this.productColumn.Width = 224;
             // 
             // statusColumn
             // 
@@ -137,6 +141,11 @@
             this.detailsText.TabIndex = 9;
             this.detailsText.Visible = false;
             // 
+            // stateHeader
+            // 
+            this.stateHeader.Text = "";
+            this.stateHeader.Width = 20;
+            // 
             // InstallProgress
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -163,7 +172,7 @@
 
         #endregion
 
-        private System.Windows.Forms.ListView productList;
+        private ListViewWex productList;
         private System.Windows.Forms.ColumnHeader productColumn;
         private System.Windows.Forms.ColumnHeader statusColumn;
         private System.Windows.Forms.ColumnHeader progressColumn;
@@ -173,5 +182,6 @@
         private System.Windows.Forms.Label subTitleLabel;
         private System.Windows.Forms.Button enableDetails;
         private System.Windows.Forms.TextBox detailsText;
+        private System.Windows.Forms.ColumnHeader stateHeader;
     }
 }

=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.cs	2011-02-03 16:58:47 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.cs	2011-02-03 17:51:37 +0000
@@ -56,11 +56,13 @@
                 foreach (Product p in pc.Products)
                 {
                     if (!p.ProposedInstalled) continue;
-                    ListViewItem item = new ListViewItem(p.TitleWithVersion);
+                    ListViewItem item = new ListViewItem(String.Empty);
                     item.Name = p.Name;
                     item.Tag = p;
+                    item.SubItems.Add(p.TitleWithVersion);
                     item.SubItems.Add(GetProductStateString(p.CurrentState));
                     item.SubItems.Add(String.Empty);
+                    item.SubItems.Add(String.Empty);
                     productList.Items.Add(item);
                 }
             }
@@ -220,12 +222,12 @@
             ListViewItem item = productList.Items.Find(p.Name, false)[0];
             Debug.Assert(item != null);
             item.StateImageIndex = (int)InstallProgressState.None;
-            item.SubItems[1].Text = GetProductStateString(p.CurrentState);
-            item.SubItems[2].Text = String.Empty;
+            item.SubItems[2].Text = GetProductStateString(p.CurrentState);
+            item.SubItems[3].Text = String.Empty;
 
             AddToDetailsText(item.Index, String.Format("Download of product '{0}' {1}",
                                                        p.Name,
-                                                       item.SubItems[1].Text));
+                                                       item.SubItems[2].Text));
         }
 
         void product_DownloadProductProgressChanged(object sender, DownloadProgressChangedEventArgs e)
@@ -248,8 +250,8 @@
 
             if (item.StateImageIndex != (int)InstallProgressState.Download && e.BytesReceived > 0)
                 item.StateImageIndex = (int)InstallProgressState.Download;
-            item.SubItems[1].Text = GetProductStateString(p.CurrentState);
-            item.SubItems[2].Text = String.Format(Resources.StatusPercentage, e.ProgressPercentage);
+            item.SubItems[2].Text = GetProductStateString(p.CurrentState);
+            item.SubItems[3].Text = String.Format(Resources.StatusPercentage, e.ProgressPercentage);
         }
 
         private void InstallNextPackage()
@@ -313,7 +315,7 @@
                     lock (installingItem)
                     {
                         installingItem.StateImageIndex = (int)InstallProgressState.Installing;
-                        installingItem.SubItems[1].Text = GetProductStateString(p.CurrentState);
+                        installingItem.SubItems[2].Text = GetProductStateString(p.CurrentState);
                     }
                     break;
                 case ChainedInstallerAction.HandleActionData:
@@ -349,10 +351,10 @@
                     lock (installingItem)
                     {
                         installingItem.StateImageIndex = (int)InstallProgressState.Ok;
-                        installingItem.SubItems[1].Text = GetProductStateString(p.CurrentState);
-                        installingItem.SubItems[2].Text = String.Empty;
+                        installingItem.SubItems[2].Text = GetProductStateString(p.CurrentState);
+                        installingItem.SubItems[3].Text = String.Empty;
                     }
-                    AddToDetailsText(item.Index, installingItem.SubItems[1].Text);
+                    AddToDetailsText(item.Index, installingItem.SubItems[2].Text);
                     installedProductsNeedConfig = installedProductsNeedConfig || (p.Controller != null);
                     InstallNextPackage();
                     break;
@@ -372,7 +374,7 @@
             overall_progress = Math.Max(overall_progress, progress);
             lock (installingItem)
             {
-                installingItem.SubItems[2].Text = String.Format(Resources.StatusPercentage, overall_progress);
+                installingItem.SubItems[3].Text = String.Format(Resources.StatusPercentage, overall_progress);
             }
         }
 

=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.resx'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.resx	2010-09-14 16:57:46 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.resx	2011-02-03 17:51:37 +0000
@@ -125,7 +125,7 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADy
-        EQAAAk1TRnQBSQFMAgEBBQEAAUABAAFAAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA
+        EQAAAk1TRnQBSQFMAgEBBQEAAUgBAAFIAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA
         AwABIAMAAQEBAAEYBgABGBIAMP+QAAP/AQcBfAGYAQUBdgGSAQUBdgGSAQUBdgGSAQUBdgGSAQUBegGW
         AQUBegGWAQUBegGWAQUBdgGSAQUBdgGSAQUBdgGSAQUBdgGSAQUBegGWASkBiAGgA/+QAAEPAZcBtwEL
         AbwB4gEGAcMB6AECAbsB5AECAbsB5AECAcEB5QECAYsBpwFGAWQBegE2AawBzwECAbsB5AEBAbQB3AEB

=== modified file 'WexInstaller/RemovePanels/RemoveProgress.Designer.cs'
--- a/WexInstaller/RemovePanels/RemoveProgress.Designer.cs	2010-11-30 20:23:23 +0000
+++ b/WexInstaller/RemovePanels/RemoveProgress.Designer.cs	2011-02-03 17:51:37 +0000
@@ -1,4 +1,5 @@
-namespace WexInstaller
+using WexInstaller.Core;
+namespace WexInstaller
 {
     partial class RemoveProgress
     {
@@ -31,7 +32,8 @@
             this.enableDetails = new System.Windows.Forms.Button();
             this.detailedLog = new System.Windows.Forms.TextBox();
             this.packageListLabel = new System.Windows.Forms.Label();
-            this.productList = new System.Windows.Forms.ListView();
+            this.productList = new WexInstaller.Core.ListViewWex();
+            this.blankHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.productHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.progressHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.SuspendLayout();
@@ -74,24 +76,36 @@
             this.productList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.productList.CheckBoxes = true;
             this.productList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.blankHeader,
             this.productHeader,
             this.progressHeader});
+            this.productList.GhostProductImages = false;
             this.productList.Location = new System.Drawing.Point(17, 113);
             this.productList.Name = "productList";
+            this.productList.OwnerDraw = true;
+            this.productList.ProgressBar = null;
+            this.productList.ProgressBarCol = 0;
+            this.productList.ProgressBarRow = 0;
             this.productList.Size = new System.Drawing.Size(513, 176);
             this.productList.TabIndex = 16;
             this.productList.UseCompatibleStateImageBehavior = false;
             this.productList.View = System.Windows.Forms.View.Details;
             this.productList.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.productList_ColumnClick);
             // 
+            // blankHeader
+            // 
+            this.blankHeader.Text = "";
+            this.blankHeader.Width = 20;
+            // 
             // productHeader
             // 
             this.productHeader.Text = "      Product";
-            this.productHeader.Width = 443;
+            this.productHeader.Width = 423;
             // 
             // progressHeader
             // 
             this.progressHeader.Text = "Progress";
+            this.progressHeader.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             this.progressHeader.Width = 69;
             // 
             // RemoveProgress
@@ -120,8 +134,9 @@
         private System.Windows.Forms.Button enableDetails;
         private System.Windows.Forms.TextBox detailedLog;
         private System.Windows.Forms.Label packageListLabel;
-        private System.Windows.Forms.ListView productList;
+        private ListViewWex productList;
         private System.Windows.Forms.ColumnHeader productHeader;
         private System.Windows.Forms.ColumnHeader progressHeader;
+        private System.Windows.Forms.ColumnHeader blankHeader;
     }
 }

=== modified file 'WexInstaller/RemovePanels/RemoveProgress.cs'
--- a/WexInstaller/RemovePanels/RemoveProgress.cs	2010-11-30 14:52:06 +0000
+++ b/WexInstaller/RemovePanels/RemoveProgress.cs	2011-02-03 17:51:37 +0000
@@ -110,7 +110,7 @@
             if (overall_progress >= 50)
                 progress += 50;
             overall_progress = Math.Max(overall_progress, progress);
-            removingItem.SubItems[1].Text = String.Format(Resources.StatusPercentage, overall_progress);
+            removingItem.SubItems[2].Text = String.Format(Resources.StatusPercentage, overall_progress);
         }
 
         public override void Activate()
@@ -122,10 +122,10 @@
                 {
                     if (p.Installed)
                     {
-                        ListViewItem item = new ListViewItem(p.TitleWithVersion);
+                        ListViewItem item = new ListViewItem(String.Empty);
                         item.Name = p.Title;
                         item.Tag = p;
-                        item.SubItems.Add(String.Empty);
+                        item.SubItems.Add(p.TitleWithVersion);
                         item.SubItems.Add(String.Empty);
                         item.Checked = true;
                         productList.Items.Add(item);

Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110203175137-nas66m9m1838vqp0.bundle
Thread
bzr commit into wex-installer-1.0 branch (reggie.burnett:295) Reggie Burnett3 Feb