aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/BasicTests/BasicTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Samples/BasicTests/BasicTests.cs')
-rw-r--r--Samples/BasicTests/BasicTests.cs155
1 files changed, 3 insertions, 152 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 =