Browse Source

Fixed some ClassBrowser bugs. Included splashscreen from Korona.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@162 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
bb7f052797
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
  2. 4
      src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.csproj
  3. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 5
      src/Main/Base/Project/Src/Dom/IClass.cs
  5. 7
      src/Main/Base/Project/Src/Dom/Implementations/DefaultClass.cs
  6. 42
      src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs
  7. 8
      src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeViewComparer.cs
  8. 8
      src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowser.cs
  9. 7
      src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/BaseTypesNode.cs
  10. 11
      src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/DerivedTypesNode.cs
  11. 16
      src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs
  12. 6
      src/Main/Core/Project/ICSharpCode.Core.csproj
  13. 2
      src/Main/Core/Project/ICSharpCode.Core.csproj.user
  14. 22
      src/Main/StartUp/Project/Dialogs/SplashScreen.cs
  15. BIN
      src/Main/StartUp/Project/Resources/SplashScreen.jpg

2
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj

@ -42,7 +42,7 @@
<Compile Include="Src\FormattingStrategy\DocumentAccessor.cs" /> <Compile Include="Src\FormattingStrategy\DocumentAccessor.cs" />
<Compile Include="Src\FormattingStrategy\Indentation.cs" /> <Compile Include="Src\FormattingStrategy\Indentation.cs" />
<Compile Include="Src\OptionPanels\BuildOptions.cs"> <Compile Include="Src\OptionPanels\BuildOptions.cs">
<SubType>UserControl</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Src\Parser\ExpressionFinder.cs" /> <Compile Include="Src\Parser\ExpressionFinder.cs" />
<Compile Include="Src\Parser\Parser.cs" /> <Compile Include="Src\Parser\Parser.cs" />

4
src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.csproj

@ -45,7 +45,7 @@
<Compile Include="Src\FormattingStrategy\DocumentAccessor.cs" /> <Compile Include="Src\FormattingStrategy\DocumentAccessor.cs" />
<Compile Include="Src\FormattingStrategy\Indentation.cs" /> <Compile Include="Src\FormattingStrategy\Indentation.cs" />
<Compile Include="Src\OptionPanels\BuildOptions.cs"> <Compile Include="Src\OptionPanels\BuildOptions.cs">
<SubType>Form</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Parser\ExpressionFinder.cs" /> <Compile Include="Src\Parser\ExpressionFinder.cs" />
<Compile Include="Src\Parser\Parser.cs" /> <Compile Include="Src\Parser\Parser.cs" />
@ -76,6 +76,8 @@
<Name>ICSharpCode.Core</Name> <Name>ICSharpCode.Core</Name>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Src\PrettyPrinter\Gui\" /> <Folder Include="Src\PrettyPrinter\Gui\" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -181,7 +181,7 @@
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\CommonAboutDialog.cs"> <Compile Include="Src\Gui\Dialogs\CommonAboutDialog.cs">
<SubType>Form</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\DirtyFilesDialog.cs" /> <Compile Include="Src\Gui\Dialogs\DirtyFilesDialog.cs" />
<Compile Include="Src\Gui\Dialogs\FolderDialog.cs" /> <Compile Include="Src\Gui\Dialogs\FolderDialog.cs" />

5
src/Main/Base/Project/Src/Dom/IClass.cs

@ -62,6 +62,9 @@ namespace ICSharpCode.SharpDevelop.Dom
get; get;
} }
/// <summary>Gets the class associated with the base type with the same index.</summary>
IClass GetBaseClass(int index);
List<IClass> InnerClasses { List<IClass> InnerClasses {
get; get;
} }
@ -107,6 +110,6 @@ namespace ICSharpCode.SharpDevelop.Dom
/* /*
ArrayList GetAccessibleMembers(IClass callingClass, bool showStatic); ArrayList GetAccessibleMembers(IClass callingClass, bool showStatic);
*/ */
} }
} }

7
src/Main/Base/Project/Src/Dom/Implementations/DefaultClass.cs

