<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
- <DefineConstants>DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <DefineConstants>DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
<Optimize>false</Optimize>
<OutputPath>$(SolutionDir)build\Debug</OutputPath>
</PropertyGroup>
<EmbeddedResource Include="Templates\Tooltip.template">
<LogicalName>Crow.Tooltip.template</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="Templates\ContextMenu.template">
+ <LogicalName>Crow.ContextMenu.template</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Icons\compiler_error.svg" />
+ <EmbeddedResource Include="Icons\project.svg" />
+ <EmbeddedResource Include="Icons\projectRef.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Crow.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Icons\compiler_warning.svg" />
+ <None Include="Icons\compiler_warning_orange.svg" />
</ItemGroup>
</Project>
<Compile Include="src\DesignInterface.cs" />
<Compile Include="src\EditPane.cs" />
<Compile Include="src\ProjectNodes.cs" />
+ <Compile Include="src\SolutionControler.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="ui\" />
{
}
ImlVisualEditor imlVE;
- SourceEditor srcEditor;
Instantiator instFileDlg;
base.OnLoad (e);
instFileDlg = Instantiator.CreateFromImlFragment
- ("<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.*' OkClicked='onFileOpen'/>");
+ ("<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.sln' OkClicked='onFileOpen'/>");
initCommands ();
}
public string CurrentDirectory {
- get { return Crow.Configuration.Get<string>("CurrentDirectory");}
+ get { return Crow.Configuration.Global.Get<string>("CurrentDirectory");}
set {
- Crow.Configuration.Set ("CurrentDirectory", value);
+ Crow.Configuration.Global.Set ("CurrentDirectory", value);
}
}
public Solution CurrentSolution {
}
public string LastOpenSolution {
- get { return Crow.Configuration.Get<string>("LastOpenSolution");}
+ get { return Crow.Configuration.Global.Get<string>("LastOpenSolution");}
set {
if (LastOpenSolution == value)
return;
- Crow.Configuration.Set ("LastOpenSolution", value);
+ Crow.Configuration.Global.Set ("LastOpenSolution", value);
NotifyValueChanged ("LastOpenSolution", value);
}
}
public bool ReopenLastSolution {
- get { return Crow.Configuration.Get<bool>("ReopenLastSolution");}
+ get { return Crow.Configuration.Global.Get<bool>("ReopenLastSolution");}
set {
if (ReopenLastSolution == value)
return;
- Crow.Configuration.Set ("ReopenLastSolution", value);
+ Crow.Configuration.Global.Set ("ReopenLastSolution", value);
NotifyValueChanged ("ReopenLastSolution", value);
}
}
if (e.Key == OpenTK.Input.Key.Escape) {
Quit (null, null);
return;
- } else if (e.Key == OpenTK.Input.Key.F4) {
- loadWindow ("#CrowIDE.ui.MemberView.crow");
- } else if (e.Key == OpenTK.Input.Key.F5) {
- loadWindow ("#CrowIDE.ui.GTreeExplorer.crow");
- } else if (e.Key == OpenTK.Input.Key.F6) {
- loadWindow ("#CrowIDE.ui.LQIsExplorer.crow");
- } else if (e.Key == OpenTK.Input.Key.F7) {
- loadWindow ("#CrowIDE.ui.CSProjExplorer.crow");
}
+// else if (e.Key == OpenTK.Input.Key.F4) {
+// loadWindow ("#CrowIDE.ui.MemberView.crow");
+// } else if (e.Key == OpenTK.Input.Key.F5) {
+// loadWindow ("#CrowIDE.ui.GTreeExplorer.crow");
+// } else if (e.Key == OpenTK.Input.Key.F6) {
+// loadWindow ("#CrowIDE.ui.LQIsExplorer.crow");
+// } else if (e.Key == OpenTK.Input.Key.F7) {
+// loadWindow ("#CrowIDE.ui.CSProjExplorer.crow");
+// }
}
void loadWindow(string path, object dataSource = null){
try {
CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
}
+ protected override void loadStyling ()
+ {
+ base.loadStyling ();
+ }
+
public override bool ProcessMouseMove (int x, int y)
{
int deltaX = x - Mouse.X;
using System.Linq;
using Microsoft.CSharp;
using System.CodeDom.Compiler;
+using Crow;
namespace CrowIDE
{
- public class Project {
- string path;
+ public class Project: IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ bool isLoaded = false;
XmlDocument xmlDoc;
XmlNode nodeProject;
XmlNode nodeProps;
XmlNodeList nodesItems;
public Solution solution;
+ public List<Crow.Command> Commands;
+ public CompilerResults CompilationResults;
+ public List<Project> dependantProjects = new List<Project>();
+ public Project ParentProject = null;
public string Name {
- get { return solution.projects.FirstOrDefault(p=>p.ProjectGuid == ProjectGuid).ProjectName; }
+ get { return solutionProject.ProjectName; }
+ }
+ public bool IsLoaded {
+ get { return isLoaded; }
+ set {
+ if (isLoaded == value)
+ return;
+ isLoaded = value;
+ NotifyValueChanged ("IsLoaded", isLoaded);
+ }
}
+ public bool IsStartupProject {
+ get {
+ bool result = solution.StartupProject == this;
+ System.Diagnostics.Debug.WriteLine ("is startup project tested for {0} => {1}", this.ProjectGuid, result);
+ return result;
+ }
+ }
+ public string Path {
+ get { return System.IO.Path.Combine (solution.SolutionFolder, solutionProject.RelativePath.Replace('\\','/')); }
+ }
+
#region Project properties
public string RootDir {
- get { return Path.GetDirectoryName (path); }
+ get { return System.IO.Path.GetDirectoryName (Path); }
}
public string ToolsVersion {
get { return nodeProject?.Attributes ["ToolsVersion"]?.Value; }
get { return nodeProject?.Attributes ["DefaultTargets"]?.Value; }
}
public string ProjectGuid {
- get { return nodeProps["ProjectGuid"]?.InnerText; }
+ get { return solutionProject.ProjectGuid; }
}
public string AssemblyName {
get { return nodeProps["AssemblyName"]?.InnerText; }
get { return nodeProps["RootNamespace"]?.InnerText; }
}
public bool AllowUnsafeBlocks {
- get { return bool.Parse (nodeProps["AllowUnsafeBlocks"]?.InnerText); }
+ get {return nodeProps["AllowUnsafeBlocks"] == null ? false :
+ bool.Parse (nodeProps["AllowUnsafeBlocks"]?.InnerText); }
}
public bool NoStdLib {
- get { return bool.Parse (nodeProps["NoStdLib"]?.InnerText); }
+ get { return nodeProps["NoStdLib"] == null ? false :
+ bool.Parse (nodeProps["NoStdLib"]?.InnerText); }
}
public bool TreatWarningsAsErrors {
- get { return bool.Parse (nodeProps["TreatWarningsAsErrors"]?.InnerText); }
+ get { return nodeProps["TreatWarningsAsErrors"] == null ? false:
+ bool.Parse (nodeProps["TreatWarningsAsErrors"]?.InnerText); }
}
public bool SignAssembly {
get { return bool.Parse (nodeProps["SignAssembly"]?.InnerText); }
switch (pn.Type) {
case ItemType.Reference:
refs.ChildNodes.Add (pn);
- break;
+ break;
+ case ItemType.ProjectReference:
+ refs.ChildNodes.Add (new ProjectReference(pn));
+ break;
case ItemType.Compile:
case ItemType.None:
case ItemType.EmbeddedResource:
}
curNode = nextNode;
}
- curNode.ChildNodes.Add (pn);
+ switch (pn.Extension) {
+ case ".crow":
+ case ".template":
+ curNode.ChildNodes.Add (new ImlProjectItem(pn));
+ break;
+ default:
+ curNode.ChildNodes.Add (pn);
+ break;
+ }
+
+
break;
}
}
}
}
- public Project () {}
+ SolutionProject solutionProject;
+
+ public Project (Solution sol, SolutionProject sp) {
+ solutionProject = sp;
+
+ solution = sol;
+
+ Commands = new List<Crow.Command> (new Crow.Command[] {
+ new Crow.Command(new Action(() => Compile())) { Caption = "Compile"},
+ new Crow.Command(new Action(() => setAsStartupProject())) { Caption = "Set as Startup Project"},
+ });
+
+ Load ();
+ }
- public Project (string _path, Solution _solution){
- solution = _solution;
- path = _path;
+ public void Load () {
+
xmlDoc = new XmlDocument();
- using (Stream ins = new FileStream (_path, FileMode.Open)) {
+ using (Stream ins = new FileStream (this.Path, FileMode.Open)) {
xmlDoc.Load (new XmlTextReader(ins) { Namespaces = false });
}
}
nodesItems = xmlDoc.SelectNodes ("/Project/ItemGroup");
+ if (ProjectGuid != solutionProject.ProjectGuid)
+ throw new Exception ("Project GUID not matching with solution");
+
+ IsLoaded = true;
+ }
+
+ void setAsStartupProject () {
+ solution.StartupProject = this;
}
-
public void Compile () {
- CSharpCodeProvider cp = new CSharpCodeProvider();
+ if (ParentProject != null)
+ ParentProject.Compile ();
+ CSharpCodeProvider cp = new CSharpCodeProvider();
CompilerParameters parameters = new CompilerParameters();
+ foreach (ProjectItem pi in Items.Where (pp=>pp.Type == ItemType.ProjectReference)) {
+ ProjectReference pr = new ProjectReference (pi);
+ Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
+ if (p == null)
+ throw new Exception ("referenced project not found");
+ p.Compile ();
+ parameters.ReferencedAssemblies.Add (pr.DisplayName);
+ }
+
foreach (ProjectItem pi in Items.Where (p=>p.Type == ItemType.Reference)) {
parameters.ReferencedAssemblies.Add (pi.Path);
}
+ parameters.ReferencedAssemblies.Add ("System.Core");
parameters.GenerateInMemory = true;
+
+ if (!Directory.Exists("testbuild"))
+ Directory.CreateDirectory ("testbuild");
+ parameters.OutputAssembly = "testbuild/" + this.AssemblyName;
+
// True - exe file generation, false - dll file generation
- parameters.GenerateExecutable = true;
+ if (this.OutputType == "Library") {
+ parameters.GenerateExecutable = false;
+ parameters.CompilerOptions += " /target:library";
+ parameters.OutputAssembly += ".dll";
+ } else {
+ parameters.GenerateExecutable = true;
+ parameters.CompilerOptions += " /target:exe";
+ parameters.OutputAssembly += ".exe";
+ }
+
+ parameters.IncludeDebugInformation = true;
+ parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors;
+ parameters.WarningLevel = 4;
+ parameters.CompilerOptions += " /noconfig";
+ if (this.AllowUnsafeBlocks)
+ parameters.CompilerOptions += " /unsafe";
+ parameters.CompilerOptions += " /delaysign+";
+
+ foreach (ProjectFile pi in Items.OfType<ProjectFile>().Where (p => p.Type == ItemType.EmbeddedResource)) {
+
+ string absPath = pi.AbsolutePath;
+ string logicName = pi.LogicalName;
+ if (string.IsNullOrEmpty (logicName))
+ parameters.CompilerOptions += string.Format (" /resource:{0}", absPath);
+ else
+ parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName);
+ }
+
string[] files = Items.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray();
- CompilerResults results = cp.CompileAssemblyFromFile(parameters, files);
+ CompilationResults = cp.CompileAssemblyFromFile(parameters, files);
+
+ solution.UpdateErrorList ();
}
}
}
foreach (ProjectNode pn in childNodes)
pn.SortChilds ();
childNodes = childNodes.OrderBy(c=>c.Type).ThenBy(cn=>cn.DisplayName).ToList();
- }
-
+ }
}
public class ProjectItem : ProjectNode {
#region CTOR
#endregion
public XmlNode node;
- object selectedItem;
-
-
public string Extension {
get { return System.IO.Path.GetExtension (Path); }
Path.Split ('/').LastOrDefault();
}
}
+
+ }
+ public class ProjectReference : ProjectItem {
+ public ProjectReference (ProjectItem pi) : base (pi.Project, pi.node){
+ }
+ public string ProjectGUID {
+ get {
+ return node.SelectSingleNode ("Project")?.InnerText;
+ }
+ }
+ public override string DisplayName {
+ get {
+ return node.SelectSingleNode ("Name").InnerText;
+ }
+ }
+ }
+ public class ProjectFile : ProjectItem {
+ public ProjectFile (ProjectItem pi) : base (pi.Project, pi.node){
+ }
+
+ object selectedItem;
+ public string LogicalName {
+ get {
+ return node.SelectSingleNode ("LogicalName")?.InnerText;
+ }
+ }
public string Source {
get {
using (StreamReader sr = new StreamReader (AbsolutePath)) {
Project.solution.CloseItem (this);
}
}
- public class ImlProjectItem : ProjectItem
+ public class ImlProjectItem : ProjectFile
{
#region CTOR
- public ImlProjectItem (Project project, XmlNode _node) : base (project, _node){
- node = _node;
+ public ImlProjectItem (ProjectItem pi) : base (pi){
}
#endregion
}
#endregion
+ ProjectItem selectedItem = null;
+ object selectedItemElement = null;
ObservableList<ProjectItem> openedItems = new ObservableList<ProjectItem>();
+
public ObservableList<ProjectItem> OpenedItems {
get { return openedItems; }
set {
NotifyValueChanged ("OpenedItems", openedItems);
}
}
- ProjectItem selectedItem = null;
- object selectedItemElement = null;
-
public ProjectItem SelectedItem {
get { return selectedItem; }
set {
NotifyValueChanged ("SelectedItemElement", selectedItemElement);
}
}
+ public string DisplayName {
+ get { return name; }
+ }
+ /// <summary>
+ /// Gets solution path
+ /// </summary>
+ public String SolutionFolder
+ {
+ get { return Path.GetDirectoryName (path); }
+ }
+
+// public System.CodeDom.Compiler.CompilerErrorCollection CompilationErrors {
+// get {
+// System.CodeDom.Compiler.CompilerErrorCollection tmp = Projects.SelectMany<Project>
+// (p => p.CompilationResults.Errors);
+// return tmp;
+// }
+// }
+ public List<System.CodeDom.Compiler.CompilerError> CompilerErrors {
+ get {
+ int errCount = 0;
+ for (int i = 0; i < Projects.Count; i++) {
+ if (Projects [i].CompilationResults != null)
+ errCount += Projects [i].CompilationResults.Errors.Count;
+ }
+ System.CodeDom.Compiler.CompilerError[] tmp = new System.CodeDom.Compiler.CompilerError[errCount];
+
+ int ptr = 0;
+ for (int i = 0; i < Projects.Count; i++) {
+ if (Projects [i].CompilationResults == null)
+ continue;
+ Projects [i].CompilationResults.Errors.CopyTo (tmp,ptr);
+ ptr += Projects [i].CompilationResults.Errors.Count;
+ }
+ return new List<System.CodeDom.Compiler.CompilerError>(tmp);
+ }
+ }
+
+ public void UpdateErrorList () {
+ NotifyValueChanged ("CompilerErrors", CompilerErrors);
+ }
void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){
ProjectItem pi = e.NewValue as ProjectItem;
/// <summary>
/// Solution name
/// </summary>
- public String name;
-
- public string DisplayName {
- get { return name; }
- }
-
- /// <summary>
- /// File path from where solution was loaded.
- /// </summary>
- [XmlIgnore]
- public String path;
+ String name;
+ /// <summary>
+ /// File path from where solution was loaded.
+ /// </summary>
+ [XmlIgnore]
+ String path;
/// <summary>
/// Solution name for debugger.
{
return "Solution: " + name;
}
-
- /// <summary>
- /// Gets solution path
- /// </summary>
- /// <returns></returns>
- public String SolutionFolder
- {
- get { return Path.GetDirectoryName (path); }
- }
-
- public IList<Project> Projects {
- get {
- List<Project> tmp = new List<Project> ();
- foreach (SolutionProject p in projects) {
- string pp = Path.Combine (SolutionFolder, p.RelativePath.Replace('\\','/'));
- tmp.Add (new Project (pp, this));
- }
- return tmp;
- }
- }
-
+
#region Solution properties
double slnVer; // 11.00 - vs2010, 12.00 - vs2015
/// <summary>
/// List of project included into solution.
/// </summary>
- public List<SolutionProject> projects = new List<SolutionProject>();
+ public List<Project> Projects = new List<Project>();
/// <summary>
/// List of configuration list, in form "{Configuration}|{Platform}", for example "Release|Win32".
}
#endregion
+ public Configuration UserConfig;
+
+ public Project StartupProject {
+ get { return Projects?.FirstOrDefault (p => p.ProjectGuid == UserConfig.Get<string> ("StartupProject")); }
+ set {
+ if (value == StartupProject)
+ return;
+ if (value == null)
+ UserConfig.Set ("StartupProject", "");
+ else {
+ UserConfig.Set ("StartupProject", value.ProjectGuid);
+ value.NotifyValueChanged("IsStartupProject", true);
+ }
+ NotifyValueChanged ("StartupProject", StartupProject);
+
+ }
+ }
#region CTOR
/// <summary>
reProjects.Replace(slnTxt, new MatchEvaluator(m =>
{
- SolutionProject p = new SolutionProject();
+ SolutionProject p = new SolutionProject ();
foreach (String g in reProjects.GetGroupNames())
{
//
var ProjectDependencies = new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Matches(depsv).Cast<Match>().Select(x => x.Groups[1].Value).ToList();
} //foreach
- s.projects.Add(p);
+ s.Projects.Add(new Project (s, p));
return "";
}
)
String action = m3.Groups[3].Value;
String projectConfig = m3.Groups[4].Value;
- SolutionProject p = s.projects.Where(x => x.ProjectGuid == guid).FirstOrDefault();
+ Project p = s.Projects.Where(x => x.ProjectGuid == guid).FirstOrDefault();
if (p == null)
continue;
new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Replace(v, new MatchEvaluator(m5 =>
{
String[] args = m5.Groups.Cast<System.Text.RegularExpressions.Group>().Skip(1).Select(x => x.Value).ToArray();
- SolutionProject child = s.projects.Where(x => args[0] == x.ProjectGuid).FirstOrDefault();
- SolutionProject parent = s.projects.Where(x => args[1] == x.ProjectGuid).FirstOrDefault();
-// parent.nodes.Add(child);
-// child.parent = parent;
+ Project child = s.Projects.Where(x => args[0] == x.ProjectGuid).FirstOrDefault();
+ Project parent = s.Projects.Where(x => args[1] == x.ProjectGuid).FirstOrDefault();
+ parent.dependantProjects.Add(child);
+ child.ParentProject = parent;
return "";
}));
return "";
}
));
+ s.UserConfig = new Configuration (s.path + ".user");
+
return s;
} //LoadSolution
#endregion
--- /dev/null
+//
+// SolutionControler.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace CrowIDE
+{
+ public class SolutionControler
+ {
+ public SolutionControler ()
+ {
+ }
+ }
+}
+
<MenuItem Command="{CMDHelp}"/>
</MenuItem>
</Menu>
-<!-- <HorizontalStack Height="Fit" Margin="2">
- <Image Style="icon" Path="#CrowIDE.images.save.svg" MouseClick="onCommandSave"/>
- </HorizontalStack>-->
- <HorizontalStack DataSource="{CurrentSolution}">
- <TreeView Name="treeview" Width="20%" Height="100%" IsRoot="true"
- Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
- ItemTemplate="#CrowIDE.ui.ProjectTree.template"/>
+ <VerticalStack DataSource="{CurrentSolution}">
+ <HorizontalStack Height="80%">
+ <EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
+ ItemTemplate="#CrowIDE.ui.EditPaneItems.template"/>
+ <Splitter/>
+ <VerticalStack Width="30%">
+ <TreeView Name="treeview" Height="50%" IsRoot="true"
+ Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
+ ItemTemplate="#CrowIDE.ui.ProjectTree.template"/>
+ <Splitter/>
+ <MembersView Instance="{SelectedItemElement}" DataTest="Type" Background="DimGray"
+ ItemTemplate="#CrowIDE.ui.MembersItem.template"/>
+ </VerticalStack>
+ </HorizontalStack>
<Splitter/>
- <EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
- ItemTemplate="#CrowIDE.ui.EditPaneItems.template"/>
- <Splitter/>
- <MembersView Width="30%" Instance="{SelectedItemElement}" DataTest="Type" Background="DimGray"
- ItemTemplate="#CrowIDE.ui.MembersItem.template"/>
- </HorizontalStack>
+ <ListBox Width="Stretched" Data="{CompilerErrors}">
+ <ItemTemplate>
+ <HorizontalStack Height="Fit" Margin="0" Focusable="true" Spacing="15"
+ MouseEnter="{Background=SteelBlue}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="16" Height="16" Path="#Crow.Icons.compiler_error.svg" SvgSub="{IsWarning}"/>
+ <Label Text="{Line}" Width="30" />
+ <Label Text="{ErrorText}" Width="60%"/>
+ <Label Text="{FileName}" Width="Fit"/>
+ </HorizontalStack>
+ </ItemTemplate>
+ </ListBox>
+ </VerticalStack>
+
</VerticalStack>
</Window>
<ItemTemplate>
<TabItem Caption="{DisplayName}" QueryClose="OnQueryClose"/>
</ItemTemplate>
+<ItemTemplate DataType=".cs">
+ <TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
+ <VerticalStack>
+ <HorizontalStack Height="Stretched" >
+ <SourceEditor Focusable="true" Name="editor" Font="monospace, 12" VerticalAlignment="Top" Margin="10"
+ Foreground="Jet" Background="White" Width="Stretched" Height="Stretched"
+ FilePath="{AbsolutePath}" KeyDown="textView_KeyDown"/>
+ <ScrollBar Name="scrollbarY" Value="{²../editor.ScrollY}"
+ LargeIncrement="{../editor.VisibleLines}"
+ CursorSize="{../editor.ChildHeightRatio}"
+ Maximum="{../editor.MaxScrollY}" Orientation="Vertical"
+ Width="14" />
+ </HorizontalStack>
+ <ScrollBar Name="scrollbarX" Value="{²../editor.ScrollX}"
+ Maximum="{../editor.MaxScrollX}" Orientation="Horizontal"
+ Height="14" />
+ <HorizontalStack Height="Fit">
+ <GraphicObject Height="5" Width="Stretched"/>
+ <GraphicObject Background="Red" Width="10" Height="10" Visible="{IsDirty}"/>
+ <Label Text="column:"/>
+ <Label Text="{../../editor.CurrentColumn}"/>
+ <Label Text="Line:"/>
+ <Label Text="{../../editor.CurrentLine}"/>
+ <Label Text="ScrollX:"/>
+ <Label Text="{../../editor.ScrollX}"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </TabItem>
+</ItemTemplate>
<ItemTemplate DataType=".svg">
<TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
<Image Path="{AbsolutePath}"/>
<?xml version="1.0"?>
-<Window Template="#Crow.ToolWindow.template" Caption="Properties" MinimumSize="10,10" Width="Stretched" Height="Stretched">
- <VerticalStack>
- <Border Height="Fit">
- <Label TextAlignment="Left" Text="{../../../../SelectedItemName}" Width="Stretched"/>
- </Border>
- <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
- ValueChanged="./_scroller_ValueChanged">
- <VerticalStack LayoutChanged="./_list_LayoutChanged" Spacing="0"
- Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
- </Scroller>
- </VerticalStack>
-</Window>
+<VerticalStack>
+ <Border Height="Fit">
+ <Label TextAlignment="Left" Text="{../../../SelectedItemName}" Width="Stretched"/>
+ </Border>
+ <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
+ ValueChanged="./_scroller_ValueChanged">
+ <VerticalStack LayoutChanged="./_list_LayoutChanged" Spacing="0"
+ Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
+ </Scroller>
+</VerticalStack>
<Label Text="{}" Background="DarkRed" Foreground="White"/>
</ItemTemplate>
<ItemTemplate DataType="CrowIDE.Project" Data="RootItems">
- <Expandable Caption="{Name}" Template="#Crow.TreeExpandable.template" >
+ <Expandable Caption="{Name}" ContextCommands="{Commands}" >
+ <Template>
+ <VerticalStack>
+ <Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
+ Foreground="Transparent"
+ MouseEnter="{Foreground=DimGray}"
+ MouseLeave="{Foreground=Transparent}">
+ <HorizontalStack Spacing="1">
+ <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+ Path="{./Image}"
+ Visible="{./IsExpandable}"
+ SvgSub="{./IsExpanded}"
+ MouseEnter="{Background=LightGray}"
+ MouseLeave="{Background=Transparent}"/>
+ <Image Margin="1" Width="14" Height="14"
+ Path="#Crow.Icons.project.svg"/>
+ <GraphicObject Width="2" Height="9" Background="Green" Visible="{IsStartupProject}"/>
+ <Label Text="{./Caption}"/>
+ </HorizontalStack>
+ </Border>
+ <Container Name="Content" Visible="false"/>
+ </VerticalStack>
+ </Template>
<HorizontalStack Height="Fit">
<GraphicObject Width="8" Height="10"/>
<TreeView Name="List" Height="Fit" DataTest="Type"
</HorizontalStack>
</Border>
</ItemTemplate>
+<ItemTemplate DataType="ProjectReference">
+ <Border CornerRadius="2" Margin="0" Focusable="true" Height="Fit" Width="Stretched" Foreground="Transparent"
+ MouseEnter="{Foreground=DimGray}"
+ MouseLeave="{Foreground=Transparent}">
+ <HorizontalStack>
+ <Image Margin="1" Width="14" Height="14"
+ Path="#Crow.Icons.projectRef.svg"/>
+ <Label Text="{DisplayName}" Width="Stretched"/>
+ </HorizontalStack>
+ </Border>
+</ItemTemplate>
<ItemTemplate DataType="Compile">
<Border CornerRadius="2" Margin="0" Focusable="true" Height="Fit" Width="Stretched" Foreground="Transparent"
MouseEnter="{Foreground=DimGray}"
Height = Fit;
Width = Stretched;
VerticalAlignment = Top;
+ SelectionBackground = Transparent;
}
MenuItem {
Caption = MenuItem;
Foreground = LightGray;
MouseEnter = {Background = vgradient|0:UnitedNationsBlue|1:Onyx;Foreground=White;}
MouseLeave = {Foreground=LightGray;Background=Transparent;}
+ SelectionBackground = Transparent;
}
MessageBox {
Background = 0.3,0.3,0.3,0.3;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
+<path d="M1,1H15V15H1zM3.5,3.5 12.5,12.5M12.5,3.5 3.5,12.5" fill="none" stroke="#f00" stroke-width="2"/>
+</svg>
\ No newline at end of file
--- /dev/null
+<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
+ <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
+ <g id="False">
+ <title>Layer 1</title>
+ <rect id="svg_1" height="27" width="27" y="2.5" x="2.5" stroke-width="5" stroke="#bf0000" fill="#fff"/>
+ <text font-weight="bold" xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="24" id="svg_2" y="24.84615" x="7.82692" stroke-width="0" stroke="#bf0000" fill="#000000">X</text>
+ </g>
+ <g id="True">
+ <title>Layer 2</title>
+ <path id="svg_1" d="m16.28846,3.46154l13.78846,26.61539l-27.57692,0l13.78846,-26.61539z" stroke-linecap="null" stroke-linejoin="null" stroke-width="3" stroke="#d1d100" fill-opacity="null" fill="#fff"/>
+ <text font-weight="bold" xml:space="preserve" text-anchor="start" font-family="Georgia, Times, 'Times New Roman', serif" font-size="24" id="svg_3" y="27.15385" x="12.44231" stroke-width="0" stroke="#bf0000" fill="#000000">!</text>
+ </g>
+</svg>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="378.30496" height="326.05325" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docbase="C:\Documents and Settings\KevinDuke\Desktop" sodipodi:docname="Ambox_warning_yellow.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" gridtolerance="10000" guidetolerance="10" objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4225" inkscape:cx="90.333919" inkscape:cy="200" inkscape:document-units="px" inkscape:current-layer="layer1" width="400px" height="400px" showgrid="false" inkscape:window-width="1280" inkscape:window-height="750" inkscape:window-x="-8" inkscape:window-y="-8"/>
+ <defs id="defs4">
+ <linearGradient id="linearGradient3149">
+ <stop id="stop3151" style="stop-color:#f6eb71;stop-opacity:1;" offset="0"/>
+ <stop offset="0.5138889" style="stop-color:#ffeb00;stop-opacity:1;" id="stop3271"/>
+ <stop offset="1" style="stop-color:#f4c930;stop-opacity:1;" id="stop3153"/>
+ </linearGradient>
+ <linearGradient id="linearGradient3134">
+ <stop offset="0" style="stop-color:#ffb300;stop-opacity:1;" id="stop3136"/>
+ <stop id="stop3165" style="stop-color:#ff9900;stop-opacity:1;" offset="1"/>
+ </linearGradient>
+ <linearGradient id="linearGradient3140" gradientUnits="userSpaceOnUse" inkscape:collect="always" x1="57.553783" x2="142.16243" xlink:href="#linearGradient3149" y1="-7.0170116" y2="123.27175"/>
+ <linearGradient id="linearGradient3148" gradientUnits="userSpaceOnUse" inkscape:collect="always" x1="57.553783" x2="142.16243" xlink:href="#linearGradient3149" y1="-7.0170116" y2="123.27175"/>
+ <filter inkscape:collect="always" id="filter3172">
+ <feGaussianBlur inkscape:collect="always" stdDeviation="5.0924795" id="feGaussianBlur3174"/>
+ </filter>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient3134" id="linearGradient2184" gradientUnits="userSpaceOnUse" x1="-49.164131" y1="-82.266502" x2="227.38515" y2="216.95886" gradientTransform="matrix(1.2084425,0,0,1.2084425,89.669573,106.93911)"/>
+ </defs>
+ <metadata id="metadata7">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title>3D effect warning triangle</dc:title>
+ <dc:date>18/9/07</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Tim O'Ryan</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <cc:license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/"/>
+ </cc:Work>
+ <cc:License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/">
+ <cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+ <cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/Notice"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/Attribution"/>
+ <cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike"/>
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g inkscape:label="Layer 1" id="layer1" inkscape:groupmode="layer" transform="translate(-15.90328,-38.352144)">
+ <path style="opacity:1;fill:#777777;fill-opacity:0.79729728;stroke:none;stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter3172)" d="M 213.05399,47.37801 C 208.83955,47.5955 205.01929,49.92458 202.89552,53.57127 L 33.940149,345.10803 C 31.700749,348.97294 31.693669,353.73905 33.921559,357.61061 C 36.149459,361.48217 40.273789,363.87084 44.740599,363.87665 L 381.66948,364.40534 C 386.13811,364.41875 390.27406,362.04591 392.51793,358.18147 C 394.7618,354.31704 394.77229,349.54876 392.54546,345.67448 L 224.53419,53.60904 C 222.18314,49.53899 217.74782,47.13166 213.05399,47.37801 L 213.05399,47.37801 z M 213.65821,84.83972 L 360.06857,339.36792 L 66.417039,338.91476 L 213.65821,84.83972 z" id="path3152"/>
+ <path style="opacity:1;fill:url(#linearGradient2184);fill-opacity:1;stroke:#a37900;stroke-width:6.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 199.82666,41.494396 C 195.61222,41.711894 191.79197,44.040971 189.66819,47.687664 L 20.712823,339.22442 C 18.473424,343.08933 18.466339,347.85544 20.694238,351.727 C 22.922136,355.59856 27.04646,357.98723 31.513278,357.99304 L 368.44215,358.52173 C 372.91078,358.53514 377.04674,356.1623 379.2906,352.29786 C 381.53447,348.43343 381.54497,343.66515 379.31813,339.79087 L 211.30686,47.725427 C 208.95581,43.655381 204.52049,41.248051 199.82666,41.494396 L 199.82666,41.494396 z M 200.43088,78.956113 L 346.84124,333.48431 L 53.189715,333.03115 L 200.43088,78.956113 z" id="path2178"/>
+ <path sodipodi:arg2="1.5723975" style="opacity:1;fill:url(#linearGradient3140);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3148);stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="path2160" sodipodi:cx="91.428574" sodipodi:cy="117.14286" sodipodi:arg1="0.52519998" sodipodi:type="star" d="M 230.71429,197.85715 L -48.114905,197.41068 L 91.686339,-43.839248 L 230.71429,197.85715 z" sodipodi:r2="80.491158" sodipodi:sides="3" inkscape:randomized="0" transform="matrix(1.2084425,0,0,1.2084425,89.669573,106.93911)" inkscape:rounded="0" sodipodi:r1="160.98232" inkscape:flatsided="true"/>
+ <path sodipodi:nodetypes="cccsccscccc" d="M 199.89464,117.765 C 197.29017,117.9016 194.92932,119.3644 193.61684,121.65473 L 89.204984,304.75655 C 87.82107,307.18391 87.81669,310.17731 89.193499,312.60887 C 90.570306,315.04044 93.119077,316.54066 95.879504,316.54431 L 304.09647,316.87636 C 306.85801,316.88477 309.41397,315.39449 310.80064,312.96739 C 312.18732,310.54032 312.1938,307.54558 310.81766,305.1123 L 206.98922,121.67846 C 205.53631,119.12222 202.79534,117.61029 199.89464,117.765 L 199.89464,117.765 z" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" id="path19491"/>
+ <path style="font-size:333.22640991px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Angsana New" d="M 203.68708,256.44083 L 198.35371,256.44083 C 197.80195,246.98576 195.96287,235.6645 192.83645,222.47702 L 186.4916,195.60456 C 182.6908,179.49366 180.79042,167.95467 180.79043,160.9876 C 180.79042,146.92949 187.50308,139.90034 200.92845,139.90018 C 206.81347,139.90034 211.67173,141.84424 215.50321,145.73187 C 219.33458,149.61982 221.25031,154.58066 221.25036,160.61436 C 221.25031,167.0216 219.22731,178.685 215.18136,195.60456 L 208.74456,222.47702 C 206.47631,231.93222 204.79048,243.25347 203.68708,256.44083 L 203.68708,256.44083 z M 201.20431,274.07588 C 207.45715,274.07593 212.30007,276.20643 215.7331,280.46742 C 219.166,284.72848 220.88248,289.28498 220.88254,294.13692 C 220.88248,300.54403 218.79818,305.47375 214.62964,308.92611 C 210.461,312.37848 205.98588,314.10466 201.20431,314.10466 C 194.89007,314.10466 190.03183,311.98969 186.62953,307.75978 C 183.22721,303.52985 181.52605,298.9889 181.52607,294.13692 C 181.52605,288.47632 183.41112,283.71765 187.18126,279.86093 C 190.95137,276.00427 195.6257,274.07593 201.20431,274.07588 L 201.20431,274.07588 z" id="text2171"/>
+ </g>
+</svg>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="378.30496" height="326.05325" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docbase="C:\Documents and Settings\KevinDuke\Desktop" sodipodi:docname="Ambox_warning_orange.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" gridtolerance="10000" guidetolerance="10" objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.64877047" inkscape:cx="107.30042" inkscape:cy="95.503105" inkscape:document-units="px" inkscape:current-layer="layer1" width="400px" height="400px" showgrid="false" inkscape:window-width="1280" inkscape:window-height="750" inkscape:window-x="-8" inkscape:window-y="-8"/>
+ <defs id="defs4">
+ <linearGradient id="linearGradient3149">
+ <stop id="stop3151" style="stop-color:#f3c381;stop-opacity:1;" offset="0"/>
+ <stop offset="0.25" style="stop-color:#f4b24e;stop-opacity:1;" id="stop3172"/>
+ <stop offset="0.5" style="stop-color:#f39502;stop-opacity:1;" id="stop3171"/>
+ <stop offset="1" style="stop-color:#f67805;stop-opacity:1;" id="stop3153"/>
+ </linearGradient>
+ <linearGradient id="linearGradient3134">
+ <stop offset="0" style="stop-color:#ffb300;stop-opacity:1;" id="stop3136"/>
+ <stop id="stop3165" style="stop-color:#ff9900;stop-opacity:1;" offset="1"/>
+ </linearGradient>
+ <linearGradient id="linearGradient3140" gradientUnits="userSpaceOnUse" inkscape:collect="always" x1="15.087464" x2="120.05667" xlink:href="#linearGradient3149" y1="9.8531685" y2="108.72849"/>
+ <linearGradient id="linearGradient3148" gradientUnits="userSpaceOnUse" inkscape:collect="always" x1="15.087464" x2="120.05667" xlink:href="#linearGradient3149" y1="9.8531685" y2="108.72849"/>
+ <filter inkscape:collect="always" id="filter3172">
+ <feGaussianBlur inkscape:collect="always" stdDeviation="5.0924795" id="feGaussianBlur3174"/>
+ </filter>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient3134" id="linearGradient2184" gradientUnits="userSpaceOnUse" x1="-49.164131" y1="-82.266502" x2="227.38515" y2="216.95886" gradientTransform="matrix(1.2084425,0,0,1.2084425,89.669573,106.93911)"/>
+ </defs>
+ <metadata id="metadata7">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title>3D effect warning triangle</dc:title>
+ <dc:date>18/9/07</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Tim O'Ryan</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <cc:license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/"/>
+ </cc:Work>
+ <cc:License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/">
+ <cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+ <cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/Notice"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/Attribution"/>
+ <cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike"/>
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g inkscape:label="Layer 1" id="layer1" inkscape:groupmode="layer" transform="translate(-15.90328,-38.352144)">
+ <path style="opacity:1;fill:#777777;fill-opacity:0.79729728;stroke:none;stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter3172)" d="M 213.05399,47.37801 C 208.83955,47.5955 205.01929,49.92458 202.89552,53.57127 L 33.940149,345.10803 C 31.700749,348.97294 31.693669,353.73905 33.921559,357.61061 C 36.149459,361.48217 40.273789,363.87084 44.740599,363.87665 L 381.66948,364.40534 C 386.13811,364.41875 390.27406,362.04591 392.51793,358.18147 C 394.7618,354.31704 394.77229,349.54876 392.54546,345.67448 L 224.53419,53.60904 C 222.18314,49.53899 217.74782,47.13166 213.05399,47.37801 L 213.05399,47.37801 z M 213.65821,84.83972 L 360.06857,339.36792 L 66.417039,338.91476 L 213.65821,84.83972 z" id="path3152"/>
+ <path style="opacity:1;fill:url(#linearGradient2184);fill-opacity:1;stroke:#a37900;stroke-width:6.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 199.82666,41.494396 C 195.61222,41.711894 191.79197,44.040971 189.66819,47.687664 L 20.712823,339.22442 C 18.473424,343.08933 18.466339,347.85544 20.694238,351.727 C 22.922136,355.59856 27.04646,357.98723 31.513278,357.99304 L 368.44215,358.52173 C 372.91078,358.53514 377.04674,356.1623 379.2906,352.29786 C 381.53447,348.43343 381.54497,343.66515 379.31813,339.79087 L 211.30686,47.725427 C 208.95581,43.655381 204.52049,41.248051 199.82666,41.494396 L 199.82666,41.494396 z M 200.43088,78.956113 L 346.84124,333.48431 L 53.189715,333.03115 L 200.43088,78.956113 z" id="path2178"/>
+ <path sodipodi:arg2="1.5723975" style="opacity:1;fill:url(#linearGradient3140);fill-opacity:1.0;fill-rule:nonzero;stroke:url(#linearGradient3148);stroke-width:20.68778610000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="path2160" sodipodi:cx="91.428574" sodipodi:cy="117.14286" sodipodi:arg1="0.52519998" sodipodi:type="star" d="M 230.71429,197.85715 L -48.114905,197.41068 L 91.686339,-43.839248 L 230.71429,197.85715 z" sodipodi:r2="80.491158" sodipodi:sides="3" inkscape:randomized="0" transform="matrix(1.2084425,0,0,1.2084425,89.669573,106.93911)" inkscape:rounded="0" sodipodi:r1="160.98232" inkscape:flatsided="true"/>
+ <path sodipodi:nodetypes="cccsccscccc" d="M 199.89464,117.765 C 197.29017,117.9016 194.92932,119.3644 193.61684,121.65473 L 89.204984,304.75655 C 87.82107,307.18391 87.81669,310.17731 89.193499,312.60887 C 90.570306,315.04044 93.119077,316.54066 95.879504,316.54431 L 304.09647,316.87636 C 306.85801,316.88477 309.41397,315.39449 310.80064,312.96739 C 312.18732,310.54032 312.1938,307.54558 310.81766,305.1123 L 206.98922,121.67846 C 205.53631,119.12222 202.79534,117.61029 199.89464,117.765 L 199.89464,117.765 z" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" id="path19491"/>
+ <path style="font-size:333.22640991px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Angsana New" d="M 203.68708,256.44083 L 198.35371,256.44083 C 197.80195,246.98576 195.96287,235.6645 192.83645,222.47702 L 186.4916,195.60456 C 182.6908,179.49366 180.79042,167.95467 180.79043,160.9876 C 180.79042,146.92949 187.50308,139.90034 200.92845,139.90018 C 206.81347,139.90034 211.67173,141.84424 215.50321,145.73187 C 219.33458,149.61982 221.25031,154.58066 221.25036,160.61436 C 221.25031,167.0216 219.22731,178.685 215.18136,195.60456 L 208.74456,222.47702 C 206.47631,231.93222 204.79048,243.25347 203.68708,256.44083 L 203.68708,256.44083 z M 201.20431,274.07588 C 207.45715,274.07593 212.30007,276.20643 215.7331,280.46742 C 219.166,284.72848 220.88248,289.28498 220.88254,294.13692 C 220.88248,300.54403 218.79818,305.47375 214.62964,308.92611 C 210.461,312.37848 205.98588,314.10466 201.20431,314.10466 C 194.89007,314.10466 190.03183,311.98969 186.62953,307.75978 C 183.22721,303.52985 181.52605,298.9889 181.52607,294.13692 C 181.52605,288.47632 183.41112,283.71765 187.18126,279.86093 C 190.95137,276.00427 195.6257,274.07593 201.20431,274.07588 L 201.20431,274.07588 z" id="text2171"/>
+ </g>
+</svg>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 64 64"
+ height="64"
+ width="64">
+ <g>
+ <path fill="#007fff" stroke="#111111" stroke-width="2" d="m1.655043,19.482317l17.905939,-17.913175l25.323143,0l17.905937,17.913175l0,25.333551l-17.905937,17.913147l-25.323143,0l-17.905939,-17.913147l0,-25.333551z" id="svg_2"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 64 64"
+ height="64"
+ width="64"
+ id="svg2"
+ version="1.1">
+ <defs id="defs6" />
+ <g>
+ <path fill="#007fff" stroke="#111111" stroke-width="2" d="m1.655043,19.482317l17.905939,-17.913175l25.323143,0l17.905937,17.913175l0,25.333551l-17.905937,17.913147l-25.323143,0l-17.905939,-17.913147l0,-25.333551z" id="svg_2"/>
+ <path
+ d="M 15,33.964845 A 6.2543149,5.8551034 0 0 1 8.7456846,39.819949 6.2543149,5.8551034 0 0 1 2.4913703,33.964845 6.2543149,5.8551034 0 0 1 8.7456846,28.109741 6.2543149,5.8551034 0 0 1 15,33.964845 Z M 30.205524,19.726298 h 24.484978 c 3.833495,0 6.919666,3.88699 6.919666,8.715226 v 11.046641 c 0,4.828235 -3.086171,8.715225 -6.919666,8.715225 H 30.205524 c -3.833494,0 -6.919665,-3.88699 -6.919665,-8.715225 V 28.441524 c 0,-4.828236 3.086171,-8.715226 6.919665,-8.715226 z M 15,33.964845 h 8.285859"
+ style="opacity:1;fill:#a0a8ab;fill-opacity:1;stroke:#181818;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
+ id="path819" />
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="378.30496" height="326.05325" id="svg2" sodipodi:version="0.32" inkscape:version="0.46" version="1.0" sodipodi:docbase="C:\Documents and Settings\KevinDuke\Desktop" sodipodi:docname="Ambox_warning_blue_construction.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" gridtolerance="10000" guidetolerance="10" objecttolerance="10" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.64877047" inkscape:cx="-125.04673" inkscape:cy="39.346892" inkscape:document-units="px" inkscape:current-layer="layer1" width="400px" height="400px" showgrid="false" inkscape:window-width="1264" inkscape:window-height="764" inkscape:window-x="0" inkscape:window-y="0"/>
+ <defs id="defs4">
+ <linearGradient id="linearGradient3134">
+ <stop offset="0" style="stop-color:#4c99f5;stop-opacity:1;" id="stop3136"/>
+ <stop id="stop3165" style="stop-color:#1361ba;stop-opacity:1;" offset="0.5"/>
+ <stop offset="1" style="stop-color:#194c9a;stop-opacity:1;" id="stop3138"/>
+ </linearGradient>
+ <linearGradient id="linearGradient3140" gradientUnits="userSpaceOnUse" inkscape:collect="always" x1="91.29969" x2="244.97258" xlink:href="#linearGradient3134" y1="4.3178039" y2="237.70302"/>
+ <linearGradient id="linearGradient3148" gradientUnits="userSpaceOnUse" inkscape:collect="always" x1="91.29969" x2="244.97258" xlink:href="#linearGradient3134" y1="4.3178039" y2="237.70302"/>
+ <filter inkscape:collect="always" id="filter3172">
+ <feGaussianBlur inkscape:collect="always" stdDeviation="5.0924795" id="feGaussianBlur3174"/>
+ </filter>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient3134" id="linearGradient2184" gradientUnits="userSpaceOnUse" x1="29.753853" y1="-13.269632" x2="202.58235" y2="183.58783" gradientTransform="matrix(1.2084425,0,0,1.2084425,89.669573,106.93911)"/>
+ </defs>
+ <metadata id="metadata7">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title>3D effect warning triangle</dc:title>
+ <dc:date>18/9/07</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Tim O'Ryan</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <cc:license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/"/>
+ </cc:Work>
+ <cc:License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/">
+ <cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+ <cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/Notice"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/Attribution"/>
+ <cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+ <cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike"/>
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g inkscape:label="Layer 1" id="layer1" inkscape:groupmode="layer" transform="translate(-15.90328,-38.352144)">
+ <path style="opacity:1;fill:#777777;fill-opacity:0.79729728;stroke:none;stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter3172)" d="M 213.05399,47.37801 C 208.83955,47.5955 205.01929,49.92458 202.89552,53.57127 L 33.940149,345.10803 C 31.700749,348.97294 31.693669,353.73905 33.921559,357.61061 C 36.149459,361.48217 40.273789,363.87084 44.740599,363.87665 L 381.66948,364.40534 C 386.13811,364.41875 390.27406,362.04591 392.51793,358.18147 C 394.7618,354.31704 394.77229,349.54876 392.54546,345.67448 L 224.53419,53.60904 C 222.18314,49.53899 217.74782,47.13166 213.05399,47.37801 L 213.05399,47.37801 z M 213.65821,84.83972 L 360.06857,339.36792 L 66.417039,338.91476 L 213.65821,84.83972 z" id="path3152"/>
+ <path style="opacity:1;fill:url(#linearGradient2184);fill-opacity:1;stroke:#001387;stroke-width:6.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 199.82666,41.494396 C 195.61222,41.711894 191.79197,44.040971 189.66819,47.687664 L 20.712823,339.22442 C 18.473424,343.08933 18.466339,347.85544 20.694238,351.727 C 22.922136,355.59856 27.04646,357.98723 31.513278,357.99304 L 368.44215,358.52173 C 372.91078,358.53514 377.04674,356.1623 379.2906,352.29786 C 381.53447,348.43343 381.54497,343.66515 379.31813,339.79087 L 211.30686,47.725427 C 208.95581,43.655381 204.52049,41.248051 199.82666,41.494396 L 199.82666,41.494396 z M 200.43088,78.956113 L 346.84124,333.48431 L 53.189715,333.03115 L 200.43088,78.956113 z" id="path2178"/>
+ <path sodipodi:arg2="1.5723975" style="opacity:1;fill:url(#linearGradient3140);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3148);stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="path2160" sodipodi:cx="91.428574" sodipodi:cy="117.14286" sodipodi:arg1="0.52519998" sodipodi:type="star" d="M 230.71429,197.85715 L -48.114905,197.41068 L 91.686339,-43.839248 L 230.71429,197.85715 z" sodipodi:r2="80.491158" sodipodi:sides="3" inkscape:randomized="0" transform="matrix(1.2084425,0,0,1.2084425,89.669573,106.93911)" inkscape:rounded="0" sodipodi:r1="160.98232" inkscape:flatsided="true"/>
+ <path sodipodi:nodetypes="cccsccscccc" d="M 199.89464,117.765 C 197.29017,117.9016 194.92932,119.3644 193.61684,121.65473 L 89.204984,304.75655 C 87.82107,307.18391 87.81669,310.17731 89.193499,312.60887 C 90.570306,315.04044 93.119077,316.54066 95.879504,316.54431 L 304.09647,316.87636 C 306.85801,316.88477 309.41397,315.39449 310.80064,312.96739 C 312.18732,310.54032 312.1938,307.54558 310.81766,305.1123 L 206.98922,121.67846 C 205.53631,119.12222 202.79534,117.61029 199.89464,117.765 L 199.89464,117.765 z" style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:20.6877861;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" id="path19491"/>
+ <g id="g2689" transform="matrix(0.4429717,0,0,0.4429717,130.45212,176.47068)">
+ <path id="path633" style="font-size:12px;fill-rule:evenodd" d="M 385.98026,297.1542 L 140.36506,297.47 C 138.14026,297.2692 136.52876,296.7617 137.37106,294.1072 L 227.62156,178.4191 C 230.74276,173.9958 235.45166,171.6041 240.18906,171.7401 L 285.54036,171.6433 C 292.89546,171.6399 295.73166,173.769 299.77886,178.8507 L 388.15426,292.9709 C 388.96306,294.9787 388.23836,296.9865 385.98026,297.1542 z"/>
+ <rect id="rect613" style="font-size:12px;fill:#000002;fill-rule:evenodd" transform="matrix(0.8854492,0.4647361,-0.4080531,0.9129582,0,0)" y="-14.842998" x="123.87642" ry="11.816919" rx="11.204546" height="124.68408" width="62.141693"/>
+ <rect id="rect615" style="font-size:12px;fill-rule:evenodd" y="46.624874" x="62.235527" ry="8" rx="9.4117651" height="32.5" width="100.00001"/>
+ <rect id="rect616" style="font-size:12px;fill-rule:evenodd" transform="matrix(0.4686899,-0.8833628,0.7446349,0.6674719,0,0)" y="81.759407" x="-81.341789" ry="6.8044353" rx="8.770999" height="27.643017" width="93.191841"/>
+ <rect id="rect617" style="font-size:12px;fill-rule:evenodd" transform="matrix(0.8845854,0.4663782,-0.4366812,0.8996163,0,0)" y="83.646034" x="80.548698" ry="3.8168414" rx="27.532589" height="15.505919" width="292.53378"/>
+ <rect id="rect618" style="font-size:12px;fill-rule:evenodd" transform="matrix(-5.7205843e-2,-0.9983624,0.9970356,-7.6942184e-2,0,0)" y="144.00377" x="-203.17215" ry="6.6537714" rx="12.701341" height="27.030947" width="134.95171"/>
+ <ellipse sodipodi:ry="32.5" sodipodi:rx="31.25" sodipodi:cy="467.36218" sodipodi:cx="418.75" id="path619" style="font-size:12px;fill-rule:evenodd;stroke-width:1" transform="matrix(0.957573,0,0,0.972804,-219.55633,-423.0267)" ry="32.5" rx="31.25" cy="467.36218" cx="418.75"/>
+ <rect id="rect621" style="font-size:12px;fill-rule:evenodd" transform="matrix(-0.2340079,-0.9722347,0.9856452,-0.16883,0,0)" y="45.608078" x="-250.27161" ry="7.6888905" rx="7.3474178" height="31.236115" width="78.066315"/>
+ <rect id="rect622" style="font-size:12px;fill-rule:evenodd" transform="matrix(-7.5698648e-3,-0.9999713,0.9970336,7.6967061e-2,0,0)" y="100.42473" x="-287.73053" ry="7.6912837" rx="7.3637767" height="31.245834" width="78.240143"/>
+ <rect id="rect623" style="font-size:12px;fill-rule:evenodd" transform="matrix(0.4947081,-0.8690592,0.8178671,0.5754071,0,0)" y="135.70329" x="-232.42075" ry="7.8654013" rx="14.748785" height="31.953188" width="156.70583"/>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<MenuItem MinimumSize="20,20" Fit="true" Caption="Context Menu" Data="{ContextCommands}" Orientation="Vertical"
+ IsOpened ="true" Visible="{/IsOpened}" SelectionBackground="Transparent"
+ Background="Red">
+ <Template>
+ <HorizontalStack>
+ <Border Background="DimGray" Foreground="Jet" CornerRadius="5">
+ <GenericStack Orientation="{./Orientation}" Name="ItemsContainer"
+ Margin="2"/>
+ </Border>
+ </HorizontalStack>
+ </Template>
+ <ItemTemplate>
+ <MenuItem Command="{}" Width="150" PopWidth="120" SelectionBackground="Transparent">
+ <Template>
+ <Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}"
+ Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
+ IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
+ <Template>
+ <Border Name="border1"
+ CornerRadius="2"
+ MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MouseLeave="{Foreground=Transparent}"
+ MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
+ MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MinimumSize = "60,0"
+ Foreground="Transparent"
+ Background="{./Background}">
+ <Label Text="{./Caption}"
+ Foreground="{./Foreground}"
+ Margin="3" HorizontalAlignment="Left"
+ Font="{./Font}" />
+ </Border>
+ </Template>
+ <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="Onyx">
+ <VerticalStack Name="ItemsContainer"/>
+ </Border>
+ </Popper>
+ </Template>
+ </MenuItem>
+ </ItemTemplate>
+</MenuItem>
+
<?xml version="1.0"?>
-<HorizontalStack Name="ItemsContainer" Margin="0" Background="{./Background}"/>
+<GenericStack Orientation="{./Orientation}" Name="ItemsContainer" Margin="0" Background="{./Background}"/>
Background="{./Background}">
<Label Text="{./Caption}"
Foreground="{./Foreground}"
- Margin="1" HorizontalAlignment="Left"
+ Margin="2" HorizontalAlignment="Left"
Font="{./Font}" />
</Border>
</Template>
string[] testFiles;
#region Test values for Binding
+ public List<Crow.Command> Commands;
public int intValue = 500;
DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
//DirectoryInfo curDir = new DirectoryInfo (@"/mnt/data/Images");
void OnLoadList (object sender, MouseButtonEventArgs e) => TestList = Color.ColorDic.Values.ToList();
+ void command1(){
+ Console.WriteLine("command1 triggered");
+ }
+ void command2(){
+ Console.WriteLine("command2 triggered");
+ }
+ void command3(){
+ Console.WriteLine("command3 triggered");
+ }
+ void command4(){
+ Console.WriteLine("command4 triggered");
+ }
+
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
+ Commands = new List<Crow.Command> (new Crow.Command[] {
+ new Crow.Command(new Action(() => command1())) { Caption = "command1"},
+ new Crow.Command(new Action(() => command2())) { Caption = "command2"},
+ new Crow.Command(new Action(() => command3())) { Caption = "command3"},
+ new Crow.Command(new Action(() => command4())) { Caption = "command4"},
+ });
+
this.KeyDown += KeyboardKeyDown1;
//testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" };
//testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
//testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
//testFiles = new string [] { @"Interfaces/TemplatedContainer/testTabView.crow" };
- testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" };
+ //testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" };
+ //testFiles = new string [] { @"Interfaces/GraphicObject/testCtxMenu.crow" };
+ testFiles = new string [] { @"Interfaces/TemplatedControl/testItemTemplateTag.crow" };
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
Load(testFiles[idx]).DataSource = this;
--- /dev/null
+<?xml version="1.0"?>
+<GraphicObject MouseEnter="{Background=Red}" MouseLeave="{Background=Green}" Margin="10" Width="50%" Height="50%" Focusable="true"
+ Background="hgradient|0:Red|0.25:Blue|0.5:Green|0.75:Yellow|1:Red"
+ MinimumSize="50,50" ContextCommands="{Commands}"/>
\ No newline at end of file
<None Include="Interfaces\Divers\testShape.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\GraphicObject\testCtxMenu.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
///
/// ```csharp\n
/// //storing\n
- /// Configuration.Set ("Option1", 42);\n
+ /// Configuration.Global.Set ("Option1", 42);\n
/// //loading\n
- /// int op1 = Configuration.Get<int> ("Option1");\n
+ /// int op1 = Configuration.Global.Get<int> ("Option1");\n
/// ```\n
/// </summary>
///
///
/// When running the application for the first time, some default options may be necessary. Their can be defined
/// in a special embedded resource text file with the key '**appname.default.config**'
- public static class Configuration
+ public class Configuration
{
- volatile static bool isDirty = false;
- static string configPath, configFileName = "app.config";
- static Dictionary<string, ConfigItem> items;
+ volatile bool isDirty = false;
+ string configPath;
+ Dictionary<string, ConfigItem> items = new Dictionary<string, ConfigItem> ();
+ static Configuration globalConfig;
+ public static Configuration Global { get { return globalConfig; } }
+
+ public Configuration (string path, Stream defaultConf = null) {
+ configPath = path;
+ if (File.Exists (configPath)) {
+ using (Stream s = new FileStream (configPath, FileMode.Open))
+ load (s);
+
+ } else if (defaultConf != null) {
+ load (defaultConf);
+ }
+ startSavingThread ();
+ }
static Configuration ()
{
- items = new Dictionary<string, ConfigItem> ();
string configRoot =
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
Assembly a = Assembly.GetEntryAssembly ();
string appName = a.GetName().Name;
+ string globalConfigPath = Path.Combine (configRoot, appName);
- configPath = Path.Combine (configRoot, appName);
+ if (!Directory.Exists (globalConfigPath))
+ Directory.CreateDirectory (globalConfigPath);
- if (!Directory.Exists(configPath))
- Directory.CreateDirectory (configPath);
+ globalConfigPath = Path.Combine (globalConfigPath, "global.config");
- string path = Path.Combine(configPath, configFileName);
-
- if (File.Exists (path)) {
- using (Stream s = new FileStream (path, FileMode.Open))
- load (s);
- } else {
- string defaultConfigResID = appName + ".default.config";
- bool found = false;
- foreach (string resIds in a.GetManifestResourceNames()) {
- if (string.Equals (defaultConfigResID, resIds, StringComparison.OrdinalIgnoreCase)) {
- using (Stream s = a.GetManifestResourceStream (defaultConfigResID))
- load (s);
- found = true;
- break;
- }
+ string defaultConfigResID = appName + ".default.config";
+ foreach (string resIds in a.GetManifestResourceNames()) {
+ if (string.Equals (defaultConfigResID, resIds, StringComparison.OrdinalIgnoreCase)) {
+ using (Stream s = a.GetManifestResourceStream (defaultConfigResID))
+ globalConfig = new Configuration (globalConfigPath, s);
+ return;
}
- if (!found)
- Console.WriteLine ("No Default Config found. ({0})", defaultConfigResID);
}
- startSavingThread ();
+ globalConfig = new Configuration (globalConfigPath);
}
- static void startSavingThread(){
+ void startSavingThread(){
Thread t = new Thread (savingThread);
t.IsBackground = true;
t.Start ();
}
- static void savingThread(){
+ void savingThread(){
while(true){
if (isDirty) {
save ();
/// retrive the value of the configuration key given in parameter
/// </summary>
/// <param name="key">option name</param>
- public static T Get<T>(string key)
+ public T Get<T>(string key)
{
return !items.ContainsKey (key) ? default(T) : items [key].GetValue<T> ();
}
/// </summary>
/// <param name="key">option name</param>
/// <param name="value">value for that option</param>
- public static void Set<T>(string key, T value)
+ public void Set<T>(string key, T value)
{
if (!items.ContainsKey (key)) {
lock(items)
items[key].Set (value);
isDirty = true;
}
- static void save(){
- using (Stream s = new FileStream(Path.Combine(configPath, configFileName),FileMode.Create)){
+ void save(){
+ using (Stream s = new FileStream(configPath,FileMode.Create)){
using (StreamWriter sw = new StreamWriter (s)) {
lock (items) {
foreach (string key in items.Keys) {
}
}
}
- static void load(Stream s){
+ void load(Stream s){
using (StreamReader sr = new StreamReader (s)) {
while (!sr.EndOfStream) {
string l = sr.ReadLine();
bool isDragged;
bool allowDrag;
bool allowDrop;
-
+ string tooltip;
+ IList<Command> contextCommands;
#endregion
#region public fields
/// Seek first logical tree upward if logicalParent is set, or seek graphic tree for
/// a not null dataSource that will be active for all descendants having dataSource=null
/// </summary>
- [XmlAttributeAttribute][DefaultValue(null)]
+ [XmlAttributeAttribute]//[DefaultValue(null)]
public virtual object DataSource {
set {
if (DataSource == value)
dataSource = value;
dse.NewDataSource = DataSource;
+ //prevent setting null causing stack overflow in specific case
+ if (dse.NewDataSource == dse.OldDataSource)
+ return;
+
OnDataSourceChanged (this, dse);
NotifyValueChanged ("DataSource", DataSource);
NotifyValueChanged ("Style", style);
}
}
- string tooltip;
[XmlAttributeAttribute]
public virtual string Tooltip {
get { return tooltip; }
NotifyValueChanged("Tooltip", tooltip);
}
}
+ [XmlAttributeAttribute]
+ public IList<Command> ContextCommands {
+ get { return contextCommands; }
+ set {
+ if (contextCommands == value)
+ return;
+ contextCommands = value;
+ NotifyValueChanged("ContextCommands", contextCommands);
+ }
+ }
#endregion
#region Default and Style Values loading
#endregion
#region Mouse handling
+ public virtual bool PointIsIn(ref Point m)
+ {
+ if (!(Visible & isEnabled)||IsDragged)
+ return false;
+ ILayoutable tmp = Parent;
+ //while (tmp != null){
+ if (!parent.PointIsIn(ref m))
+ return false;
+ m -= (parent.getSlot().Position + parent.ClientRectangle.Position) ;
+
+ return Slot.ContainsOrIsEqual (m);
+ }
public virtual bool MouseIsIn(Point m)
{
- try {
- if (!(Visible & isEnabled)||IsDragged)
- return false;
- if (ScreenCoordinates (Slot).ContainsOrIsEqual (m)) {
- Scroller scr = Parent as Scroller;
- if (scr == null) {
- if (Parent is GraphicObject)
- return (Parent as GraphicObject).MouseIsIn (m);
- else return true;
- }
- return scr.MouseIsIn (scr.savedMousePos);
- }
- } catch (Exception ex) {
- return false;
- }
- return false;
+ Point p = m;
+ return PointIsIn (ref m);
+// try {
+// if (!(Visible & isEnabled)||IsDragged)
+// return false;
+// ILayoutable tmp = Parent;
+// //while (tmp != null){
+// if (!parent.MouseIsIn(m))
+// return false;
+// m -= (parent.getSlot().Position + parent.ClientRectangle.Position) ;
+//
+// return slot.ContainsOrIsEqual (m);
+//// Scroller scr = tmp as Scroller;
+//// if (scr != null) {
+//// m.Y += scr.ScrollY;
+//// m.X += scr.ScrollX;
+//// }
+//// tmp = tmp.Parent;
+// //}
+//
+// //}
+// } catch (Exception ex) {
+// return false;
+// }
+ //return false;
}
public virtual void checkHoverWidget(MouseMoveEventArgs e)
{
onMouseEnter (this, e);
}
- this.onMouseMove (this, e);//without this, window border doesn't work, should be removed
+ //this.onMouseMove (this, e);//without this, window border doesn't work, should be removed
}
public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
{
if (be.Focused == null) {
be.Focused = this;
CurrentInterface.FocusedWidget = this;
+ if (e.Button == MouseButton.Right && this.ContextCommands != null)
+ CurrentInterface.ShowContextMenu (this);
}
}
//bubble event to the top
lock (children) {
foreach (GraphicObject g in children)
if (g.localDataSourceIsNull & g.localLogicalParentIsNull)
- g.OnDataSourceChanged (sender, e);
+ g.OnDataSourceChanged (g, e);
}
}
public override GraphicObject FindByName (string nameToFind)
void RegisterForLayouting(LayoutingType layoutType);
void RegisterClip(Rectangle clip);
bool UpdateLayout(LayoutingType layoutType);
-
+ bool PointIsIn(ref Point m);
Rectangle ContextCoordinates(Rectangle r);
Rectangle ScreenCoordinates (Rectangle r);
public event EventHandler Open;
public event EventHandler Close;
- string caption;
Command command;
Picture icon;
bool isOpened;
if (isOpened) {
onOpen (this, null);
- (LogicalParent as Menu).AutomaticOpenning = true;
+ if (LogicalParent is Menu)
+ (LogicalParent as Menu).AutomaticOpenning = true;
}else
onClose (this, null);
}
}
void onMI_Click (object sender, MouseButtonEventArgs e)
{
- if (command != null)
+ if (command != null) {
command.Execute ();
+ closeMenu ();
+ }
if(!IsOpened)
(LogicalParent as Menu).AutomaticOpenning = false;
}
Open.Raise (this, null);
}
protected virtual void onClose (object sender, EventArgs e){
+ System.Diagnostics.Debug.WriteLine ("close: " + this.ToString());
Close.Raise (this, null);
}
public override bool MouseIsIn (Point m)
IsOpened = false;
base.onMouseLeave (this, e);
}
+
+ void closeMenu () {
+ MenuItem tmp = LogicalParent as MenuItem;
+ while (tmp != null) {
+ tmp.IsOpened = false;
+ tmp = tmp.LogicalParent as MenuItem;
+ }
+ }
}
}
base.onMouseLeave (this, e);
IsPopped = false;
}
+// public override bool PointIsIn (ref Point m)
+// {
+// if (!base.PointIsIn (ref m))
+// return false;
+//
+// }
public override bool MouseIsIn (Point m)
{
bool isInContent = false;
base.OnDataSourceChanged (this, e);
if (child != null)
if (child.localDataSourceIsNull & child.localLogicalParentIsNull)
- child.OnDataSourceChanged (sender, e);
+ child.OnDataSourceChanged (child, e);
}
public override bool UpdateLayout (LayoutingType layoutType)
{
}
#region Mouse handling
- internal Point savedMousePos;
- public override bool MouseIsIn (Point m)
- {
- return Visible ? base.ScreenCoordinates(Slot).ContainsOrIsEqual (m) : false;
- }
- public override void checkHoverWidget (MouseMoveEventArgs e)
+ //internal Point savedMousePos;
+
+ public override bool PointIsIn (ref Point m)
{
- savedMousePos = e.Position;
- Point m = e.Position - new Point (ScrollX, ScrollY);
- base.checkHoverWidget (new MouseMoveEventArgs(m.X,m.Y,e.XDelta,e.YDelta));
+// if (!(Visible & IsEnabled)||IsDragged)
+// return false;
+// ILayoutable tmp = Parent;
+// //while (tmp != null){
+// if (!Parent.PointIsIn(ref m))
+// return false;
+// m -= (Parent.getSlot().Position + Parent.ClientRectangle.Position);
+// if (!Slot.ContainsOrIsEqual (m) || child==null)
+// return false;
+// m += new Point (ScrollX, ScrollY);
+// return true;
+ if (!base.PointIsIn(ref m))
+ return false;
+ //m -= (Parent.getSlot().Position + Parent.ClientRectangle.Position);
+ if (!Slot.ContainsOrIsEqual (m) || child==null)
+ return false;
+ m += new Point (ScrollX, ScrollY);
+ return true;
}
+// public override bool MouseIsIn (Point m)
+// {
+// return Visible ? base.ScreenCoordinates(Slot).ContainsOrIsEqual (m) : false;
+// }
+// public override void checkHoverWidget (MouseMoveEventArgs e)
+// {
+// savedMousePos = e.Position;
+// Point m = e.Position - new Point (ScrollX, ScrollY);
+// base.checkHoverWidget (new MouseMoveEventArgs(m.X,m.Y,e.XDelta,e.YDelta));
+// }
public override void onMouseWheel (object sender, MouseWheelEventArgs e)
{
if (Child == null)
if (HorizontalScrolling )
ScrollX -= e.Delta * ScrollSpeed;
}
- public override void onMouseMove (object sender, MouseMoveEventArgs e)
- {
- savedMousePos.X += e.XDelta;
- savedMousePos.Y += e.YDelta;
- base.onMouseMove (sender, new MouseMoveEventArgs(savedMousePos.X,savedMousePos.Y,e.XDelta,e.YDelta));
- }
+// public override void onMouseMove (object sender, MouseMoveEventArgs e)
+// {
+// savedMousePos.X += e.XDelta;
+// savedMousePos.Y += e.YDelta;
+// base.onMouseMove (sender, new MouseMoveEventArgs(savedMousePos.X,savedMousePos.Y,e.XDelta,e.YDelta));
+// }
public override void RegisterClip (Rectangle clip)
{
base.RegisterClip (clip - new Point(ScrollX,ScrollY));
}
public override bool Contains (GraphicObject goToFind)
{
- if (Content == null)
- return base.Contains (goToFind);
-
if (Content == goToFind)
return true;
- return Content.Contains (goToFind);
+ if (Content?.Contains (goToFind) == true)
+ return true;
+ return base.Contains (goToFind);
}
#endregion
}
#endif
Group page;
- if (typeof(TabView).IsAssignableFrom (items.GetType ())||typeof(Wrapper).IsAssignableFrom (items.GetType ())) {
+ if (typeof(TabView).IsAssignableFrom (items.GetType ())||
+ typeof(Menu).IsAssignableFrom (this.GetType())||
+ typeof(Wrapper).IsAssignableFrom (items.GetType ())) {
page = items;
itemPerPage = int.MaxValue;
} else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
lock (CurrentInterface.LayoutMutex) {
g = iTemp.CreateInstance(CurrentInterface);
page.AddChild (g);
- //g.LogicalParent = this;
+// if (isPaged)
+// g.LogicalParent = this;
registerItemClick (g);
}
if (splitedExp.Length < 2)//dataSource binding
return null;
- if (string.IsNullOrEmpty (splitedExp [0]) || splitedExp [0] == ".") {//search template root
- ptr--;
- while (ptr >= 0) {
- if (typeof(TemplatedControl).IsAssignableFrom (this [ptr].CrowType))
- break;
+ if (!string.IsNullOrEmpty (splitedExp [0])) {//else bind on current node
+ //return new NodeAddress (this.Take(ptr+1).ToArray());
+ if (splitedExp [0] == ".") {//search template root
ptr--;
+ while (ptr >= 0) {
+ if (typeof(TemplatedControl).IsAssignableFrom (this [ptr].CrowType))
+ break;
+ ptr--;
+ }
+ } else if (splitedExp [0] == "..") { //search starting at current node
+ int levelUp = splitedExp.Length - 1;
+ if (levelUp > ptr + 1)
+ throw new Exception ("Binding error: try to bind outside IML source");
+ ptr -= levelUp;
}
- } else if (splitedExp [0] == "..") { //search starting at current node
- int levelUp = splitedExp.Length - 1;
- if (levelUp > ptr + 1)
- throw new Exception ("Binding error: try to bind outside IML source");
- ptr -= levelUp;
}
expression = splitedExp [splitedExp.Length - 1];
//TODO:change Template special address identified with Nodecount = 0 to something not using array count to 0,
this.IsPressed = pressed;
}
+ public MouseButtonEventArgs(MouseButton button)
+ : base()
+ {
+ this.button = button;
+ }
+
/// <summary>
/// Constructs a new <see cref="MouseButtonEventArgs"/> instance.
/// </summary>
if (!Directory.Exists (CrowConfigRoot))
Directory.CreateDirectory (CrowConfigRoot);
+ //ensure all assemblies are loaded, because IML could contains classes not instanciated in source
+// foreach (string af in Directory.GetFiles (AppDomain.CurrentDomain.BaseDirectory, "*.dll")){
+// try {
+// Assembly.LoadFrom (af);
+// } catch (Exception ex) {
+// Console.WriteLine ("{0} not loaded as assembly.", af);
+// }
+// }
+
loadCursors ();
findAvailableTemplates ();
CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
loadStyling ();
initTooltip ();
+ initContextMenus ();
}
#endregion
/// <summary>Set visible state of widget to false and remove if from the graphic tree</summary>
public void RemoveWidget(GraphicObject g)
{
+ if (g.Contains(HoverWidget)) {
+ while (HoverWidget != g.LogicalParent) {
+ HoverWidget.onMouseLeave (HoverWidget, null);
+ HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ }
+ }
lock (UpdateMutex) {
RegisterClip (g.ScreenCoordinates (g.LastPaintedSlot));
GraphicTree.Remove (g);
public bool ProcessMouseButtonUp(int button)
{
Mouse.DisableBit (button);
- MouseButtonEventArgs e = new MouseButtonEventArgs () { Mouse = Mouse };
+ MouseButtonEventArgs e = new MouseButtonEventArgs ((Crow.MouseButton)button) { Mouse = Mouse };
if (_activeWidget == null)
return false;
public bool ProcessMouseButtonDown(int button)
{
Mouse.EnableBit (button);
- MouseButtonEventArgs e = new MouseButtonEventArgs () { Mouse = Mouse };
+ MouseButtonEventArgs e = new MouseButtonEventArgs ((Crow.MouseButton)button) { Mouse = Mouse };
if (HoverWidget == null)
return false;
}
#endregion
+ #region Contextual menu
+ MenuItem ctxMenuContainer;
+ void initContextMenus (){
+ ctxMenuContainer = Load ("#Crow.ContextMenu.template") as MenuItem;
+ }
+
+ public void ShowContextMenu (GraphicObject go) {
+
+ if (ctxMenuContainer.Parent == null)
+ this.AddWidget (ctxMenuContainer);
+ else
+ ctxMenuContainer.IsOpened = true;
+
+ ctxMenuContainer.LogicalParent = go;
+ ctxMenuContainer.DataSource = go;
+
+ PutOnTop (ctxMenuContainer, true);
+ ctxMenuContainer.Left = Mouse.X - 5;
+ ctxMenuContainer.Top = Mouse.Y - 5;
+
+ HoverWidget = ctxMenuContainer;
+ ctxMenuContainer.onMouseEnter (ctxMenuContainer, new MouseMoveEventArgs (Mouse.X, Mouse.Y, 0, 0));
+ }
+ #endregion
+
#region Device Repeat Events
volatile bool mouseRepeatOn, keyboardRepeatOn;
volatile int mouseRepeatCount, keyboardRepeatCount;
#endregion
#region ILayoutable implementation
+ public virtual bool PointIsIn(ref Point m)
+ {
+ return true;
+ }
public void RegisterClip(Rectangle r){
clipping.UnionRectangle (r);
}