diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-05-21 00:46:43 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-05-21 00:46:43 +0200 |
| commit | f1cda0b040c750e0fdfb5df35349aff6af163446 (patch) | |
| tree | cc0a4d70daa598102785340305e76740ddee5fb3 /Samples/BasicTests | |
| parent | bc9f4e2cc8e46d5f452fabea472ebc99a909a992 (diff) | |
styling and debugging
Diffstat (limited to 'Samples/BasicTests')
| -rw-r--r-- | Samples/BasicTests/BasicTests.cs | 155 | ||||
| -rw-r--r-- | Samples/BasicTests/BasicTests.csproj | 36 |
2 files changed, 4 insertions, 187 deletions
diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index 2fdc50ba..b0d99ccc 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -8,7 +8,7 @@ using Glfw; namespace tests { - public class BasicTests : Interface + public class BasicTests : SampleBase { [STAThread] static void Main () @@ -34,7 +34,7 @@ namespace tests //testFiles = new string [] { @"Interfaces/TemplatedGroup/3.crow" }; //testFiles = new string [] { @"Interfaces/Divers/testShape.crow" }; //testFiles = new string [] { @"Interfaces/TemplatedControl/testEnumSelector.crow" }; - testFiles = new string [] { @"Interfaces/Stack/StretchedInFit.crow" }; + testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" }; //testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" }; testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray (); @@ -55,11 +55,6 @@ namespace tests int idx = 0; string [] testFiles; - public Version CrowVersion { - get { - return System.Reflection.Assembly.GetAssembly (typeof (Widget)).GetName ().Version; - } - } public override bool OnKeyDown (Key key) { @@ -111,151 +106,7 @@ namespace tests } return false; } - #region Test values for Binding - public List<Crow.Command> Commands; - public int intValue = 500; - DirectoryInfo curDir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetEntryAssembly ().Location)); - //DirectoryInfo curDir = new DirectoryInfo (@"/mnt/data/Images"); - public FileSystemInfo [] CurDirectory { - get { return curDir.GetFileSystemInfos (); } - } - public int IntValue { - get { - return intValue; - } - set { - intValue = value; - NotifyValueChanged ("IntValue", intValue); - } - } - VerticalAlignment currentVAlign; - public VerticalAlignment CurrentVAlign { - get => currentVAlign; - set { - if (currentVAlign == value) - return; - currentVAlign = value; - NotifyValueChanged ("CurrentVAlign", currentVAlign); - } - } - void onSpinnerValueChange (object sender, ValueChangeEventArgs e) - { - if (e.MemberName != "Value") - return; - intValue = Convert.ToInt32 (e.NewValue); - } - void change_alignment (object sender, EventArgs e) - { - RadioButton rb = sender as RadioButton; - if (rb == null) - return; - NotifyValueChanged ("alignment", Enum.Parse (typeof (Alignment), rb.Caption)); - } - public IEnumerable<String> List2 = new List<string> (new string [] - { - "string1", - "string2", - "string3", - "string4", - "string5", - "string6", - "string7", - "string8", - "string8", - "string8", - "string8", - "string8", - "string8", - "string9" - } - ); - public IEnumerable<String> TestList2 { - set { - List2 = value; - NotifyValueChanged ("TestList2", testList); - } - get { return List2; } - } - public class TestClass - { - public string Prop1 { get; set; } - public string Prop2 { get; set; } - - public override string ToString () - => $"{Prop1}, {Prop2}"; - - } - public IEnumerable<TestClass> List3 = new List<TestClass> (new TestClass [] - { - new TestClass { Prop1 = "string1", Prop2="prop2-1" }, - new TestClass { Prop1 = "string2", Prop2="prop2-2" }, - new TestClass { Prop1 = "string3", Prop2="prop2-3" }, - } - ); - public IEnumerable<string> TestList3Props1 => List3.Select (sc => sc.Prop1).ToList(); - public IEnumerable<TestClass> TestList3 { - set { - List3 = value; - NotifyValueChanged ("TestList3", testList); - } - get { return List3; } - } - string prop1; - public string TestList3SelProp1 { - get => prop1; - set { - if (prop1 == value) - return; - prop1 = value; - - NotifyValueChanged ("TestList3SelProp1", prop1); - } - } - - string selString; - public string TestList2SelectedString { - get => selString; - set { - if (selString == value) - return; - selString = value; - NotifyValueChanged ("TestList2SelectedString", selString); - } - } - - List<Color> testList = null; //Color.ColorDic.Values//.OrderBy(c=>c.Hue) - //.ThenBy(c=>c.Value).ThenBy(c=>c.Saturation) - //.ToList (); - public List<Color> TestList { - set { - testList = value; - NotifyValueChanged ("TestList", testList); - } - get { return testList; } - } - string curSources = ""; - public string CurSources { - get { return curSources; } - set { - if (value == curSources) - return; - curSources = value; - NotifyValueChanged ("CurSources", curSources); - } - } - bool boolVal = true; - public bool BoolVal { - get { return boolVal; } - set { - if (boolVal == value) - return; - boolVal = value; - NotifyValueChanged ("BoolVal", boolVal); - } - } - - #endregion - + void OnClear (object sender, MouseButtonEventArgs e) => TestList = null; void OnLoadList (object sender, MouseButtonEventArgs e) => TestList = diff --git a/Samples/BasicTests/BasicTests.csproj b/Samples/BasicTests/BasicTests.csproj index 71a7a829..b92bf102 100644 --- a/Samples/BasicTests/BasicTests.csproj +++ b/Samples/BasicTests/BasicTests.csproj @@ -1,45 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> - <PropertyGroup> - <TargetFrameworks>net472</TargetFrameworks> - <OutputType>Exe</OutputType> - <EnableDefaultNoneItems>false</EnableDefaultNoneItems> - <ReleaseVersion>0.8.0</ReleaseVersion> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugType>full</DebugType> - <DefineConstants>TRACE;DEBUG</DefineConstants> - <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> - </PropertyGroup> - <ItemGroup> - <ProjectReference Include="..\..\Crow\Crow.csproj" /> - </ItemGroup> <ItemGroup> <EmbeddedResource Remove="..\common\ui\templates\test.style" /> </ItemGroup> - <ItemGroup> - <Datas Include="..\data\**\*.*"> - <Link>data\%(RecursiveDir)%(Filename)%(Extension)</Link> - </Datas> + <ItemGroup> <EmbeddedResource Include="ui\*.*"> <LogicalName>ShowCase.%(Filename)%(Extension)</LogicalName> </EmbeddedResource> - <None Include="..\common\ui\Interfaces\**\*.*"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Link>Interfaces\%(RecursiveDir)%(Filename)%(Extension)</Link> - </None> - <EmbeddedResource Include="..\common\ui\templates\**\*.*"> - <LogicalName>ui.%(Filename)%(Extension)</LogicalName> - <Link>Templates\%(Filename)%(Extension)</Link> - </EmbeddedResource> - <EmbeddedResource Include="..\common\samples.style" /> - <EmbeddedResource Include="..\common\ui\images\**\*.*"> - <LogicalName>images.%(Filename)%(Extension)</LogicalName> - <Link>Images\%(Filename)%(Extension)</Link> - </EmbeddedResource> - <EmbeddedResource Include="..\common\ui\Icons\*.*"> - <LogicalName>Icons.%(Filename)%(Extension)</LogicalName> - <Link>Icons\%(Filename)%(Extension)</Link> - </EmbeddedResource> </ItemGroup> </Project>
\ No newline at end of file |