]> 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)
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 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);