int frameCpt = 0;\r
int idx = 0;\r
string[] testFiles = {\r
+ "testWindow3.goml",\r
+ "testExpandable.goml",\r
+ "testPopper.goml",\r
+ "testCheckbox.goml",\r
+ "fps.goml",\r
+ "testLabel.goml",\r
"testAll.goml",\r
- "test4.goml",\r
+ "testWindow.goml",\r
+ "testWindow2.goml",\r
// "testSpinner.goml",\r
// "test_Listbox.goml",\r
+ "test4.goml",\r
"testRadioButton2.goml",\r
- "fps.goml",\r
- "testCheckbox.goml",\r
- "testExpandable.goml",\r
"testContainer.goml",\r
"testBorder.goml",\r
- "testLabel.goml",\r
"testRadioButton.goml",\r
"testSpinner.goml",\r
- "testPopper.goml",\r
"testGroupBox.goml",\r
- "testWindow.goml",\r
"testMsgBox.goml",\r
"testGrid.goml",\r
"testMeter.goml",\r
<Groupbox Background="DarkGreen"> \r
<!-- <Template>\r
<Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <Border CornerRadius="5" BorderWidth="1" Margin="6"\r
+ <Border CornerRadius="5" BorderWidth="1" Margin="0"\r
Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
- <Container Name="Content" Margin="10"\r
+ <Container Name="Content" Margin="0"\r
Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
</Border>\r
<Label Text="{../../Title}" VerticalAlignment="Top" Left="15"\r
Background="Clear" Margin="1"/>\r
</Group>\r
</Template>-->\r
- <VerticalStack Fit="true" Background="Red" Margin="0">\r
+ <VerticalStack Fit="true" Background="Red" Margin="10">\r
<TextRun Text="text run test" />\r
<TextRun Text="text run test" />\r
<TextRun Text="text run test"/>\r
<?xml version="1.0"?>\r
-<Checkbox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="false"/>\r
+<Checkbox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>\r
\r
Width="250" Height="300" >\r
<VerticalStack Name="contentVSStack" Margin="10" Spacing="10">\r
<Slider Name="slider" Height="10" Width="0"/>\r
-\r
- <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">\r
- <Checkbox Height="-1" Width="80"/>\r
- <GraphicObject Width="0"/>\r
- <Checkbox Height="-1" Width="80"/>\r
- </HorizontalStack>\r
<Groupbox Text="test" Height="-1" Width="-1" Margin="5">\r
<VerticalStack Height="-1" Width="0" >\r
<RadioButton Caption="Radio 1" Background="Red" />\r
<RadioButton Caption="Radio 3" />\r
</VerticalStack>\r
</Groupbox>\r
+ <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">\r
+ <Checkbox Height="-1" Width="80"/>\r
+ <GraphicObject Width="0"/>\r
+ <Checkbox Height="-1" Width="80" IsChecked="true"/>\r
+ </HorizontalStack>\r
+\r
<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
</VerticalStack>\r
</Window>\r
--- /dev/null
+<?xml version="1.0"?>\r
+<!--<Group>-->\r
+<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8" \r
+ Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">\r
+ <Template>\r
+ <Container Margin="20" Name="Content" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
+ </Template>\r
+ <Group Background="Green">\r
+ <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/> \r
+ </Group>\r
+</Window>\r
<None Include="Interfaces\testAll.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\testWindow3.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
\r
public virtual void onExpand(object sender, EventArgs e)\r
{\r
- _contentContainer.Visible = true;\r
+ if (_contentContainer != null)\r
+ _contentContainer.Visible = true;\r
+ \r
Expand.Raise (this, e);\r
}\r
public virtual void onCollapse(object sender, EventArgs e)\r
{\r
- _contentContainer.Visible = false;\r
+ if (_contentContainer != null)\r
+ _contentContainer.Visible = false;\r
+ \r
Collapse.Raise (this, e);\r
}\r
\r
{ \r
if (Parent == null)\r
return;\r
+\r
base.RegisterForLayouting (layoutType);\r
\r
if ((layoutType & (int)LayoutingType.PositionChildren) > 0)\r
{\r
if (Parent == null)\r
return;\r
+ #if DEBUG_LAYOUTING\r
+ Debug.WriteLine ("RegisterForLayouting => {1}->{0}", layoutType, this.ToString());\r
+ #endif\r
lock (Interface.LayoutingQueue) {\r
Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);\r
\r
Width = -1;\r
\r
if (Bounds.Width == 0) //stretch in parent\r
- Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
+ Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
else if (Bounds.Width < 0) //fit \r
- Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Width, this);\r
+ Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Width, this);\r
else\r
Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));\r
}\r
Height = -1;\r
\r
if (Bounds.Height == 0) //stretch in parent\r
- Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
+ Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
else if (Bounds.Height < 0) //fit \r
- Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Height, this);\r
+ Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Height, this);\r
else\r
Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));\r
}\r
\r
if ((layoutType & (int)LayoutingType.X) > 0)\r
- //for x positionning, sizing of parent and this have to be done\r
- Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.X, this);\r
+ //for x positionning, sizing of parent and this have to be done\r
+ Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.X, this);\r
\r
if ((layoutType & (int)LayoutingType.Y) > 0)\r
- //for x positionning, sizing of parent and this have to be done\r
- Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this);\r
+ //for x positionning, sizing of parent and this have to be done\r
+ Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this);\r
}\r
}\r
\r
{\r
base.OnLayoutChanges (layoutType);\r
\r
+ GenericStack gs = this as GenericStack;\r
//position smaller objects in group when group size is fit\r
switch (layoutType) {\r
- case LayoutingType.Width: \r
- if (Width < 0) {\r
- int crw = ClientRectangle.Width;\r
- foreach (GraphicObject c in Children.Where(ch => ch.Visible))\r
- c.RegisterForLayouting ((int)LayoutingType.X); \r
- } else {\r
- foreach (GraphicObject c in Children.Where(ch => ch.Width == 0 && ch.Visible))\r
- c.RegisterForLayouting ((int)LayoutingType.Width); \r
+ case LayoutingType.Width:\r
+ if (gs != null) {\r
+ if (gs.Orientation == Orientation.Horizontal) {\r
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
+ break;\r
+ }\r
+ } \r
+ foreach (GraphicObject c in Children.Where(ch => ch.Visible)) {\r
+ if (c.getBounds ().Width == 0)\r
+ c.RegisterForLayouting ((int)LayoutingType.Width);\r
+ else\r
+ c.RegisterForLayouting ((int)LayoutingType.X); \r
}\r
break;\r
case LayoutingType.Height:\r
- if (Height < 0) {\r
- int crh = ClientRectangle.Height;\r
- foreach (GraphicObject c in Children.Where(ch => ch.Visible))\r
- c.RegisterForLayouting ((int)LayoutingType.Y); \r
- } else {\r
- foreach (GraphicObject c in Children.Where(ch => ch.Height == 0 && ch.Visible))\r
- c.RegisterForLayouting ((int)LayoutingType.Height); \r
+ if (gs != null) {\r
+ if (gs.Orientation == Orientation.Vertical) {\r
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
+ break;\r
+ }\r
+ }\r
+ foreach (GraphicObject c in Children.Where(ch => ch.Visible)) {\r
+ if (c.getBounds ().Height == 0)\r
+ c.RegisterForLayouting ((int)LayoutingType.Height);\r
+ else\r
+ c.RegisterForLayouting ((int)LayoutingType.Y);\r
}\r
break;\r
}\r
protected override void loadDefaultValues ()
{
- if (child == null)//trigger loading of default template if child is empty
- loadTemplate ();
+// if (child == null)//trigger loading of default template if child is empty
+// loadTemplate ();
base.loadDefaultValues ();
}
public override GraphicObject FindByName (string nameToFind)
xr.Read ();//go close tag
xr.Read ();//Template close tag
break;
- } else {
- xr.ReadInnerXml ();
- }
+ } else
+ xr.ReadInnerXml ();
}
}
} else
loadTemplate (Interface.Load (template, this));
-
+ if (this.child == null) {
+ loadTemplate ();
+ loadDefaultValues ();
+ }
+
//normal xml read
using (XmlReader xr = new XmlTextReader (tmp, XmlNodeType.Element, null)) {
xr.Read ();