From dca4d91d401ba718eccb83d6be42a12f55919838 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 30 Jul 2016 10:00:02 +0200 Subject: [PATCH] remove style attributes, add ';' to style files line ending, new style parser --- Crow.csproj | 1 + Styles/Button.style | 4 +- Styles/CheckBox.style | 4 +- Styles/ComboBox.style | 4 +- Styles/Expandable.style | 4 +- Styles/Label.style | 2 +- Styles/MessageBox.style | 10 +-- Styles/Popper.style | 4 +- Styles/RadioButton.style | 4 +- Styles/Slider.style | 8 +-- Styles/Spinner.style | 4 +- Styles/Splitter.style | 4 +- Styles/TabItem.style | 4 +- Styles/TextBox.style | 8 +-- Styles/TextRun.style | 4 +- Styles/Window.style | 6 +- Tests/BasicTests.cs | 2 +- Tests/Interfaces/Divers/2.crow | 1 + Tests/ui/LabelButton.style | 16 ++--- Tests/ui/MenuItem.style | 22 +++---- src/ExtensionsMethods.cs | 4 ++ src/GraphicObjects/Button.cs | 1 - src/GraphicObjects/CheckBox.cs | 24 ++++++- src/GraphicObjects/ComboBox.cs | 24 ++++++- src/GraphicObjects/Expandable.cs | 24 ++++++- src/GraphicObjects/GraphicObject.cs | 34 ++++++---- src/GraphicObjects/GroupBox.cs | 26 +++++++- src/GraphicObjects/Label.cs | 47 ++++++++++---- src/GraphicObjects/MessageBox.cs | 1 - src/GraphicObjects/Popper.cs | 24 ++++++- src/GraphicObjects/RadioButton.cs | 24 ++++++- src/GraphicObjects/Slider.cs | 27 ++++++-- src/GraphicObjects/Spinner.cs | 1 - src/GraphicObjects/Splitter.cs | 3 +- src/GraphicObjects/TabItem.cs | 7 +- src/GraphicObjects/TemplatedControl.cs | 6 +- src/GraphicObjects/TextBox.cs | 30 ++++++--- src/GraphicObjects/TextRun.cs | 2 - src/GraphicObjects/Window.cs | 24 ++++++- src/Interface.cs | 43 +++++++++++++ src/StyleReader.cs | 88 +++++++++++++++++++++++++- 41 files changed, 450 insertions(+), 130 deletions(-) diff --git a/Crow.csproj b/Crow.csproj index 68f67ca6..0467b314 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -321,6 +321,7 @@ + diff --git a/Styles/Button.style b/Styles/Button.style index 2038c524..55920f27 100644 --- a/Styles/Button.style +++ b/Styles/Button.style @@ -1,2 +1,2 @@ -Focusable = true -Fit = true +Focusable = true; +Fit = true; diff --git a/Styles/CheckBox.style b/Styles/CheckBox.style index 13d2224a..934248ab 100644 --- a/Styles/CheckBox.style +++ b/Styles/CheckBox.style @@ -1,2 +1,2 @@ -Focusable = true -Height=Fit +Focusable = true; +Height=Fit; diff --git a/Styles/ComboBox.style b/Styles/ComboBox.style index 9fa3b267..8b54a40a 100644 --- a/Styles/ComboBox.style +++ b/Styles/ComboBox.style @@ -1,2 +1,2 @@ -Focusable = true -Height = Fit +Focusable = true; +Height = Fit; diff --git a/Styles/Expandable.style b/Styles/Expandable.style index 9fa3b267..8b54a40a 100644 --- a/Styles/Expandable.style +++ b/Styles/Expandable.style @@ -1,2 +1,2 @@ -Focusable = true -Height = Fit +Focusable = true; +Height = Fit; diff --git a/Styles/Label.style b/Styles/Label.style index d5b41383..8a165c2a 100644 --- a/Styles/Label.style +++ b/Styles/Label.style @@ -1 +1 @@ -Fit = true +Fit = true; diff --git a/Styles/MessageBox.style b/Styles/MessageBox.style index ed5cb20f..1f562c11 100644 --- a/Styles/MessageBox.style +++ b/Styles/MessageBox.style @@ -1,5 +1,5 @@ -Width=200 -Height=Fit -Title=MessageBox -Focusable=true -MinimumSize=150;80 +Width=200; +Height=Fit; +Title=MessageBox; +Focusable=true; +MinimumSize=150;80; diff --git a/Styles/Popper.style b/Styles/Popper.style index 9fa3b267..8b54a40a 100644 --- a/Styles/Popper.style +++ b/Styles/Popper.style @@ -1,2 +1,2 @@ -Focusable = true -Height = Fit +Focusable = true; +Height = Fit; diff --git a/Styles/RadioButton.style b/Styles/RadioButton.style index 9fa3b267..8b54a40a 100644 --- a/Styles/RadioButton.style +++ b/Styles/RadioButton.style @@ -1,2 +1,2 @@ -Focusable = true -Height = Fit +Focusable = true; +Height = Fit; diff --git a/Styles/Slider.style b/Styles/Slider.style index e767555c..7e4f6068 100644 --- a/Styles/Slider.style +++ b/Styles/Slider.style @@ -1,4 +1,4 @@ -Background = vgradient|0:Black|0,1:Gray|0,9:Gray|1:LightGray -Foreground = Gray -Focusable = true -Fit = true +Background = vgradient|0:Black|0,1:Gray|0,9:Gray|1:LightGray; +Foreground = Gray; +Focusable = true; +Fit = true; diff --git a/Styles/Spinner.style b/Styles/Spinner.style index 9fa3b267..8b54a40a 100644 --- a/Styles/Spinner.style +++ b/Styles/Spinner.style @@ -1,2 +1,2 @@ -Focusable = true -Height = Fit +Focusable = true; +Height = Fit; diff --git a/Styles/Splitter.style b/Styles/Splitter.style index 536e13dd..b02cd714 100644 --- a/Styles/Splitter.style +++ b/Styles/Splitter.style @@ -1,2 +1,2 @@ -Focusable = true -Background = DimGray +Focusable = true; +Background = DimGray; diff --git a/Styles/TabItem.style b/Styles/TabItem.style index 9562848d..dc3820e0 100644 --- a/Styles/TabItem.style +++ b/Styles/TabItem.style @@ -1,2 +1,2 @@ -Focusable = true -CacheEnabled = false +Focusable = true; +CacheEnabled = false; diff --git a/Styles/TextBox.style b/Styles/TextBox.style index 2ad617a5..764cfcdd 100644 --- a/Styles/TextBox.style +++ b/Styles/TextBox.style @@ -1,5 +1,5 @@ -Fit = true -Focusable = true -Background = White -Foreground = Black +Fit = true; +Focusable = true; +Background = White; +Foreground = Black; diff --git a/Styles/TextRun.style b/Styles/TextRun.style index c2eb97fe..1f000247 100644 --- a/Styles/TextRun.style +++ b/Styles/TextRun.style @@ -1,2 +1,2 @@ -Fit = true -Margin = 2 +Fit = true; +Margin = 2; diff --git a/Styles/Window.style b/Styles/Window.style index f0032e46..22ee20e2 100644 --- a/Styles/Window.style +++ b/Styles/Window.style @@ -1,3 +1,3 @@ -Focusable=true -MinimumSize=50;50 -Fit=true +Focusable=true; +MinimumSize=50;50; +Fit=true; diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index e194bc80..0cc2c555 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -80,6 +80,7 @@ namespace Tests testFiles = new string [] { @"Interfaces/Divers/welcome.crow" }; + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/basicTests", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray (); @@ -87,7 +88,6 @@ namespace Tests testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Expandable", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); this.Title = testFiles [idx] + ". Press key to switch example."; CrowInterface.LoadInterface(testFiles[idx]).DataSource = this; diff --git a/Tests/Interfaces/Divers/2.crow b/Tests/Interfaces/Divers/2.crow index 959cadb1..5b4d9c75 100755 --- a/Tests/Interfaces/Divers/2.crow +++ b/Tests/Interfaces/Divers/2.crow @@ -1,5 +1,6 @@  +