]> O.S.I.I.S - jp/crow.git/commitdiff
wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 7 Dec 2018 03:24:53 +0000 (04:24 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 7 Dec 2018 03:24:53 +0000 (04:24 +0100)
13 files changed:
CrowIDE/CrowIDE.csproj
CrowIDE/src/CrowIDE.cs
CrowIDE/src/Editors/CodeBuffer/TextEditor.cs
CrowIDE/src/ProjectTree/ProjectFile.cs
CrowIDE/ui/IDE.style
CrowIDE/ui/ProjectTree.template
Tests/BasicTests.cs
Tests/Interfaces/GraphicObject/0.crow
src/Configuration.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/TabItem.cs
src/Interface.cs
src/Rectangle.cs

index 7f23c32a8881748734d15bc9acbe9014ca22d2ee..bf02c662e7f4bfaaba9718c7b5291bd24c017c83 100644 (file)
     <Folder Include="src\Editors\CodeBuffer\" />
     <Folder Include="src\ProjectTree\" />
     <Folder Include="src\Editors\Parsers2\" />
+    <Folder Include="src\ProjectTree\msbuild\" />
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="images\save.svg" />
index 5db4af6d4ed7873f87f0338849b4632c4206941c..55ea1570a88d5882d21e5421d24a936e35ee1e6d 100644 (file)
@@ -36,8 +36,6 @@ namespace Crow.Coding
 {
        class CrowIDE : Interface
        {
-               static bool running = true;
-
                public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, cmdCloseSolution, CMDQuit,
                CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp,
                CMDAbout, CMDOptions,
@@ -50,7 +48,7 @@ namespace Crow.Coding
                        CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#Crow.Coding.icons.open.svg")};
                        CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#Crow.Coding.icons.save.svg"), CanExecute = false};
                        CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#Crow.Coding.icons.save.svg"), CanExecute = false};
-                       CMDQuit = new Command(new Action(() => running = false)) { Caption = "Quit", Icon = new SvgPicture("#Crow.Coding.ui.icons.sign-out.svg")};
+                       CMDQuit = new Command(new Action(() => app.running = false)) { Caption = "Quit", Icon = new SvgPicture("#Crow.Coding.ui.icons.sign-out.svg")};
                        CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#Crow.Coding.icons.undo.svg"), CanExecute = false};
                        CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#Crow.Coding.icons.redo.svg"), CanExecute = false};
                        //CMDCut = new Command(new Action(() => Quit (null, null))) { Caption = "Cut", Icon = new SvgPicture("#Crow.Coding.icons.scissors.svg"), CanExecute = false};
@@ -105,6 +103,7 @@ namespace Crow.Coding
 
                public void saveWinConfigs() {
                        Configuration.Global.Set ("WinConfigs", mainDock.ExportConfig ());
+                       Configuration.Global.Save ();
                }
                public void reloadWinConfigs() {
                        string conf = Configuration.Global.Get<string>("WinConfigs");
@@ -125,13 +124,9 @@ namespace Crow.Coding
 
                                app.reloadWinConfigs ();
 
-                               while (running) {
-                                       app.ProcessEvents ();
-                                       //Thread.Sleep(1);
-                               }
+                               app.Run ();
 
                                app.saveWinConfigs ();
-                               Thread.Sleep (500);
                        }
                }
 
index d5d9240a78c745214df9a14922af27d50f9f4bb7..feef6b410609045f69b153308776665d3c1f506b 100644 (file)
@@ -230,7 +230,7 @@ namespace Crow.Text
                                }
                        }
                }