@ -244,12 +244,17 @@ namespace ICSharpCode.SharpDevelop.Dom
} }
} }
public IClass GetBaseClass(int index)
{
return ProjectContent.SearchType(BaseTypes[index], this, Region != null ? Region.BeginLine : 0, Region != null ? Region.BeginColumn : 0);
}
public IClass BaseClass { public IClass BaseClass {
get { get {
Debug.Assert(ProjectContent != null); Debug.Assert(ProjectContent != null);
if (BaseTypes.Count > 0) { if (BaseTypes.Count > 0) {
IClass baseClass = ProjectContent.SearchType(BaseTypes[0], this, Region != null ? Region.BeginLine : 0, Region != null ? Region.BeginColumn : 0); IClass baseClass = GetBaseClass(0);
if (baseClass != null && baseClass.ClassType != ClassType.Interface) { if (baseClass != null && baseClass.ClassType != ClassType.Interface) {
return baseClass; return baseClass;
} }

42
src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeView.cs

@ -16,6 +16,9 @@ namespace ICSharpCode.SharpDevelop.Gui
List<ExtTreeNode> cutNodes = new List<ExtTreeNode>(); List<ExtTreeNode> cutNodes = new List<ExtTreeNode>();
bool isSorted = true; bool isSorted = true;
/// <summary>
/// Gets/Sets whether the ExtTreeView does its own sorting.
/// </summary>
public bool IsSorted { public bool IsSorted {
get { get {
return isSorted; return isSorted;
@ -24,18 +27,53 @@ namespace ICSharpCode.SharpDevelop.Gui
isSorted = value; isSorted = value;
} }
} }
[Obsolete("Use IsSorted instead!")]
public new bool Sorted {
get {
return base.Sorted;
}
set {
base.Sorted = value;
}
}
public List<ExtTreeNode> CutNodes { public List<ExtTreeNode> CutNodes {
get { get {
return cutNodes; return cutNodes;
} }
} }
// using TreeView.TreeViewNodeSorter will result in TreeNodeCollection
// calling Sort() after every insertion. Therefore, we have to create
// our own NodeSorter property.
IComparer<TreeNode> nodeSorter = new ExtTreeViewComparer();
public IComparer<TreeNode> NodeSorter {
get {
return nodeSorter;
}
set {
nodeSorter = value;
}
}
[Obsolete("Use NodeSorter instead!")]
public new System.Collections.IComparer TreeViewNodeSorter {
get {
return base.TreeViewNodeSorter;
}
set {
base.TreeViewNodeSorter = value;
}
}
public ExtTreeView() public ExtTreeView()
{ {
DrawMode = TreeViewDrawMode.OwnerDrawText; DrawMode = TreeViewDrawMode.OwnerDrawText;
HideSelection = false; HideSelection = false;
AllowDrop = true; AllowDrop = true;
this.TreeViewNodeSorter = new ExtTreeViewComparer();
ImageList newImageList = new ImageList(); ImageList newImageList = new ImageList();
newImageList.ImageSize = new Size(16, 16); newImageList.ImageSize = new Size(16, 16);
newImageList.ColorDepth = ColorDepth.Depth32Bit; newImageList.ColorDepth = ColorDepth.Depth32Bit;
@ -55,7 +93,7 @@ namespace ICSharpCode.SharpDevelop.Gui
} }
TreeNode[] nodeArray = new TreeNode[node.Nodes.Count]; TreeNode[] nodeArray = new TreeNode[node.Nodes.Count];
node.Nodes.CopyTo(nodeArray, 0); node.Nodes.CopyTo(nodeArray, 0);
Array.Sort(nodeArray, TreeViewNodeSorter); Array.Sort(nodeArray, nodeSorter);
node.Nodes.Clear(); node.Nodes.Clear();
node.Nodes.AddRange(nodeArray); node.Nodes.AddRange(nodeArray);

8
src/Main/Base/Project/Src/Gui/Components/ExtTreeView/ExtTreeViewComparer.cs

@ -1,13 +1,13 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Collections; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
namespace ICSharpCode.SharpDevelop.Gui namespace ICSharpCode.SharpDevelop.Gui
{ {
public class ExtTreeViewComparer : IComparer public class ExtTreeViewComparer : IComparer<TreeNode>
{ {
public int Compare(object x, object y) public int Compare(TreeNode x, TreeNode y)
{ {
Debug.Assert(x != null); Debug.Assert(x != null);
Debug.Assert(y != null); Debug.Assert(y != null);
@ -15,7 +15,7 @@ namespace ICSharpCode.SharpDevelop.Gui
ExtTreeNode node2 = y as ExtTreeNode; ExtTreeNode node2 = y as ExtTreeNode;
if (node1 == null || node2 == null) { if (node1 == null || node2 == null) {
return ((TreeNode)x).Text.CompareTo(((TreeNode)y).Text); return x.Text.CompareTo(y.Text);
} }
if (node1.SortOrder != node2.SortOrder) { if (node1.SortOrder != node2.SortOrder) {

8
src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowser.cs

@ -227,12 +227,16 @@ namespace ICSharpCode.SharpDevelop.Gui
return searchTerm; return searchTerm;
} }
set { set {
searchTerm = value.ToUpper(); searchTerm = value.ToUpper().Trim();
} }
} }
public void StartSearch() public void StartSearch()
{ {
if (searchTerm.Length == 0) {
CancelSearch();
return;
}
if (!inSearchMode) { if (!inSearchMode) {
foreach (TreeNode node in classBrowserTreeView.Nodes) { foreach (TreeNode node in classBrowserTreeView.Nodes) {
oldNodes.Add(node); oldNodes.Add(node);
@ -242,6 +246,7 @@ namespace ICSharpCode.SharpDevelop.Gui
nextNodes.Clear(); nextNodes.Clear();
UpdateToolbars(); UpdateToolbars();
} }
classBrowserTreeView.BeginUpdate();
classBrowserTreeView.Nodes.Clear(); classBrowserTreeView.Nodes.Clear();
if (ProjectService.OpenSolution != null) { if (ProjectService.OpenSolution != null) {
foreach (IProject project in ProjectService.OpenSolution.Projects) { foreach (IProject project in ProjectService.OpenSolution.Projects) {
@ -260,6 +265,7 @@ namespace ICSharpCode.SharpDevelop.Gui
notFoundMsg.Text = "No search results found."; notFoundMsg.Text = "No search results found.";
notFoundMsg.AddTo(classBrowserTreeView); notFoundMsg.AddTo(classBrowserTreeView);
} }
classBrowserTreeView.EndUpdate();
} }
public void CancelSearch() public void CancelSearch()

7
src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/BaseTypesNode.cs

@ -60,10 +60,11 @@ namespace ICSharpCode.SharpDevelop.Gui
base.Initialize(); base.Initialize();
Nodes.Clear(); Nodes.Clear();
IProjectContent content = ParserService.GetProjectContent(project); IProjectContent content = c.ProjectContent;
if (content != null) { if (content != null) {
foreach (string baseType in c.BaseTypes) { int count = c.BaseTypes.Count;
IClass baseClass = content.GetClass(baseType); for (int i = 0; i < count; i++) {
IClass baseClass = c.GetBaseClass(i);
if (baseClass != null) { if (baseClass != null) {
new ClassNode(project, baseClass).AddTo(this); new ClassNode(project, baseClass).AddTo(this);
} }

11
src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/Nodes/DerivedTypesNode.cs

@ -60,16 +60,15 @@ namespace ICSharpCode.SharpDevelop.Gui
base.Initialize(); base.Initialize();
Nodes.Clear(); Nodes.Clear();
List<IProjectContent> contentList = new List<IProjectContent>(1);
contentList.Add(null);
if (ProjectService.OpenSolution != null) { if (ProjectService.OpenSolution != null) {
foreach (IProject project in ProjectService.OpenSolution.Projects) { foreach (IProject project in ProjectService.OpenSolution.Projects) {
IProjectContent projectContent = ParserService.GetProjectContent(project); IProjectContent projectContent = ParserService.GetProjectContent(project);
if (projectContent != null) { if (projectContent != null) {
foreach (IClass possibleDerivedClass in projectContent.Classes) { contentList[0] = projectContent;
foreach (string baseType in possibleDerivedClass.BaseTypes) { foreach (IClass derivedClass in RefactoringService.FindDerivedClasses(c, contentList)) {
if (baseType == this.c.FullyQualifiedName) { new ClassNode(project, derivedClass).AddTo(this);
new ClassNode(project, possibleDerivedClass).AddTo(this);
}
}
} }
} }
} }

16
src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

@ -33,12 +33,16 @@ namespace ICSharpCode.Core
continue; continue;
} }
foreach (IClass c in pc.Classes) { foreach (IClass c in pc.Classes) {
if (c.BaseTypes.Count == 0) continue; int count = c.BaseTypes.Count;
string baseType = c.BaseTypes[0]; for (int i = 0; i < count; i++) {
if (pc.Language.NameComparer.Equals(baseType, baseClassName) || string baseType = c.BaseTypes[i];
pc.Language.NameComparer.Equals(baseType, baseClassFullName)) { if (pc.Language.NameComparer.Equals(baseType, baseClassName) ||
if (c.BaseClass.FullyQualifiedName == baseClass.FullyQualifiedName) { pc.Language.NameComparer.Equals(baseType, baseClassFullName)) {
list.Add(c); IClass possibleBaseClass = c.GetBaseClass(i);
if (possibleBaseClass != null &&
possibleBaseClass.FullyQualifiedName == baseClass.FullyQualifiedName) {
list.Add(c);
}
} }
} }
} }

6
src/Main/Core/Project/ICSharpCode.Core.csproj

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.41115</ProductVersion> <ProductVersion>8.0.50215</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</ProjectGuid> <ProjectGuid>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</ProjectGuid>
<RootNamespace>ICSharpCode.Core</RootNamespace> <RootNamespace>ICSharpCode.Core</RootNamespace>
@ -123,7 +123,9 @@
<Compile Include="Src\Util\AbstractCommand.cs" /> <Compile Include="Src\Util\AbstractCommand.cs" />
<Compile Include="Src\Util\ICommand.cs" /> <Compile Include="Src\Util\ICommand.cs" />
<Compile Include="Src\Util\RightToLeftConverter.cs" /> <Compile Include="Src\Util\RightToLeftConverter.cs" />
<Compile Include="Src\Services\MessageService\InputBox.cs" /> <Compile Include="Src\Services\MessageService\InputBox.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project> </Project>

2
src/Main/Core/Project/ICSharpCode.Core.csproj.user

@ -2,7 +2,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " /> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " /> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<PropertyGroup> <PropertyGroup>
<LastOpenVersion>8.0.41115</LastOpenVersion> <LastOpenVersion>8.0.50215</LastOpenVersion>
<ProjectView>ShowAllFiles</ProjectView> <ProjectView>ShowAllFiles</ProjectView>
<ProjectTrust>0</ProjectTrust> <ProjectTrust>0</ProjectTrust>
</PropertyGroup> </PropertyGroup>

22
src/Main/StartUp/Project/Dialogs/SplashScreen.cs

@ -6,9 +6,11 @@ using System.Reflection;
using System.Resources; using System.Resources;
namespace ICSharpCode.SharpDevelop namespace ICSharpCode.SharpDevelop
{ {
public class SplashScreenForm : Form public class SplashScreenForm : Form
{ {
public const string VersionText = "Corsavy alpha";
static SplashScreenForm splashScreen = new SplashScreenForm(); static SplashScreenForm splashScreen = new SplashScreenForm();
static ArrayList requestedFileList = new ArrayList(); static ArrayList requestedFileList = new ArrayList();
static ArrayList parameterList = new ArrayList(); static ArrayList parameterList = new ArrayList();
@ -18,22 +20,32 @@ namespace ICSharpCode.SharpDevelop
get { get {
return splashScreen; return splashScreen;
} }
} }
public SplashScreenForm() public SplashScreenForm()
{ {
#if !DEBUG #if !DEBUG
TopMost = true; TopMost = true;
#endif #endif
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
ShowInTaskbar = false; ShowInTaskbar = false;
bitmap = new Bitmap(Assembly.GetEntryAssembly().GetManifestResourceStream("Resources.SplashScreen.jpg")); bitmap = new Bitmap(Assembly.GetEntryAssembly().GetManifestResourceStream("Resources.SplashScreen.jpg"));
Size = bitmap.Size; Size = bitmap.Size;
#if DEBUG
string versionText = VersionText + " (debug)";
#else
string versionText = VersionText;
#endif
using (Font font = new Font("Vrinda", 4)) {
using (Graphics g = Graphics.FromImage(bitmap)) {
g.DrawString(versionText, font, Brushes.Black, 116, 142);
}
}
BackgroundImage = bitmap; BackgroundImage = bitmap;
} }
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing) { if (disposing) {
if (bitmap != null) { if (bitmap != null) {

BIN
src/Main/StartUp/Project/Resources/SplashScreen.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Loading…
Cancel
Save