Update release

This commit is contained in:
vczh
2015-10-25 21:05:47 -07:00
parent 64638b30cf
commit ac82e798b6
10 changed files with 1593 additions and 720 deletions
+830 -428
View File
File diff suppressed because it is too large Load Diff
+309 -160
View File
File diff suppressed because it is too large Load Diff
+158 -64
View File
@@ -4552,10 +4552,6 @@ GuiListViewInstanceLoader
return Value();
}
void GetPropertyNames(const TypeInfo& typeInfo, collections::List<GlobalStringKey>& propertyNames)override
{
}
void GetConstructorParameters(const TypeInfo& typeInfo, collections::List<GlobalStringKey>& propertyNames)override
{
if (typeInfo.typeName == GetTypeName())
@@ -4602,11 +4598,6 @@ GuiListViewInstanceLoader
}
return IGuiInstanceLoader::GetPropertyType(propertyInfo);
}
bool SetPropertyValue(PropertyValue& propertyValue)override
{
return false;
}
};
/***********************************************************************
@@ -5156,6 +5147,70 @@ GuiBindableDataGridInstanceLoader
}
};
/***********************************************************************
GuiAxisInstanceLoader
***********************************************************************/
class GuiAxisInstanceLoader : public Object, public IGuiInstanceLoader
{
protected:
GlobalStringKey typeName;
GlobalStringKey _AxisDirection;
public:
GuiAxisInstanceLoader()
{
typeName = GlobalStringKey::Get(description::GetTypeDescriptor<GuiAxis>()->GetTypeName());
_AxisDirection = GlobalStringKey::Get(L"AxisDirection");
}
GlobalStringKey GetTypeName()override
{
return typeName;
}
bool IsCreatable(const TypeInfo& typeInfo)override
{
return typeName == typeInfo.typeName;
}
description::Value CreateInstance(Ptr<GuiInstanceEnvironment> env, const TypeInfo& typeInfo, collections::Group<GlobalStringKey, description::Value>& constructorArguments)override
{
if (typeInfo.typeName == GetTypeName())
{
vint indexAxisDirection = constructorArguments.Keys().IndexOf(_AxisDirection);
if (indexAxisDirection == -1)
{
return Value();
}
auto axisDirection = UnboxValue<AxisDirection>(constructorArguments.GetByIndex(indexAxisDirection)[0]);
auto axis = new GuiAxis(axisDirection);
return Value::From(axis);
}
return Value();
}
void GetConstructorParameters(const TypeInfo& typeInfo, collections::List<GlobalStringKey>& propertyNames)override
{
if (typeInfo.typeName == GetTypeName())
{
propertyNames.Add(_AxisDirection);
}
}
Ptr<GuiInstancePropertyInfo> GetPropertyType(const PropertyInfo& propertyInfo)override
{
if (propertyInfo.propertyName == _AxisDirection)
{
auto info = GuiInstancePropertyInfo::Assign(description::GetTypeDescriptor<AxisDirection>());
info->scope = GuiInstancePropertyInfo::Constructor;
return info;
}
return IGuiInstanceLoader::GetPropertyType(propertyInfo);
}
};
/***********************************************************************
GuiCompositionInstanceLoader
***********************************************************************/
@@ -5560,6 +5615,7 @@ GuiPredefinedInstanceLoadersPlugin
manager->SetLoader(new GuiBindableDataColumnInstanceLoader); // VisualizerTemplates, EditorTemplate
manager->SetLoader(new GuiBindableDataGridInstanceLoader); // ControlTemplate, ItemSource
manager->SetLoader(new GuiAxisInstanceLoader);
manager->SetLoader(new GuiCompositionInstanceLoader);
manager->SetLoader(new GuiTableCompositionInstanceLoader);
manager->SetLoader(new GuiCellCompositionInstanceLoader);
@@ -9344,6 +9400,17 @@ Type Declaration
ENUM_CLASS_ITEM(Bottom)
END_ENUM_ITEM(Alignment)
BEGIN_ENUM_ITEM(AxisDirection)
ENUM_CLASS_ITEM(LeftDown)
ENUM_CLASS_ITEM(RightDown)
ENUM_CLASS_ITEM(LeftUp)
ENUM_CLASS_ITEM(RightUp)
ENUM_CLASS_ITEM(DownLeft)
ENUM_CLASS_ITEM(DownRight)
ENUM_CLASS_ITEM(UpLeft)
ENUM_CLASS_ITEM(UpRight)
END_ENUM_ITEM(AxisDirection)
BEGIN_STRUCT_MEMBER(TextPos)
STRUCT_MEMBER(row)
STRUCT_MEMBER(column)
@@ -10261,6 +10328,46 @@ Type Declaration
#define INTERFACE_IDENTIFIER(INTERFACE)\
CLASS_MEMBER_STATIC_EXTERNALMETHOD(GetIdentifier, NO_PARAMETER, WString(*)(), []()->WString{return INTERFACE::Identifier;})
BEGIN_ENUM_ITEM(KeyDirection)
ENUM_CLASS_ITEM(Up)
ENUM_CLASS_ITEM(Down)
ENUM_CLASS_ITEM(Left)
ENUM_CLASS_ITEM(Right)
ENUM_CLASS_ITEM(Home)
ENUM_CLASS_ITEM(End)
ENUM_CLASS_ITEM(PageUp)
ENUM_CLASS_ITEM(PageDown)
ENUM_CLASS_ITEM(PageLeft)
ENUM_CLASS_ITEM(PageRight)
END_ENUM_ITEM(KeyDirection)
BEGIN_CLASS_MEMBER(IGuiAxis)
CLASS_MEMBER_BASE(IDescriptable)
INTERFACE_EXTERNALCTOR(compositions, IGuiAxis)
CLASS_MEMBER_METHOD(RealSizeToVirtualSize, {L"size"})
CLASS_MEMBER_METHOD(VirtualSizeToRealSize, {L"size"})
CLASS_MEMBER_METHOD(RealPointToVirtualPoint, {L"realFullSize" _ L"point"})
CLASS_MEMBER_METHOD(VirtualPointToRealPoint, {L"realFullSize" _ L"point"})
CLASS_MEMBER_METHOD(RealRectToVirtualRect, {L"realFullSize" _ L"rect"})
CLASS_MEMBER_METHOD(VirtualRectToRealRect, {L"realFullSize" _ L"rect"})
CLASS_MEMBER_METHOD(RealMarginToVirtualMargin, {L"margin"})
CLASS_MEMBER_METHOD(VirtualMarginToRealMargin, {L"margin"})
CLASS_MEMBER_METHOD(RealKeyDirectionToVirtualKeyDirection, {L"key"})
END_CLASS_MEMBER(IGuiAxis)
BEGIN_CLASS_MEMBER(GuiDefaultAxis)
CLASS_MEMBER_BASE(IGuiAxis)
CLASS_MEMBER_CONSTRUCTOR(Ptr<GuiDefaultAxis>(), NO_PARAMETER)
END_CLASS_MEMBER(GuiDefaultAxis)
BEGIN_CLASS_MEMBER(GuiAxis)
CLASS_MEMBER_BASE(IGuiAxis)
CLASS_MEMBER_CONSTRUCTOR(Ptr<GuiAxis>(AxisDirection), {L"axisDirection"})
CLASS_MEMBER_PROPERTY_READONLY_FAST(Alignment)
END_CLASS_MEMBER(GuiAxis)
BEGIN_CLASS_MEMBER(GuiStackComposition)
CLASS_MEMBER_BASE(GuiBoundsComposition)
CLASS_MEMBER_CONSTRUCTOR(GuiStackComposition*(), NO_PARAMETER)
@@ -10341,6 +10448,46 @@ Type Declaration
CLASS_MEMBER_METHOD(SetSite, {L"row" _ L"column" _ L"rowSpan" _ L"columnSpan"})
END_CLASS_MEMBER(GuiCellComposition)
BEGIN_ENUM_ITEM(FlowAlignment)
ENUM_CLASS_ITEM(Left)
ENUM_CLASS_ITEM(Center)
ENUM_CLASS_ITEM(Extend)
END_ENUM_ITEM(FlowAlignment)
BEGIN_CLASS_MEMBER(GuiFlowComposition)
CLASS_MEMBER_BASE(GuiBoundsComposition)
CLASS_MEMBER_CONSTRUCTOR(GuiFlowComposition*(), NO_PARAMETER)
CLASS_MEMBER_PROPERTY_READONLY_FAST(FlowItems)
CLASS_MEMBER_PROPERTY_FAST(ExtraMargin)
CLASS_MEMBER_PROPERTY_FAST(RowPadding)
CLASS_MEMBER_PROPERTY_FAST(ColumnPadding)
CLASS_MEMBER_PROPERTY_FAST(Axis)
CLASS_MEMBER_PROPERTY_FAST(Alignment)
END_CLASS_MEMBER(GuiFlowComposition)
BEGIN_STRUCT_MEMBER(GuiFlowOption)
STRUCT_MEMBER(baseline)
STRUCT_MEMBER(percentage)
STRUCT_MEMBER(distance)
END_STRUCT_MEMBER(GuiFlowOption)
BEGIN_ENUM_ITEM(GuiFlowOption::BaselineType)
ENUM_ITEM_NAMESPACE(GuiFlowOption)
ENUM_NAMESPACE_ITEM(Percentage)
ENUM_NAMESPACE_ITEM(FromTop)
ENUM_NAMESPACE_ITEM(FromBottom)
END_ENUM_ITEM(GuiFlowOption::BaselineType)
BEGIN_CLASS_MEMBER(GuiFlowItemComposition)
CLASS_MEMBER_BASE(GuiGraphicsSite)
CLASS_MEMBER_CONSTRUCTOR(GuiFlowItemComposition*(), NO_PARAMETER)
CLASS_MEMBER_PROPERTY_EVENT_FAST(Bounds, BoundsChanged)
CLASS_MEMBER_PROPERTY_FAST(ExtraMargin)
CLASS_MEMBER_PROPERTY_FAST(FlowOption)
END_CLASS_MEMBER(GuiFlowItemComposition)
BEGIN_CLASS_MEMBER(GuiSideAlignedComposition)
CLASS_MEMBER_BASE(GuiGraphicsSite)
CLASS_MEMBER_CONSTRUCTOR(GuiSideAlignedComposition*(), NO_PARAMETER)
@@ -10964,7 +11111,7 @@ Type Declaration
CLASS_MEMBER_PROPERTY_READONLY_FAST(ItemProvider)
CLASS_MEMBER_PROPERTY_GUIEVENT_FAST(StyleProvider)
CLASS_MEMBER_PROPERTY_GUIEVENT_FAST(Arranger)
CLASS_MEMBER_PROPERTY_GUIEVENT_FAST(CoordinateTransformer)
CLASS_MEMBER_PROPERTY_GUIEVENT_FAST(Axis)
CLASS_MEMBER_METHOD(EnsureItemVisible, {L"itemIndex"})
END_CLASS_MEMBER(GuiListControl)
@@ -11007,20 +11154,6 @@ Type Declaration
CLASS_MEMBER_METHOD(GetBindingValue, {L"itemIndex"})
END_CLASS_MEMBER(GuiListControl::IItemBindingView)
BEGIN_ENUM_ITEM(GuiListControl::KeyDirection)
ENUM_ITEM_NAMESPACE(GuiListControl)
ENUM_NAMESPACE_ITEM(Up)
ENUM_NAMESPACE_ITEM(Down)
ENUM_NAMESPACE_ITEM(Left)
ENUM_NAMESPACE_ITEM(Right)
ENUM_NAMESPACE_ITEM(Home)
ENUM_NAMESPACE_ITEM(End)
ENUM_NAMESPACE_ITEM(PageUp)
ENUM_NAMESPACE_ITEM(PageDown)
ENUM_NAMESPACE_ITEM(PageLeft)
ENUM_NAMESPACE_ITEM(PageRight)
END_ENUM_ITEM(GuiListControl::KeyDirection)
BEGIN_CLASS_MEMBER(GuiListControl::IItemProvider)
CLASS_MEMBER_BASE(IDescriptable)
INTERFACE_EXTERNALCTOR(GuiListControl, IItemProvider)
@@ -11074,21 +11207,6 @@ Type Declaration
CLASS_MEMBER_METHOD(EnsureItemVisible, {L"itemIndex"})
END_CLASS_MEMBER(GuiListControl::IItemArranger)
BEGIN_CLASS_MEMBER(GuiListControl::IItemCoordinateTransformer)
CLASS_MEMBER_BASE(IDescriptable)
INTERFACE_EXTERNALCTOR(GuiListControl, IItemCoordinateTransformer)
CLASS_MEMBER_METHOD(RealSizeToVirtualSize, {L"size"})
CLASS_MEMBER_METHOD(VirtualSizeToRealSize, {L"size"})
CLASS_MEMBER_METHOD(RealPointToVirtualPoint, {L"realFullSize" _ L"point"})
CLASS_MEMBER_METHOD(VirtualPointToRealPoint, {L"realFullSize" _ L"point"})
CLASS_MEMBER_METHOD(RealRectToVirtualRect, {L"realFullSize" _ L"rect"})
CLASS_MEMBER_METHOD(VirtualRectToRealRect, {L"realFullSize" _ L"rect"})
CLASS_MEMBER_METHOD(RealMarginToVirtualMargin, {L"margin"})
CLASS_MEMBER_METHOD(VirtualMarginToRealMargin, {L"margin"})
CLASS_MEMBER_METHOD(RealKeyDirectionToVirtualKeyDirection, {L"key"})
END_CLASS_MEMBER(GuiListControl::IItemCoordinateTransformer)
BEGIN_CLASS_MEMBER(GuiSelectableListControl)
CLASS_MEMBER_BASE(GuiListControl)
CLASS_MEMBER_CONSTRUCTOR(GuiSelectableListControl*(GuiSelectableListControl::IStyleProvider* _ GuiSelectableListControl::IItemProvider*), {L"styleProvider" _ L"itemProvider"})
@@ -11114,30 +11232,6 @@ Type Declaration
CLASS_MEMBER_METHOD(SetStyleSelected, {L"style" _ L"value"})
END_CLASS_MEMBER(GuiSelectableListControl::IItemStyleProvider)
BEGIN_CLASS_MEMBER(DefaultItemCoordinateTransformer)
CLASS_MEMBER_BASE(GuiListControl::IItemCoordinateTransformer)
CLASS_MEMBER_CONSTRUCTOR(Ptr<DefaultItemCoordinateTransformer>(), NO_PARAMETER)
END_CLASS_MEMBER(DefaultItemCoordinateTransformer)
BEGIN_CLASS_MEMBER(AxisAlignedItemCoordinateTransformer)
CLASS_MEMBER_BASE(GuiListControl::IItemCoordinateTransformer)
CLASS_MEMBER_CONSTRUCTOR(Ptr<AxisAlignedItemCoordinateTransformer>(AxisAlignedItemCoordinateTransformer::Alignment), {L"alignment"})
CLASS_MEMBER_PROPERTY_READONLY_FAST(Alignment)
END_CLASS_MEMBER(AxisAlignedItemCoordinateTransformer)
BEGIN_ENUM_ITEM(AxisAlignedItemCoordinateTransformer::Alignment)
ENUM_ITEM_NAMESPACE(AxisAlignedItemCoordinateTransformer)
ENUM_NAMESPACE_ITEM(LeftDown)
ENUM_NAMESPACE_ITEM(RightDown)
ENUM_NAMESPACE_ITEM(LeftUp)
ENUM_NAMESPACE_ITEM(RightUp)
ENUM_NAMESPACE_ITEM(DownLeft)
ENUM_NAMESPACE_ITEM(DownRight)
ENUM_NAMESPACE_ITEM(UpLeft)
ENUM_NAMESPACE_ITEM(UpRight)
END_ENUM_ITEM(AxisAlignedItemCoordinateTransformer::Alignment)
BEGIN_CLASS_MEMBER(RangedItemArrangerBase)
CLASS_MEMBER_BASE(GuiListControl::IItemArranger)
END_CLASS_MEMBER(RangedItemArrangerBase)
@@ -11314,7 +11408,7 @@ Type Declaration
CLASS_MEMBER_BASE(IDescriptable)
INTERFACE_EXTERNALCTOR(ListViewItemStyleProvider, IListViewItemContentProvider)
CLASS_MEMBER_METHOD(CreatePreferredCoordinateTransformer, NO_PARAMETER)
CLASS_MEMBER_METHOD(CreatePreferredAxis, NO_PARAMETER)
CLASS_MEMBER_METHOD(CreatePreferredArranger, NO_PARAMETER)
CLASS_MEMBER_METHOD(CreateItemContent, {L"font"})
CLASS_MEMBER_METHOD(AttachListControl, {L"value"})
+72 -67
View File
@@ -898,6 +898,7 @@ Type List
#define GUIREFLECTIONBASIC_TYPELIST(F)\
F(presentation::Color)\
F(presentation::Alignment)\
F(presentation::AxisDirection)\
F(presentation::TextPos)\
F(presentation::GridPos)\
F(presentation::Point)\
@@ -1210,6 +1211,10 @@ Type List
***********************************************************************/
#define GUIREFLECTIONCOMPOSITION_TYPELIST(F)\
F(presentation::compositions::KeyDirection)\
F(presentation::compositions::IGuiAxis)\
F(presentation::compositions::GuiDefaultAxis)\
F(presentation::compositions::GuiAxis)\
F(presentation::compositions::GuiStackComposition)\
F(presentation::compositions::GuiStackComposition::Direction)\
F(presentation::compositions::GuiStackItemComposition)\
@@ -1217,6 +1222,11 @@ Type List
F(presentation::compositions::GuiCellOption::ComposeType)\
F(presentation::compositions::GuiTableComposition)\
F(presentation::compositions::GuiCellComposition)\
F(presentation::compositions::FlowAlignment)\
F(presentation::compositions::GuiFlowComposition)\
F(presentation::compositions::GuiFlowOption)\
F(presentation::compositions::GuiFlowOption::BaselineType)\
F(presentation::compositions::GuiFlowItemComposition)\
F(presentation::compositions::GuiSideAlignedComposition)\
F(presentation::compositions::GuiSideAlignedComposition::Direction)\
F(presentation::compositions::GuiPartialViewComposition)\
@@ -1274,6 +1284,65 @@ Interface Proxy
INVOKE_INTERFACE_PROXY_NOPARAMS(Stop);
}
};
class compositions_IGuiAxis : public ValueInterfaceRoot, public virtual IGuiAxis
{
public:
compositions_IGuiAxis(Ptr<IValueInterfaceProxy> _proxy)
:ValueInterfaceRoot(_proxy)
{
}
static Ptr<IGuiAxis> Create(Ptr<IValueInterfaceProxy> proxy)
{
return new compositions_IGuiAxis(proxy);
}
Size RealSizeToVirtualSize(Size size)override
{
return INVOKEGET_INTERFACE_PROXY(RealSizeToVirtualSize, size);
}
Size VirtualSizeToRealSize(Size size)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualSizeToRealSize, size);
}
Point RealPointToVirtualPoint(Size realFullSize, Point point)override
{
return INVOKEGET_INTERFACE_PROXY(RealPointToVirtualPoint, realFullSize, point);
}
Point VirtualPointToRealPoint(Size realFullSize, Point point)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualPointToRealPoint, realFullSize, point);
}
Rect RealRectToVirtualRect(Size realFullSize, Rect rect)override
{
return INVOKEGET_INTERFACE_PROXY(RealRectToVirtualRect, realFullSize, rect);
}
Rect VirtualRectToRealRect(Size realFullSize, Rect rect)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualRectToRealRect, realFullSize, rect);
}
Margin RealMarginToVirtualMargin(Margin margin)override
{
return INVOKEGET_INTERFACE_PROXY(RealMarginToVirtualMargin, margin);
}
Margin VirtualMarginToRealMargin(Margin margin)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualMarginToRealMargin, margin);
}
KeyDirection RealKeyDirectionToVirtualKeyDirection(KeyDirection key)override
{
return INVOKEGET_INTERFACE_PROXY(RealKeyDirectionToVirtualKeyDirection, key);
}
};
}
#pragma warning(pop)
@@ -1358,17 +1427,12 @@ Type List
F(presentation::controls::GuiListControl::IItemArrangerCallback)\
F(presentation::controls::GuiListControl::IItemPrimaryTextView)\
F(presentation::controls::GuiListControl::IItemBindingView)\
F(presentation::controls::GuiListControl::KeyDirection)\
F(presentation::controls::GuiListControl::IItemProvider)\
F(presentation::controls::GuiListControl::IItemStyleController)\
F(presentation::controls::GuiListControl::IItemStyleProvider)\
F(presentation::controls::GuiListControl::IItemArranger)\
F(presentation::controls::GuiListControl::IItemCoordinateTransformer)\
F(presentation::controls::GuiSelectableListControl)\
F(presentation::controls::GuiSelectableListControl::IItemStyleProvider)\
F(presentation::controls::list::DefaultItemCoordinateTransformer)\
F(presentation::controls::list::AxisAlignedItemCoordinateTransformer)\
F(presentation::controls::list::AxisAlignedItemCoordinateTransformer::Alignment)\
F(presentation::controls::list::RangedItemArrangerBase)\
F(presentation::controls::list::FixedHeightItemArranger)\
F(presentation::controls::list::FixedSizeMultiColumnItemArranger)\
@@ -2070,7 +2134,7 @@ Interface Proxy
INVOKE_INTERFACE_PROXY(OnViewChanged, bounds);
}
vint FindItem(vint itemIndex, GuiListControl::KeyDirection key)override
vint FindItem(vint itemIndex, compositions::KeyDirection key)override
{
return INVOKEGET_INTERFACE_PROXY(FindItem, itemIndex, key);
}
@@ -2081,65 +2145,6 @@ Interface Proxy
}
};
class GuiListControl_IItemCoordinateTransformer : public ValueInterfaceRoot, public virtual GuiListControl::IItemCoordinateTransformer
{
public:
GuiListControl_IItemCoordinateTransformer(Ptr<IValueInterfaceProxy> _proxy)
:ValueInterfaceRoot(_proxy)
{
}
static Ptr<GuiListControl::IItemCoordinateTransformer> Create(Ptr<IValueInterfaceProxy> proxy)
{
return new GuiListControl_IItemCoordinateTransformer(proxy);
}
Size RealSizeToVirtualSize(Size size)override
{
return INVOKEGET_INTERFACE_PROXY(RealSizeToVirtualSize, size);
}
Size VirtualSizeToRealSize(Size size)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualSizeToRealSize, size);
}
Point RealPointToVirtualPoint(Size realFullSize, Point point)override
{
return INVOKEGET_INTERFACE_PROXY(RealPointToVirtualPoint, realFullSize, point);
}
Point VirtualPointToRealPoint(Size realFullSize, Point point)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualPointToRealPoint, realFullSize, point);
}
Rect RealRectToVirtualRect(Size realFullSize, Rect rect)override
{
return INVOKEGET_INTERFACE_PROXY(RealRectToVirtualRect, realFullSize, rect);
}
Rect VirtualRectToRealRect(Size realFullSize, Rect rect)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualRectToRealRect, realFullSize, rect);
}
Margin RealMarginToVirtualMargin(Margin margin)override
{
return INVOKEGET_INTERFACE_PROXY(RealMarginToVirtualMargin, margin);
}
Margin VirtualMarginToRealMargin(Margin margin)override
{
return INVOKEGET_INTERFACE_PROXY(VirtualMarginToRealMargin, margin);
}
GuiListControl::KeyDirection RealKeyDirectionToVirtualKeyDirection(GuiListControl::KeyDirection key)override
{
return INVOKEGET_INTERFACE_PROXY(RealKeyDirectionToVirtualKeyDirection, key);
}
};
class GuiSelectableListControl_IItemStyleProvider : public virtual GuiListControl_IItemStyleProvider, public virtual GuiSelectableListControl::IItemStyleProvider
{
public:
@@ -2358,9 +2363,9 @@ Interface Proxy
return new ListViewItemStyleProvider_IListViewItemContentProvider(proxy);
}
GuiListControl::IItemCoordinateTransformer* CreatePreferredCoordinateTransformer()override
compositions::IGuiAxis* CreatePreferredAxis()override
{
return INVOKEGET_INTERFACE_PROXY_NOPARAMS(CreatePreferredCoordinateTransformer);
return INVOKEGET_INTERFACE_PROXY_NOPARAMS(CreatePreferredAxis);
}
GuiListControl::IItemArranger* CreatePreferredArranger()override
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+209 -1
View File
@@ -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.