Controls/TextEditor

This commit is contained in:
Zihan Chen
2017-01-25 08:43:53 -08:00
parent c88074ae3b
commit c205211502
3 changed files with 36 additions and 23 deletions

View File

@@ -2442,6 +2442,16 @@ Native Window Services
virtual bool ShowFileDialog(INativeWindow* window, collections::List<WString>& selectionFileNames, vint& selectionFilterIndex, FileDialogTypes dialogType, const WString& title, const WString& initialFileName, const WString& initialDirectory, const WString& defaultExtension, const WString& filter, FileDialogOptions options)=0;
};
inline INativeDialogService::FileDialogOptions operator|(INativeDialogService::FileDialogOptions a, INativeDialogService::FileDialogOptions b)
{
return static_cast<INativeDialogService::FileDialogOptions>(static_cast<vuint64_t>(a) | static_cast<vuint64_t>(b));
}
inline INativeDialogService::FileDialogOptions operator&(INativeDialogService::FileDialogOptions a, INativeDialogService::FileDialogOptions b)
{
return static_cast<INativeDialogService::FileDialogOptions>(static_cast<vuint64_t>(a) & static_cast<vuint64_t>(b));
}
/***********************************************************************
Native Window Controller
***********************************************************************/

View File

@@ -1077,6 +1077,17 @@ GuiVrtualTypeInstanceLoader
}
}
if (!stopControlTemplateTd)
{
auto value = MakePtr<WfStringExpression>();
value->value.value = L"Cannot find a matched control template to create.";
auto raiseStat = MakePtr<WfRaiseExceptionStatement>();
raiseStat->expression = value;
block->statements.Add(raiseStat);
}
auto member = MakePtr<WfClassMember>();
member->kind = WfClassMemberKind::Override;
member->declaration = funcCreateTemplate;

View File

@@ -14743,18 +14743,18 @@ WfCppConfig
case ITypeInfo::RawPtr:
return ConvertType(typeInfo->GetElementType()) + L"*";
case ITypeInfo::SharedPtr:
if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor<IValueFunctionProxy>())
if (typeInfo->GetElementType()->GetDecorator() == ITypeInfo::Generic)
{
return ConvertType(typeInfo->GetElementType());
}
else if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor<IValueEnumerable>())
{
return ConvertType(typeInfo->GetElementType());
}
else
{
return L"::vl::Ptr<" + ConvertType(typeInfo->GetElementType()) + L">";
if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor<IValueFunctionProxy>())
{
return ConvertType(typeInfo->GetElementType());
}
else if (typeInfo->GetTypeDescriptor() == description::GetTypeDescriptor<IValueEnumerable>())
{
return ConvertType(typeInfo->GetElementType());
}
}
return L"::vl::Ptr<" + ConvertType(typeInfo->GetElementType()) + L">";
case ITypeInfo::Nullable:
return L"::vl::Nullable<" + ConvertType(typeInfo->GetElementType()) + L">";
case ITypeInfo::Generic:
@@ -16279,7 +16279,7 @@ WfGenerateExpressionVisitor
{
auto fromType = types[0];
auto toType = types[1];
ConvertType(config, writer, fromType, toType, writeExpression, true);
ConvertType(config, writer, fromType, toType, writeExpression, false);
});
}
else
@@ -17632,24 +17632,16 @@ WfGenerateExpressionVisitor
void Visit(WfInferExpression* node)override
{
auto scope = config->manager->nodeScopes[node].Obj();
auto typeInfo = CreateTypeInfoFromType(scope, node->type);
Call(node->expression, typeInfo.Obj());
Call(node->expression);
}
void Visit(WfTypeCastingExpression* node)override
{
auto scope = config->manager->nodeScopes[node].Obj();
auto typeInfo = CreateTypeInfoFromType(scope, node->type);
if (node->strategy == WfTypeCastingStrategy::Strong)
{
Call(node->expression, typeInfo.Obj());
}
else
{
auto result = config->manager->expressionResolvings[node->expression.Obj()];
ConvertType(config, writer, result.type.Obj(), typeInfo.Obj(), [&]() {Call(node->expression); }, false);
}
bool strongCast = node->strategy == WfTypeCastingStrategy::Strong;
auto result = config->manager->expressionResolvings[node->expression.Obj()];
ConvertType(config, writer, result.type.Obj(), typeInfo.Obj(), [&]() {Call(node->expression); }, strongCast);
}
void Visit(WfTypeTestingExpression* node)override