Changeset 974


Ignore:
Timestamp:
5/5/2009 10:01:38 AM (5 years ago)
Author:
lowjoel
Message:

-Don't change the dialog font and add the bevel line.
-Factor out the code dealing with copy/clear button enabling to the EnableButtons? function.

Location:
branches/eraser6/Eraser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/LogForm.Designer.cs

    r972 r974  
    5858            this.close = new System.Windows.Forms.Button(); 
    5959            this.copy = new System.Windows.Forms.Button(); 
    60             this.separator = new Trustbridge.Windows.Controls.BevelLine(); 
    6160            this.SuspendLayout(); 
    6261            //  
     
    108107            this.copy.Click += new System.EventHandler(this.copy_Click); 
    109108            //  
    110             // separator 
    111             //  
    112             resources.ApplyResources(this.separator, "separator"); 
    113             this.separator.Angle = 90; 
    114             this.separator.Name = "separator"; 
    115             //  
    116109            // LogForm 
    117110            //  
    118111            resources.ApplyResources(this, "$this"); 
    119112            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 
    120             this.Controls.Add(this.separator); 
    121113            this.Controls.Add(this.copy); 
    122114            this.Controls.Add(this.close); 
     
    142134        private System.Windows.Forms.ColumnHeader message; 
    143135        private System.Windows.Forms.Button copy; 
    144         private Trustbridge.Windows.Controls.BevelLine separator; 
    145136    } 
    146137} 
  • branches/eraser6/Eraser/LogForm.cs

    r972 r974  
    4141            UxThemeAPI.UpdateControlTheme(this); 
    4242            this.task = task; 
    43             Rectangle r; 
    4443 
    4544            //Update the title 
     
    5655            } 
    5756 
    58             clear.Enabled = copy.Enabled  = log.Count > 0; 
    5957            //Register our event handler to get live log messages 
    6058            task.Log.Logged += task_Logged; 
    6159            this.log.EndUpdate(); 
     60            EnableButtons(); 
    6261        } 
    6362 
     
    103102                    break; 
    104103            } 
     104 
     105            //Enable the clear and copy log buttons only if we have entries to copy. 
     106            EnableButtons(); 
    105107        } 
    106108 
    107109        private void clear_Click(object sender, EventArgs e) 
    108110        { 
    109             this.task.Log.Clear(); 
     111            task.Log.Clear(); 
    110112            log.Items.Clear(); 
    111             copy.Enabled = clear.Enabled = log.Items.Count > 0; 
     113            EnableButtons(); 
    112114        } 
    113115 
     
    127129            } 
    128130 
    129             Clipboard.SetText(text.ToString(), TextDataFormat.CommaSeparatedValue); 
     131            if (text.Length > 0) 
     132                Clipboard.SetText(text.ToString(), TextDataFormat.CommaSeparatedValue); 
    130133        } 
    131134 
     
    135138        } 
    136139 
     140        /// <summary> 
     141        /// Enables/disables buttons based on the current system state. 
     142        /// </summary> 
     143        private void EnableButtons() 
     144        { 
     145            clear.Enabled = copy.Enabled = task.Log.Entries.Count > 0; 
     146        } 
     147 
     148        /// <summary> 
     149        /// The task which this log is displaying entries for 
     150        /// </summary> 
    137151        private Task task; 
    138152    } 
  • branches/eraser6/Eraser/LogForm.resx

    r972 r974  
    143143  </data> 
    144144  <data name="log.Size" type="System.Drawing.Size, System.Drawing"> 
    145     <value>414, 361</value> 
     145    <value>600, 391</value> 
    146146  </data> 
    147147  <data name="log.TabIndex" type="System.Int32, mscorlib"> 
     
    158158  </data> 
    159159  <data name="&gt;&gt;log.ZOrder" xml:space="preserve"> 
    160     <value>4</value> 
     160    <value>3</value> 
    161161  </data> 
    162162  <data name="clear.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 
    163     <value>Bottom, Left</value> 
     163    <value>Bottom, Right</value> 
    164164  </data> 
    165165  <data name="clear.Location" type="System.Drawing.Point, System.Drawing"> 
    166     <value>12, 392</value> 
     166    <value>12, 409</value> 
    167167  </data> 
    168168  <data name="clear.Size" type="System.Drawing.Size, System.Drawing"> 
     
    185185  </data> 
    186186  <data name="&gt;&gt;clear.ZOrder" xml:space="preserve"> 
    187     <value>3</value> 
     187    <value>2</value> 
    188188  </data> 
    189189  <data name="close.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 
     
    191191  </data> 
    192192  <data name="close.Location" type="System.Drawing.Point, System.Drawing"> 
    193     <value>351, 392</value> 
     193    <value>537, 409</value> 
    194194  </data> 
    195195  <data name="close.Size" type="System.Drawing.Size, System.Drawing"> 
     
    212212  </data> 
    213213  <data name="&gt;&gt;close.ZOrder" xml:space="preserve"> 
    214     <value>2</value> 
    215   </data> 
    216   <data name="copy.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 
    217     <value>Bottom, Left</value> 
     214    <value>1</value> 
    218215  </data> 
    219216  <data name="copy.Location" type="System.Drawing.Point, System.Drawing"> 
    220     <value>96, 392</value> 
     217    <value>96, 409</value> 
    221218  </data> 
    222219  <data name="copy.Size" type="System.Drawing.Size, System.Drawing"> 
     
    239236  </data> 
    240237  <data name="&gt;&gt;copy.ZOrder" xml:space="preserve"> 
    241     <value>1</value> 
    242   </data> 
    243   <data name="separator.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> 
    244     <value>Bottom, Left, Right</value> 
    245   </data> 
    246   <data name="separator.Location" type="System.Drawing.Point, System.Drawing"> 
    247     <value>9, 387</value> 
    248   </data> 
    249   <data name="separator.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> 
    250     <value>0, 11, 0, 0</value> 
    251   </data> 
    252   <data name="separator.Size" type="System.Drawing.Size, System.Drawing"> 
    253     <value>420, 2</value> 
    254   </data> 
    255   <data name="separator.TabIndex" type="System.Int32, mscorlib"> 
    256     <value>7</value> 
    257   </data> 
    258   <data name="&gt;&gt;separator.Name" xml:space="preserve"> 
    259     <value>separator</value> 
    260   </data> 
    261   <data name="&gt;&gt;separator.Type" xml:space="preserve"> 
    262     <value>Trustbridge.Windows.Controls.BevelLine, BevelLine, Version=1.0.3240.33061, Culture=neutral, PublicKeyToken=552aec48acab06da</value> 
    263   </data> 
    264   <data name="&gt;&gt;separator.Parent" xml:space="preserve"> 
    265     <value>$this</value> 
    266   </data> 
    267   <data name="&gt;&gt;separator.ZOrder" xml:space="preserve"> 
    268238    <value>0</value> 
    269239  </data> 
     
    275245  </data> 
    276246  <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> 
    277     <value>438, 427</value> 
     247    <value>624, 444</value> 
    278248  </data> 
    279249  <data name="$this.Font" type="System.Drawing.Font, System.Drawing"> 
    280     <value>Microsoft Sans Serif, 9pt</value> 
    281   </data> 
    282   <data name="$this.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> 
    283     <value>NoControl</value> 
    284   </data> 
    285   <data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing"> 
    286     <value>274, 197</value> 
     250    <value>Segoe UI, 9pt</value> 
    287251  </data> 
    288252  <data name="$this.Text" xml:space="preserve"> 
Note: See TracChangeset for help on using the changeset viewer.