Changeset 2667


Ignore:
Timestamp:
01/21/10 18:34:56 (10 years ago)
Author:
epitzer
Message:

Ensure proper resizing of CodeEditor and don't crash when removing non-existent assemblies (#842)

Location:
trunk/sources/HeuristicLab.CodeEditor/3.2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CodeEditor/3.2/CodeEditor.Designer.cs

    r2659 r2667  
    4040      //
    4141      toolStripFiller.Name = "toolStripFiller";
    42       toolStripFiller.Size = new System.Drawing.Size(364, 17);
     42      toolStripFiller.Size = new System.Drawing.Size(395, 17);
    4343      toolStripFiller.Spring = true;
    4444      //
     
    5858      this.textEditor.ShowTabs = true;
    5959      this.textEditor.ShowVRuler = false;
    60       this.textEditor.Size = new System.Drawing.Size(556, 248);
     60      this.textEditor.Size = new System.Drawing.Size(556, 245);
    6161      this.textEditor.TabIndent = 2;
    6262      this.textEditor.TabIndex = 0;
     
    113113      this.Name = "CodeEditor";
    114114      this.Size = new System.Drawing.Size(556, 270);
     115      this.Resize += new System.EventHandler(this.CodeEditor_Resize);
    115116      this.statusStrip1.ResumeLayout(false);
    116117      this.statusStrip1.PerformLayout();
  • trunk/sources/HeuristicLab.CodeEditor/3.2/CodeEditor.cs

    r2659 r2667  
    296296        return;
    297297      var content = projectContentRegistry.GetExistingProjectContent(a.Location);
    298       projectContent.ReferencedContents.Remove(content);
    299       projectContentRegistry.UnloadProjectContent(content);
     298      if (content != null) {
     299        projectContent.ReferencedContents.Remove(content);
     300        projectContentRegistry.UnloadProjectContent(content);
     301      }
    300302      ShowMessage("Ready");
    301303    }
     
    306308      ParseStep();
    307309      BeginInvoke(new MethodInvoker(delegate { parserThreadLabel.Text = "Ready"; }));
    308       while (!IsDisposed) {
    309         ParseStep();
    310         Thread.Sleep(2000);
    311       }
     310      try {
     311        while (!IsDisposed) {
     312          ParseStep();
     313          Thread.Sleep(2000);
     314        }
     315      } catch { }
    312316    }
    313317
     
    349353      proc.Start();
    350354    }
     355
     356    private void CodeEditor_Resize(object sender, EventArgs e) {
     357      var textArea = textEditor.ActiveTextAreaControl.TextArea;
     358      var vScrollBar = textEditor.ActiveTextAreaControl.VScrollBar;
     359      var hScrollBar = textEditor.ActiveTextAreaControl.HScrollBar;
     360
     361      textArea.SuspendLayout();
     362      textArea.Width = textEditor.Width - vScrollBar.Width;
     363      textArea.Height = textEditor.Height - hScrollBar.Height;
     364      textArea.ResumeLayout();
     365
     366      vScrollBar.SuspendLayout();
     367      vScrollBar.Location = new Point(textArea.Width, 0);
     368      vScrollBar.Height = textArea.Height;
     369      vScrollBar.ResumeLayout();
     370
     371      hScrollBar.SuspendLayout();
     372      hScrollBar.Location = new Point(0, textArea.Height);
     373      hScrollBar.Width = textArea.Width;
     374      hScrollBar.ResumeLayout();
     375    }
    351376  }
    352377}
  • trunk/sources/HeuristicLab.CodeEditor/3.2/HeuristicLab.CodeEditor-3.2.csproj

    r2660 r2667  
    7575  </PropertyGroup>
    7676  <ItemGroup>
    77     <Reference Include="HeuristicLab.Common.Resources-3.2, Version=3.2.0.2591, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
    78       <SpecificVersion>False</SpecificVersion>
    79       <HintPath>..\..\HeuristicLab.Common.Resources\3.2\bin\x86\Debug\HeuristicLab.Common.Resources-3.2.dll</HintPath>
    80     </Reference>
    8177    <Reference Include="HeuristicLab.PluginInfrastructure, Version=3.2.0.2615, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
    8278      <SpecificVersion>False</SpecificVersion>
     
    9490      <SpecificVersion>False</SpecificVersion>
    9591      <HintPath>..\..\HeuristicLab.ExtLibs\HeuristicLab.SharpDevelop\3.1.1.5327\ICSharpCode.TextEditor.dll</HintPath>
     92    </Reference>
     93    <Reference Include="Mono.Cecil, Version=0.6.9.1, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
     94      <SpecificVersion>False</SpecificVersion>
     95      <HintPath>..\..\HeuristicLab.ExtLibs\HeuristicLab.SharpDevelop\3.1.1.5327\Mono.Cecil.dll</HintPath>
    9696    </Reference>
    9797    <Reference Include="System" />
     
    137137  </ItemGroup>
    138138  <ItemGroup>
     139    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.2\HeuristicLab.Common.Resources-3.2.csproj">
     140      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
     141      <Name>HeuristicLab.Common.Resources-3.2</Name>
     142    </ProjectReference>
    139143    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.SharpDevelop\3.1.1.5327\HeuristicLab.SharpDevelop-3.1.1.5327.csproj">
    140144      <Project>{4ABA047D-46DD-4608-9E4A-41C5F92FDBB1}</Project>
Note: See TracChangeset for help on using the changeset viewer.