mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-21 14:46:20 +08:00
Update release
This commit is contained in:
@@ -13,10 +13,218 @@
|
||||
</Folder>
|
||||
</Folder>
|
||||
<Folder name="MainWindow">
|
||||
<InstanceStyle name="MainWindowStyle">
|
||||
<Styles>
|
||||
<Style ref.Path="//*.groupBoxAxis//RadioButton">
|
||||
<ev.SelectedChanged-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var radioButton = cast (SelectableButton*) sender.RelatedControl;
|
||||
if (radioButton.Selected)
|
||||
{
|
||||
var direction = cast (AxisDirection) radioButton.Text;
|
||||
var axis = new Axis^(direction);
|
||||
flowLayout.Axis = axis;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.SelectedChanged-eval>
|
||||
</Style>
|
||||
<Style ref.Path="//*.groupBoxAlignment//RadioButton">
|
||||
<ev.SelectedChanged-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
var radioButton = cast (SelectableButton*) sender.RelatedControl;
|
||||
if (radioButton.Selected)
|
||||
{
|
||||
flowLayout.Alignment = cast (FlowAlignment) radioButton.Text;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</ev.SelectedChanged-eval>
|
||||
</Style>
|
||||
<Style ref.Path="//FlowItem/Button">
|
||||
<ev.Clicked-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
for (item in flowLayout.FlowItems)
|
||||
{
|
||||
item.ExtraMargin = cast Margin "";
|
||||
}
|
||||
|
||||
var item = cast (FlowItem*) sender.Parent;
|
||||
item.ExtraMargin = cast Margin "left:10 top:10 right:10 bottom:10";
|
||||
flowLayout.MoveChild(item, flowLayout.FlowItems.Count - 1);
|
||||
}
|
||||
]]>
|
||||
</ev.Clicked-eval>
|
||||
</Style>
|
||||
</Styles>
|
||||
</InstanceStyle>
|
||||
<Instance name="MainWindowResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow" xmlns:x="presentation::controls::GuiSelectableButton::*" ref.Styles="res://MainWindow/MainWindowStyle">
|
||||
<Window Text="Flow" ClientSize="x:480 y:320">
|
||||
<x:MutexGroupController ref.Name="groupAxis"/>
|
||||
<x:MutexGroupController ref.Name="groupAlignment"/>
|
||||
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
|
||||
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
|
||||
|
||||
<Table AlignmentToParent="left:5 top:5 right:5 bottom:5" CellPadding="5" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:Percentage percentage:1.0</CellOption>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:Percentage percentage:1.0</CellOption>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<GroupBox ref.Name="groupBoxAxis" Text="Axis">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:5 top:5 right:5 bottom:5"/>
|
||||
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
|
||||
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:1">
|
||||
<RadioButton Text="RightDown" GroupController-ref="groupAxis" Selected="true"/>
|
||||
</Cell>
|
||||
<Cell Site="row:0 column:2">
|
||||
<RadioButton Text="LeftDown" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
<Cell Site="row:1 column:0">
|
||||
<RadioButton Text="DownRight" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
<Cell Site="row:1 column:3">
|
||||
<RadioButton Text="DownLeft" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
<Cell Site="row:2 column:0">
|
||||
<RadioButton Text="UpRight" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
<Cell Site="row:2 column:3">
|
||||
<RadioButton Text="UpLeft" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
<Cell Site="row:3 column:1">
|
||||
<RadioButton Text="RightUp" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
<Cell Site="row:3 column:2">
|
||||
<RadioButton Text="LeftUp" GroupController-ref="groupAxis"/>
|
||||
</Cell>
|
||||
</Table>
|
||||
</GroupBox>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:0 column:1">
|
||||
<GroupBox ref.Name="groupBoxAlignment" Text="Alignment">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:5 top:5 right:5 bottom:5"/>
|
||||
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
|
||||
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
</att.Rows>
|
||||
<att.Columns>
|
||||
<CellOption>composeType:MinSize</CellOption>
|
||||
</att.Columns>
|
||||
|
||||
<Cell Site="row:0 column:0">
|
||||
<RadioButton Text="Left" GroupController-ref="groupAlignment" Selected="true"/>
|
||||
</Cell>
|
||||
<Cell Site="row:1 column:0">
|
||||
<RadioButton Text="Center" GroupController-ref="groupAlignment"/>
|
||||
</Cell>
|
||||
<Cell Site="row:2 column:0">
|
||||
<RadioButton Text="Extend" GroupController-ref="groupAlignment"/>
|
||||
</Cell>
|
||||
</Table>
|
||||
</GroupBox>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:1 column:0 columnSpan:3">
|
||||
<Label Text="Click any button in stack items to enlarge it."/>
|
||||
</Cell>
|
||||
|
||||
<Cell Site="row:2 column:0 columnSpan:3">
|
||||
<Flow ref.Name="flowLayout" AlignmentToParent="left:0 top:0 right:0 bottom:0" RowPadding="20" ColumnPadding="5" ExtraMargin="left:10 top:10 right:10 bottom:10" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<FlowItem>
|
||||
<Button Text="Large 1">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:100 y:100"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Medium 1">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:75 y:75"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Small 1">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:50 y:50"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Large 2">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:100 y:100"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Medium 2">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:75 y:75"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Small 2">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:50 y:50"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Large 3">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:100 y:100"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Medium 3">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:75 y:75"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Small 3">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:50 y:50"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Large 4">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:100 y:100"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Medium 4">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:75 y:75"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
<FlowItem>
|
||||
<Button Text="Small 4">
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:50 y:50"/>
|
||||
</Button>
|
||||
</FlowItem>
|
||||
</Flow>
|
||||
</Cell>
|
||||
</Table>
|
||||
</Window>
|
||||
</Instance>
|
||||
</Instance>
|
||||
|
||||
@@ -23,11 +23,21 @@ namespace demo
|
||||
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
|
||||
private:
|
||||
protected:
|
||||
vl::presentation::compositions::GuiFlowComposition* flowLayout;
|
||||
vl::presentation::controls::GuiSelectableButton::MutexGroupController* groupAlignment;
|
||||
vl::presentation::controls::GuiSelectableButton::MutexGroupController* groupAxis;
|
||||
vl::presentation::controls::GuiControl* groupBoxAlignment;
|
||||
vl::presentation::controls::GuiControl* groupBoxAxis;
|
||||
|
||||
void InitializeComponents()
|
||||
{
|
||||
if (InitializeFromResource())
|
||||
{
|
||||
GUI_INSTANCE_REFERENCE(flowLayout);
|
||||
GUI_INSTANCE_REFERENCE(groupAlignment);
|
||||
GUI_INSTANCE_REFERENCE(groupAxis);
|
||||
GUI_INSTANCE_REFERENCE(groupBoxAlignment);
|
||||
GUI_INSTANCE_REFERENCE(groupBoxAxis);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -37,6 +47,11 @@ namespace demo
|
||||
MainWindow_()
|
||||
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(L"demo::MainWindow")
|
||||
,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle())
|
||||
,flowLayout(0)
|
||||
,groupAlignment(0)
|
||||
,groupAxis(0)
|
||||
,groupBoxAlignment(0)
|
||||
,groupBoxAxis(0)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user