<Compile Include="src\ObservableList.cs" />
<Compile Include="src\GraphicObjects\IMLContainer.cs" />
<Compile Include="src\DragDropEventArgs.cs" />
- <Compile Include="src\GraphicObjects\Docker.cs" />
<Compile Include="src\GraphicObjects\DockWindow.cs" />
<Compile Include="src\ParsingException.cs" />
<Compile Include="src\IMLAttributes.cs" />
cmdCloseSolution = new Command(new Action(() => closeSolution()))
{ Caption = "Close Solution", Icon = new SvgPicture("#Crow.Coding.ui.icons.paste-on-document.svg"), CanExecute = false};
- CMDViewErrors = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winErrors.crow")))
+ CMDViewErrors = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winErrors.crow",this)))
{ Caption = "Errors pane"};
- CMDViewSolution = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow")))
+ CMDViewSolution = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow",this)))
{ Caption = "Solution Tree", CanExecute = false};
- CMDViewEditor = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winEditor.crow")))
+ CMDViewEditor = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winEditor.crow",this)))
{ Caption = "Editor Pane"};
- CMDViewProperties = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winProperties.crow")))
+ CMDViewProperties = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winProperties.crow",this)))
{ Caption = "Properties"};
- CMDViewDesign = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winDesign.crow")))
+ CMDViewDesign = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winDesign.crow",this)))
{ Caption = "Quick Design", CanExecute = true};
- CMDViewToolbox = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow")))
+ CMDViewToolbox = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow",this)))
{ Caption = "Toolbox", CanExecute = false};
- CMDViewSchema = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winSchema.crow")))
+ CMDViewSchema = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winSchema.crow",this)))
{ Caption = "IML Shematic View", CanExecute = true};
- CMDViewStyling = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winStyleView.crow")))
+ CMDViewStyling = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winStyleView.crow",this)))
{ Caption = "Styling Explorer", CanExecute = true};
- CMDViewGTExp = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winGTExplorer.crow")))
+ CMDViewGTExp = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winGTExplorer.crow")))
{ Caption = "Graphic Tree Explorer", CanExecute = false};
CMDCompile = new Command(new Action(() => compileSolution()))
{ Caption = "Compile", CanExecute = false};
Instantiator instFileDlg;
Solution currentSolution;
Project currentProject;
- Docker mainDock;
+ DockStack mainDock;
public static Interface MainIFace;
public static CrowIDE MainWin;
MainIFace = ifaceControl[0].CrowInterface;
- mainDock = go.FindByName ("mainDock") as Docker;
+ mainDock = go.FindByName ("mainDock") as DockStack;
if (ReopenLastSolution && !string.IsNullOrEmpty (LastOpenSolution)) {
CurrentSolution = Solution.LoadSolution (LastOpenSolution);
instFileDlg = Instantiator.CreateFromImlFragment
(MainIFace, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.sln' OkClicked='onFileOpen'/>");
- DockWindow dw = loadDockWindow ("#Crow.Coding.ui.DockWindows.winEditor.crow");
+ DockWindow dw = loadWindow ("#Crow.Coding.ui.DockWindows.winEditor.crow", this) as DockWindow;
dw.DockingPosition = Alignment.Center;
- dw.Dock (mainDock.Children [0] as DockStack);
- dw = loadDockWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow");
+ dw.Dock (mainDock);
+ dw = loadWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow", this) as DockWindow;
dw.DockingPosition = Alignment.Right;
- dw.Dock (mainDock.Children [0] as DockStack);
- dw = loadDockWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow");
+ dw.Dock (mainDock);
+ dw = loadWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow", this) as DockWindow;
dw.DockingPosition = Alignment.Left;
- dw.Dock (mainDock.Children [0] as DockStack);
+ dw.Dock (mainDock);
}
// loadWindow ("#Crow.Coding.ui.CSProjExplorer.crow");
// }
}
- DockWindow loadDockWindow(string path){
- lock (MainIFace.UpdateMutex) {
- GraphicObject g = MainIFace.FindByName (path);
- if (g == null){
- try {
- g = MainIFace.Load (path);
- mainDock.AddChild (g);
- g.Name = path;
- g.DataSource = CurrentSolution;
- } catch (Exception ex) {
- System.Diagnostics.Debug.WriteLine (ex.ToString ());
- }
- }
- return g as DockWindow;
- }
- }
- void loadWindow(string path, object dataSource = null){
+// DockWindow loadDockWindow(string path){
+// lock (MainIFace.UpdateMutex) {
+// GraphicObject g = MainIFace.FindByName (path);
+// if (g == null){
+// try {
+// g = MainIFace.Load (path);
+// mainDock.AddChild (g);
+// g.Name = path;
+// g.DataSource = CurrentSolution;
+// } catch (Exception ex) {
+// System.Diagnostics.Debug.WriteLine (ex.ToString ());
+// }
+// }
+// return g as DockWindow;
+// }
+// }
+ Window loadWindow(string path, object dataSource = null){
try {
GraphicObject g = MainIFace.FindByName (path);
if (g != null)
- return;
+ return g as Window;
g = MainIFace.AddWidget (path);
g.Name = path;
g.DataSource = dataSource;
+ return g as Window;
} catch (Exception ex) {
System.Diagnostics.Debug.WriteLine (ex.ToString ());
}
+ return null;
}
void closeWindow (string path){
GraphicObject g = MainIFace.FindByName (path);
Picture icoMove, icoStyle;
Rectangle rIcons = default(Rectangle);
- Size iconSize = new Size(10,10);
+ Size iconSize = new Size(11,11);
public List<Crow.Command> Commands;
Crow.Command cmdDelete;
}
SelectedItem = HoverWidget;
- if (SelectedItem != null && projFile != null) {
- projFile.CurrentLine = SelectedItem.design_line;
- projFile.CurrentColumn = SelectedItem.design_column;
- }
+// if (SelectedItem != null && projFile != null) {
+// projFile.CurrentLine = SelectedItem.design_line;
+// projFile.CurrentColumn = SelectedItem.design_column;
+// }
}
} else {
gr.SetSourceColor (Color.LavenderBlush);
gr.Rectangle (cb, 2.0 / z);
- drawCenteredTextLine(gr, cb.Center, Error.InnerException?.Message);
+ string[] lerrs = Error.ToString ().Split ('\n');
+ Point p = cb.Center;
+ p.Y -= lerrs.Length * 20;
+ foreach (string le in lerrs) {
+ drawCenteredTextLine(gr, p, le);
+ p.Y += 20;
+
+ }
}
gr.Stroke ();
drawCenteredTextLine (gr, new PointD(center.X,center.Y), txt);
}
void drawCenteredTextLine (Context gr, PointD center, string txt){
+ if (string.IsNullOrEmpty(txt))
+ return;
FontExtents fe = gr.FontExtents;
TextExtents te = gr.TextExtents (txt);
</MenuItem>
</Menu>
<!-- <Label DataSource="{CurrentSolution}" Text="{SelectedItemElement}" Width="Stretched"/>-->
- <Docker Name="mainDock">
- <DockStack />
+<!-- <Docker >-->
+ <DockStack Name="mainDock"/>
<!-- <DockWindow DataSource="{CurrentSolution}" Name="winEditor" Caption="Edit View" Width="70%" Height="80%">
<Template>
<Border BorderWidth="1" Foreground="DimGray" CornerRadius="{./CornerRadius}"
<EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
ItemTemplate="#Crow.Coding.ui.EditPaneItems.template"/>
</DockWindow>-->
- </Docker>
+<!-- </Docker>-->
</VerticalStack>
</Window>
<?xml version="1.0"?>
-<DockWindow DataSource="{CurrentSolution}" Name="winEditor" Caption="Edit View">
- <EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
+<DockWindow Name="winEditor" Caption="Edit View">
+ <EditPane DataSource="{CurrentSolution}" SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
ItemTemplate="#Crow.Coding.ui.EditPaneItems.template"/>
</DockWindow>
<?xml version="1.0"?>
-<DockWindow DataSource="{CurrentSolution}" Name="winProperties" Caption="Properties" Width="20%">
- <MembersView ProjectNode="{SelectedItem}"
+<DockWindow Name="winProperties" Caption="Properties" Width="20%">
+ <MembersView DataSource="{CurrentSolution}" ProjectNode="{SelectedItem}"
Instance="{SelectedItemElement}" DataTest="Type"
ItemTemplate="#Crow.Coding.ui.MembersItem.template"/>
</DockWindow>
<?xml version="1.0"?>
-<DockWindow DataSource="{CurrentSolution}" Name="winSolution" Caption="Solution" Width="20%">
- <TreeView Name="treeview" IsRoot="true"
+<DockWindow Name="winSolution" Caption="Solution" Width="20%">
+ <TreeView Name="treeview" IsRoot="true" DataSource="{CurrentSolution}"
Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
ItemTemplate="#Crow.Coding.ui.ProjectTree.template"/>
</DockWindow>
<Label DataSource="{../editor.HoverWidget}" Width="Stretched" Margin="1" Text="{Name}"/>
<VerticalStack Height="60%" Width="Stretched" Margin="0" MinimumSize="10,10">
<HorizontalStack>
- <Scroller Name="scroller1"
- Margin="2" ScrollY="{../scrollbar1.Value}">
+ <Scroller Name="scroller1" Margin="2" >
<ImlVisualEditor Foreground="SkyBlue" Name="editor" Background="Gray"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10"
Width="512" Height="512" ContextCommands="{/Commands}"
Background = "Onyx";
Focusable = "true";
AllowDrag = "true";
+ AlwaysOnTop = "true";
Margin="0";
Width="200";
Height="200";
</Border>
<GraphicObject Width="5"/>
</HorizontalStack>
- <Container Name="Content" MinimumSize="50,50" Background="DimGray">
+ <Container Name="Content" MinimumSize="50,50" Background="Jet">
<VerticalStack Margin="1">
<HorizontalStack Height="Fit">
<Button Fit="true" Caption="Up" MouseClick="./goUpDirClick">
SelectedItemChanged="./onSelectedItemChanged">
<Template>
<HorizontalStack>
- <Scroller ScrollX="{../scrollbar1.Value}" Name="scroller1">
+ <Scroller Name="scroller1">
<VerticalStack Height="Fit" VerticalAlignment="Top"
Name="ItemsContainer" Margin="0" Spacing="1"/>
</Scroller>
- <ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
- LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
+ <ScrollBar Name="scrollbar1" Orientation="Vertical"
+ Value="{²../scroller1.ScrollY}" Maximum="{../scroller1.MaxScrollY}"
CursorSize="{../scroller1.ChildHeightRatio}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
Width="14" />
</HorizontalStack>
</Template>
this.KeyDown += KeyboardKeyDown1;
- testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
+ //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
//testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
//testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Experimental", "*.crow")).ToArray ();
Load(testFiles[idx]).DataSource = this;
+
+ LoadIMLFragment (@"<DockWindow Width=""150"" Height=""150"" Background=""DarkRed"" />", 0);
+ LoadIMLFragment (@"<DockWindow Width=""200"" Height=""150"" Background=""DarkGreen"" />", 0);
+ LoadIMLFragment (@"<DockWindow Width=""250"" Height=""150"" Background=""Brown"" />", 0);
+ LoadIMLFragment (@"<DockWindow Width=""300"" Height=""150"" Background=""DarkBlue"" />", 0);
+
+
}
void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
{
<?xml version="1.0"?>
-<VerticalStack>
- <Docker>
- <DockStack Background="DimGray"/>
- <DockWindow Width="150" Height="150" Background="DarkRed" />
- <DockWindow Width="150" Height="150" Background="DarkGreen"/>
- <DockWindow Width="150" Height="150" Background="Blue"/>
- <DockWindow Width="150" Height="150" Background="DarkYellow"/>
- <DockWindow Width="150" Height="150" Background="Yellow"/>
- <DockWindow Width="150" Height="150" Background="BrownWeb"/>
- </Docker>
+<Window Height="50%" Width="60%">
+ <DockStack Background="#60101050" Margin="10"/>
+</Window>
<!--- <DockWindow Left="400" Top="400" Width="150" Height="150" Background="MediumSeaGreen"/>
<DockWindow Left="450" Top="450" Width="150" Height="150" Background="Maize"/>-->
-</VerticalStack>
+
<!--<Group Background="DimGray" Margin = "0" Focusable="true" >
<Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
<Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
{
[DesignIgnore]
public class DockStack : GenericStack
- {
- Docker rootDock { get { return LogicalParent as Docker; }}
-
+ {
#region CTor
public DockStack () {}
public DockStack (Interface iface) : base (iface) {}
public override void AddChild (GraphicObject g)
{
base.AddChild (g);
- g.LogicalParent = this.LogicalParent;
+ if (localLogicalParentIsNull)
+ g.LogicalParent = this;
+ else
+ g.LogicalParent = this.LogicalParent;
}
public override void InsertChild (int idx, GraphicObject g)
{
Rectangle savedSlot; //last undocked slot recalled when view is undocked
bool wasResizable;
- public Docker RootDock { get { return LogicalParent as Docker; }}
-
public bool IsDocked {
get { return isDocked; }
set {
DockStack ds = Parent as DockStack;
ds.Undock (this);
- RootDock.AddChild (this);
+ IFace.AddWidget (this);
this.Left = savedSlot.Left;
this.Top = savedSlot.Top;
LastSlots = LastPaintedSlot = Slot = default(Rectangle);
Left = Top = 0;
- Group g = Parent as Group;
- g.RemoveChild (this);
+ IFace.RemoveWidget (this);
target.Dock (this);
}
+++ /dev/null
-//
-// DocksView.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;
-using System.Xml.Serialization;
-using System.ComponentModel;
-using Crow.IML;
-using System.Collections.Generic;
-using System.Diagnostics;
-
-namespace Crow
-{
- public class Docker : Group
- {
- #region CTOR
- static Docker () {
- }
- public Docker () : base ()
- {
- }
- #endregion
-
- int dockingThreshold;
-
-
- [XmlAttributeAttribute][DefaultValue(10)]
- public virtual int DockingThreshold {
- get { return dockingThreshold; }
- set {
- if (dockingThreshold == value)
- return;
- dockingThreshold = value;
- NotifyValueChanged ("DockingThreshold", dockingThreshold);
- }
- }
-
- public override void AddChild (GraphicObject g)
- {
- base.AddChild (g);
- g.LogicalParent = this;
- }
-
- public override void onMouseMove (object sender, MouseMoveEventArgs e)
- {
- if (IFace.DragAndDropOperation?.DragSource as DockWindow != null) {
- DockWindow dw = IFace.DragAndDropOperation.DragSource as DockWindow;
- if (!dw.IsDocked) {
- Rectangle r = dw.ScreenCoordinates (dw.Slot);
- Point p = ScreenPointToLocal (e.Position);
- dw.Left = p.X - r.Width / 2;
- dw.Top = p.Y - r.Height / 2;
- }
- }
- base.onMouseMove (sender, e);
- }
-
- public string ExportWinConfigs () {
- return "";
- }
- }
-}
-
if (string.IsNullOrEmpty(value))
Picture = null;
else {
- lock(IFace.LayoutMutex){
+ //lock(IFace.LayoutMutex){
LoadImage (value);
- }
+ //}
}
} catch (Exception ex) {
Debug.WriteLine (ex.Message);