diff --git a/Import/GacUI.cpp b/Import/GacUI.cpp index 86a77e12..bce7df60 100644 --- a/Import/GacUI.cpp +++ b/Import/GacUI.cpp @@ -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); } diff --git a/Import/GacUI.h b/Import/GacUI.h index 30b59fee..8c5d63ac 100644 --- a/Import/GacUI.h +++ b/Import/GacUI.h @@ -10332,7 +10332,7 @@ Scroll View GuiScrollView(theme::ThemeName themeName); ~GuiScrollView(); - virtual void SetFont(const FontProperties& value); + virtual void SetFont(const FontProperties& value)override; /// Force to update contents and scroll bars. 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 /// Toolstrip item collection. class GuiToolstripCollection : public GuiToolstripCollectionBase { + using EventHandlerList = collections::List>; 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 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 ***********************************************************************/ diff --git a/Import/GacUICompiler.cpp b/Import/GacUICompiler.cpp index d63d7a7b..7e47bc82 100644 --- a/Import/GacUICompiler.cpp +++ b/Import/GacUICompiler.cpp @@ -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 CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors) + Ptr 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 CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors) + Ptr CreateInstance(GuiResourcePrecompileContext& precompileContext, types::ResolvingResult& resolvingResult, const TypeInfo& typeInfo, GlobalStringKey variableName, ArgumentMap& arguments, GuiResourceTextPos tagPosition, GuiResourceError::List& errors)override { if (CanCreate(typeInfo)) { diff --git a/Import/VlppWorkflowCompiler.cpp b/Import/VlppWorkflowCompiler.cpp index 44d8b1e7..bf1f2da7 100644 --- a/Import/VlppWorkflowCompiler.cpp +++ b/Import/VlppWorkflowCompiler.cpp @@ -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, input, node->inputs) @@ -15883,6 +15883,7 @@ CheckScopes_BaseType } } + /*********************************************************************** .\ANALYZER\WFANALYZER_CONTEXTFREEDESUGAR.CPP ***********************************************************************/ diff --git a/Tools/CppMerge.exe b/Tools/CppMerge.exe index f5cd2714..f8468407 100644 Binary files a/Tools/CppMerge.exe and b/Tools/CppMerge.exe differ diff --git a/Tools/GacGen32.exe b/Tools/GacGen32.exe index 495ecd15..9846a0e9 100644 Binary files a/Tools/GacGen32.exe and b/Tools/GacGen32.exe differ diff --git a/Tools/GacGen64.exe b/Tools/GacGen64.exe index 7d1f735b..15f39f9a 100644 Binary files a/Tools/GacGen64.exe and b/Tools/GacGen64.exe differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin index b85ff04d..7e57568a 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin differ