aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorj-p <jp.bruyere@live.be>2016-08-02 00:25:42 +0200
committerGitHub <noreply@github.com>2016-08-02 00:25:42 +0200
commit7aa1b2660fa257e570fb75f4c03bb33f1d7d151e (patch)
tree639804dec0ca0d0cfd96cec38489808f9fce197e
parentfd5b776826028a0c12a92f11d1daf4065d4c6024 (diff)
parent77f7028debf55a8d6faff8e88c18e33500867774 (diff)
Merge pull request #13 from jpbruyere/UpdateQueuingReview
Update queuing review and styling debug
-rw-r--r--Default.style6
-rw-r--r--Tests/BasicTests.cs30
-rwxr-xr-xTests/Interfaces/Divers/testWindow.goml2
-rw-r--r--Tests/Interfaces/Divers/welcome.crow2
-rwxr-xr-xTests/Interfaces/Expandable/0.crow12
-rwxr-xr-xTests/Interfaces/Unsorted/test4.1.crow (renamed from Tests/Interfaces/Nouveau dossier/test4.1.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/test4.crow (renamed from Tests/Interfaces/Nouveau dossier/test4.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/test6.crow (renamed from Tests/Interfaces/Nouveau dossier/test6.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testColorList.crow (renamed from Tests/Interfaces/Nouveau dossier/testColorList.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testDirViewer.crow (renamed from Tests/Interfaces/Nouveau dossier/testDirViewer.crow)0
-rw-r--r--Tests/Interfaces/Unsorted/testFileDialog.goml (renamed from Tests/Interfaces/Nouveau dossier/testFileDialog.goml)0
-rwxr-xr-xTests/Interfaces/Unsorted/testImage.crow (renamed from Tests/Interfaces/Nouveau dossier/testImage.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testLabel.crow (renamed from Tests/Interfaces/Nouveau dossier/testLabel.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testMsgBox.crow (renamed from Tests/Interfaces/Nouveau dossier/testMsgBox.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testOutOfClipUpdate.crow (renamed from Tests/Interfaces/Nouveau dossier/testOutOfClipUpdate.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testRadioButton2.crow (renamed from Tests/Interfaces/Nouveau dossier/testRadioButton2.crow)0
-rw-r--r--Tests/Interfaces/Unsorted/testTabView.crow (renamed from Tests/Interfaces/Nouveau dossier/testTabView.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testTreeView.crow (renamed from Tests/Interfaces/Nouveau dossier/testTreeView.crow)0
-rwxr-xr-xTests/Interfaces/Unsorted/testTypeViewer.goml (renamed from Tests/Interfaces/Nouveau dossier/testTypeViewer.goml)0
-rw-r--r--Tests/Tests.csproj185
-rw-r--r--Tests/ui/test.style3
-rw-r--r--src/GraphicObjects/Border.cs5
-rw-r--r--src/GraphicObjects/GenericStack.cs41
-rw-r--r--src/GraphicObjects/GraphicObject.cs111
-rw-r--r--src/GraphicObjects/Grid.cs2
-rw-r--r--src/GraphicObjects/Group.cs4
-rw-r--r--src/GraphicObjects/Label.cs24
-rw-r--r--src/GraphicObjects/ListBox.cs2
-rw-r--r--src/GraphicObjects/NumericControl.cs8
-rw-r--r--src/GraphicObjects/PrivateContainer.cs10
-rw-r--r--src/GraphicObjects/Scroller.cs4
-rw-r--r--src/GraphicObjects/Slider.cs3
-rw-r--r--src/GraphicObjects/TabView.cs8
-rw-r--r--src/GraphicObjects/TextBox.cs10
-rw-r--r--src/GraphicObjects/TextRun.cs6
-rw-r--r--src/GraphicObjects/Trend.cs12
-rw-r--r--src/Interface.cs158
-rw-r--r--src/StyleReader.cs9
38 files changed, 288 insertions, 369 deletions
diff --git a/Default.style b/Default.style
index 77d281f1..2f7f75d5 100644
--- a/Default.style
+++ b/Default.style
@@ -7,7 +7,8 @@ Button {
Width = Fit;
}
Label {
- Fit = true;
+ Height = Fit;
+ Width = Fit;
Margin = 0;
}
MessageBox {
@@ -37,4 +38,7 @@ Window {
MinimumSize=50,50;
Width = 150;
Height = 150;
+}
+Border {
+ Foreground = White;
} \ No newline at end of file
diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs
index 1382d739..e75ed01d 100644
--- a/Tests/BasicTests.cs
+++ b/Tests/BasicTests.cs
@@ -10,7 +10,7 @@ namespace Tests
class BasicTests : OpenTKGameWindow
{
public BasicTests ()
- : base(800, 600,"test: press spacebar to toogle test files")
+ : base(800, 600,"test: press <F3> to toogle test files")
{
}
@@ -76,9 +76,10 @@ namespace Tests
{
base.OnLoad (e);
- KeyboardKeyDown += GOLIBTests_KeyboardKeyDown1;
+ this.KeyDown += KeyboardKeyDown1;
testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.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 ();
@@ -88,28 +89,37 @@ namespace Tests
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.";
+ this.Title = testFiles [idx] + ". Press <F3> to switch example.";
CrowInterface.LoadInterface(testFiles[idx]).DataSource = this;
}
- void GOLIBTests_KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
+ void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
{
if (e.Key == OpenTK.Input.Key.Escape) {
Quit (null, null);
return;
- } else if (e.Key == OpenTK.Input.Key.L) {
+ } else if (e.Key == OpenTK.Input.Key.F1) {
TestList.Add ("new string");
NotifyValueChanged ("TestList", TestList);
return;
- } else if (e.Key == OpenTK.Input.Key.W) {
- GraphicObject w = CrowInterface.LoadInterface("Interfaces/testWindow.goml");
+ } else if (e.Key == OpenTK.Input.Key.F4) {
+ GraphicObject w = CrowInterface.LoadInterface ("Interfaces/Divers/testWindow.goml");
w.DataSource = this;
return;
- }
+ } else if (e.Key == OpenTK.Input.Key.F2)
+ idx--;
+ else if (e.Key == OpenTK.Input.Key.F3)
+ idx++;
+ else
+ return;
+
CrowInterface.ClearInterface ();
- idx++;
+
if (idx == testFiles.Length)
idx = 0;
- this.Title = testFiles [idx] + ". Press key to cycle examples.";
+ else if (idx < 0)
+ idx = testFiles.Length - 1;
+
+ this.Title = testFiles [idx] + ". Press <F3> to cycle examples.";
GraphicObject obj = CrowInterface.LoadInterface(testFiles[idx]);
obj.DataSource = this;
}
diff --git a/Tests/Interfaces/Divers/testWindow.goml b/Tests/Interfaces/Divers/testWindow.goml
index 9e184dff..09db6193 100755
--- a/Tests/Interfaces/Divers/testWindow.goml
+++ b/Tests/Interfaces/Divers/testWindow.goml
@@ -16,7 +16,7 @@
<GraphicObject Width="Stretched"/>
<RadioButton Width="80" Height="Fit" Caption="Radio 3" />
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" MinimumSize="10,10" Margin="10" CornerRadius="5"
+ <HorizontalStack Width="Stretched" Height="Stretched" MinimumSize="10,40" Margin="0" CornerRadius="5"
Background="vgradient|0:White|0.1:SteelBlue|0.9:SteelBlue|1:Transparent">
<CheckBox Height="Fit" Width="80"/>
<GraphicObject Width="Stretched"/>
diff --git a/Tests/Interfaces/Divers/welcome.crow b/Tests/Interfaces/Divers/welcome.crow
index 504413a1..8a98b380 100644
--- a/Tests/Interfaces/Divers/welcome.crow
+++ b/Tests/Interfaces/Divers/welcome.crow
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<VerticalStack>
- <Label Text="Press a key to cycle into the examples"/>
+ <Label Text="Press &lt;F3&gt; to cycle into the examples"/>
<Label Text="Those are basic tests used to validate changes"/>
</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Expandable/0.crow b/Tests/Interfaces/Expandable/0.crow
index d243e67e..0c37d335 100755
--- a/Tests/Interfaces/Expandable/0.crow
+++ b/Tests/Interfaces/Expandable/0.crow
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<Expandable Fit="true" Caption="Test expandable" Background="DimGray">
- <VerticalStack Margin="5" Background="Green" Fit="true">
- <CheckBox Name="chk1" Background="Red" Fit="true"/>
- <CheckBox Name="chk2" IsChecked="true" Fit="true"/>
- <CheckBox Name="chk3" Fit="true"/>
- <CheckBox Name="chk4" Fit="true"/>
- <HorizontalStack Fit="true" Margin="2" Background="Blue">
+ <VerticalStack Margin="5" >
+ <CheckBox Name="chk1" />
+ <CheckBox Name="chk2" IsChecked="true"/>
+ <CheckBox Name="chk3" />
+ <CheckBox Name="chk4" />
+ <HorizontalStack Fit="true" Margin="2" Background="Mantis">
<Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/>
<Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="Fit" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
diff --git a/Tests/Interfaces/Nouveau dossier/test4.1.crow b/Tests/Interfaces/Unsorted/test4.1.crow
index 2ac55cd0..2ac55cd0 100755
--- a/Tests/Interfaces/Nouveau dossier/test4.1.crow
+++ b/Tests/Interfaces/Unsorted/test4.1.crow
diff --git a/Tests/Interfaces/Nouveau dossier/test4.crow b/Tests/Interfaces/Unsorted/test4.crow
index 06476f31..06476f31 100755
--- a/Tests/Interfaces/Nouveau dossier/test4.crow
+++ b/Tests/Interfaces/Unsorted/test4.crow
diff --git a/Tests/Interfaces/Nouveau dossier/test6.crow b/Tests/Interfaces/Unsorted/test6.crow
index 532450da..532450da 100755
--- a/Tests/Interfaces/Nouveau dossier/test6.crow
+++ b/Tests/Interfaces/Unsorted/test6.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testColorList.crow b/Tests/Interfaces/Unsorted/testColorList.crow
index d9b67410..d9b67410 100755
--- a/Tests/Interfaces/Nouveau dossier/testColorList.crow
+++ b/Tests/Interfaces/Unsorted/testColorList.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testDirViewer.crow b/Tests/Interfaces/Unsorted/testDirViewer.crow
index dd6f9b8a..dd6f9b8a 100755
--- a/Tests/Interfaces/Nouveau dossier/testDirViewer.crow
+++ b/Tests/Interfaces/Unsorted/testDirViewer.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testFileDialog.goml b/Tests/Interfaces/Unsorted/testFileDialog.goml
index 715ff2fa..715ff2fa 100644
--- a/Tests/Interfaces/Nouveau dossier/testFileDialog.goml
+++ b/Tests/Interfaces/Unsorted/testFileDialog.goml
diff --git a/Tests/Interfaces/Nouveau dossier/testImage.crow b/Tests/Interfaces/Unsorted/testImage.crow
index 46ffdcb6..46ffdcb6 100755
--- a/Tests/Interfaces/Nouveau dossier/testImage.crow
+++ b/Tests/Interfaces/Unsorted/testImage.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testLabel.crow b/Tests/Interfaces/Unsorted/testLabel.crow
index 51cf97b6..51cf97b6 100755
--- a/Tests/Interfaces/Nouveau dossier/testLabel.crow
+++ b/Tests/Interfaces/Unsorted/testLabel.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testMsgBox.crow b/Tests/Interfaces/Unsorted/testMsgBox.crow
index 680f43b4..680f43b4 100755
--- a/Tests/Interfaces/Nouveau dossier/testMsgBox.crow
+++ b/Tests/Interfaces/Unsorted/testMsgBox.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testOutOfClipUpdate.crow b/Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow
index b5e29f4e..b5e29f4e 100755
--- a/Tests/Interfaces/Nouveau dossier/testOutOfClipUpdate.crow
+++ b/Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testRadioButton2.crow b/Tests/Interfaces/Unsorted/testRadioButton2.crow
index 02231d25..02231d25 100755
--- a/Tests/Interfaces/Nouveau dossier/testRadioButton2.crow
+++ b/Tests/Interfaces/Unsorted/testRadioButton2.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testTabView.crow b/Tests/Interfaces/Unsorted/testTabView.crow
index 27c221f4..27c221f4 100644
--- a/Tests/Interfaces/Nouveau dossier/testTabView.crow
+++ b/Tests/Interfaces/Unsorted/testTabView.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testTreeView.crow b/Tests/Interfaces/Unsorted/testTreeView.crow
index 86bcae88..86bcae88 100755
--- a/Tests/Interfaces/Nouveau dossier/testTreeView.crow
+++ b/Tests/Interfaces/Unsorted/testTreeView.crow
diff --git a/Tests/Interfaces/Nouveau dossier/testTypeViewer.goml b/Tests/Interfaces/Unsorted/testTypeViewer.goml
index caa454fc..caa454fc 100755
--- a/Tests/Interfaces/Nouveau dossier/testTypeViewer.goml
+++ b/Tests/Interfaces/Unsorted/testTypeViewer.goml
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 3554e9c9..61868849 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -8,17 +8,18 @@
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>Tests.HelloCube</StartupObject>
+ <StartupObject>Tests.BasicTests</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReleaseVersion>0.4</ReleaseVersion>
<OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath>
<IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath>
- <CustomCommands>
+ <CustomCommands>
<CustomCommands>
<Command type="Execute" command="${TargetName}" workingdir="${SolutionDir}/build/${ProjectConfigName}" />
</CustomCommands>
- </CustomCommands>
+ </CustomCommands>
+ <SynchReleaseVersion>false</SynchReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -51,6 +52,7 @@
</Reference>
<Reference Include="glib-sharp">
<HintPath>$(SolutionDir)packages\GtkSharp.3.1.3\lib\net45\glib-sharp.dll</HintPath>
+ <Package>glib-sharp-3.0</Package>
</Reference>
<Reference Include="OpenTK">
<HintPath>$(SolutionDir)packages\OpenTK.Next.1.2.2336.6514-pre\lib\net20\OpenTK.dll</HintPath>
@@ -59,247 +61,177 @@
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)packages\GtkSharp.3.1.3\build\net45\GtkSharp.targets" Condition="Exists('$(SolutionDir)packages\GtkSharp.3.1.3\build\net45\GtkSharp.targets')" />
<ItemGroup>
- <Compile Include="Interfaces\testBorder.goml.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="BasicTests.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="OpenGL\Shader.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="OpenGL\vaoMesh.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="OpenTKGameWindow.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="OpenGL\Texture.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="HelloWorld.cs">
- <LogicalName></LogicalName>
- </Compile>
- <Compile Include="HelloCube.cs">
- <LogicalName></LogicalName>
- </Compile>
+ <Compile Include="Interfaces\testBorder.goml.cs" />
+ <Compile Include="BasicTests.cs" />
+ <Compile Include="OpenGL\Shader.cs" />
+ <Compile Include="OpenGL\vaoMesh.cs" />
+ <Compile Include="OpenTKGameWindow.cs" />
+ <Compile Include="OpenGL\Texture.cs" />
+ <Compile Include="HelloWorld.cs" />
+ <Compile Include="HelloCube.cs" />
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\log.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\testMeter.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\tmpMembers.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\itemTmp.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\tmpDirItem.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\5.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\6.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\basicTests\7.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\GraphicObject\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\GraphicObject\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\GraphicObject\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Container\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Container\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Container\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Container\3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Group\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Group\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Group\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Group\3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Group\4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\0h.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\1h.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\2h.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\3h.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Stack\4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\5.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\6.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\clip0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\clip1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\clip2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\clip3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\clip4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\fps.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test_Listbox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test_stack.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test1.1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test1.2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test2WayBinding.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test5.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\test7.crow">
<LogicalName>Tests.Interfaces.test7.goml</LogicalName>
@@ -307,165 +239,122 @@
</None>
<None Include="Interfaces\Divers\testAll.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testBorder.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testButton.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testCheckbox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testCombobox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testContainer.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testGrid.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testGroupBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testHStack.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testPopper.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testRadioButton.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testScrollbar.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testSpinner.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testStacks.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testTextBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testWindow.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testWindow2.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
<None Include="Interfaces\Divers\testWindow3.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testColorList.crow">
+ <None Include="Interfaces\Expandable\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\test4.crow">
+ <None Include="Interfaces\Expandable\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\test6.crow">
+ <None Include="Interfaces\Expandable\7.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\test4.1.crow">
+ <None Include="Interfaces\Expandable\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testMsgBox.crow">
+ <None Include="Interfaces\Splitter\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testOutOfClipUpdate.crow">
+ <None Include="OpenTK.dll.config" />
+ <None Include="image\textest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testFileDialog.goml">
+ <None Include="Interfaces\Divers\welcome.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testImage.crow">
+ <None Include="packages.config" />
+ <None Include="Interfaces\Unsorted\testColorList.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testDirViewer.crow">
+ <None Include="Interfaces\Unsorted\test4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testTabView.crow">
+ <None Include="Interfaces\Unsorted\test6.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testTypeViewer.goml">
+ <None Include="Interfaces\Unsorted\test4.1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testLabel.crow">
+ <None Include="Interfaces\Unsorted\testMsgBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testRadioButton2.crow">
+ <None Include="Interfaces\Unsorted\testOutOfClipUpdate.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Expandable\1.crow">
+ <None Include="Interfaces\Unsorted\testFileDialog.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Expandable\0.crow">
+ <None Include="Interfaces\Unsorted\testImage.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Expandable\7.crow">
+ <None Include="Interfaces\Unsorted\testDirViewer.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Expandable\2.crow">
+ <None Include="Interfaces\Unsorted\testTabView.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Nouveau dossier\testTreeView.crow">
+ <None Include="Interfaces\Unsorted\testTypeViewer.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Splitter\1.crow">
+ <None Include="Interfaces\Unsorted\testLabel.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="OpenTK.dll.config">
- <LogicalName></LogicalName>
- </None>
- <None Include="image\textest.png">
+ <None Include="Interfaces\Unsorted\testRadioButton2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
</None>
- <None Include="Interfaces\Divers\welcome.crow">
+ <None Include="Interfaces\Unsorted\testTreeView.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName></LogicalName>
- </None>
- <None Include="packages.config">
- <LogicalName></LogicalName>
</None>
</ItemGroup>
<ItemGroup>
@@ -475,9 +364,9 @@
<Folder Include="Interfaces\GraphicObject\" />
<Folder Include="Interfaces\Group\" />
<Folder Include="Interfaces\Divers\" />
- <Folder Include="Interfaces\Nouveau dossier\" />
<Folder Include="Interfaces\Expandable\" />
<Folder Include="Interfaces\Splitter\" />
+ <Folder Include="Interfaces\Unsorted\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="image\tetra.png">
diff --git a/Tests/ui/test.style b/Tests/ui/test.style
new file mode 100644
index 00000000..fe85d912
--- /dev/null
+++ b/Tests/ui/test.style
@@ -0,0 +1,3 @@
+BlueLabel {
+ Background = Blue;
+}
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs
index c6355726..6c1ed6a1 100644
--- a/src/GraphicObjects/Border.cs
+++ b/src/GraphicObjects/Border.cs
@@ -24,11 +24,6 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue("White")]
- public override Fill Foreground {
- get { return base.Foreground;}
- set {base.Foreground = value;}
- }
#endregion
#region GraphicObject override
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index 3ec29fb5..efa98d1a 100644
--- a/src/GraphicObjects/GenericStack.cs
+++ b/src/GraphicObjects/GenericStack.cs
@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
+using System;
namespace Crow
{
@@ -99,7 +100,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && bmp == null)
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
@@ -126,15 +127,22 @@ namespace Crow
contentSize.Width += go.Slot.Width - go.LastSlots.Width;
if (stretchedGO != null) {
- stretchedGO.Slot.Width = this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1);
- stretchedGO.bmp = null;
+ int newW = Math.Max (
+ this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1),
+ stretchedGO.MinimumSize.Width);
+ if (stretchedGO.MaximumSize.Width > 0)
+ newW = Math.Min (newW, stretchedGO.MaximumSize.Width);
+ if (newW != stretchedGO.Slot.Width) {
+ stretchedGO.Slot.Width = newW;
+ stretchedGO.bmp = null;
#if DEBUG_LAYOUTING
Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
#endif
- stretchedGO.LayoutChanged -= OnChildLayoutChanges;
- stretchedGO.OnLayoutChanges (LayoutingType.Width);
- stretchedGO.LayoutChanged += OnChildLayoutChanges;
- stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
+ stretchedGO.LayoutChanged -= OnChildLayoutChanges;
+ stretchedGO.OnLayoutChanges (LayoutingType.Width);
+ stretchedGO.LayoutChanged += OnChildLayoutChanges;
+ stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
+ }
}
if (Width == Measure.Fit)
@@ -158,15 +166,22 @@ namespace Crow
contentSize.Height += go.Slot.Height - go.LastSlots.Height;
if (stretchedGO != null) {
- stretchedGO.Slot.Height = this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count -1);
- stretchedGO.bmp = null;
+ int newH = Math.Max (
+ this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count - 1),
+ stretchedGO.MinimumSize.Height);
+ if (stretchedGO.MaximumSize.Height > 0)
+ newH = Math.Min (newH, stretchedGO.MaximumSize.Height);
+ if (newH != stretchedGO.Slot.Height) {
+ stretchedGO.Slot.Height = newH;
+ stretchedGO.bmp = null;
#if DEBUG_LAYOUTING
Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
#endif
- stretchedGO.LayoutChanged -= OnChildLayoutChanges;
- stretchedGO.OnLayoutChanges (LayoutingType.Height);
- stretchedGO.LayoutChanged += OnChildLayoutChanges;
- stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
+ stretchedGO.LayoutChanged -= OnChildLayoutChanges;
+ stretchedGO.OnLayoutChanges (LayoutingType.Height);
+ stretchedGO.LayoutChanged += OnChildLayoutChanges;
+ stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
+ }
}
if (Height == Measure.Fit)
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 8c91824d..7a2e8ec5 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -241,10 +241,22 @@ namespace Crow
if (value < MinimumSize.Width || (value > MaximumSize.Width && MaximumSize.Width > 0))
return;
}
-
+ Measure lastWP = WidthPolicy;
_width = value;
NotifyValueChanged ("Width", _width);
- NotifyValueChanged ("WidthPolicy", WidthPolicy);
+ if (WidthPolicy != lastWP) {
+ NotifyValueChanged ("WidthPolicy", WidthPolicy);
+ //contentSize in Stacks are only update on childLayoutChange, and the single stretched
+ //child of the stack is not counted in contentSize, so when changing size policy of a child
+ //we should adapt contentSize
+ //TODO:check case when child become stretched, and another stretched item already exists.
+ if (_parent is GenericStack) {//TODO:check if I should test Group instead
+ if (lastWP == Measure.Fit)
+ (_parent as GenericStack).contentSize.Width -= this.LastSlots.Width;
+ else
+ (_parent as GenericStack).contentSize.Width += this.LastSlots.Width;
+ }
+ }
this.RegisterForLayouting (LayoutingType.Width);
}
@@ -259,10 +271,18 @@ namespace Crow
if (value < MinimumSize.Height || (value > MaximumSize.Height && MaximumSize.Height > 0))
return;
}
-
+ Measure lastHP = HeightPolicy;
_height = value;
NotifyValueChanged ("Height", _height);
- NotifyValueChanged ("HeightPolicy", HeightPolicy);
+ if (HeightPolicy != lastHP) {
+ NotifyValueChanged ("HeightPolicy", HeightPolicy);
+ if (_parent is GenericStack) {
+ if (lastHP == Measure.Fit)
+ (_parent as GenericStack).contentSize.Height -= this.LastSlots.Height;
+ else
+ (_parent as GenericStack).contentSize.Height += this.LastSlots.Height;
+ }
+ }
this.RegisterForLayouting (LayoutingType.Height);
}
@@ -342,7 +362,7 @@ namespace Crow
return;
_background = value;
NotifyValueChanged ("Background", _background);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue("White")]
@@ -353,7 +373,7 @@ namespace Crow
return;
_foreground = value;
NotifyValueChanged ("Foreground", _foreground);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue("sans,10")]
@@ -375,7 +395,7 @@ namespace Crow
return;
_cornerRadius = value;
NotifyValueChanged ("CornerRadius", _cornerRadius);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(0)]
@@ -402,8 +422,8 @@ namespace Crow
return;
//ensure main win doesn't keep hidden childrens ref
- if (!_isVisible && this.Contains (Interface.CurrentInterface.hoverWidget))
- Interface.CurrentInterface.hoverWidget = null;
+ if (!_isVisible && this.Contains (Interface.CurrentInterface.HoverWidget))
+ Interface.CurrentInterface.HoverWidget = null;
if (Parent is GraphicObject)
(Parent as GraphicObject).RegisterForLayouting (LayoutingType.Sizing);
@@ -412,7 +432,7 @@ namespace Crow
if (_isVisible)
RegisterForLayouting (LayoutingType.Sizing);
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
NotifyValueChanged ("Visible", _isVisible);
}
@@ -497,14 +517,16 @@ namespace Crow
Interface.DefaultValuesLoader [Style] (this);
return;
}
- }
- if (Interface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
- Interface.DefaultValuesLoader [thisType.FullName] (this);
- return;
- }
- if (Interface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
- Interface.DefaultValuesLoader [thisType.Name] (this);
- return;
+ } else {
+ if (Interface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
+ Interface.DefaultValuesLoader [thisType.FullName] (this);
+ return;
+ } else if (!Interface.Styling.ContainsKey (thisType.FullName)) {
+ if (Interface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
+ Interface.DefaultValuesLoader [thisType.Name] (this);
+ return;
+ }
+ }
}
List<Dictionary<string, object>> styling = new List<Dictionary<string, object>>();
@@ -516,17 +538,17 @@ namespace Crow
// those files being placed in a Styles folder
string styleKey = Style;
if (!string.IsNullOrEmpty (Style)) {
- if (Interface.CurrentInterface.Styling.ContainsKey (Style)) {
- styling.Add (Interface.CurrentInterface.Styling [Style]);
+ if (Interface.Styling.ContainsKey (Style)) {
+ styling.Add (Interface.Styling [Style]);
}
}
- if (Interface.CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
- styling.Add (Interface.CurrentInterface.Styling [thisType.FullName]);
+ if (Interface.Styling.ContainsKey (thisType.FullName)) {
+ styling.Add (Interface.Styling [thisType.FullName]);
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.FullName;
}
- if (Interface.CurrentInterface.Styling.ContainsKey (thisType.Name)) {
- styling.Add (Interface.CurrentInterface.Styling [thisType.Name]);
+ if (Interface.Styling.ContainsKey (thisType.Name)) {
+ styling.Add (Interface.Styling [thisType.Name]);
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.Name;
}
@@ -582,7 +604,10 @@ namespace Crow
}
}
if (styleIndex >= 0){
- defaultValue = styling[styleIndex] [name];
+ if (pi.PropertyType.IsEnum)//maybe should be in parser..
+ defaultValue = Enum.Parse(pi.PropertyType, (string)styling[styleIndex] [name], true);
+ else
+ defaultValue = styling[styleIndex] [name];
}else {
DefaultValueAttribute dv = (DefaultValueAttribute)pi.GetCustomAttribute (typeof (DefaultValueAttribute));
if (dv == null)
@@ -685,8 +710,12 @@ namespace Crow
il.Emit(OpCodes.Ret);
#endregion
- Interface.DefaultValuesLoader[styleKey] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
- Interface.DefaultValuesLoader[styleKey] (this);
+ try {
+ Interface.DefaultValuesLoader[styleKey] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
+ Interface.DefaultValuesLoader[styleKey] (this);
+ } catch (Exception ex) {
+ throw new Exception ("Error applying style <" + styleKey + ">:", ex);
+ }
}
public virtual GraphicObject FindByName(string nameToFind){
@@ -701,21 +730,29 @@ namespace Crow
if (Parent != null)
Parent.RegisterClip (clip + Slot.Position + ClientRectangle.Position);
}
- public bool IsQueueForGraphicUpdate = false;
- /// <summary>
- /// Clear chached object and add clipping region in redraw list of interface
- /// </summary>
+ public bool IsQueueForRedraw = false;
+ /// <summary> Full update, taking care of sizing policy </summary>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RegisterForGraphicUpdate ()
{
- Interface.RegisterForGraphicUpdate (this);
+ bmp = null;
+ if (Width == Measure.Fit || Height == Measure.Fit)
+ RegisterForLayouting (LayoutingType.Sizing);
+ Interface.CurrentInterface.EnqueueForRepaint (this);
+ }
+ /// <summary> query an update of the content, a redraw </summary>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void RegisterForRedraw ()
+ {
+ bmp = null;
+ Interface.CurrentInterface.EnqueueForRepaint (this);
}
-
#region Layouting
[XmlIgnore]public int LayoutingTries {
get { return layoutingTries; }
set { layoutingTries = value; }
}
- protected Size contentSize;
+ internal Size contentSize;
/// <summary> return size of content + margins </summary>
protected virtual int measureRawSize (LayoutingType lt) {
return lt == LayoutingType.Width ?
@@ -930,7 +967,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (this.registeredLayoutings == LayoutingType.None && bmp == null)
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
@@ -1044,8 +1081,8 @@ namespace Crow
}
public virtual void checkHoverWidget(MouseMoveEventArgs e)
{
- if (Interface.CurrentInterface.hoverWidget != this) {
- Interface.CurrentInterface.hoverWidget = this;
+ if (Interface.CurrentInterface.HoverWidget != this) {
+ Interface.CurrentInterface.HoverWidget = this;
onMouseEnter (this, e);
}
diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs
index 92b4f906..525827e0 100644
--- a/src/GraphicObjects/Grid.cs
+++ b/src/GraphicObjects/Grid.cs
@@ -136,7 +136,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && bmp == null)
- this.RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index 2b440ac1..48f835ac 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -290,8 +290,8 @@ namespace Crow
#region Mouse handling
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (Interface.CurrentInterface.hoverWidget != this) {
- Interface.CurrentInterface.hoverWidget = this;
+ if (Interface.CurrentInterface.HoverWidget != this) {
+ Interface.CurrentInterface.HoverWidget = this;
onMouseEnter (this, e);
}
for (int i = Children.Count - 1; i >= 0; i--) {
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 505bd69e..2f5798ee 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -79,7 +79,7 @@ namespace Crow
return;
selColor = value;
NotifyValueChanged ("SelectionBackground", selColor);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute][DefaultValue("White")]
@@ -90,7 +90,7 @@ namespace Crow
return;
selFontColor = value;
NotifyValueChanged ("SelectionForeground", selFontColor);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute][DefaultValue(Alignment.Left)]
@@ -101,8 +101,7 @@ namespace Crow
if (value == _textAlignment)
return;
_textAlignment = value;
- RegisterForGraphicUpdate ();
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("TextAlignment", _textAlignment);
}
}
@@ -113,7 +112,7 @@ namespace Crow
if (horizontalStretch == value)
return;
horizontalStretch = value;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("HorizontalStretch", horizontalStretch);
}
}
@@ -124,8 +123,8 @@ namespace Crow
if (verticalStretch == value)
return;
verticalStretch = value;
+ RegisterForRedraw ();
NotifyValueChanged ("VerticalStretch", verticalStretch);
-
}
}
[XmlAttributeAttribute][DefaultValue("label")]
@@ -147,9 +146,8 @@ namespace Crow
lines = getLines;
- this.RegisterForGraphicUpdate ();
- this.RegisterForLayouting (LayoutingType.Sizing);
NotifyValueChanged ("Text", _text);
+ RegisterForGraphicUpdate ();
}
}
[XmlAttributeAttribute][DefaultValue(false)]
@@ -598,7 +596,7 @@ namespace Crow
SelBegin = new Point(0,0);
SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
public override void onUnfocused (object sender, EventArgs e)
{
@@ -606,7 +604,7 @@ namespace Crow
SelBegin = -1;
SelRelease = -1;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
@@ -617,7 +615,7 @@ namespace Crow
updatemouseLocalPos (e.Position);
- RegisterForGraphicUpdate();
+ RegisterForRedraw();
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
@@ -626,7 +624,7 @@ namespace Crow
SelBegin = -1;
SelRelease = -1;
SelectionInProgress = true;
- RegisterForGraphicUpdate();//TODO:should put it in properties
+ RegisterForRedraw();//TODO:should put it in properties
}
//done at the end to set 'hasFocus' value after testing it
@@ -641,7 +639,7 @@ namespace Crow
updatemouseLocalPos (e.Position);
SelectionInProgress = false;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
#endregion
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs
index 34834b8d..79efac33 100644
--- a/src/GraphicObjects/ListBox.cs
+++ b/src/GraphicObjects/ListBox.cs
@@ -141,7 +141,7 @@ namespace Crow
using (Stream stream = Interface.GetStreamFromPath (ItemTemplate))
stream.CopyTo (templateStream);
}
- templateBaseType = Interface.GetTopContainerOfGOMLStream (templateStream);
+ templateBaseType = Interface.GetTopContainerOfXMLStream (templateStream);
}
lock (Interface.CurrentInterface.UpdateMutex) {
diff --git a/src/GraphicObjects/NumericControl.cs b/src/GraphicObjects/NumericControl.cs
index 0f74eb2d..b1b097c6 100644
--- a/src/GraphicObjects/NumericControl.cs
+++ b/src/GraphicObjects/NumericControl.cs
@@ -30,7 +30,7 @@ namespace Crow
minValue = value;
NotifyValueChanged ("Minimum", minValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -43,7 +43,7 @@ namespace Crow
maxValue = value;
NotifyValueChanged ("Maximum", maxValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(1.0)]
@@ -56,7 +56,7 @@ namespace Crow
smallStep = value;
NotifyValueChanged ("SmallIncrement", smallStep);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(5.0)]
@@ -69,7 +69,7 @@ namespace Crow
bigStep = value;
NotifyValueChanged ("LargeIncrement", bigStep);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(0.0)]
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index 16a797d7..08abf95a 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -126,21 +126,19 @@ namespace Crow
LayoutingType ltChild = LayoutingType.None;
if (layoutType == LayoutingType.Width) {
- if (Width == Measure.Fit)
- return;
if (child.Width.Units == Unit.Percent) {
ltChild |= LayoutingType.Width;
if (child.Width.Value < 100 && child.Left == 0)
ltChild |= LayoutingType.X;
- }
+ } else if (child.Left == 0)
+ ltChild |= LayoutingType.X;
} else if (layoutType == LayoutingType.Height) {
- if (Height == Measure.Fit)
- return;
if (child.Height.Units == Unit.Percent) {
ltChild |= LayoutingType.Height;
if (child.Height.Value < 100 && child.Top == 0)
ltChild |= LayoutingType.Y;
- }
+ } else if (child.Top == 0)
+ ltChild |= LayoutingType.Y;
}
if (ltChild == LayoutingType.None)
return;
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs
index 22b36fd2..0d57cdb3 100644
--- a/src/GraphicObjects/Scroller.cs
+++ b/src/GraphicObjects/Scroller.cs
@@ -70,7 +70,7 @@ namespace Crow
else
_scrollX = value;
NotifyValueChanged("ScrollX", _scrollX);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
Scrolled.Raise (this, new ScrollingEventArgs (Orientation.Horizontal));
}
}
@@ -89,7 +89,7 @@ namespace Crow
else
_scrollY = value;
NotifyValueChanged("ScrollY", _scrollY);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
Scrolled.Raise (this, new ScrollingEventArgs (Orientation.Vertical));
}
}
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index bce74971..526c2759 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -65,7 +65,7 @@ namespace Crow
if (_cursorColor == value)
return;
_cursorColor = value;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("CursorColor", _cursorColor);
}
}
@@ -76,7 +76,6 @@ namespace Crow
if (_cursorSize == value)
return;
_cursorSize = value;
- RegisterForLayouting (LayoutingType.Sizing);
RegisterForGraphicUpdate ();
NotifyValueChanged ("CursorSize", _cursorSize);
}
diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs
index 5afcdaad..d616ffc6 100644
--- a/src/GraphicObjects/TabView.cs
+++ b/src/GraphicObjects/TabView.cs
@@ -78,7 +78,7 @@ namespace Crow
(Children [selectedTab] as TabItem).IsSelected = true;
NotifyValueChanged ("SelectedTab", selectedTab);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(22)]
@@ -148,7 +148,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && bmp == null)
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
@@ -183,8 +183,8 @@ namespace Crow
#region Mouse handling
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (Interface.CurrentInterface.hoverWidget != this) {
- Interface.CurrentInterface.hoverWidget = this;
+ if (Interface.CurrentInterface.HoverWidget != this) {
+ Interface.CurrentInterface.HoverWidget = this;
onMouseEnter (this, e);
}
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index fc02f0d6..5c3772b7 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -49,7 +49,7 @@ namespace Crow
set
{
base.HasFocus = value;
- RegisterForGraphicUpdate();
+ RegisterForRedraw();
}
}
@@ -210,10 +210,6 @@ namespace Crow
default:
break;
}
- if (Width < 0)
- RegisterForLayouting (LayoutingType.Width);
- if (Height < 0)
- RegisterForLayouting (LayoutingType.Height);
RegisterForGraphicUpdate();
}
public override void onKeyPress (object sender, KeyPressEventArgs e)
@@ -225,10 +221,6 @@ namespace Crow
SelRelease = -1;
SelBegin = new Point(CurrentColumn, SelBegin.Y);
- if (Width < 0)
- RegisterForLayouting (LayoutingType.Width);
- if (Height < 0)
- RegisterForLayouting (LayoutingType.Height);
RegisterForGraphicUpdate();
}
#endregion
diff --git a/src/GraphicObjects/TextRun.cs b/src/GraphicObjects/TextRun.cs
index 35b46f18..6b6f7999 100644
--- a/src/GraphicObjects/TextRun.cs
+++ b/src/GraphicObjects/TextRun.cs
@@ -55,7 +55,7 @@ namespace Crow
if (horizontalStretch == value)
return;
horizontalStretch = value;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("HorizontalStretch", horizontalStretch);
}
}
@@ -67,8 +67,8 @@ namespace Crow
if (verticalStretch == value)
return;
verticalStretch = value;
+ RegisterForRedraw ();
NotifyValueChanged ("VerticalStretch", verticalStretch);
-
}
}
[XmlAttributeAttribute ()]
@@ -83,8 +83,6 @@ namespace Crow
return;
RegisterForGraphicUpdate ();
- this.RegisterForLayouting (LayoutingType.Sizing);
-
_text = value;
diff --git a/src/GraphicObjects/Trend.cs b/src/GraphicObjects/Trend.cs
index e9ff4c06..fef1e48f 100644
--- a/src/GraphicObjects/Trend.cs
+++ b/src/GraphicObjects/Trend.cs
@@ -41,7 +41,7 @@ namespace Crow
values.Add (_value);
while (values.Count > nbValues)
values.RemoveAt (0);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
public Trend ()
@@ -61,7 +61,7 @@ namespace Crow
nbValues = value;
NotifyValueChanged ("NbValues", minValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(0.0)]
@@ -73,7 +73,7 @@ namespace Crow
minValue = value;
NotifyValueChanged ("Minimum", minValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -86,7 +86,7 @@ namespace Crow
maxValue = value;
NotifyValueChanged ("Maximum", maxValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(20.0)]
@@ -119,7 +119,7 @@ namespace Crow
return;
lowThresholdFill = value;
NotifyValueChanged ("LowThresholdFill", lowThresholdFill);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue("DarkGreen")]
@@ -130,7 +130,7 @@ namespace Crow
return;
highThresholdFill = value;
NotifyValueChanged ("HighThresholdFill", highThresholdFill);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
protected override void onDraw (Cairo.Context gr)
diff --git a/src/Interface.cs b/src/Interface.cs
index dee5e146..607044d9 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -44,7 +44,8 @@ namespace Crow
{
#region CTOR
static Interface(){
- Interface.LoadCursors ();
+ LoadCursors ();
+ LoadStyling ();
FontRenderingOptions = new FontOptions ();
FontRenderingOptions.Antialias = Antialias.Subpixel;
@@ -54,12 +55,10 @@ namespace Crow
}
public Interface(){
Interface.CurrentInterface = this;
- LoadStyling ();
}
#endregion
#region Static and constants
- internal bool XmlLoading = false;
/// <summary> keep ressource path for debug msg </summary>
internal static string CurrentGOMLPath = "";
//used in templatedControl
@@ -87,32 +86,53 @@ namespace Crow
public static FontOptions FontRenderingOptions;
#endregion
+ internal bool XmlLoading = false;
+
public Queue<LayoutingQueueItem> LayoutingQueue = new Queue<LayoutingQueueItem> ();
- public Queue<GraphicObject> GraphicUpdateQueue = new Queue<GraphicObject>();
- public Dictionary<string, Dictionary<string, object>> Styling;
- public string Clipboard;
- public static void RegisterForGraphicUpdate(GraphicObject g)
+ public Queue<GraphicObject> DrawingQueue = new Queue<GraphicObject>();
+ public string Clipboard;//TODO:use object instead for complex copy paste
+ public void EnqueueForRepaint(GraphicObject g)
{
- lock (CurrentInterface.GraphicUpdateQueue) {
- if (g.IsQueueForGraphicUpdate)
- return;
- if (CurrentInterface == null)
+ lock (DrawingQueue) {
+ if (g.IsQueueForRedraw)
return;
- CurrentInterface.GraphicUpdateQueue.Enqueue (g);
- g.IsQueueForGraphicUpdate = true;
+ DrawingQueue.Enqueue (g);
+ g.IsQueueForRedraw = true;
}
}
- #region default values loading helpers
+ #region default values and style loading
/// Default values of properties from GraphicObjects are retrieve from XML Attributes.
/// The reflexion process used to retrieve those values being very slow, it is compiled in MSIL
/// and injected as a dynamic method referenced in the DefaultValuesLoader Dictionnary.
/// The compilation is done on the first object instancing, and is also done for custom widgets
public delegate void loadDefaultInvoker(object instance);
public static Dictionary<String, loadDefaultInvoker> DefaultValuesLoader = new Dictionary<string, loadDefaultInvoker>();
- #endregion
+ public static Dictionary<string, Dictionary<string, object>> Styling;
+ /// <summary> parse all styling data's and build global Styling Dictionary </summary>
+ static void LoadStyling() {
+ System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
+ Styling = new Dictionary<string, Dictionary<string, object>> ();
- public static void LoadCursors(){
+ //fetch styling info in this order, if member styling is alreadey referenced in previous
+ //assembly, it's ignored.
+ loadStylingFromAssembly (Assembly.GetEntryAssembly ());
+ loadStylingFromAssembly (Assembly.GetExecutingAssembly ());
+
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+ }
+ /// <summary> Search for .style resources in assembly </summary>
+ static void loadStylingFromAssembly (Assembly assembly) {
+ foreach (string s in assembly
+ .GetManifestResourceNames ()
+ .Where (r => r.EndsWith (".style", StringComparison.OrdinalIgnoreCase))) {
+ new StyleReader (assembly, s)
+ .Dispose ();
+ }
+ }
+ static void LoadCursors(){
//Load cursors
XCursor.Cross = XCursorFile.Load("#Crow.Images.Icons.Cursors.cross").Cursors[0];
XCursor.Default = XCursorFile.Load("#Crow.Images.Icons.Cursors.arrow").Cursors[0];
@@ -123,6 +143,8 @@ namespace Crow
XCursor.H = XCursorFile.Load("#Crow.Images.Icons.Cursors.sb_h_double_arrow").Cursors[0];
XCursor.V = XCursorFile.Load("#Crow.Images.Icons.Cursors.sb_v_double_arrow").Cursors[0];
}
+ #endregion
+
#region Load/Save
public static Stream GetStreamFromPath (string path)
@@ -151,7 +173,7 @@ namespace Crow
/// Pre-read first node to set GraphicObject class for loading
/// and reset stream position to 0
/// </summary>
- public static Type GetTopContainerOfGOMLStream (Stream stream)
+ public static Type GetTopContainerOfXMLStream (Stream stream)
{
string root = "Object";
stream.Seek (0, SeekOrigin.Begin);
@@ -197,8 +219,12 @@ namespace Crow
Interface.XmlLoaderCount ++;
CurrentGOMLPath = path;
GraphicObject tmp = null;
- using (Stream stream = GetStreamFromPath (path)) {
- tmp = Load(stream, GetTopContainerOfGOMLStream(stream), hostClass);
+ try {
+ using (Stream stream = GetStreamFromPath (path)) {
+ tmp = Load(stream, GetTopContainerOfXMLStream(stream), hostClass);
+ }
+ } catch (Exception ex) {
+ throw new Exception ("Error loading <" + CurrentGOMLPath + ">:", ex);
}
Interface.XmlLoaderCount --;
@@ -249,30 +275,6 @@ namespace Crow
return tmp;
}
}
-
- public void LoadStyling() {
- System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
- Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
-
- Styling = new Dictionary<string, Dictionary<string, object>> ();
-
- //fetch styling info in this order, if member styling is alreadey referenced in previous
- //assembly, it's ignored.
- loadStylingFromAssembly (Assembly.GetEntryAssembly ());
- loadStylingFromAssembly (Assembly.GetExecutingAssembly ());
-
- Thread.CurrentThread.CurrentCulture = savedCulture;
- }
-
- void loadStylingFromAssembly (Assembly assembly) {
- foreach (string s in assembly
- .GetManifestResourceNames ()
- .Where (r => r.EndsWith (".style", StringComparison.OrdinalIgnoreCase))) {
-
- StyleReader sr = new StyleReader (assembly, s);
- sr.Dispose ();
- }
- }
#endregion
#if MEASURE_TIME
@@ -283,12 +285,10 @@ namespace Crow
#endif
public List<GraphicObject> GraphicTree = new List<GraphicObject>();
- public Color Background = Color.Transparent;
- internal static Interface currentWindow;
public static Interface CurrentInterface;
- Rectangles _redrawClip = new Rectangles();//should find another way to access it from child
+ Rectangles _redrawClip = new Rectangles();
Context ctx;
Surface surf;
@@ -330,7 +330,7 @@ namespace Crow
#endif
}
}
- public GraphicObject hoverWidget
+ public GraphicObject HoverWidget
{
get { return _hoverWidget; }
set {
@@ -380,24 +380,6 @@ namespace Crow
processDrawing ();
Monitor.Exit (UpdateMutex);
-
- // if (ToolTip.isVisible) {
- // ToolTip.panel.processkLayouting();
- // if (ToolTip.panel.layoutIsValid)
- // ToolTip.panel.Paint(ref ctx);
- // }
- // Debug.WriteLine("INTERFACE: layouting: {0} ticks \t graphical update {1} ticks \t drawing {2} ticks",
- // layoutTime.ElapsedTicks,
- // guTime.ElapsedTicks,
- // drawingTime.ElapsedTicks);
- // Debug.WriteLine("INTERFACE: layouting: {0} ms \t graphical update {1} ms \t drawing {2} ms",
- // layoutTime.ElapsedMilliseconds,
- // guTime.ElapsedMilliseconds,
- // drawingTime.ElapsedMilliseconds);
-
- // Debug.WriteLine("UPDATE: {0} ticks \t, {1} ms",
- // updateTime.ElapsedTicks,
- // updateTime.ElapsedMilliseconds);
}
void processLayouting(){
#if MEASURE_TIME
@@ -419,16 +401,16 @@ namespace Crow
#if MEASURE_TIME
clippingTime.Restart ();
#endif
- lock (CurrentInterface.GraphicUpdateQueue) {
- while (CurrentInterface.GraphicUpdateQueue.Count > 0) {
- GraphicObject g = CurrentInterface.GraphicUpdateQueue.Dequeue ();
- g.bmp = null;
- g.IsQueueForGraphicUpdate = false;
+ lock (CurrentInterface.DrawingQueue) {
+ while (CurrentInterface.DrawingQueue.Count > 0) {
+ GraphicObject g = CurrentInterface.DrawingQueue.Dequeue ();
+ g.IsQueueForRedraw = false;
try {
if (g.Parent == null)
continue;
g.Parent.RegisterClip (g.LastPaintedSlot);
- g.Parent.RegisterClip (g.getSlot ());
+ if (g.getSlot () != g.LastPaintedSlot)
+ g.Parent.RegisterClip (g.getSlot ());
} catch (Exception ex) {
Debug.WriteLine ("Error Register Clip: " + ex.ToString ());
}
@@ -519,7 +501,7 @@ namespace Crow
{
GraphicTree.Remove(g);
GraphicTree.Insert(0, g);
- //g.registerClipRect ();
+ EnqueueForRepaint (g);
}
}
/// <summary> Remove all Graphic objects from top container </summary>
@@ -596,10 +578,10 @@ namespace Crow
return true;
}
- if (hoverWidget != null) {
+ if (HoverWidget != null) {
//TODO, ensure object is still in the graphic tree
//check topmost graphicobject first
- GraphicObject tmp = hoverWidget;
+ GraphicObject tmp = HoverWidget;
GraphicObject topc = null;
while (tmp is GraphicObject) {
topc = tmp;
@@ -610,7 +592,7 @@ namespace Crow
int i = 0;
while (i < idxhw) {
if (GraphicTree [i].MouseIsIn (e.Position)) {
- hoverWidget.onMouseLeave (this, e);
+ HoverWidget.onMouseLeave (this, e);
GraphicTree [i].checkHoverWidget (e);
return true;
}
@@ -619,19 +601,19 @@ namespace Crow
}
- if (hoverWidget.MouseIsIn (e.Position)) {
- hoverWidget.checkHoverWidget (e);
+ if (HoverWidget.MouseIsIn (e.Position)) {
+ HoverWidget.checkHoverWidget (e);
return true;
} else {
- hoverWidget.onMouseLeave (this, e);
+ HoverWidget.onMouseLeave (this, e);
//seek upward from last focused graph obj's
- while (hoverWidget.Parent as GraphicObject != null) {
- hoverWidget = hoverWidget.Parent as GraphicObject;
- if (hoverWidget.MouseIsIn (e.Position)) {
- hoverWidget.checkHoverWidget (e);
+ while (HoverWidget.Parent as GraphicObject != null) {
+ HoverWidget = HoverWidget.Parent as GraphicObject;
+ if (HoverWidget.MouseIsIn (e.Position)) {
+ HoverWidget.checkHoverWidget (e);
return true;
} else
- hoverWidget.onMouseLeave (this, e);
+ HoverWidget.onMouseLeave (this, e);
}
}
}
@@ -645,7 +627,7 @@ namespace Crow
return true;
}
}
- hoverWidget = null;
+ HoverWidget = null;
return false;
}
public bool ProcessMouseButtonUp(int button)
@@ -671,10 +653,10 @@ namespace Crow
Mouse.EnableBit (button);
MouseButtonEventArgs e = new MouseButtonEventArgs () { Mouse = Mouse };
- if (hoverWidget == null)
+ if (HoverWidget == null)
return false;
- hoverWidget.onMouseDown(hoverWidget,new BubblingMouseButtonEventArg(e));
+ HoverWidget.onMouseDown(HoverWidget,new BubblingMouseButtonEventArg(e));
if (FocusedWidget == null)
return true;
@@ -690,9 +672,9 @@ namespace Crow
Mouse.SetScrollRelative (0, delta);
MouseWheelEventArgs e = new MouseWheelEventArgs () { Mouse = Mouse, DeltaPrecise = delta };
- if (hoverWidget == null)
+ if (HoverWidget == null)
return false;
- hoverWidget.onMouseWheel (this, e);
+ HoverWidget.onMouseWheel (this, e);
return true;
}
diff --git a/src/StyleReader.cs b/src/StyleReader.cs
index 11174e29..92b24e2d 100644
--- a/src/StyleReader.cs
+++ b/src/StyleReader.cs
@@ -34,7 +34,6 @@ namespace Crow
public StyleReader (Assembly assembly, string resId)
: base(assembly.GetManifestResourceStream (resId))
{
- Interface iface = Interface.CurrentInterface;
string styleKey = resId.Substring (0, resId.Length - 6);
string token = "";
List<string> targetsClasses = new List<string> ();
@@ -105,11 +104,11 @@ namespace Crow
string expression = token.Trim ();
foreach (string tc in targetsClasses) {
- if (!iface.Styling.ContainsKey (tc))
- iface.Styling [tc] = new Dictionary<string, object> ();
- else if (iface.Styling [tc].ContainsKey (currentProperty))
+ if (!Interface.Styling.ContainsKey (tc))
+ Interface.Styling [tc] = new Dictionary<string, object> ();
+ else if (Interface.Styling [tc].ContainsKey (currentProperty))
continue;
- iface.Styling [tc] [currentProperty] = expression;
+ Interface.Styling [tc] [currentProperty] = expression;
}
token = "";
}