From: Jean-Philippe Bruyère Date: Fri, 7 Dec 2018 03:24:53 +0000 (+0100) Subject: wip X-Git-Tag: v0.9.5-beta~149^2~3 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d8e417769988c76a7ebe9adc85c929e815583683;p=jp%2Fcrow.git wip --- diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index 8984951b..43b4da94 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -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, ""); + /*app.instFileDlg = Crow.IML.Instantiator.CreateFromImlFragment + (app, "");*/ //app.AddWidget (@"Interfaces/Divers/colorPicker.crow").DataSource = app; diff --git a/Tests/Interfaces/GraphicObject/0.crow b/Tests/Interfaces/GraphicObject/0.crow index 7fdd607f..97cda8a0 100755 --- a/Tests/Interfaces/GraphicObject/0.crow +++ b/Tests/Interfaces/GraphicObject/0.crow @@ -1,3 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/Configuration.cs b/src/Configuration.cs index 4acba6af..71cae84a 100644 --- a/src/Configuration.cs +++ b/src/Configuration.cs @@ -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)) { diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index 0e0d9fe1..b3f97a2e 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -87,6 +87,7 @@ namespace Crow protected TextExtents te; #endregion + [XmlAttributeAttribute][DefaultValue("SteelBlue")] public virtual Color SelectionBackground { get { return selBackground; } diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs index 52fdbfef..f92c1d75 100644 --- a/src/GraphicObjects/TabItem.cs +++ b/src/GraphicObjects/TabItem.cs @@ -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 diff --git a/src/Interface.cs b/src/Interface.cs index 9a11fa18..d1d46e8a 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -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) diff --git a/src/Rectangle.cs b/src/Rectangle.cs index 56e4148f..b5934157 100644 --- a/src/Rectangle.cs +++ b/src/Rectangle.cs @@ -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);