<Folder Include="src\SourceEditor\" />
<Folder Include="ui\ItemTemplates\" />
<Folder Include="src\MemberView\" />
+ <Folder Include="ui\DockWindows\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="images\save.svg" />
<EmbeddedResource Include="ui\MembersItem.template" />
<EmbeddedResource Include="ui\ItemTemplates\Enum.template" />
<EmbeddedResource Include="ui\ItemTemplates\Fill.template" />
+ <EmbeddedResource Include="ui\DockWindows\winEditor.crow" />
+ <EmbeddedResource Include="ui\DockWindows\winErrors.crow" />
+ <EmbeddedResource Include="ui\DockWindows\winSolution.crow" />
</ItemGroup>
<ItemGroup>
<None Include="ui\test.crow">
public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit,
CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp,
CMDAbout, CMDOptions,
- CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps,
+ CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps, CMDViewErrors, CMDViewSolution,
CMDCompile;
void initCommands () {
CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#Crow.Coding.ui.icons.question.svg")};
CMDOptions = new Command(new Action(() => openOptionsDialog())) { Caption = "Editor Options", Icon = new SvgPicture("#Crow.Coding.ui.icons.tools.svg")};
+ CMDViewErrors = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winErrors.crow")))
+ { Caption = "Errors pane"};
+ CMDViewSolution = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow")))
+ { Caption = "Solution Tree"};
+
CMDViewGTExp = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.GTreeExplorer.crow"))) { Caption = "Graphic Tree Explorer"};
CMDViewProps = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.MemberView.crow"))) { Caption = "Properties View"};
CMDCompile = new Command(new Action(() => compileSolution())) { Caption = "Compile"};
Instantiator instFileDlg;
Solution currentSolution;
+ Docker mainDock;
public static Interface MainIFace;
MainIFace = ifaceControl[0].CrowInterface;
+ mainDock = go.FindByName ("mainDock") as Docker;
+
if (ReopenLastSolution && !string.IsNullOrEmpty (LastOpenSolution)) {
CurrentSolution = Solution.LoadSolution (LastOpenSolution);
//lock(MainIFace.UpdateMutex)
CurrentSolution.ReopenItemsSavedInUserConfig ();
}
-
instFileDlg = Instantiator.CreateFromImlFragment
(MainIFace, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.sln' OkClicked='onFileOpen'/>");
}
// loadWindow ("#Crow.Coding.ui.CSProjExplorer.crow");
// }
}
+ void loadDockWindow(string path){
+ lock (MainIFace.UpdateMutex) {
+ try {
+ GraphicObject g = MainIFace.FindByName (path);
+ if (g != null)
+ return;
+ g = MainIFace.Load (path);
+ mainDock.AddChild (g);
+ g.Name = path;
+ g.DataSource = CurrentSolution;
+ } catch (Exception ex) {
+ System.Diagnostics.Debug.WriteLine (ex.ToString ());
+ }
+ }
+ }
void loadWindow(string path, object dataSource = null){
try {
GraphicObject g = MainIFace.FindByName (path);
saveOpenedItemsInUserConfig ();
}
public void CloseItem (ProjectItem pi) {
- Console.WriteLine ("CloseItem");
+ Console.WriteLine ("CloseItem: " + pi.ToString());
openedItems.RemoveElement (pi);
saveOpenedItemsInUserConfig ();
}
<MenuItem Command="{CMDOptions}"/>
</MenuItem>
<MenuItem Caption="View" Fit="true" PopWidth="150">
+ <MenuItem Command="{CMDViewSolution}"/>
+ <MenuItem Command="{CMDViewErrors}"/>
<MenuItem Command="{CMDViewGTExp}"/>
<MenuItem Command="{CMDViewProps}"/>
<MenuItem Command="{CMDViewProj}"/>
<MenuItem Command="{CMDHelp}"/>
</MenuItem>
</Menu>
- <VerticalStack DataSource="{CurrentSolution}">
- <Label Background="Gray" Text="{SelectedItem}" Width="Stretched" TextAlignment="Left"/>
- <HorizontalStack Height="80%">
+ <Docker Name="mainDock">
+ <DockWindow DataSource="{CurrentSolution}" Name="winEditor" Caption="Edit View" Width="70%" Height="80%">
+ <Template>
+ <Border BorderWidth="1" Foreground="Jet" CornerRadius="{./CornerRadius}"
+ Background="{./Background}"
+ MouseEnter="./onBorderMouseEnter"
+ MouseLeave="./onBorderMouseLeave">
+ <Container Name="Content" MinimumSize="50,50"/>
+ </Border>
+ </Template>
<EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
ItemTemplate="#Crow.Coding.ui.EditPaneItems.template"/>
- <Splitter/>
- <VerticalStack Width="30%">
- <TreeView Name="treeview" Height="50%" IsRoot="true"
- Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
- ItemTemplate="#Crow.Coding.ui.ProjectTree.template"/>
- <Splitter/>
- <MembersView ProjectNode="{SelectedItem}"
- Instance="{SelectedItemElement}" DataTest="Type"
- ItemTemplate="#Crow.Coding.ui.MembersItem.template"/>
- </VerticalStack>
- </HorizontalStack>
- <Splitter/>
- <ListBox Width="Stretched" Data="{CompilerErrors}">
- <ItemTemplate>
- <HorizontalStack Height="Fit" Margin="0" Focusable="true" Spacing="10"
- MouseEnter="{Background=SteelBlue}"
- MouseLeave="{Background=Transparent}">
- <Image Width="10" Height="10" Path="#Crow.Icons.compiler_error.svg" SvgSub="{IsWarning}"/>
- <Label Text="{Line}" Width="25" TextAlignment="Right"/>
- <Label Text="{ErrorText}" Width="60%"/>
- <Label Text="{FileName}" Width="Fit"/>
- </HorizontalStack>
- </ItemTemplate>
- </ListBox>
- </VerticalStack>
-
+ </DockWindow>
+ </Docker>
</VerticalStack>
</Window>
--- /dev/null
+<?xml version="1.0"?>
+<DockWindow DataSource="{CurrentSolution}" Name="winEditor" Caption="Edit View" Width="70%" Height="80%">
+ <EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
+ ItemTemplate="#Crow.Coding.ui.EditPaneItems.template"/>
+</DockWindow>
--- /dev/null
+<?xml version="1.0"?>
+<DockWindow DataSource="{CurrentSolution}" Name="winErrors" Caption="Errors" Width="70%" Height="20%">
+ <ListBox Width="Stretched" Data="{CompilerErrors}">
+ <ItemTemplate>
+ <HorizontalStack Height="Fit" Margin="0" Focusable="true" Spacing="10"
+ MouseEnter="{Background=SteelBlue}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="10" Height="10" Path="#Crow.Icons.compiler_error.svg" SvgSub="{IsWarning}"/>
+ <Label Text="{Line}" Width="25" TextAlignment="Right"/>
+ <Label Text="{ErrorText}" Width="60%"/>
+ <Label Text="{FileName}" Width="Fit"/>
+ </HorizontalStack>
+ </ItemTemplate>
+ </ListBox>
+</DockWindow>
--- /dev/null
+<?xml version="1.0"?>
+<DockWindow DataSource="{CurrentSolution}" Name="winSolution" Caption="Solution" Width="30%" Height="80%">
+ <VerticalStack>
+ <TreeView Name="treeview" IsRoot="true" Height="50%"
+ Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
+ ItemTemplate="#Crow.Coding.ui.ProjectTree.template"/>
+ <Splitter/>
+ <MembersView ProjectNode="{SelectedItem}"
+ Instance="{SelectedItemElement}" DataTest="Type"
+ ItemTemplate="#Crow.Coding.ui.MembersItem.template"/>
+ </VerticalStack>
+</DockWindow>
}
Splitter {
Focusable = "true";
- Margin = "2";
+ Margin = "1";
Background = "Gray";
}
Spinner {
}
Docker {
AllowDrop = "false";
- Margin="1";
+ Margin="0";
Focusable="true";
}
DockStack {
- Margin="3";
+ Margin="1";
AllowDrop = "true";
Focusable="true";
//DragEnter="{Background=Blue}";
DockWindow {
Focusable = "true";
AllowDrag = "true";
+ Margin="0";
}
FileDialog {
Template = "#Crow.FileDialog.template";
MouseLeave="./onBorderMouseLeave">
<VerticalStack Spacing="0">
<HorizontalStack Background="vgradient|0:0.5,0.6,0.5,0.5|1:0.2,0.3,0.3,0.7"
- Name="hs" Margin="2" Spacing="0" Height="Fit">
+ Name="hs" Margin="0" Spacing="0" Height="Fit">
<GraphicObject Width="5"/>
- <Image Margin="1" Width="12" Height="12" Path="{./Icon}"/>
+ <Image Margin="1" Width="10" Height="10" Path="{./Icon}"/>
<Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Center" Text="{./Caption}" />
- <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
+ <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="10" Width="10"
MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
MouseClick="./butQuitPress"/>
</Border>
<GraphicObject Width="5"/>
</HorizontalStack>
- <Container Name="Content" MinimumSize="50,50" Background="0.5,0.5,0.5,0.5"/>
+ <Container Name="Content" MinimumSize="50,50"/>
</VerticalStack>
</Border>
namespace Crow
{
public class DockStack : GenericStack
- {
- internal static Instantiator instStack, instSplit;//, instSpacer;
-
- int dockingDiv = 5;
+ {
+ int dockingDiv = 6;
GraphicObject subStack = null;
Docker rootDock { get { return LogicalParent as Docker; }}
public DockStack (Interface iface) : base (iface) {}
#endregion
- protected override void onInitialized (object sender, EventArgs e)
- {
- base.onInitialized (sender, e);
- instStack = IFace.CreateITorFromIMLFragment (@"<DockStack/>");
- instSplit = IFace.CreateITorFromIMLFragment (@"<Splitter/>");
- //instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='Transparent' IsEnabled='false'/>");
- }
-
public override void AddChild (GraphicObject g)
{
base.AddChild (g);
dsp.SubStack = SubStack;
return;
}
- public void Dock(DockWindow dw){
- Splitter splitter = instSplit.CreateInstance<Splitter> ();
+ public void Dock(DockWindow dw){
Rectangle r = ClientRectangle;
int vTreshold = r.Height / dockingDiv;
activeStack = this;
Orientation = dw.DockingPosition.GetOrientation ();
}else if (dw.DockingPosition.GetOrientation() != Orientation) {
- activeStack = instStack.CreateInstance<DockStack> ();
+ activeStack = new DockStack (IFace);
int ci = Children.IndexOf (rootDock.CenterDockedObj);
if (ci <0 ){
DockStack dsp = Parent as DockStack;
dw.Height = vTreshold;
dw.Width = Measure.Stretched;
activeStack.InsertChild (0, dw);
- activeStack.InsertChild (1, splitter);
+ activeStack.InsertChild (1, new Splitter(IFace));
break;
case Alignment.Bottom:
dw.Height = vTreshold;
dw.Width = Measure.Stretched;
- activeStack.AddChild (splitter);
+ activeStack.AddChild (new Splitter(IFace));
activeStack.AddChild (dw);
break;
case Alignment.Left:
dw.Width = hTreshold;
dw.Height = Measure.Stretched;
activeStack.InsertChild (0, dw);
- activeStack.InsertChild (1, splitter);
+ activeStack.InsertChild (1, new Splitter(IFace));
break;
case Alignment.Right:
dw.Width = hTreshold;
dw.Height = Measure.Stretched;
- activeStack.AddChild (splitter);
+ activeStack.AddChild (new Splitter(IFace));
activeStack.AddChild (dw);
break;
case Alignment.Center:
}
public override void RemoveChild (GraphicObject child)
{
- lock (IFace.UpdateMutex) {
- RegisterClip (ScreenCoordinates (LastPaintedSlot));
- }
+// lock (IFace.UpdateMutex) {
+// RegisterClip (ScreenCoordinates (LastPaintedSlot));
+// }
base.RemoveChild (child);
}
int thickness;
- [XmlAttributeAttribute][DefaultValue(1)]
+ [XmlAttributeAttribute][DefaultValue(3)]
public virtual int Thickness {
get { return thickness; }
set {