This commit is contained in:
Zihan Chen
2016-12-13 02:44:10 -08:00
parent 429576a42b
commit 08f51905e2
6 changed files with 30 additions and 15 deletions
@@ -18,7 +18,7 @@
<Window Text="Hello, world!" ClientSize="x:480 y:320"> <Window Text="Hello, world!" ClientSize="x:480 y:320">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/> <att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Label Text="Welcome to GacUI Library!"> <Label Text="Welcome to GacUI Library!">
<att.Font>fontFamily:{Segoe UI} size:32 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:32 antialias:true</att.Font>
</Label> </Label>
</Window> </Window>
</Instance> </Instance>
@@ -22,12 +22,12 @@
</att.Columns> </att.Columns>
<Cell Site="row:0 column:0 columnSpan:2"> <Cell Site="row:0 column:0 columnSpan:2">
<SolidLabel Text="www.gaclib.net" HorizontalAlignment="Center" VerticalAlignment="Center"> <SolidLabel Text="www.gaclib.net" HorizontalAlignment="Center" VerticalAlignment="Center">
<att.Font>fontFamily:{Segoe UI} size:40 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:40 antialias:true</att.Font>
</SolidLabel> </SolidLabel>
</Cell> </Cell>
<Cell Site="row:1 column:0"> <Cell Site="row:1 column:0">
<SolidLabel Text="Username: " VerticalAlignment="Center"> <SolidLabel Text="Username: " VerticalAlignment="Center">
<att.Font>fontFamily:{Segoe UI} size:12 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:12 antialias:true</att.Font>
</SolidLabel> </SolidLabel>
</Cell> </Cell>
<Cell Site="row:1 column:1"> <Cell Site="row:1 column:1">
@@ -37,12 +37,12 @@
</Cell> </Cell>
<Cell Site="row:2 column:1"> <Cell Site="row:2 column:1">
<SolidLabel Color="#FF0000" WrapLine="true" WrapLineHeightCalculation="true" Text-bind="ViewModel.UserNameError"> <SolidLabel Color="#FF0000" WrapLine="true" WrapLineHeightCalculation="true" Text-bind="ViewModel.UserNameError">
<att.Font>fontFamily:{Segoe UI} size:12 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:12 antialias:true</att.Font>
</SolidLabel> </SolidLabel>
</Cell> </Cell>
<Cell Site="row:3 column:0"> <Cell Site="row:3 column:0">
<SolidLabel Text="Password: " VerticalAlignment="Center"> <SolidLabel Text="Password: " VerticalAlignment="Center">
<att.Font>fontFamily:{Segoe UI} size:12 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:12 antialias:true</att.Font>
</SolidLabel> </SolidLabel>
</Cell> </Cell>
<Cell Site="row:3 column:1"> <Cell Site="row:3 column:1">
@@ -52,7 +52,7 @@
</Cell> </Cell>
<Cell Site="row:4 column:1"> <Cell Site="row:4 column:1">
<SolidLabel Color="#FF0000" WrapLine="true" WrapLineHeightCalculation="true" Text-bind="ViewModel.PasswordError"> <SolidLabel Color="#FF0000" WrapLine="true" WrapLineHeightCalculation="true" Text-bind="ViewModel.PasswordError">
<att.Font>fontFamily:{Segoe UI} size:12 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:12 antialias:true</att.Font>
</SolidLabel> </SolidLabel>
</Cell> </Cell>
<Cell Site="row:7 column:0 columnSpan:2"> <Cell Site="row:7 column:0 columnSpan:2">
@@ -12,7 +12,7 @@
<Window Text="Hello, world!" ClientSize="x:480 y:320"> <Window Text="Hello, world!" ClientSize="x:480 y:320">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/> <att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Label Text="Welcome to GacUI Library!"> <Label Text="Welcome to GacUI Library!">
<att.Font>fontFamily:{Segoe UI} size:32 antialias:true</att.Font> <att.Font>fontFamily:"Segoe UI" size:32 antialias:true</att.Font>
</Label> </Label>
</Window> </Window>
</Instance> </Instance>
+15 -4
View File
@@ -22,7 +22,15 @@
var radioButton = cast (SelectableButton*) sender.RelatedControl; var radioButton = cast (SelectableButton*) sender.RelatedControl;
if (radioButton.Selected) if (radioButton.Selected)
{ {
var direction = cast (AxisDirection) radioButton.Text; var direction : AxisDirection =
radioButton.Text == "LeftDown" ? LeftDown :
radioButton.Text == "LeftUp" ? LeftUp :
radioButton.Text == "RightDown" ? RightDown :
radioButton.Text == "RightUp" ? RightUp :
radioButton.Text == "UpRight" ? UpRight :
radioButton.Text == "UpLeft" ? UpLeft :
radioButton.Text == "DownLeft" ? DownLeft :
DownRight;
var axis = new Axis^(direction); var axis = new Axis^(direction);
flowLayout.Axis = axis; flowLayout.Axis = axis;
} }
@@ -37,7 +45,10 @@
var radioButton = cast (SelectableButton*) sender.RelatedControl; var radioButton = cast (SelectableButton*) sender.RelatedControl;
if (radioButton.Selected) if (radioButton.Selected)
{ {
flowLayout.Alignment = cast (FlowAlignment) radioButton.Text; flowLayout.Alignment =
radioButton.Text == "Left" ? Left :
radioButton.Text == "Center" ? Center :
Extend;
} }
} }
]]> ]]>
@@ -49,11 +60,11 @@
{ {
for (flowItem in flowLayout.FlowItems) for (flowItem in flowLayout.FlowItems)
{ {
flowItem.ExtraMargin = cast Margin ""; flowItem.ExtraMargin = {};
} }
var selectedItem = cast (FlowItem*) sender.Parent; var selectedItem = cast (FlowItem*) sender.Parent;
selectedItem.ExtraMargin = cast Margin "left:10 top:10 right:10 bottom:10"; selectedItem.ExtraMargin = {left:10 top:10 right:10 bottom:10};
flowLayout.MoveChild(selectedItem, flowLayout.FlowItems.Count - 1); flowLayout.MoveChild(selectedItem, flowLayout.FlowItems.Count - 1);
} }
]]> ]]>
+7 -3
View File
@@ -22,7 +22,11 @@
var radioButton = cast (SelectableButton*) sender.RelatedControl; var radioButton = cast (SelectableButton*) sender.RelatedControl;
if (radioButton.Selected) if (radioButton.Selected)
{ {
stackLayout.Direction = cast (Stack::Direction) radioButton.Text; stackLayout.Direction =
radioButton.Text == "Horizontal" ? Horizontal :
radioButton.Text == "Vertical" ? Vertical :
radioButton.Text == "ReversedHorizontal" ? ReversedHorizontal :
ReversedVertical;
} }
} }
]]> ]]>
@@ -34,11 +38,11 @@
{ {
for (stackItem in stackLayout.StackItems) for (stackItem in stackLayout.StackItems)
{ {
stackItem.ExtraMargin = cast Margin ""; stackItem.ExtraMargin = {};
} }
var selectedItem = cast (StackItem*) sender.Parent; var selectedItem = cast (StackItem*) sender.Parent;
selectedItem.ExtraMargin = cast Margin "left:10 top:10 right:10 bottom:10"; selectedItem.ExtraMargin = {left:10 top:10 right:10 bottom:10};
stackLayout.MoveChild(selectedItem, stackLayout.StackItems.Count - 1); stackLayout.MoveChild(selectedItem, stackLayout.StackItems.Count - 1);
} }
]]> ]]>
+1 -1
View File
@@ -33,7 +33,7 @@
</att.Columns> </att.Columns>
<Cell Site="row:0 column:0 columnSpan:3"> <Cell Site="row:0 column:0 columnSpan:3">
<SolidLabel Font="fontFamily:{Lucida Calligraphy} size:96" HorizontalAlignment="Center" VerticalAlignment="Center" Text="GacUI"/> <SolidLabel Font="fontFamily:'Lucida Calligraphy' size:96" HorizontalAlignment="Center" VerticalAlignment="Center" Text="GacUI"/>
</Cell> </Cell>
<Cell Site="row:2 column:0"> <Cell Site="row:2 column:0">