New Project Window

This commit is contained in:
dexyfex
2018-03-04 00:03:08 +11:00
Unverified
parent 0c558e746c
commit c093aa4736
136 changed files with 29501 additions and 20 deletions
@@ -40,6 +40,12 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=3.0.4.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.3.0.4\lib\net40\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2015, Version=3.0.4.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.ThemeVS2015.3.0.4\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MenuStripFix.cs">
@@ -48,6 +54,9 @@
<Compile Include="MenuStripFix.Designer.cs">
<DependentUpon>MenuStripFix.cs</DependentUpon>
</Compile>
<Compile Include="ProjectPanel.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PropertyGridFix.cs">
<SubType>Component</SubType>
@@ -99,6 +108,9 @@
</Compile>
<Compile Include="FormUtils.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
+118
View File
@@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
namespace CodeWalker.Project
{
public class ProjectPanel : DockContent
{
public virtual void SetTheme(ThemeBase theme)
{
BackColor = SystemColors.Control;
ForeColor = SystemColors.ControlText;
var txtback = SystemColors.Window;
var disback = SystemColors.Control;
var disfore = ForeColor;
var btnback = Color.Transparent;
if (theme is VS2015DarkTheme)
{
BackColor = theme.ColorPalette.MainWindowActive.Background;
ForeColor = Color.White;
txtback = BackColor;
disback = BackColor;// Color.FromArgb(32,32,32);
disfore = Color.DarkGray;
btnback = BackColor;
}
var allcontrols = new List<Control>();
RecurseControls(this, allcontrols);
foreach (var c in allcontrols)
{
if ((c is TabPage) || (c is CheckedListBox) || (c is ListBox))
{
c.ForeColor = ForeColor;
c.BackColor = txtback;
}
else if ((c is TextBox))
{
var txtbox = c as TextBox;
c.ForeColor = txtbox.ReadOnly ? disfore : ForeColor;
c.BackColor = txtbox.ReadOnly ? disback : txtback;
}
else if ((c is Button) || (c is GroupBox))
{
c.ForeColor = ForeColor;
c.BackColor = btnback;
}
}
}
private void RecurseControls(Control c, List<Control> l)
{
foreach (Control cc in c.Controls)
{
l.Add(cc);
RecurseControls(cc, l);
}
}
}
public class ProjectFloatWindow : FloatWindow
{
public ProjectFloatWindow(DockPanel dockPanel, DockPane pane)
: base(dockPanel, pane)
{
Init(dockPanel, pane);
}
public ProjectFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
: base(dockPanel, pane, bounds)
{
Init(dockPanel, pane);
}
private void Init(DockPanel dockPanel, DockPane pane)
{
FormBorderStyle = FormBorderStyle.Sizable;
//trying to set float window tab strip location to the top... for some reason it defaults to bottom!
//var t = this;
//if (pane != null)
//{
// pane.DockState = DockState.Document;
//}
//if (dockPanel != null)
//{
// dockPanel.DocumentTabStripLocation = DocumentTabStripLocation.Top;
//}
//if (DockPanel != null)
//{
// DockPanel.DocumentTabStripLocation = DocumentTabStripLocation.Top;
//}
}
}
public class ProjectFloatWindowFactory : DockPanelExtender.IFloatWindowFactory
{
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
{
return new ProjectFloatWindow(dockPanel, pane, bounds);
}
public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
{
return new ProjectFloatWindow(dockPanel, pane);
}
}
}
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DockPanelSuite" version="3.0.4" targetFramework="net452" />
<package id="DockPanelSuite.ThemeVS2015" version="3.0.4" targetFramework="net452" />
</packages>