aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-09-12 21:46:14 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-09-12 21:46:14 +0200
commit11dcc340f08a142f807419b85ff07d45f870e8e5 (patch)
tree342576cea03d06eac4f5d5f2f50e62d1d456d6b0 /Tests
parent8624ae1ead48d7ddc206486db0c4fc024afac703 (diff)
update template and tests with new sizing policy for stacks (stretched
by default)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GOLIBTest_4.cs74
-rwxr-xr-xTests/Interfaces/fps.goml10
-rwxr-xr-xTests/Interfaces/test4.goml148
-rwxr-xr-xTests/Interfaces/testExpandable.goml2
-rwxr-xr-xTests/Interfaces/testHStack.goml6
-rwxr-xr-xTests/Interfaces/testWindow.goml14
-rw-r--r--Tests/Tests.csproj2
7 files changed, 139 insertions, 117 deletions
diff --git a/Tests/GOLIBTest_4.cs b/Tests/GOLIBTest_4.cs
index c1f2e0ad..a5cdbb49 100644
--- a/Tests/GOLIBTest_4.cs
+++ b/Tests/GOLIBTest_4.cs
@@ -33,7 +33,7 @@ namespace test
#region FPS
- static int _fps = 0;
+ int _fps = 0;
public int fps {
get { return _fps; }
@@ -52,20 +52,24 @@ namespace test
}
ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
+ this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
}
}
- public static int fpsMin = 0;
- public static int fpsMax = 0;
+ public int fpsMin = int.MaxValue;
+ public int fpsMax = 0;
- static void resetFps ()
+ void resetFps ()
{
fpsMin = int.MaxValue;
fpsMax = 0;
_fps = 0;
}
+ public string update = "";
#endregion
+
GraphicObject c;
ProgressBar pb, pb2;
Label labMousePos, labPb, labF, labA, labH, labFps, labFpsMin, labFpsMax, labV,
@@ -88,19 +92,19 @@ namespace test
//c2.HorizontalAlignment = HorizontalAlignment.Left;
//c2.VerticalAlignment = VerticalAlignment.Top;
c.Background.AdjustAlpha (0.5);
- labMousePos = c.FindByName ("labMouse") as Label;
- //pb = c.FindByName("pbBar") as ProgressBar;
- pb2 = c.FindByName("pbBar2") as ProgressBar;
- labPb = c.FindByName ("labPb") as Label;
+// labMousePos = c.FindByName ("labMouse") as Label;
+// //pb = c.FindByName("pbBar") as ProgressBar;
+// pb2 = c.FindByName("pbBar2") as ProgressBar;
+// labPb = c.FindByName ("labPb") as Label;
labF = c.FindByName ("labFocus") as Label;
labA = c.FindByName ("labActive") as Label;
labH = c.FindByName ("labHover") as Label;
- labFps = c.FindByName ("labFps") as Label;
- labFpsMin = c.FindByName ("labFpsMin") as Label;
- labFpsMax = c.FindByName ("labFpsMax") as Label;
- labV = c.FindByName ("labValue") as Label;
- labUpdate = c.FindByName ("labUpdate") as Label;
- slTest = c.FindByName ("slider") as Slider;
+// labFps = c.FindByName ("labFps") as Label;
+// labFpsMin = c.FindByName ("labFpsMin") as Label;
+// labFpsMax = c.FindByName ("labFpsMax") as Label;
+// labV = c.FindByName ("labValue") as Label;
+// labUpdate = c.FindByName ("labUpdate") as Label;
+// slTest = c.FindByName ("slider") as Slider;
colors = c.FindByName ("colors") as Group;
@@ -112,7 +116,7 @@ namespace test
int i = 0;
foreach (Color col in Color.ColorDic) {
- HorizontalStack s = colors.addChild (new HorizontalStack ());
+ HorizontalStack s = colors.addChild (new HorizontalStack () { Fit = true});
s.HorizontalAlignment = HorizontalAlignment.Left;
Border b = new Border () {
Bounds = new Size (32, 20),
@@ -139,7 +143,7 @@ namespace test
if (i > 150)
break;
}
- ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
+// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
}
void pFps_mousemove(object sender, MouseMoveEventArgs e)
{
@@ -158,38 +162,36 @@ namespace test
fps = (int)RenderFrequency;
- labUpdate.Text = this.updateTime.ElapsedMilliseconds.ToString() + " ms";
if (frameCpt > 200) {
resetFps ();
frameCpt = 0;
-
}
frameCpt++;
- if (pb2.Value == pb2.Maximum)
- pb2.Value = 0;
- pb2.Value++;
-
- if (FocusedWidget==null)
- labF.Text = "- none -";
- else
- labF.Text = FocusedWidget.Name;
- if (activeWidget==null)
- labA.Text = "- none -";
- else
- labA.Text = activeWidget.Name;
-
- if (hoverWidget==null)
- labH.Text = "- none -";
- else
- labH.Text = hoverWidget.Name;
+// if (FocusedWidget==null)
+// labF.Text = "- none -";
+// else
+// labF.Text = FocusedWidget.Name;
+//
+// if (activeWidget==null)
+// labA.Text = "- none -";
+// else
+// labA.Text = activeWidget.Name;
+//
+// if (hoverWidget==null)
+// labH.Text = "- none -";
+// else
+// labH.Text = hoverWidget.Name;
}
+ //public Point MousePosition;
+
protected override void OnMouseMove (MouseMoveEventArgs e)
{
base.OnMouseMove (e);
- labMousePos.Text = e.Position.ToString ();
+ //MousePosition = e.Position;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("MousePosition", e.Position.ToString()));
}
[STAThread]
static void Main ()
diff --git a/Tests/Interfaces/fps.goml b/Tests/Interfaces/fps.goml
index 151d9905..edc63e70 100755
--- a/Tests/Interfaces/fps.goml
+++ b/Tests/Interfaces/fps.goml
@@ -3,20 +3,20 @@
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="10" Width="-1" Height="-1" Focusable="True" >
- <VerticalStack Name="vsFps" BorderWidth="1" Margin="5" Spacing="4">
- <HorizontalStack>
+ <VerticalStack Name="vsFps" BorderWidth="1" Margin="5" Spacing="4" Fit="true">
+ <HorizontalStack Height="-1">
<Label Text="Update:" FontColor="White" />
<Label Name="labUpdate" Text="{update}" FontSize="12" Background="DarkGreen"/>
</HorizontalStack>
- <HorizontalStack Name="hsFps" Background="Red" >
+ <HorizontalStack Height="-1" Name="hsFps" Background="Red" >
<Label Name="captionFps" Text="Fps:" />
<Label Name="valueFps" Text="{fps}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
- <HorizontalStack Background="Red">
+ <HorizontalStack Height="-1" Background="Red">
<Label Text="Min:" Width = "30" />
<Label Text="{fpsMin}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
- <HorizontalStack Background="Red" >
+ <HorizontalStack Height="-1" Background="Red" >
<Label Text="Max:" Width = "30"/>
<Label Text="{fpsMax}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
diff --git a/Tests/Interfaces/test4.goml b/Tests/Interfaces/test4.goml
index 4d824a2e..d2866bb6 100755
--- a/Tests/Interfaces/test4.goml
+++ b/Tests/Interfaces/test4.goml
@@ -1,91 +1,64 @@
<?xml version="1.0"?>
-<Group Name="MainGrp" Focusable="true"
+<Group Name="MainGrp"
Width="800" Height="500"
Background="0,5;0,5;0,5;0,5" Foreground="White"
Margin="10" >
- <Border Margin="10"
+ <Border Margin="10" CornerRadius="10"
Name="mainBorder"
BorderWidth="2" BorderColor="Transparent"
Focusable="True"
MouseEnter="{BorderColor = White}"
MouseLeave="{BorderColor = Transparent}">
-
- <HorizontalStack Name="hs0"
- WidgetSpacing="1"
- VerticalAlignment="Top">
- <Slider Orientation="Vertical" Height="300" Width="10" Background="Transparent" />
- <VerticalStack Name="vs1" Spacing="5">
- <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
- <Label Name="labMouse" Text="MousePos"/>
- <HorizontalStack WidgetSpacing="10">
- <VerticalStack Width="100">
- <Checkbox Name="chk1" Focusable="true"/>
+ <HorizontalStack WidgetSpacing="1">
+ <VerticalStack Width="-1">
+ <HorizontalStack WidgetSpacing="1" Fit="true">
+ <VerticalStack Fit="true">
+ <Label Text="{MousePosition}"/>
+ <HorizontalStack Name="hsFocus" Fit="true">
+ <Label Text="Focused:"/>
+ <Label Name="labFocus"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Active:" Name="hsActive"/>
+ <Label Name="labActive"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Hover:" Name="hsHover"/>
+ <Label Name="labHover"/>
+ </HorizontalStack>
+ </VerticalStack>
+ <VerticalStack Fit="true">
+ <Checkbox Name="chk1"/>
<Checkbox Name="chk2" IsChecked="true"/>
- <Checkbox Name="chk3" Template="#go.Templates.Checkbox2.goml"/>
- <Checkbox Name="chk4">
+ <Checkbox Name="chk4" >
<Template>
- <HorizontalStack Margin="0" Spacing="1" Focusable="false">
- <Image Name="Image" Width="16" Height="16" Path="#go.Images.Icons.checkbox.svg"/>
- <Label Name="Caption" Foreground="Black" Background="Yellow"/>
+ <HorizontalStack Fit="True" Margin="0" Spacing="1">
+ <Image Name="Image" Width="20" Height="20" Path="#go.Images.Icons.checkbox.svg"/>
+ <Label Name="Caption" Height="-1" Width="-1" Foreground="Black" Background="Yellow"/>
</HorizontalStack>
</Template>
</Checkbox>
</VerticalStack>
- <VerticalStack Width="100">
+ <VerticalStack Fit="true">
<RadioButton IsChecked="true"/>
<RadioButton/>
<RadioButton>
<Template>
- <HorizontalStack Background="Green" Margin="0" Spacing="1" Focusable="false">
- <Image Name="Image" Width="16" Height="16" Path="#go.Images.Icons.radiobutton.svg"/>
+ <HorizontalStack Fit="true" Background="Green" Margin="0" Spacing="1" Focusable="false">
+ <Image Name="Image" Width="20" Height="20" Path="#go.Images.Icons.radiobutton.svg"/>
<Label Name="Caption"/>
</HorizontalStack>
</Template>
</RadioButton>
- <RadioButton/>
</VerticalStack>
- <Spinner Width="50" Value="5"></Spinner>
- </HorizontalStack>
-<!-- <ListBox Data="{TestList}"></ListBox>-->
- <HorizontalStack Name="hsPbar" Margin="5">
- <ProgressBar Name="pbBar"
- Width="200" Height="20"
- Minimum="0"
- Maximum="200"
- Value="{fps}"
- Foreground="BlueCrayola" Background="DarkGray"
- BorderWidth="2" BorderColor="White"/>
-<!-- <Label Name="labPb"
- Width="30"
- TextAlignment="RightCenter"/>-->
- </HorizontalStack>
- <HorizontalStack Name="hsFocus">
- <Label Text="Focused:"/>
- <Label Name="labFocus"/>
- </HorizontalStack>
- <HorizontalStack>
- <Label Text="Active:" Name="hsActive"/>
- <Label Name="labActive"/>
- </HorizontalStack>
- <HorizontalStack>
- <Label Text="Hover:" Name="hsHover"/>
- <Label Name="labHover"/>
</HorizontalStack>
- <Button Margin="5" BorderWidth="0" Width="-1" Height="-1" HorizontalAlignment="Center">
- <Label FontSize="18" Text="This is a test" Margin="5" Foreground="Black" />
- </Button>
<TextBoxWidget Name="textbox1" TextAlignment="LeftCenter" Font="droid,14"
- Width="300" Height="-1" Margin="2"
- BorderColor="White" BorderWidth="1"
+ Width="200" Height="-1" Margin="2" Background="White"
+ Forground="Black"
+ BorderColor="DimGray" BorderWidth="1"
Text="editable text"/>
- <GroupBox Title="Group Box" Width="300" Height="100"
- BorderColor="White" BorderWidth="2" Margin="3">
- <Label Name="labValue" FontSize="14" Text="{../../slider.Value}" TextAlignment="Center"/>
- </GroupBox>
- <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
- <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>
</VerticalStack>
- <VerticalStack Width="-1" Height="-1" Margin="0" WidgetSpacing="1">
+ <VerticalStack Fit="true" Margin="0" WidgetSpacing="1">
<Button Margin="1" Width="150" Height="100">
<Image Path="#Tests.image.tetra.png"/>
</Button>
@@ -116,7 +89,7 @@
</Expandable>
<HorizontalStack>
<Label Text="Update" FontColor="White"/>
- <Label Name="labUpdate" Text="xxxx" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>
+ <Label Name="labUpdate" Text="{update}" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>
</HorizontalStack>
<HorizontalStack>
<Label Text="Fps:" Width = "30"/>
@@ -134,6 +107,53 @@
TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
</VerticalStack>
+ <HorizontalStack Width="-1">
+ <Scroller Name="scroller1" Background="DimGray" Width="-1"
+ Margin="5" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
+ <VerticalStack Name="colors" VerticalAlignment="Top" Margin="1" Fit="true">
+ <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"
+ BorderWidth="2" BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>
+ <ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"
+ BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>
+ </VerticalStack>
+ </Scroller>
+ <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
+ Orientation="Vertical" Width="16" />
+ </HorizontalStack>
+ </HorizontalStack>
+<!-- <HorizontalStack Name="hs0"
+ WidgetSpacing="1"
+ VerticalAlignment="Top">
+ <Slider Orientation="Vertical" Height="300" Width="10" Background="Transparent" />
+ <VerticalStack Name="vs1" Spacing="5">
+ <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
+ <HorizontalStack WidgetSpacing="10">
+
+
+ <Spinner Width="50" Value="5"></Spinner>
+ </HorizontalStack>
+ <HorizontalStack Name="hsPbar" Margin="5">
+ <ProgressBar Name="pbBar"
+ Width="200" Height="20"
+ Minimum="0"
+ Maximum="200"
+ Value="{fps}"
+ Foreground="BlueCrayola" Background="DarkGray"
+ BorderWidth="2" BorderColor="White"/>
+ </HorizontalStack>
+
+ <Button Margin="5" BorderWidth="0" Width="-1" Height="-1" HorizontalAlignment="Center">
+ <Label FontSize="18" Text="This is a test" Margin="5" Foreground="Black" />
+ </Button>
+
+ <GroupBox Title="Group Box" Width="300" Height="100"
+ BorderColor="White" BorderWidth="2" Margin="3">
+ <Label Name="labValue" FontSize="14" Text="{../../slider.Value}" TextAlignment="Center"/>
+ </GroupBox>
+ <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
+ <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>
+ </VerticalStack>
+
<HorizontalStack Height="350" Width="-1">
<Scroller Name="scroller1" Background="DimGray" Height="0" Width="-1"
Margin="5" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
@@ -148,10 +168,10 @@
Orientation="Vertical" Width="16" />
</HorizontalStack>
</HorizontalStack>
-
- <Slider
+-->
+<!-- <Slider
Height="20" Width="100"
Background="Transparent"
- VerticalAlignment="Bottom" />
+ VerticalAlignment="Bottom" />-->
</Border>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/testExpandable.goml b/Tests/Interfaces/testExpandable.goml
index a292cdde..0caf0a32 100755
--- a/Tests/Interfaces/testExpandable.goml
+++ b/Tests/Interfaces/testExpandable.goml
@@ -3,7 +3,7 @@
Margin="20" Focusable="True" Background="Gray">
<Expandable Width="150" Height="-1" Margin="2" VerticalAlignment="Top">
- <VerticalStack Width="100" >
+ <VerticalStack Width="100" Height="-1">
<Checkbox Name="chk1"/>
<Checkbox Name="chk2" IsChecked="true"/>
<Checkbox Name="chk3"/>
diff --git a/Tests/Interfaces/testHStack.goml b/Tests/Interfaces/testHStack.goml
index 8e4083a0..ac03eac9 100755
--- a/Tests/Interfaces/testHStack.goml
+++ b/Tests/Interfaces/testHStack.goml
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!--<HorizontalStack Background="Gray" Margin="1">-->
-<Group Background="Gray" Margin="5" Height="-1" Width="-1">
+<Group Background="Gray" Margin="5" Height="200" Width="300">
<VerticalStack Background="Green" Margin="1">
- <HorizontalStack Width="-1" Height="-1" Margin="5" Background="Red">
- <Checkbox Height="100" Width="200" Background="Blue"/>
+ <HorizontalStack Width="0" Height="0" Margin="5" Background="Red">
+ <Checkbox Height="-1" Width="100" Background="Blue"/>
<!-- <Checkbox Height="-1" Width="-1"/>-->
</HorizontalStack>
</VerticalStack>
diff --git a/Tests/Interfaces/testWindow.goml b/Tests/Interfaces/testWindow.goml
index efad1d8f..b336a9dc 100755
--- a/Tests/Interfaces/testWindow.goml
+++ b/Tests/Interfaces/testWindow.goml
@@ -4,9 +4,9 @@
Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">
<Template>
<Border BorderWidth="1" BorderColor="White" Margin="0" CornerRadius="20">
- <VerticalStack Height="0" Width="0" Margin="0">
- <Border BorderWidth="1" BorderColor="White" Height="-1" Width="0" Background="0,1;0,5;1,0;0,5">
- <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" Width="0" Focusable="false" >
+ <VerticalStack Margin="0">
+ <Border BorderWidth="1" BorderColor="White" Height="-1" Background="0,1;0,5;1,0;0,5">
+ <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" Focusable="false" >
<GraphicObject Width="5" Height="0"/>
<Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
<Label Foreground="White" Width="0" Name="Title" Margin="1" TextAlignment="Center" />
@@ -22,15 +22,15 @@
</VerticalStack>
</Border>
</Template>
- <VerticalStack Name="contentVSStack" Height="0" Width="0" Margin="10" Spacing="10">
+ <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">
<Slider Name="slider" Height="10" Width="0"/>
<HorizontalStack Width="-1" Height="-1" Margin="0" Background="Red">
- <Checkbox Height="-1" Width="-1"/>
- <Checkbox Height="-1" Width="-1"/>
+ <Checkbox Height="-1" Width="100"/>
+ <Checkbox Height="-1" Width="100"/>
</HorizontalStack>
<GroupBox Title="test" Height="-1" Width="-1" Margin="5">
- <VerticalStack Width="-1">
+ <VerticalStack Height="-1" Width="-1">
<RadioButton Caption="Radio 1"/>
<RadioButton Caption="Radio 2" IsChecked="true"/>
<RadioButton Caption="Radio 3"/>
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 8694d0e0..ce666004 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>test.GOLIBTests</StartupObject>
+ <StartupObject>test.GOLIBTest_4</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>..\bin\$(configuration)</OutputPath>
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>