From dca4d91d401ba718eccb83d6be42a12f55919838 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 30 Jul 2016 10:00:02 +0200 Subject: remove style attributes, add ';' to style files line ending, new style parser --- src/Interface.cs | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/Interface.cs') diff --git a/src/Interface.cs b/src/Interface.cs index b8426e6f..d8f66443 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Threading; using System.Xml; @@ -54,6 +55,7 @@ namespace Crow public Interface(){ LayoutingQueue = new Queue(); Interface.CurrentInterface = this; + LoadStyling (); } #endregion @@ -259,7 +261,48 @@ namespace Crow return tmp; } } + public Dictionary> Styling; + public void LoadStyling() { + Styling = new Dictionary> (); + + //fetch styling info in this order, if member styling is alreadey referenced in previous + //assembly, it's ignored + loadStylingFromAssembly (Assembly.GetEntryAssembly ()); + loadStylingFromAssembly (Assembly.GetExecutingAssembly ()); + } + + void loadStylingFromAssembly (Assembly assembly) { + foreach (string s in assembly + .GetManifestResourceNames () + .Where (r => r.EndsWith (".style", StringComparison.OrdinalIgnoreCase))) { + + StyleReader sr = new StyleReader (assembly, s); + + } + } + + //public static bool TryGetStyle (Type crowType, out Stream stream) { + // string styleId = crowType.Name + ".style"; + + // if (tryGetStyle (Assembly.GetEntryAssembly (), styleId, out stream)) + // return true; + // if (tryGetStyle (Assembly.GetExecutingAssembly (), styleId, out stream)) + // return true; + // return false; + //} + + //static bool tryGetStyle (Assembly assembly, string styleId, out Stream stream) { + // try { + // stream = assembly.GetManifestResourceStream ( + // assembly.GetManifestResourceNames ().FirstOrDefault (r => r.EndsWith + // (styleId, StringComparison.OrdinalIgnoreCase))); + // } catch { + // stream = null; + // return false; + // } + // return true; + //} #endregion #if MEASURE_TIME -- cgit v1.3.1-4-g156e From 6c6fb760bfb6a956a3413abfb56571a11113acd3 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 30 Jul 2016 12:42:25 +0200 Subject: replace ';' separator between members by ',' and set '.' as decimal mark in files --- Styles/MessageBox.style | 2 +- Styles/Window.style | 2 +- Templates/ArrowButTemplate.crow | 8 ++++---- Templates/Button.crow | 8 ++++---- Templates/FileDialog.goml | 6 +++--- Templates/MessageBox.goml | 6 +++--- Templates/ScrollBar.goml | 4 ++-- Templates/Window.goml | 6 +++--- Templates/imgItemTemplate.goml | 4 ++-- Tests/Interfaces/Divers/fps.crow | 4 ++-- Tests/Interfaces/Divers/testBorder.crow | 4 ++-- Tests/Interfaces/Divers/testGrid.crow | 10 +++++----- Tests/Interfaces/Divers/testWindow.goml | 8 ++++---- Tests/Interfaces/Divers/testWindow2.goml | 8 ++++---- Tests/Interfaces/Divers/testWindow3.goml | 6 +++--- Tests/Interfaces/Divers/test_Listbox.crow | 4 ++-- Tests/Interfaces/Nouveau dossier/test4.1.crow | 6 +++--- Tests/Interfaces/Nouveau dossier/test4.crow | 4 ++-- Tests/Interfaces/Nouveau dossier/test6.crow | 6 +++--- Tests/Interfaces/Nouveau dossier/testColorList.crow | 4 ++-- Tests/Interfaces/Nouveau dossier/testDirViewer.crow | 4 ++-- Tests/OpenTKGameWindow.cs | 2 ++ Tests/ui/test.crow | 6 +++--- Tests/ui/tmpWindow.crow | 4 ++-- src/Colors.cs | 4 ++-- src/GraphicObjects/GraphicObject.cs | 18 ++++++++++++------ src/Interface.cs | 11 +++++++++++ src/Point.cs | 4 ++-- src/Rectangle.cs | 4 ++-- src/Size.cs | 2 +- 30 files changed, 94 insertions(+), 75 deletions(-) (limited to 'src/Interface.cs') diff --git a/Styles/MessageBox.style b/Styles/MessageBox.style index 1f562c11..914fbb97 100644 --- a/Styles/MessageBox.style +++ b/Styles/MessageBox.style @@ -2,4 +2,4 @@ Height=Fit; Title=MessageBox; Focusable=true; -MinimumSize=150;80; +MinimumSize=150,80; diff --git a/Styles/Window.style b/Styles/Window.style index 22ee20e2..26422233 100644 --- a/Styles/Window.style +++ b/Styles/Window.style @@ -1,3 +1,3 @@ Focusable=true; -MinimumSize=50;50; +MinimumSize=50,50; Fit=true; diff --git a/Templates/ArrowButTemplate.crow b/Templates/ArrowButTemplate.crow index 8614670d..fe0e122c 100755 --- a/Templates/ArrowButTemplate.crow +++ b/Templates/ArrowButTemplate.crow @@ -1,10 +1,10 @@ - + \ No newline at end of file diff --git a/Templates/Button.crow b/Templates/Button.crow index 7d128f75..a9e45dc3 100755 --- a/Templates/Button.crow +++ b/Templates/Button.crow @@ -1,10 +1,10 @@ - +