Update release

This commit is contained in:
Zihan Chen
2017-09-03 04:28:40 -07:00
parent 77cd6ed827
commit 03cbdfab44
29 changed files with 5730 additions and 5113 deletions
+222 -925
View File
File diff suppressed because it is too large Load Diff
+106 -404
View File
File diff suppressed because it is too large Load Diff
+81 -42
View File
@@ -31,7 +31,7 @@ namespace vl
GuiResourceError::SortAndLog(errors, output);
if (!File(errorPath).WriteAllLines(output, true, BomEncoder::Utf8))
{
return false;
return nullptr;
}
}
return precompiledFolder;
@@ -315,6 +315,7 @@ namespace vl
}
}
/***********************************************************************
.\GUIINSTANCEHELPERTYPES.CPP
***********************************************************************/
@@ -1561,6 +1562,13 @@ GuiDefaultInstanceLoader
collectionType = true;
return genericType->GetGenericArgument(0);
}
else if (genericType->GetTypeDescriptor() == description::GetTypeDescriptor<IValueObservableList>())
{
readableList = true;
writableList = true;
collectionType = true;
return genericType->GetGenericArgument(0);
}
else if (genericType->GetTypeDescriptor() == description::GetTypeDescriptor<IValueEnumerator>())
{
collectionType = true;
@@ -5496,44 +5504,40 @@ Workflow_GenerateInstanceClass
// ref.Parameter (Variable, Getter, CtorArgument)
///////////////////////////////////////////////////////////////
FOREACH(Ptr<GuiInstanceParameter>, param, context->parameters)
FOREACH(Ptr<GuiInstanceParameter>, parameter, context->parameters)
{
bool isReferenceType = true;
auto paramTd = GetTypeDescriptor(param->className.ToString());
if (paramTd)
WString classNameTail;
Ptr<ITypeInfo> parameterTypeInfo;
if (auto paramTd = GetTypeDescriptor(parameter->className.ToString()))
{
isReferenceType = (paramTd->GetTypeDescriptorFlags() & TypeDescriptorFlags::ReferenceType) != TypeDescriptorFlags::Undefined;
parameterTypeInfo = Workflow_GetSuggestedParameterType(paramTd);
switch (parameterTypeInfo->GetDecorator())
{
case ITypeInfo::RawPtr: classNameTail = L"*"; break;
case ITypeInfo::SharedPtr: classNameTail = L"^"; break;
default:;
}
}
if (auto type = Workflow_ParseType(precompileContext, { resolvingResult.resource }, param->className.ToString() + (isReferenceType ? L"^" : L""), param->classPosition, errors))
if (auto type = Workflow_ParseType(precompileContext, { resolvingResult.resource }, parameter->className.ToString() + classNameTail, parameter->classPosition, errors))
{
if (!beforePrecompile)
{
auto decl = MakePtr<WfVariableDeclaration>();
addDecl(decl);
decl->name.value = L"<parameter>" + param->name.ToString();
decl->name.value = L"<parameter>" + parameter->name.ToString();
decl->type = CopyType(type);
decl->expression = CreateDefaultValue(parameterTypeInfo.Obj());
if (isReferenceType)
{
auto nullExpr = MakePtr<WfLiteralExpression>();
nullExpr->value = WfLiteralValue::Null;
decl->expression = nullExpr;
}
else
{
decl->expression = CreateDefaultValue(MakePtr<TypeDescriptorTypeInfo>(paramTd, TypeInfoHint::Normal).Obj());
}
Workflow_RecordScriptPosition(precompileContext, param->tagPosition, (Ptr<WfDeclaration>)decl);
Workflow_RecordScriptPosition(precompileContext, parameter->tagPosition, (Ptr<WfDeclaration>)decl);
}
{
auto decl = MakePtr<WfFunctionDeclaration>();
addDecl(decl);
decl->anonymity = WfFunctionAnonymity::Named;
decl->name.value = L"Get" + param->name.ToString();
decl->name.value = L"Get" + parameter->name.ToString();
decl->returnType = CopyType(type);
if (!beforePrecompile)
{
@@ -5541,7 +5545,7 @@ Workflow_GenerateInstanceClass
decl->statement = block;
auto ref = MakePtr<WfReferenceExpression>();
ref->name.value = L"<parameter>" + param->name.ToString();
ref->name.value = L"<parameter>" + parameter->name.ToString();
auto returnStat = MakePtr<WfReturnStatement>();
returnStat->expression = ref;
@@ -5552,31 +5556,31 @@ Workflow_GenerateInstanceClass
decl->statement = notImplemented();
}
Workflow_RecordScriptPosition(precompileContext, param->tagPosition, (Ptr<WfDeclaration>)decl);
Workflow_RecordScriptPosition(precompileContext, parameter->tagPosition, (Ptr<WfDeclaration>)decl);
}
{
auto decl = MakePtr<WfPropertyDeclaration>();
addDecl(decl);
decl->name.value = param->name.ToString();
decl->name.value = parameter->name.ToString();
decl->type = type;
decl->getter.value = L"Get" + param->name.ToString();
decl->getter.value = L"Get" + parameter->name.ToString();
Workflow_RecordScriptPosition(precompileContext, param->tagPosition, (Ptr<WfDeclaration>)decl);
Workflow_RecordScriptPosition(precompileContext, parameter->tagPosition, (Ptr<WfDeclaration>)decl);
}
{
auto argument = MakePtr<WfFunctionArgument>();
argument->name.value = L"<ctor-parameter>" + param->name.ToString();
argument->name.value = L"<ctor-parameter>" + parameter->name.ToString();
argument->type = CopyType(type);
ctor->arguments.Add(argument);
}
if (!beforePrecompile)
{
auto refLeft = MakePtr<WfReferenceExpression>();
refLeft->name.value = L"<parameter>" + param->name.ToString();
refLeft->name.value = L"<parameter>" + parameter->name.ToString();
auto refRight = MakePtr<WfReferenceExpression>();
refRight->name.value = L"<ctor-parameter>" + param->name.ToString();
refRight->name.value = L"<ctor-parameter>" + parameter->name.ToString();
auto assignExpr = MakePtr<WfBinaryExpression>();
assignExpr->op = WfBinaryOperator::Assign;
@@ -5588,7 +5592,7 @@ Workflow_GenerateInstanceClass
ctorBlock->statements.Add(exprStat);
Workflow_RecordScriptPosition(precompileContext, param->tagPosition, (Ptr<WfStatement>)exprStat);
Workflow_RecordScriptPosition(precompileContext, parameter->tagPosition, (Ptr<WfStatement>)exprStat);
}
}
}
@@ -6507,6 +6511,46 @@ WorkflowReferenceNamesVisitor
}
};
Ptr<reflection::description::ITypeInfo> Workflow_GetSuggestedParameterType(reflection::description::ITypeDescriptor* typeDescriptor)
{
auto elementType = MakePtr<TypeDescriptorTypeInfo>(typeDescriptor, TypeInfoHint::Normal);
if ((typeDescriptor->GetTypeDescriptorFlags() & TypeDescriptorFlags::ReferenceType) != TypeDescriptorFlags::Undefined)
{
bool isShared = false;
bool isRaw = false;
if (auto ctorGroup = typeDescriptor->GetConstructorGroup())
{
vint count = ctorGroup->GetMethodCount();
for (vint i = 0; i < count; i++)
{
auto returnType = ctorGroup->GetMethod(i)->GetReturn();
switch (returnType->GetDecorator())
{
case ITypeInfo::RawPtr: isRaw = true; break;
case ITypeInfo::SharedPtr: isShared = true; break;
default:;
}
}
}
if (!isShared && !isRaw)
{
return MakePtr<SharedPtrTypeInfo>(elementType);
}
else if (isShared)
{
return MakePtr<SharedPtrTypeInfo>(elementType);
}
else
{
return MakePtr<RawPtrTypeInfo>(elementType);
}
}
else
{
return elementType;
}
}
IGuiInstanceLoader::TypeInfo Workflow_CollectReferences(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, GuiResourceError::List& errors)
{
FOREACH(Ptr<GuiInstanceParameter>, parameter, resolvingResult.context->parameters)
@@ -6528,18 +6572,7 @@ WorkflowReferenceNamesVisitor
}
else
{
Ptr<ITypeInfo> referenceType;
{
auto elementType = MakePtr<TypeDescriptorTypeInfo>(type, TypeInfoHint::Normal);
if ((type->GetTypeDescriptorFlags() & TypeDescriptorFlags::ReferenceType) != TypeDescriptorFlags::Undefined)
{
referenceType = MakePtr<SharedPtrTypeInfo>(elementType);
}
else
{
referenceType = elementType;
}
}
auto referenceType = Workflow_GetSuggestedParameterType(type);
resolvingResult.typeInfos.Add(parameter->name, { GlobalStringKey::Get(type->GetTypeName()),referenceType });
}
}
@@ -8858,6 +8891,9 @@ GuiDocumentInstanceLoaderBase
template<typename TBaseType>
class GuiDocumentInstanceLoaderBase : public TBaseType
{
private:
using TypeInfo = typename TBaseType::TypeInfo;
public:
using PropertyInfo = IGuiInstanceLoader::PropertyInfo;
using ArgumentMap = IGuiInstanceLoader::ArgumentMap;
@@ -9940,6 +9976,9 @@ GuiToolstripInstanceLoaderBase
template<typename TBaseType>
class GuiToolstripInstanceLoaderBase : public TBaseType
{
private:
using TypeInfo = typename TBaseType::TypeInfo;
public:
using ArgumentMap = IGuiInstanceLoader::ArgumentMap;
using PropertyInfo = IGuiInstanceLoader::PropertyInfo;
+2 -1
View File
@@ -619,7 +619,7 @@ namespace vl
}
}
#endif#pragma once
#endif
/***********************************************************************
@@ -953,6 +953,7 @@ WorkflowCompiler (Compile)
};
extern bool Workflow_GetPropertyTypes(WString& errorPrefix, types::ResolvingResult& resolvingResult, IGuiInstanceLoader* loader, IGuiInstanceLoader::TypeInfo resolvedTypeInfo, GlobalStringKey prop, Ptr<GuiAttSetterRepr::SetterValue> setter, collections::List<types::PropertyResolving>& possibleInfos, GuiResourceError::List& errors);
extern Ptr<reflection::description::ITypeInfo> Workflow_GetSuggestedParameterType(reflection::description::ITypeDescriptor* typeDescriptor);
extern IGuiInstanceLoader::TypeInfo Workflow_CollectReferences(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, GuiResourceError::List& errors);
extern void Workflow_GenerateCreating(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, Ptr<workflow::WfBlockStatement> statements, GuiResourceError::List& errors);
extern void Workflow_GenerateBindings(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, Ptr<workflow::WfBlockStatement> statements, GuiResourceError::List& errors);
+23 -6
View File
@@ -1136,6 +1136,25 @@ Type Declaration
CLASS_MEMBER_CONSTRUCTOR(GuiSharedSizeRootComposition*(), NO_PARAMETER)
END_CLASS_MEMBER(GuiSubComponentMeasurerSource)
BEGIN_CLASS_MEMBER(GuiRepeatCompositionBase)
CLASS_MEMBER_GUIEVENT(ItemInserted)
CLASS_MEMBER_GUIEVENT(ItemRemoved)
CLASS_MEMBER_PROPERTY_FAST(ItemTemplate)
CLASS_MEMBER_PROPERTY_FAST(ItemSource)
END_CLASS_MEMBER(GuiRepeatCompositionBase)
BEGIN_CLASS_MEMBER(GuiRepeatStackComposition)
CLASS_MEMBER_BASE(GuiStackComposition)
CLASS_MEMBER_BASE(GuiRepeatCompositionBase)
CLASS_MEMBER_CONSTRUCTOR(GuiRepeatStackComposition*(), NO_PARAMETER)
END_CLASS_MEMBER(GuiRepeatStackComposition)
BEGIN_CLASS_MEMBER(GuiRepeatFlowComposition)
CLASS_MEMBER_BASE(GuiFlowComposition)
CLASS_MEMBER_BASE(GuiRepeatCompositionBase)
CLASS_MEMBER_CONSTRUCTOR(GuiRepeatFlowComposition*(), NO_PARAMETER)
END_CLASS_MEMBER(GuiRepeatFlowComposition)
BEGIN_INTERFACE_MEMBER(IGuiGraphicsAnimation)
CLASS_MEMBER_PROPERTY_READONLY_FAST(TotalLength)
CLASS_MEMBER_PROPERTY_READONLY_FAST(CurrentPosition)
@@ -1601,6 +1620,8 @@ Type Declaration
CLASS_MEMBER_BASE(GuiCustomControl)
CONTROL_CONSTRUCTOR_CONTROLLER(GuiTabPage)
CONTROL_CONSTRUCTOR_DEFAULT(GuiTabPage, vl::presentation::theme::g::NewTabPage)
CLASS_MEMBER_PROPERTY_READONLY_FAST(OwnerTab)
END_CLASS_MEMBER(GuiTabPage)
BEGIN_CLASS_MEMBER(GuiTab)
@@ -1617,12 +1638,8 @@ Type Declaration
CLASS_MEMBER_BASE(GuiControl::IStyleController)
CLASS_MEMBER_METHOD(SetCommandExecutor, {L"value"})
CLASS_MEMBER_METHOD(InsertTab, {L"index"})
CLASS_MEMBER_METHOD(SetTabText, {L"index" _ L"value"})
CLASS_MEMBER_METHOD(RemoveTab, {L"index"})
CLASS_MEMBER_METHOD(SetSelectedTab, {L"index"})
CLASS_MEMBER_METHOD(SetTabAlt, {L"index" _ L"value"})
CLASS_MEMBER_METHOD(GetTabAltAction, {L"index"})
CLASS_MEMBER_METHOD(SetTabPages, { L"value" })
CLASS_MEMBER_METHOD(SetSelectedTabPage, { L"value" })
END_INTERFACE_MEMBER(GuiTab::IStyleController)
BEGIN_CLASS_MEMBER(GuiScrollView)
+3
View File
@@ -222,6 +222,9 @@ Type List (Compositions)
F(presentation::compositions::GuiPartialViewComposition)\
F(presentation::compositions::GuiSharedSizeItemComposition)\
F(presentation::compositions::GuiSharedSizeRootComposition)\
F(presentation::compositions::GuiRepeatCompositionBase)\
F(presentation::compositions::GuiRepeatStackComposition)\
F(presentation::compositions::GuiRepeatFlowComposition)\
F(presentation::compositions::IGuiGraphicsAnimation)\
F(presentation::compositions::GuiGraphicsAnimationManager)\
F(presentation::compositions::IGuiShortcutKeyItem)\
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+21 -13
View File
@@ -100,8 +100,8 @@ namespace vl
IMPL_CPP_TYPE_INFO(darkskin::ShortcutKeyTemplateConstructor)
IMPL_CPP_TYPE_INFO(darkskin::SinglelineTextBoxTemplate)
IMPL_CPP_TYPE_INFO(darkskin::SinglelineTextBoxTemplateConstructor)
IMPL_CPP_TYPE_INFO(darkskin::TabDropdownTemplate)
IMPL_CPP_TYPE_INFO(darkskin::TabDropdownTemplateConstructor)
IMPL_CPP_TYPE_INFO(darkskin::TabHeaderButtonTemplate)
IMPL_CPP_TYPE_INFO(darkskin::TabHeaderButtonTemplateConstructor)
IMPL_CPP_TYPE_INFO(darkskin::TabHeaderTemplate)
IMPL_CPP_TYPE_INFO(darkskin::TabHeaderTemplateConstructor)
IMPL_CPP_TYPE_INFO(darkskin::TabTemplate)
@@ -596,22 +596,29 @@ namespace vl
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::darkskin::SinglelineTextBoxTemplateConstructor)
BEGIN_CLASS_MEMBER(::darkskin::TabDropdownTemplate)
CLASS_MEMBER_CONSTRUCTOR(::darkskin::TabDropdownTemplate*(), NO_PARAMETER)
END_CLASS_MEMBER(::darkskin::TabDropdownTemplate)
BEGIN_CLASS_MEMBER(::darkskin::TabHeaderButtonTemplate)
CLASS_MEMBER_CONSTRUCTOR(::darkskin::TabHeaderButtonTemplate*(), NO_PARAMETER)
END_CLASS_MEMBER(::darkskin::TabHeaderButtonTemplate)
BEGIN_CLASS_MEMBER(::darkskin::TabDropdownTemplateConstructor)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::darkskin::TabDropdownTemplateConstructor>(), NO_PARAMETER)
BEGIN_CLASS_MEMBER(::darkskin::TabHeaderButtonTemplateConstructor)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::darkskin::TabHeaderButtonTemplateConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::darkskin::TabDropdownTemplateConstructor)
END_CLASS_MEMBER(::darkskin::TabHeaderButtonTemplateConstructor)
BEGIN_CLASS_MEMBER(::darkskin::TabHeaderTemplate)
CLASS_MEMBER_CONSTRUCTOR(::darkskin::TabHeaderTemplate*(), NO_PARAMETER)
CLASS_MEMBER_CONSTRUCTOR(::darkskin::TabHeaderTemplate*(::vl::presentation::controls::GuiTabPage*), { L"__vwsn_ctor_parameter_CurrentTabPage" })
CLASS_MEMBER_METHOD(GetCommands, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetCurrentTabPage, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetCommands, { L"__vwsn_value_" })
CLASS_MEMBER_EVENT(CommandsChanged)
CLASS_MEMBER_FIELD(__vwsn_parameter_CurrentTabPage)
CLASS_MEMBER_FIELD(__vwsn_prop_Commands)
CLASS_MEMBER_PROPERTY_EVENT(Commands, GetCommands, SetCommands, CommandsChanged)
CLASS_MEMBER_PROPERTY_READONLY(CurrentTabPage, GetCurrentTabPage)
END_CLASS_MEMBER(::darkskin::TabHeaderTemplate)
BEGIN_CLASS_MEMBER(::darkskin::TabHeaderTemplateConstructor)
@@ -619,12 +626,13 @@ namespace vl
CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(CurrentTabPage)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::darkskin::TabHeaderTemplateConstructor)
BEGIN_CLASS_MEMBER(::darkskin::TabTemplate)
CLASS_MEMBER_CONSTRUCTOR(::darkskin::TabTemplate*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(UpdateTabHeader, NO_PARAMETER)
END_CLASS_MEMBER(::darkskin::TabTemplate)
BEGIN_CLASS_MEMBER(::darkskin::TabTemplateConstructor)
@@ -974,8 +982,8 @@ namespace vl
ADD_TYPE_INFO(::darkskin::ShortcutKeyTemplateConstructor)
ADD_TYPE_INFO(::darkskin::SinglelineTextBoxTemplate)
ADD_TYPE_INFO(::darkskin::SinglelineTextBoxTemplateConstructor)
ADD_TYPE_INFO(::darkskin::TabDropdownTemplate)
ADD_TYPE_INFO(::darkskin::TabDropdownTemplateConstructor)
ADD_TYPE_INFO(::darkskin::TabHeaderButtonTemplate)
ADD_TYPE_INFO(::darkskin::TabHeaderButtonTemplateConstructor)
ADD_TYPE_INFO(::darkskin::TabHeaderTemplate)
ADD_TYPE_INFO(::darkskin::TabHeaderTemplateConstructor)
ADD_TYPE_INFO(::darkskin::TabTemplate)
+2 -2
View File
@@ -108,8 +108,8 @@ namespace vl
DECL_TYPE_INFO(::darkskin::ShortcutKeyTemplateConstructor)
DECL_TYPE_INFO(::darkskin::SinglelineTextBoxTemplate)
DECL_TYPE_INFO(::darkskin::SinglelineTextBoxTemplateConstructor)
DECL_TYPE_INFO(::darkskin::TabDropdownTemplate)
DECL_TYPE_INFO(::darkskin::TabDropdownTemplateConstructor)
DECL_TYPE_INFO(::darkskin::TabHeaderButtonTemplate)
DECL_TYPE_INFO(::darkskin::TabHeaderButtonTemplateConstructor)
DECL_TYPE_INFO(::darkskin::TabHeaderTemplate)
DECL_TYPE_INFO(::darkskin::TabHeaderTemplateConstructor)
DECL_TYPE_INFO(::darkskin::TabTemplate)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -167,7 +167,7 @@
</Cell>
<Cell Site="row:2 column:0">
<DocumentViewer ref.Name="document" EditMode="Editable">
<DocumentViewer ref.Name="document" EditMode="Editable" Alt="D">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.ActiveHyperlinkExecuted-eval>
<![CDATA[
@@ -0,0 +1,12 @@
<Folder>
<Instance name="RepeatItemTemplateResource">
<Instance ref.CodeBehind="false" ref.Class="demo::RepeatItemTemplate">
<ref.Parameter Name="ViewModel" Class="demo::MyTextItem"/>
<ControlTemplate MinSizeLimitation="LimitToElementAndChildren">
<Button Text-bind="ViewModel.Name">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</Button>
</ControlTemplate>
</Instance>
</Instance>
</Folder>
@@ -0,0 +1,180 @@
<Instance ref.CodeBehind="false" ref.Class="demo::RepeatTabPage">
<ref.Members>
<![CDATA[
var counter : int = 0;
var itemsToBind : observe MyTextItem^[] = {};
func ToText_1to9(i : int) : string
{
switch (i)
{
case 1: { return "one"; }
case 2: { return "two"; }
case 3: { return "three"; }
case 4: { return "four"; }
case 5: { return "five"; }
case 6: { return "six"; }
case 7: { return "seven"; }
case 8: { return "eight"; }
case 9: { return "nine"; }
}
raise "ToText_1to9: Number out of range.";
}
func ToText_11to19(i : int) : string
{
switch (i)
{
case 1: { return "eleven"; }
case 2: { return "twelve"; }
case 3: { return "thirteen"; }
case 4: { return "fourteen"; }
case 5: { return "fifteen"; }
case 6: { return "sixteen"; }
case 7: { return "seventeen"; }
case 8: { return "eightteen"; }
case 9: { return "nineteen"; }
}
raise "ToText_11to19: Number out of range.";
}
func NumberToText_1To99(i : int) : string
{
switch (i / 10)
{
case 0: { return ToText_1to9(i % 10); }
case 1: { return i == 10 ? "ten" : ToText_11to19(i % 10); }
case 2: { return i % 10 == 0 ? "twenty" : "twenty-" & ToText_1to9(i % 10); }
case 3: { return i % 10 == 0 ? "thirty" : "thirty-" & ToText_1to9(i % 10); }
case 4: { return i % 10 == 0 ? "fourty" : "fourty-" & ToText_1to9(i % 10); }
case 5: { return i % 10 == 0 ? "fifty" : "fifty-" & ToText_1to9(i % 10); }
case 6: { return i % 10 == 0 ? "sixty" : "sixty-" & ToText_1to9(i % 10); }
case 7: { return i % 10 == 0 ? "seventy" : "seventy-" & ToText_1to9(i % 10); }
case 8: { return i % 10 == 0 ? "eighty" : "eighty-" & ToText_1to9(i % 10); }
case 9: { return i % 10 == 0 ? "ninety" : "ninety-" & ToText_1to9(i % 10); }
}
raise "NumberToText_1To99: Number out of range.";
}
func NumberToText_0to999(i : int) : string
{
if (i < 100) { return NumberToText_1To99(i); }
return ToText_1to9(i / 100) & " hundred" & (i % 100 == 0 ? "" : " and " & NumberToText_1To99(i % 100));
}
func NumberToText(i : int) : string
{
if (i == 0) { return "zero"; }
if (i < 1000) { return NumberToText_0to999(i); }
return "Number too large: " & i;
}
]]>
</ref.Members>
<TabPage ref.Name="self" Text="Repeat">
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" CellPadding="5">
<att.Rows>
<_>composeType:Percentage percentage:1.0</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:0.5</_>
<_>composeType:MinSize</_>
</att.Columns>
<Cell Site="row:0 column:0">
<Tab>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.Pages>
<TabPage Text="RepeatStack" Alt="S">
<RepeatStack ref.Name="repeatStack" AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Direction>Vertical</att.Direction>
<att.Padding>5</att.Padding>
<att.ExtraMargin>left:5 top:5 right:5 bottom:5</att.ExtraMargin>
<att.ItemTemplate>demo::RepeatItemTemplate</att.ItemTemplate>
<att.ItemSource-eval>self.itemsToBind</att.ItemSource-eval>
</RepeatStack>
</TabPage>
<TabPage Text="RepeatFlow" Alt="F">
<RepeatFlow ref.Name="repeatFlow" AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.RowPadding>5</att.RowPadding>
<att.ColumnPadding>5</att.ColumnPadding>
<att.ExtraMargin>left:5 top:5 right:5 bottom:5</att.ExtraMargin>
<att.ItemTemplate>demo::RepeatItemTemplate</att.ItemTemplate>
<att.ItemSource-eval>self.itemsToBind</att.ItemSource-eval>
</RepeatFlow>
</TabPage>
</att.Pages>
</Tab>
</Cell>
<Cell Site="row:0 column:1">
<Stack Direction="Vertical" Padding="5" AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
<StackItem>
<Button Alt="A" Text="Add 10 items">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.Clicked-eval>
<![CDATA[
{
for (i in range [0, 9])
{
var textItem = new demo::MyTextItem^();
textItem.Name = self.NumberToText(self.counter + i);
self.itemsToBind.Add(textItem);
}
self.counter = self.counter + 10;
}
]]>
</ev.Clicked-eval>
</Button>
</StackItem>
<StackItem>
<Button Alt="O" Text="Remove odd items">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.Clicked-eval>
<![CDATA[
{
var i = 0;
while (i < self.itemsToBind.Count)
{
self.itemsToBind.RemoveAt(i);
i = i + 1;
}
}
]]>
</ev.Clicked-eval>
</Button>
</StackItem>
<StackItem>
<Button Alt="E" Text="Remove even items">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.Clicked-eval>
<![CDATA[
{
var i = 1;
while (i < self.itemsToBind.Count)
{
self.itemsToBind.RemoveAt(i);
i = i + 1;
}
}
]]>
</ev.Clicked-eval>
</Button>
</StackItem>
<StackItem>
<Button Alt="C" Text="Clear">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.Clicked-eval>
<![CDATA[
{
self.itemsToBind.Clear();
}
]]>
</ev.Clicked-eval>
</Button>
</StackItem>
</Stack>
</Cell>
</Table>
</TabPage>
</Instance>
@@ -20,11 +20,12 @@
<att.Pages>
<demo:TextListTabPage Alt="T"/>
<demo:ListViewTabPage Alt="L"/>
<demo:TreeViewTabPage Alt="R"/>
<demo:TreeViewTabPage Alt="T"/>
<demo:DataGridTabPage Alt="D"/>
</att.Pages>
</Tab>
</TabPage>
<demo:RepeatTabPage Alt="R"/>
<demo:DocumentTabPage Alt="D"/>
<demo:TextBoxTabPage Alt="D"/>
</att.Pages>
@@ -36,10 +37,12 @@
<Instance name="TextListTabPageResource" content="File">TextListTabPage.xml</Instance>
<Instance name="ListViewTabPageResource" content="File">ListViewTabPage.xml</Instance>
<Instance name="TreeViewTabPageResource" content="File">TreeViewTabPage.xml</Instance>
<Instance name="RepeatTabPageResource" content="File">RepeatTabPage.xml</Instance>
<Instance name="DataGridTabPageResource" content="File">DataGridTabPage.xml</Instance>
<Instance name="DocumentTabPageResource" content="File">DocumentTabPage.xml</Instance>
<Folder name="TextBoxComponents" content="Link">TextBoxTabPage.xml</Folder>
<Folder name="DataGridComponents" content="Link">DataGridComponents.xml</Folder>
<Folder name="RepeatComponents" content="Link">RepeatComponents.xml</Folder>
<Folder name="DocumentComponents" content="Link">DocumentComponents.xml</Folder>
<Folder name="LargeImages" content="Link">Images/LargeImages.xml</Folder>
<Folder name="SmallImages" content="Link">Images/SmallImages.xml</Folder>
@@ -65,6 +65,10 @@ namespace vl
IMPL_CPP_TYPE_INFO(demo::MyDataItem)
IMPL_CPP_TYPE_INFO(demo::MyGender)
IMPL_CPP_TYPE_INFO(demo::MyTextItem)
IMPL_CPP_TYPE_INFO(demo::RepeatItemTemplate)
IMPL_CPP_TYPE_INFO(demo::RepeatItemTemplateConstructor)
IMPL_CPP_TYPE_INFO(demo::RepeatTabPage)
IMPL_CPP_TYPE_INFO(demo::RepeatTabPageConstructor)
IMPL_CPP_TYPE_INFO(demo::TextBoxTabPage)
IMPL_CPP_TYPE_INFO(demo::TextBoxTabPageConstructor)
IMPL_CPP_TYPE_INFO(demo::TextEditor)
@@ -472,6 +476,7 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_10)
CLASS_MEMBER_FIELD(__vwsn_precompile_11)
CLASS_MEMBER_FIELD(__vwsn_precompile_12)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
@@ -541,6 +546,61 @@ namespace vl
CLASS_MEMBER_PROPERTY(Name, GetName, SetName)
END_CLASS_MEMBER(::demo::MyTextItem)
BEGIN_CLASS_MEMBER(::demo::RepeatItemTemplate)
CLASS_MEMBER_CONSTRUCTOR(::demo::RepeatItemTemplate*(::vl::Ptr<::demo::MyTextItem>), { L"__vwsn_ctor_parameter_ViewModel" })
CLASS_MEMBER_METHOD(GetViewModel, NO_PARAMETER)
CLASS_MEMBER_FIELD(__vwsn_parameter_ViewModel)
CLASS_MEMBER_PROPERTY_READONLY(ViewModel, GetViewModel)
END_CLASS_MEMBER(::demo::RepeatItemTemplate)
BEGIN_CLASS_MEMBER(::demo::RepeatItemTemplateConstructor)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::RepeatItemTemplateConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(ViewModel)
END_CLASS_MEMBER(::demo::RepeatItemTemplateConstructor)
BEGIN_CLASS_MEMBER(::demo::RepeatTabPage)
CLASS_MEMBER_CONSTRUCTOR(::demo::RepeatTabPage*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(NumberToText, { L"i" })
CLASS_MEMBER_METHOD(NumberToText_0to999, { L"i" })
CLASS_MEMBER_METHOD(NumberToText_1To99, { L"i" })
CLASS_MEMBER_METHOD(ToText_11to19, { L"i" })
CLASS_MEMBER_METHOD(ToText_1to9, { L"i" })
CLASS_MEMBER_FIELD(counter)
CLASS_MEMBER_FIELD(itemsToBind)
END_CLASS_MEMBER(::demo::RepeatTabPage)
BEGIN_CLASS_MEMBER(::demo::RepeatTabPageConstructor)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::RepeatTabPageConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_10)
CLASS_MEMBER_FIELD(__vwsn_precompile_11)
CLASS_MEMBER_FIELD(__vwsn_precompile_12)
CLASS_MEMBER_FIELD(__vwsn_precompile_13)
CLASS_MEMBER_FIELD(__vwsn_precompile_14)
CLASS_MEMBER_FIELD(__vwsn_precompile_15)
CLASS_MEMBER_FIELD(__vwsn_precompile_16)
CLASS_MEMBER_FIELD(__vwsn_precompile_17)
CLASS_MEMBER_FIELD(__vwsn_precompile_18)
CLASS_MEMBER_FIELD(__vwsn_precompile_19)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
CLASS_MEMBER_FIELD(__vwsn_precompile_5)
CLASS_MEMBER_FIELD(__vwsn_precompile_6)
CLASS_MEMBER_FIELD(__vwsn_precompile_7)
CLASS_MEMBER_FIELD(__vwsn_precompile_8)
CLASS_MEMBER_FIELD(__vwsn_precompile_9)
CLASS_MEMBER_FIELD(repeatFlow)
CLASS_MEMBER_FIELD(repeatStack)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::demo::RepeatTabPageConstructor)
BEGIN_CLASS_MEMBER(::demo::TextBoxTabPage)
CLASS_MEMBER_CONSTRUCTOR(::demo::TextBoxTabPage*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(UpdateFont, { L"newFont" })
@@ -738,6 +798,10 @@ namespace vl
ADD_TYPE_INFO(::demo::MyDataItem)
ADD_TYPE_INFO(::demo::MyGender)
ADD_TYPE_INFO(::demo::MyTextItem)
ADD_TYPE_INFO(::demo::RepeatItemTemplate)
ADD_TYPE_INFO(::demo::RepeatItemTemplateConstructor)
ADD_TYPE_INFO(::demo::RepeatTabPage)
ADD_TYPE_INFO(::demo::RepeatTabPageConstructor)
ADD_TYPE_INFO(::demo::TextBoxTabPage)
ADD_TYPE_INFO(::demo::TextBoxTabPageConstructor)
ADD_TYPE_INFO(::demo::TextEditor)
@@ -68,6 +68,10 @@ namespace vl
DECL_TYPE_INFO(::demo::MyDataItem)
DECL_TYPE_INFO(::demo::MyGender)
DECL_TYPE_INFO(::demo::MyTextItem)
DECL_TYPE_INFO(::demo::RepeatItemTemplate)
DECL_TYPE_INFO(::demo::RepeatItemTemplateConstructor)
DECL_TYPE_INFO(::demo::RepeatTabPage)
DECL_TYPE_INFO(::demo::RepeatTabPageConstructor)
DECL_TYPE_INFO(::demo::TextBoxTabPage)
DECL_TYPE_INFO(::demo::TextBoxTabPageConstructor)
DECL_TYPE_INFO(::demo::TextEditor)
@@ -125,7 +125,7 @@ So as I pray, unlimited blade works.]]>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.Pages>
<TabPage Text="TextBox">
<TabPage Text="TextBox" Alt="T">
<Table CellPadding="5" AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Rows>
<CellOption>composeType:MinSize</CellOption>
@@ -136,20 +136,20 @@ So as I pray, unlimited blade works.]]>
</att.Columns>
<Cell Site="row:0 column:0">
<SinglelineTextBox ref.Name="textBoxS" Text="Archer">
<SinglelineTextBox ref.Name="textBoxS" Text="Archer" Alt="S">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</SinglelineTextBox>
</Cell>
<Cell Site="row:1 column:0">
<MultilineTextBox ref.Name="textBoxM" Text-uri="res://TextBoxComponents/Text">
<MultilineTextBox ref.Name="textBoxM" Text-uri="res://TextBoxComponents/Text" Alt="M">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</MultilineTextBox>
</Cell>
</Table>
</TabPage>
<TabPage Text="Document">
<TabPage Text="Document" Alt="D">
<Table CellPadding="5" AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Rows>
<CellOption>composeType:MinSize</CellOption>
@@ -161,18 +161,18 @@ So as I pray, unlimited blade works.]]>
</att.Columns>
<Cell Site="row:0 column:0 columnSpan:2">
<DocumentTextBox ref.Name="documentTextBox" EditMode="Editable" Text="Archer">
<DocumentTextBox ref.Name="documentTextBox" EditMode="Editable" Text="Archer" Alt="T">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</DocumentTextBox>
</Cell>
<Cell Site="row:1 column:0">
<DocumentViewer ref.Name="documentViewer" EditMode="Editable" Document-uri="res://TextBoxComponents/DocFixed">
<DocumentViewer ref.Name="documentViewer" EditMode="Editable" Document-uri="res://TextBoxComponents/DocFixed" Alt="V">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</DocumentViewer>
</Cell>
<Cell Site="row:1 column:1">
<DocumentLabel ref.Name="documentLabel" EditMode="Editable" Document-uri="res://TextBoxComponents/DocRelative">
<DocumentLabel ref.Name="documentLabel" EditMode="Editable" Document-uri="res://TextBoxComponents/DocRelative" Alt="L">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</DocumentLabel>
</Cell>
@@ -183,10 +183,10 @@ So as I pray, unlimited blade works.]]>
</Cell>
<Cell Site="row:1 column:0">
<Button Text="Make Font Larger" ev.Clicked-eval="self.OnMakeFontLarger();"/>
<Button Text="Make Font Larger" Alt="L" ev.Clicked-eval="self.OnMakeFontLarger();"/>
</Cell>
<Cell Site="row:1 column:1">
<Button Text="Make Font Smaller" Enabled-bind="textBoxS.Font.size &gt; 5" ev.Clicked-eval="self.OnMakeFontSmaller();"/>
<Button Text="Make Font Smaller" Alt="S" Enabled-bind="textBoxS.Font.size &gt; 5" ev.Clicked-eval="self.OnMakeFontSmaller();"/>
</Cell>
</Table>
</TabPage>
Binary file not shown.
@@ -372,7 +372,7 @@ namespace demo
::vl::__vwsn::This(::vl::__vwsn::This(this->__vwsn_precompile_3)->GetContainerComposition())->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_4));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_3));
}
{
@@ -605,7 +605,7 @@ namespace demo
::vl::__vwsn::This(this->__vwsn_precompile_44)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->__vwsn_precompile_45));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_44));
}
(this->__vwsn_precompile_2 = ::vl::__vwsn::This(this->__vwsn_precompile_1)->GetBoundsComposition());
@@ -75,12 +75,15 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -1042,7 +1042,7 @@ Class (::demo::MainWindowConstructor)
::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlt(::vl::WString(L"T", false));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_2));
}
(this->__vwsn_precompile_3 = new ::demo::ListViewTabPage());
@@ -1050,7 +1050,7 @@ Class (::demo::MainWindowConstructor)
::vl::__vwsn::This(this->__vwsn_precompile_3)->SetAlt(::vl::WString(L"L", false));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_3));
}
(this->__vwsn_precompile_4 = new ::demo::TreeViewTabPage());
@@ -1058,7 +1058,7 @@ Class (::demo::MainWindowConstructor)
::vl::__vwsn::This(this->__vwsn_precompile_4)->SetAlt(::vl::WString(L"R", false));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_4));
}
(this->__vwsn_precompile_1 = ::vl::__vwsn::This(this->__vwsn_precompile_0)->GetBoundsComposition());
Binary file not shown.
@@ -109,7 +109,7 @@ namespace demo
::vl::__vwsn::This(::vl::__vwsn::This(this->__vwsn_precompile_3)->GetContainerComposition())->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_4));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_3));
}
{
@@ -131,7 +131,7 @@ namespace demo
::vl::__vwsn::This(this->__vwsn_precompile_6)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->documentLabel));
}
{
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_1)->GetPages());
::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_6));
}
(this->__vwsn_precompile_2 = ::vl::__vwsn::This(this->__vwsn_precompile_1)->GetBoundsComposition());