-               [DefaultValue("BlueGrey")]
+               [DefaultValue("Blue")]
                public virtual Color SelectionBackground {
                        get { return selBackground; }
                        set {
index 2fab8ec49e7390c0f6cf58612eb2b9533a1c0297..7218c1d113a6cb0017d49d1551d01e7822ddc33f 100644 (file)
@@ -56,7 +56,7 @@ namespace Crow.Coding
                        { Caption = "Save As ..", Icon = new SvgPicture ("#Crow.Coding.icons.save.svg"), CanExecute = false };
                        cmdOpen = new Crow.Command (new Action (() => Open ())) 
                        { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.icons.open.svg"), CanExecute = true };
-                       cmdClose = new Crow.Command (new Action (() => Close ())) 
+                       cmdClose = new Crow.Command (new Action (() => OnQueryClose (this,null))) 
                        { Caption = "Close", Icon = new SvgPicture ("#Crow.Coding.icons.open.svg"), CanExecute = false };
                        cmdUndo = new Crow.Command (new Action (() => Undo (null))) 
                        { Caption = "Undo", Icon = new SvgPicture ("#Crow.Coding.icons.undo.svg"), CanExecute = false };
@@ -110,6 +110,7 @@ namespace Crow.Coding
                                NotifyValueChanged ("IsOpened", isOpened);
                        }
                }
+
                public void UnregisterEditor (object editor){
                        lock(RegisteredEditors){
                                RegisteredEditors.Remove (editor);
index 9f01cc2d3af59af85ca26e66b5c85fb297b0f443..3ba5ed42139ae86dc4d1107154ef4a7baccb6279 100644 (file)
@@ -39,7 +39,7 @@ TabItem {
 TreeItemBorder {
        CornerRadius="2";
        Margin="0";
-       Focusable="true";
+       //Focusable="true";
        Height="Fit";
        Width="Stretched";
        Foreground="Transparent";
index 1b4b0543559b79f1f715980bf3fdcff8deb2da39..a18b67dcdbdc71e830946f6d57625f75738c3c94 100644 (file)
        </Border>
 </ItemTemplate>
 <ItemTemplate DataType="Crow.Coding.Project" Data="RootItems" DataTest="Type">
-       <Expandable Caption="{Name}" ContextCommands="{Commands}" IsExpanded="{²IsExpanded}">
+       <Expandable Caption="{Name}" ContextCommands="{Commands}" IsExpanded="{²IsExpanded}" MouseDoubleClick="/onClickForExpand">
                <Template>
                        <VerticalStack>
-                               <Border Style="TreeItemBorder" Focusable="true" MouseDoubleClick="./onClickForExpand">
+                               <Border Style="TreeItemBorder" >
                                        <HorizontalStack Spacing="1">
                                                <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
                                                        Path="{./Image}"
@@ -27,6 +27,7 @@
                                                        Path="#Crow.Icons.crowproj.svg"/>
                                                <GraphicObject Width="4" Height="9" Background="Green" Visible="{IsStartupProject}"/>
                                                <Label Text="{./Caption}"/>
+                                               <Label Text="{./Caption}" Visible="{IsStartupProject}" Font="mono bold, 12"/>
                                        </HorizontalStack>
                                </Border>
                                <Container Name="Content" Visible="false"/>
index 8984951b5aee076a75f776f150b4f8839b082e35..43b4da946c5bef8b0a09caa8ad2cb040866f2f47 100644 (file)
@@ -110,14 +110,14 @@ namespace tests
                                app.CMDTest = new Command(new Action(() => app.AddWidget (app.instFileDlg.CreateInstance()).DataSource = app)) { Caption = "Test", Icon = new SvgPicture("#Tests.image.blank-file.svg"), CanExecute = true};
                                //app.AddWidget (@"Interfaces/Divers/testFocus.crow").DataSource = app;
                                //app.AddWidget (@"Interfaces/Divers/testMenu.crow").DataSource = app;
-                               app.AddWidget (@"Interfaces/Divers/testVisibility.crow").DataSource = app;
+                               //app.AddWidget (@"Interfaces/Divers/testVisibility.crow").DataSource = app;
                                //app.AddWidget (@"Interfaces/Divers/0.crow").DataSource = app;
                                //app.AddWidget (@"Interfaces/Splitter/1.crow").DataSource = app;
-                               //app.AddWidget (@"Interfaces/Container/0.crow").DataSource = app;
+                               app.AddWidget (@"Interfaces/GraphicObject/0.crow").DataSource = app;
                                //app.AddWidget (@"Interfaces/TemplatedContainer/test_Listbox.crow").DataSource = app;
 
-                               app.instFileDlg = Crow.IML.Instantiator.CreateFromImlFragment
-                                       (app, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}'/>");
+                               /*app.instFileDlg = Crow.IML.Instantiator.CreateFromImlFragment
+                                       (app, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}'/>");*/
                                
 
                                //app.AddWidget (@"Interfaces/Divers/colorPicker.crow").DataSource = app;
index 7fdd607f4dd023268bac24581783f61467589d6b..97cda8a0a4f85b133bdb89787d0e9032ca64b3b6 100755 (executable)
@@ -1,3 +1,2 @@
 <?xml version="1.0"?>
-<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="SeaGreen"
-               MinimumSize="50,50"/>
\ No newline at end of file
+<GraphicObject Background="SeaGreen"/>
\ No newline at end of file
index 4acba6af8cc24eb3ffa30e7c169bfb8014214502..71cae84adac76ac75b382b7098a6ad3b16e98613 100644 (file)
@@ -144,10 +144,8 @@ namespace Crow
                }
                void savingThread(){
                        while(true){
-                               if (isDirty) {
-                                       save ();
-                                       isDirty = false;
-                               }
+                               if (isDirty)
+                                       Save ();                                
                                Thread.Sleep (100);
                        }
                }
@@ -173,7 +171,7 @@ namespace Crow
                                items[key].Set (value);
                        isDirty = true;
                }
-               void save(){
+               public void Save(){
                        using (Stream s = new FileStream(configPath,FileMode.Create)){
                                using (StreamWriter sw = new StreamWriter (s)) {
                                        lock (items) {
@@ -184,6 +182,7 @@ namespace Crow
                                        }
                                }
                        }
+                       isDirty = false;
                }
                void load(Stream s){
                        using (StreamReader sr = new StreamReader (s)) {
index 0e0d9fe19ee0262ad4711e2740372cd54263826c..b3f97a2e7338634ebc231910b0f90396c983809c 100644 (file)
@@ -87,6 +87,7 @@ namespace Crow
                protected TextExtents te;
                #endregion
 
+
                [XmlAttributeAttribute][DefaultValue("SteelBlue")]
                public virtual Color SelectionBackground {
                        get { return selBackground; }
index 52fdbfef6744488d85ea18a714f549b94a03f881..f92c1d75032bdce1750a30a7b621bd3086a9e407 100644 (file)
@@ -264,7 +264,8 @@ namespace Crow
                {
                        if (!base.PointIsIn (ref m))
                                return false;
-
+                       if (tview == null)//double check this, just added to prevent exception
+                               return false;
                        if (m.Y < tview.TabHeight)
                                return TabTitle.Slot.ContainsOrIsEqual (m);
                        else
index 9a11fa18100d76d7f572e042ec74cd7eddea2985..d1d46e8a35f1e002a3c8e71e499fbcc7478b87f8 100644 (file)
@@ -129,8 +129,8 @@ namespace Crow
                        Keyboard.KeyUp += Keyboard_KeyUp;
                        Keyboard.KeyPress += Keyboard_KeyPress;
 
-                       /*initTooltip ();
-                       initContextMenus ();*/
+                       initTooltip ();
+                       initContextMenus ();
 
                        running = true;
 
@@ -138,7 +138,12 @@ namespace Crow
                        t.IsBackground = true;
                        t.Start ();
                }
-
+               public void Run () {
+                       while (running) {
+                               ProcessEvents ();
+                               Thread.Sleep(1);
+                       }
+               }
                void Keyboard_KeyPress (object sender, KeyPressEventArgs e)
                {
                        if (_focusedWidget != null)
index 56e4148fb2bf4c6e7e732c3aaa528b81a5478259..b59341572025de9ff7d332b9ef6212aa1d5a8e5d 100644 (file)
@@ -180,14 +180,6 @@ namespace Crow
                #endregion
 
         #region operators
-        public static implicit operator Rectangle(System.Drawing.Rectangle r)
-        {
-            return new Rectangle(r.X, r.Y, r.Width, r.Height);
-        }
-        public static implicit operator System.Drawing.Rectangle(Rectangle r)
-        {
-            return new System.Drawing.Rectangle(r.X, r.Y, r.Width, r.Height);
-        }
         public static Rectangle operator +(Rectangle r1, Rectangle r2)
         {
             int x = Math.Min(r1.X, r2.X);