This commit is contained in:
Zihan Chen
2018-02-26 03:30:30 -08:00
parent 4b12a8201b
commit 4881436226
8 changed files with 54 additions and 19 deletions
+40 -11
View File
@@ -6980,6 +6980,7 @@ GuiWindow
case templates::BoolOption::AlwaysFalse: \
VARIABLE = false; \
break; \
default:; \
} \
FIX_WINDOW_PROPERTY(hasMaximizedBox, MaximizedBox)
@@ -7511,6 +7512,7 @@ GuiPopup
}
}
/***********************************************************************
.\GRAPHICSCOMPOSITION\GUIGRAPHICSCOMPOSITION.CPP
***********************************************************************/
@@ -31124,11 +31126,6 @@ GuiToolstripCollectionBase
}
}
void GuiToolstripCollectionBase::OnInterestingMenuButtonPropertyChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments)
{
InvokeUpdateLayout();
}
bool GuiToolstripCollectionBase::QueryInsert(vint index, GuiControl* const& child)
{
return !items.Contains(child);
@@ -31170,22 +31167,54 @@ GuiToolstripCollectionBase
GuiToolstripCollection
***********************************************************************/
void GuiToolstripCollection::UpdateItemVisibility(vint index, GuiControl* child)
{
auto stackItem = stackComposition->GetStackItems()[index];
if (child->GetVisible())
{
stackItem->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren);
child->GetBoundsComposition()->SetAlignmentToParent(Margin(0, 0, 0, 0));
}
else
{
stackItem->SetMinSizeLimitation(GuiGraphicsComposition::NoLimit);
child->GetBoundsComposition()->SetAlignmentToParent(Margin(-1, -1, -1, -1));
}
}
void GuiToolstripCollection::OnItemVisibleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments)
{
auto child = sender->GetRelatedControl();
vint index = IndexOf(child);
UpdateItemVisibility(index, child);
InvokeUpdateLayout();
}
void GuiToolstripCollection::BeforeRemove(vint index, GuiControl* const& child)
{
GuiStackItemComposition* stackItem = stackComposition->GetStackItems().Get(index);
stackComposition->RemoveChild(stackItem);
{
auto eventHandler = eventHandlers[index];
child->VisibleChanged.Detach(eventHandler);
eventHandlers.RemoveAt(index);
}
GuiToolstripCollectionBase::BeforeRemove(index, child);
SafeDeleteComposition(stackItem);
}
void GuiToolstripCollection::AfterInsert(vint index, GuiControl* const& child)
{
GuiStackItemComposition* stackItem=new GuiStackItemComposition;
child->GetBoundsComposition()->SetAlignmentToParent(Margin(0, 0, 0, 0));
stackItem->AddChild(child->GetBoundsComposition());
stackComposition->InsertChild(index, stackItem);
{
GuiStackItemComposition* stackItem = new GuiStackItemComposition;
stackItem->AddChild(child->GetBoundsComposition());
stackComposition->InsertChild(index, stackItem);
}
{
auto eventHandler = child->VisibleChanged.AttachMethod(this, &GuiToolstripCollection::OnItemVisibleChanged);
eventHandlers.Insert(index, eventHandler);
}
UpdateItemVisibility(index, child);
GuiToolstripCollectionBase::AfterInsert(index, child);
}
+8 -3
View File
@@ -10332,7 +10332,7 @@ Scroll View
GuiScrollView(theme::ThemeName themeName);
~GuiScrollView();
virtual void SetFont(const FontProperties& value);
virtual void SetFont(const FontProperties& value)override;
/// <summary>Force to update contents and scroll bars.</summary>
void CalculateView();
@@ -10398,6 +10398,7 @@ Scroll View
#endif
/***********************************************************************
.\CONTROLS\GUIWINDOWCONTROLS.H
***********************************************************************/
@@ -17115,7 +17116,6 @@ Toolstrip Item Collection
IToolstripUpdateLayout * contentCallback;
void InvokeUpdateLayout();
void OnInterestingMenuButtonPropertyChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments);
bool QueryInsert(vint index, GuiControl* const& child)override;
void BeforeRemove(vint index, GuiControl* const& child)override;
void AfterInsert(vint index, GuiControl* const& child)override;
@@ -17128,9 +17128,13 @@ Toolstrip Item Collection
/// <summary>Toolstrip item collection.</summary>
class GuiToolstripCollection : public GuiToolstripCollectionBase
{
using EventHandlerList = collections::List<Ptr<compositions::IGuiGraphicsEventHandler>>;
protected:
compositions::GuiStackComposition* stackComposition;
EventHandlerList eventHandlers;
void UpdateItemVisibility(vint index, GuiControl* child);
void OnItemVisibleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments);
void BeforeRemove(vint index, GuiControl* const& child)override;
void AfterInsert(vint index, GuiControl* const& child)override;
public:
@@ -17211,7 +17215,7 @@ Toolstrip Component
IToolstripUpdateLayout* callback = nullptr;
Ptr<compositions::IGuiGraphicsEventHandler> descriptionChangedHandler;
void SetCallback(IToolstripUpdateLayout* _callback);
void SetCallback(IToolstripUpdateLayout* _callback)override;
void UpdateCommandContent();
void OnLayoutAwaredPropertyChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments);
void OnClicked(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments);
@@ -17335,6 +17339,7 @@ Toolstrip Group
#endif
/***********************************************************************
.\RESOURCES\GUIDOCUMENTEDITOR.H
***********************************************************************/
+4 -4
View File
@@ -11400,12 +11400,12 @@ GuiCommonDatePickerLookLoader
return IGuiInstanceLoader::GetPropertyType(propertyInfo);
}
bool CanCreate(const TypeInfo& typeInfo)
bool CanCreate(const TypeInfo& typeInfo)override
{
return typeInfo.typeName == typeName;
}
Ptr<workflow::WfStatement> CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors)
Ptr<workflow::WfStatement> CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors)override
{
if (CanCreate(typeInfo))
{
@@ -11484,12 +11484,12 @@ GuiCommonScrollViewLookLoader
return IGuiInstanceLoader::GetPropertyType(propertyInfo);
}
bool CanCreate(const TypeInfo& typeInfo)
bool CanCreate(const TypeInfo& typeInfo)override
{
return typeInfo.typeName == typeName;
}
Ptr<workflow::WfStatement> CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors)
Ptr<workflow::WfStatement> CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors)override
{
if (CanCreate(typeInfo))
{
+2 -1
View File
@@ -15425,7 +15425,7 @@ CompleteScopeForClassMember
node->Accept((WfVirtualCseDeclaration::IVisitor*)this);
}
void Visit(WfStateMachineDeclaration* node)
void Visit(WfStateMachineDeclaration* node)override
{
auto scope = manager->nodeScopes[node];
FOREACH(Ptr<WfStateInput>, input, node->inputs)
@@ -15883,6 +15883,7 @@ CheckScopes_BaseType
}
}
/***********************************************************************
.\ANALYZER\WFANALYZER_CONTEXTFREEDESUGAR.CPP
***********************************************************************/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.