<?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="-1" Width="0">\r
- <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
+<!--<HorizontalStack Spacing="1" Height="-1" Width="0">\r
+ <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub2}"/>\r
<Label Text="{Caption}" Width="0"/>\r
+</HorizontalStack>-->\r
+<HorizontalStack Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
+ <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
+ <Label Text="{Caption}" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
</HorizontalStack>
\ No newline at end of file
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="0" MouseClick="onMouseClick">\r
- <VerticalStack Height="-1" Width="0">\r
- <HorizontalStack Spacing="1" Height="-1" Width="0">\r
+<Border BorderWidth="1" BorderColor="LightGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}" MouseClick="onMouseClick">\r
+ <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
+ <HorizontalStack Spacing="1" Height="-1" Width="{TemplatedWidth}">\r
<Image Margin="2" Width="12" Height="12" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Title}" Width="0"/>\r
+ <Label Text="{Title}" Width="{TemplatedWidth}"/>\r
</HorizontalStack>\r
- <Container Name="Content" Visible="false"/>\r
+ <Container Name="Content" Visible="false" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
</VerticalStack>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>\r
-<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Fit="True" Background="Gray">\r
- <VerticalStack Name="List" Margin="1" VerticalAlignment="Top"/>\r
+<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
+ <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>
-<Border Height="-1" BorderWidth="1" BorderColor="White" CornerRadius="10" >
- <VerticalStack Height="-1" Background="0,4;0,4;0,4;0,4">
- <Border BorderWidth="1" BorderColor="White" Height="18" Background="0,1;0,5;1,0;0,5">
- <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" >
- <GraphicObject Width="5"/>
- <Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
- <Label Foreground="White" Width="0" Text="{Title}" Margin="1" TextAlignment="Center" />
- <Border CornerRadius="6" BorderWidth="1" Margin="0" BorderColor="Transparent" Height="12" Width="12"
+<Border Height="{TemplatedHeight}" Width="{TemplatedWidth}" BorderWidth="1" BorderColor="White" CornerRadius="10" >
+ <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="0,4;0,4;0,4;0,4">
+ <Border BorderWidth="1" BorderColor="White" Width="{TemplatedWidth}" Height="-1"
+ Background="0,1;0,5;1,0;0,5">
+ <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{TemplatedWidth}" Height="-1" >
+ <GraphicObject Width="5" Height="5"/>
+ <Image Margin="1" Width="12" Height="12" Path="{Icon}"/>
+ <Label Foreground="White" Width="{TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{Title}" />
+ <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"
MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"
MouseClick="butQuitPress"/>
</Border>
- <GraphicObject Width="5"/>
+ <GraphicObject Width="5" Height="5"/>
</HorizontalStack>
</Border>
-<!-- <Container Name="Content"/>-->
- <HorizontalStack Spacing="10">
- <GraphicObject Width="20"/>
+ <HorizontalStack Spacing="10" Margin="10" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
<Image Name="Image" Width="32" Height="32"
Path="#go.Images.Icons.iconInfo.svg" />
- <TextRun Font="serif, 12" Width="0" Height="80" Text="{Message}"
+ <TextRun Font="serif, 12" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Text="{Message}"
Multiline="true" WordWrap="true"/>
</HorizontalStack>
- <HorizontalStack Height="-1" Margin="5">
- <GraphicObject/>
+ <HorizontalStack Height="-1" Width="{TemplatedWidth}" Margin="5">
+ <GraphicObject Height="5"/>
<Button Text="Ok"/>
<Button Text="Cancel"/>
</HorizontalStack>
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="-1" MouseClick="onMouseClick">\r
- <HorizontalStack Spacing="1" Height="-1" >\r
+<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{TemplatedWidth}" MouseClick="onMouseClick">\r
+ <HorizontalStack Spacing="1" Height="-1" Width="{TemplatedWidth}">\r
<Image Margin="2" Width="12" Height="12" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Title}" Width="0"/>\r
+ <Label Text="{Title}" Width="{TemplatedWidth}"/>\r
</HorizontalStack>\r
</Border>
\ No newline at end of file
<?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="-1" Width="0">\r
+<HorizontalStack Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
<Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
- <Label Text="{Caption}" Width="0"/>\r
+ <Label Text="{Caption}" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
</HorizontalStack>
\ No newline at end of file
<?xml version="1.0"?>
-<Border BorderWidth="1" Width="{Width}" Height="{Height}" Background="White">
- <HorizontalStack Name="hstack" Margin="0" Spacing="2" Width="{Width}" Height="{Height}">
- <Label Foreground="DimGray" Width="0" Height="{Height}" Name="labCpt"
+<Border BorderWidth="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="White">
+ <HorizontalStack Name="hstack" Margin="0" Spacing="2" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+ <Label Foreground="DimGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}"
Text="{Value}" Margin="1" TextAlignment="RightCenter"/>
- <VerticalStack Width="-1" Height="-1" Spacing="1" >
+ <VerticalStack Width="-1" Height="{TemplatedHeight}" Spacing="1" >
<Button Width="12" Height="8" MouseClick="onUp">
<Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>
</Button>
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="White" CornerRadius="20">\r
- <VerticalStack Height="0">\r
- <Border BorderWidth="1" BorderColor="White" Height="-1" Background="0,1;0,5;1,0;0,5">\r
- <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" >\r
+<Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
+ <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
+ <Border BorderWidth="1" BorderColor="White" Width="{TemplatedWidth}" Height="-1" \r
+ Background="0,1;0,5;1,0;0,5">\r
+ <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{TemplatedWidth}" Height="-1" >\r
<GraphicObject Width="5"/>\r
<Image Margin="1" Width="12" Height="12" Path="{Icon}"/>\r
- <Label Foreground="White" Width="0" Margin="1" TextAlignment="Center" Text="{Title}" />\r
+ <Label Foreground="White" Width="{TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{Title}" />\r
<Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"\r
MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"\r
<GraphicObject Width="5"/>\r
</HorizontalStack>\r
</Border>\r
- <Container Name="Content" Background="0,5;0,5;0,5;0,5"/>\r
+ <Container Name="Content" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
</VerticalStack>\r
</Border>
\ No newline at end of file
int frameCpt = 0;\r
int idx = 0;\r
string[] testFiles = {\r
+ "testCheckbox.goml",\r
"testWindow.goml",\r
"test0.goml",\r
"test1.goml",\r
"test1.2.goml",\r
"testLabel.goml",\r
"testContainer.goml",\r
- "testCheckbox.goml",\r
"testRadioButton.goml",\r
"testSpinner.goml",\r
"testPopper.goml",\r
<?xml version="1.0"?>\r
-<Checkbox Caption="Checkbox" Background="DimGray"/>\r
+<Checkbox Width="100" Height="-1" Caption="Checkbox" Background="DimGray"/>\r
\r
<?xml version="1.0"?>
-<MessageBox/>
\ No newline at end of file
+<MessageBox Width="200" Height="-1"/>
\ No newline at end of file
<Checkbox Height="-1" Width="80"/>\r
</HorizontalStack>\r
<GroupBox Text="test" Height="-1" Width="0" Margin="5">\r
- <VerticalStack Height="-1" Width="0">\r
- <RadioButton Caption="Radio 1"/>\r
- <RadioButton Caption="Radio 2" IsChecked="true"/>\r
- <RadioButton Caption="Radio 3"/>\r
+ <VerticalStack Height="-1" Width="0" >\r
+ <RadioButton Caption="Radio 1" Background="Red" />\r
+ <RadioButton Caption="Radio 2" IsChecked="true" />\r
+ <RadioButton Caption="Radio 3" />\r
</VerticalStack>\r
</GroupBox>\r
<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
\r
\r
#region GraphicObject overrides\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
- }\r
+// [XmlAttributeAttribute()][DefaultValue(-1)]\r
+// public override int Height {\r
+// get { return base.Height; }\r
+// set { base.Height = value; }\r
+// }\r
[XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
public override bool Focusable\r
{\r
// set { _templatePath = value; }
// }
-
- protected virtual void loadTemplate(GraphicObject template = null)
- {
- if (template == null) {
- DefaultTemplate dt = (DefaultTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultTemplate), true).FirstOrDefault();
- this.SetChild (Interface.Load (dt.Path, this));
- }else
- this.SetChild (template);
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Width {
+ get { return base.Width; }
+ set {
+ base.Width = value;
+ //PropertyLess binding for sizing policy in template
+ if (base.Width < 1) //send size policy to template elements
+ NotifyValueChanged ("TemplatedWidth", base.Width);
+ else //stretched in control if size is fixed
+ NotifyValueChanged ("TemplatedWidth", 0);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Height {
+ get { return base.Height; }
+ set {
+ base.Height = value;
+
+ //PropertyLess binding for sizing policy in template
+ if (base.Height < 1) //send size policy to template elements
+ NotifyValueChanged ("TemplatedHeight", base.Height);
+ else //stretched in control if size is fixed
+ NotifyValueChanged ("TemplatedHeight", 0);
+ }
}
protected override void loadDefaultValues ()
loadTemplate ();
base.loadDefaultValues ();
}
-
public override GraphicObject FindByName (string nameToFind)
{
//prevent name searching in template
return nameToFind == this.Name ? this : null;
}
+ #endregion
+
+ protected virtual void loadTemplate(GraphicObject template = null)
+ {
+ if (template == null) {
+ DefaultTemplate dt = (DefaultTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultTemplate), true).FirstOrDefault();
+ this.SetChild (Interface.Load (dt.Path, this));
+ }else
+ this.SetChild (template);
+ }
+
+
#region IXmlSerializable
[DefaultTemplate("#go.Templates.Window.goml")]
public class Window : TemplatedContainer
{
+ enum Direction
+ {
+ None,
+ N,
+ S,
+ E,
+ W,
+ NW,
+ NE,
+ SW,
+ SE,
+ }
+
string _title;
string _icon;
Container _contentContainer;
+ Direction currentDirection = Direction.None;
+
+ #region CTOR
+ public Window () : base() {}
+ #endregion
#region GraphicObject overrides
[XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
NotifyValueChanged ("Icon", _icon);
}
}
-
- public Window () : base()
- {
- }
- enum Direction
- {
- None,
- N,
- S,
- E,
- W,
- NW,
- NE,
- SW,
- SE,
- }
- Direction currentDirection = Direction.None;
-
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
base.onMouseMove (sender, e);