diff --git a/Import/GacUI.Windows.cpp b/Import/GacUI.Windows.cpp index 09d70630..7a89d957 100644 --- a/Import/GacUI.Windows.cpp +++ b/Import/GacUI.Windows.cpp @@ -388,6 +388,7 @@ WindowsForm static void ClosePopupsOf(WindowsForm* owner, SortedList& exceptions) { + // TODO: (enumerable) foreach for (vint i = 0; i < owner->childWindows.Count(); i++) { auto popup = owner->childWindows[i]; @@ -456,6 +457,7 @@ WindowsForm List allRootWindows; GetAllCreatedWindows(allRootWindows, true); + // TODO: (enumerable) foreach for (vint i = 0; i < allRootWindows.Count(); i++) { if (auto windowsForm = dynamic_cast(allRootWindows[i])) @@ -475,6 +477,7 @@ WindowsForm { LPRECT rawBounds=(LPRECT)lParam; NativeRect bounds(rawBounds->left, rawBounds->top, rawBounds->right, rawBounds->bottom); + // TODO: (enumerable) foreach for(vint i=0;iMoving(bounds, false, (uMsg == WM_SIZING)); @@ -494,6 +497,7 @@ WindowsForm break; case WM_MOVE:case WM_SIZE: { + // TODO: (enumerable) foreach for(vint i=0;iMoved(); @@ -508,11 +512,13 @@ WindowsForm auto newRect = (RECT*)lParam; MoveWindow(handle, newRect->left, newRect->top, (newRect->right - newRect->left), (newRect->bottom - newRect->top), FALSE); + // TODO: (enumerable) foreach for (vint i = 0; i < listeners.Count(); i++) { listeners[i]->DpiChanged(true); } + // TODO: (enumerable) foreach for (vint i = 0; i < listeners.Count(); i++) { listeners[i]->DpiChanged(false); @@ -522,6 +528,7 @@ WindowsForm // ************************************** state case WM_ENABLE: { + // TODO: (enumerable) foreach for(vint i=0;iOpened(); @@ -571,6 +580,7 @@ WindowsForm } else { + // TODO: (enumerable) foreach for (vint i = 0; i < listeners.Count(); i++) { listeners[i]->Closed(); @@ -581,12 +591,14 @@ WindowsForm case WM_CLOSE: { bool cancel = false; + // TODO: (enumerable) foreach for (vint i = 0; i < listeners.Count(); i++) { listeners[i]->BeforeClosing(cancel); } if (!cancel) { + // TODO: (enumerable) foreach for (vint i = 0; i < listeners.Count(); i++) { listeners[i]->AfterClosing(); @@ -602,6 +614,7 @@ WindowsForm case WM_LBUTTONDOWN: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iLeftButtonDown(info); @@ -614,6 +627,7 @@ WindowsForm case WM_LBUTTONUP: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iLeftButtonUp(info); @@ -626,6 +640,7 @@ WindowsForm case WM_LBUTTONDBLCLK: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iLeftButtonDoubleClick(info); @@ -638,6 +653,7 @@ WindowsForm case WM_RBUTTONDOWN: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iRightButtonDown(info); @@ -650,6 +666,7 @@ WindowsForm case WM_RBUTTONUP: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iRightButtonUp(info); @@ -662,6 +679,7 @@ WindowsForm case WM_RBUTTONDBLCLK: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iRightButtonDoubleClick(info); @@ -674,6 +692,7 @@ WindowsForm case WM_MBUTTONDOWN: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iMiddleButtonDown(info); @@ -686,6 +705,7 @@ WindowsForm case WM_MBUTTONUP: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iMiddleButtonUp(info); @@ -698,6 +718,7 @@ WindowsForm case WM_MBUTTONDBLCLK: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, false, nonClient); + // TODO: (enumerable) foreach for(vint i=0;iMiddleButtonDoubleClick(info); @@ -715,12 +736,14 @@ WindowsForm if(!mouseHoving) { mouseHoving=true; + // TODO: (enumerable) foreach for(vint i=0;iMouseEntered(); } TrackMouse(true); } + // TODO: (enumerable) foreach for(vint i=0;iMouseMoving(info); @@ -732,6 +755,7 @@ WindowsForm case WM_MOUSEHWHEEL: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, true, false); + // TODO: (enumerable) foreach for(vint i=0;iHorizontalWheel(info); @@ -741,6 +765,7 @@ WindowsForm case WM_MOUSEWHEEL: { NativeWindowMouseInfo info=ConvertMouse(wParam, lParam, true, false); + // TODO: (enumerable) foreach for(vint i=0;iVerticalWheel(info); @@ -756,6 +781,7 @@ WindowsForm mouseLastX=-1; mouseLastY=-1; mouseHoving=false; + // TODO: (enumerable) foreach for(vint i=0;iMouseLeaved(); @@ -773,6 +799,7 @@ WindowsForm { NativeWindowKeyInfo info=ConvertKey(wParam, lParam); info.autoRepeatKeyDown = false; + // TODO: (enumerable) foreach for(vint i=0;iKeyUp(info); @@ -782,6 +809,7 @@ WindowsForm case WM_KEYDOWN: { NativeWindowKeyInfo info=ConvertKey(wParam, lParam); + // TODO: (enumerable) foreach for(vint i=0;iKeyDown(info); @@ -810,6 +838,7 @@ WindowsForm { break; } + // TODO: (enumerable) foreach for(vint i=0;iKeyDown(info); @@ -819,6 +848,7 @@ WindowsForm case WM_CHAR: { NativeWindowCharInfo info=ConvertChar(wParam); + // TODO: (enumerable) foreach for(vint i=0;iChar(info); @@ -828,6 +858,7 @@ WindowsForm // ************************************** painting case WM_PAINT: { + // TODO: (enumerable) foreach for(vint i=0;iPaint(); @@ -971,6 +1002,7 @@ WindowsForm case WM_LBUTTONUP: { POINTS location = MAKEPOINTS(lParam); + // TODO: (enumerable) this for-loop needs to be removed, because it is not looping, just leave the body for (vint i = 0; i < listeners.Count(); i++) { switch (PerformHitTest(From(listeners), { location.x,location.y })) @@ -1065,6 +1097,7 @@ WindowsForm { parentWindow->childWindows.Remove(this); } + // TODO: (enumerable) foreach for (vint i = childWindows.Count() - 1; i >= 0; i--) { childWindows[i]->SetParent(parentWindow); @@ -1073,6 +1106,7 @@ WindowsForm *flagDisposed.Obj() = true; List copiedListeners; CopyFrom(copiedListeners, listeners); + // TODO: (enumerable) foreach for (vint i = 0; i < copiedListeners.Count(); i++) { INativeWindowListener* listener = copiedListeners[i]; @@ -1091,6 +1125,7 @@ WindowsForm void InvokeDestroying() { + // TODO: (enumerable) foreach for(vint i=0;iDestroying(); @@ -1220,6 +1255,7 @@ WindowsForm void SetBounds(const NativeRect& bounds)override { NativeRect newBounds=bounds; + // TODO: (enumerable) foreach for(vint i=0;iMoving(newBounds, true, false); @@ -1926,6 +1962,7 @@ WindowsController { DestroyNativeWindow(window); } + // TODO: (enumerable) foreach:reversed for (vint i = windows.Count() - 1; i >= 0; i--) { auto window = windows.Values()[i]; @@ -2466,7 +2503,7 @@ WindowListener 1.1 if (size.x <= 1) size.x = 1; if (size.y <= 1) size.y = 1; - if(!d2dDeviceContext) + if (!d2dDeviceContext) { if (!dxgiDevice) { @@ -2479,8 +2516,6 @@ WindowListener 1.1 } d2dDeviceContext = CreateDeviceContext(dxgiDevice.Obj()); - auto d2dBitmap = CreateBitmap(dxgiSwapChain.Obj(), d2dDeviceContext.Obj()); - d2dDeviceContext->SetTarget(d2dBitmap.Obj()); IWindowsForm* form = GetWindowsForm(window); { UINT dpiX = 0; @@ -2488,18 +2523,26 @@ WindowListener 1.1 DpiAwared_GetDpiForWindow(form->GetWindowHandle(), &dpiX, &dpiY); d2dDeviceContext->SetDpi((FLOAT)dpiX, (FLOAT)dpiY); } + previousSize = { 0,0 }; } - else if(previousSize!=size) + + if (previousSize != size) { + previousSize = size; d2dDeviceContext->SetTarget(nullptr); - HRESULT hr = dxgiSwapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0); + HRESULT hr = dxgiSwapChain->ResizeBuffers( + 0, + (UINT)size.x.value, + (UINT)size.y.value, + DXGI_FORMAT_UNKNOWN, + 0 + ); if (SUCCEEDED(hr)) { auto d2dBitmap = CreateBitmap(dxgiSwapChain.Obj(), d2dDeviceContext.Obj()); d2dDeviceContext->SetTarget(d2dBitmap.Obj()); } } - previousSize=size; } public: Direct2DWindowsNativeWindowListener_1_1(INativeWindow* _window, ComPtr _d2dFactory1, ID3D11Device* _d3d11Device) @@ -2578,6 +2621,7 @@ ControllerListener ~Direct2DWindowsNativeControllerListener() { + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < nativeWindowListeners.Count(); i++) { auto window = nativeWindowListeners.Keys()[i]; @@ -3133,6 +3177,7 @@ WindowsDirect2DParagraph (Ranges) void CutMap(Dictionary& map, vint start, vint length) { vint end=start+length; + // TODO: (enumerable) foreach:alterable(reversed) on group for(vint i=map.Count()-1;i>=0;i--) { TextRange key=map.Keys()[i]; @@ -3166,6 +3211,7 @@ WindowsDirect2DParagraph (Ranges) void UpdateOverlappedMap(Dictionary& map, vint start, vint length, const T& value) { vint end=start+length; + // TODO: (enumerable) foreach:alterable(reversed)) on dictionary for(vint i=map.Count()-1;i>=0;i--) { TextRange key=map.Keys()[i]; @@ -3181,6 +3227,7 @@ WindowsDirect2DParagraph (Ranges) { vint lastIndex=map.Count()-1; T lastValue=map.Values()[lastIndex]; + // TODO: (enumerable) foreach:indexed(alterable(reversed)) on dictionary for(vint i=map.Count()-2;i>=-1;i--) { if(i==-1 || map.Values()[i]!=lastValue) @@ -3262,6 +3309,7 @@ WindowsDirect2DParagraph (Layout Retriving) lineTops.Resize(lineCount); vint start=0; FLOAT top=0; + // TODO: (enumerable) foreach for(vint i=0;i inlineObject=inlineElements.Values().Get(i); @@ -3695,6 +3746,7 @@ WindowsDirect2DParagraph (Rendering) BackgroundRenderer backgroundRenderer; backgroundRenderer.renderTarget = renderTarget; + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < backgroundColors.Count(); i++) { TextRange key = backgroundColors.Keys()[i]; @@ -5216,6 +5268,7 @@ GuiPolygonElementRenderer p.x = (FLOAT)(oldPoints[0].x + offset.x) + 0.5f; p.y = (FLOAT)(oldPoints[0].y + offset.y) + 0.5f; pgs->BeginFigure(p, D2D1_FIGURE_BEGIN_FILLED); + // TODO: (enumerable) foreach for (vint i = 1; i < oldPoints.Count(); i++) { p.x = (FLOAT)(oldPoints[i].x + offset.x) + 0.5f; @@ -5319,6 +5372,7 @@ GuiPolygonElementRenderer } else { + // TODO: (enumerable) foreach for(vint i=0;iGetPoint(i)) @@ -5344,6 +5398,7 @@ GuiColorizedTextElementRenderer if(_renderTarget) { colors.Resize(element->GetColors().Count()); + // TODO: (enumerable) foreach:indexed for(vint i=0;iGetColors().Get(i); @@ -5370,6 +5425,7 @@ GuiColorizedTextElementRenderer { if(_renderTarget) { + // TODO: (enumerable) foreach for(vint i=0;iDestroyDirect2DBrush(colors[i].normal.text); @@ -8442,6 +8498,7 @@ namespace vl ~GdiWindowsNativeControllerListener() { + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < nativeWindowListeners.Count(); i++) { auto window = nativeWindowListeners.Keys()[i]; @@ -9774,6 +9831,7 @@ GuiColorizedTextElementRenderer void GuiColorizedTextElementRenderer::DestroyColors() { auto resourceManager=GetWindowsGDIResourceManager(); + // TODO: (enumerable) foreach for(vint i=0;iDestroyGdiBrush(colors[i].normal.background); @@ -9787,6 +9845,7 @@ GuiColorizedTextElementRenderer auto resourceManager=GetWindowsGDIResourceManager(); ColorArray newColors; newColors.Resize(element->GetColors().Count()); + // TODO: (enumerable) foreach:indexed for(vint i=0;iGetColors().Get(i); @@ -13481,6 +13540,7 @@ WindowsDialogService Array filterBuffer(filter.Length()+2); vint index=0; + // TODO: (enumerable) foreach for(vint i=0;iOnDetach(this); @@ -13919,6 +13980,7 @@ WindowsImage { if ((vint)actualCount > colorContexts.Count()) { + // TODO: (enumerable) foreach for (vint i = 0; i < colorContexts.Count(); i++) colorContexts[i]->Release(); colorContexts.Resize((vint)actualCount); bitmapDecoder->GetColorContexts(actualCount, &colorContexts[0], &actualCount); @@ -14639,6 +14701,7 @@ WindowsScreenService void WindowsScreenService::RefreshScreenInformation() { + // TODO: (enumerable) foreach for(vint i=0;imonitor=NULL; @@ -14670,6 +14733,7 @@ WindowsScreenService HMONITOR monitor=MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL); if(monitor!=NULL) { + // TODO: (enumerable) foreach for(vint i=0;imonitor==monitor) diff --git a/Import/GacUI.cpp b/Import/GacUI.cpp index f6a813bf..2c7252a0 100644 --- a/Import/GacUI.cpp +++ b/Import/GacUI.cpp @@ -156,6 +156,7 @@ External Functions (Compositions) { Group group; host->CollectAltActions(group); + // TODO: (enumerable) Linq:SelectMany for (vint i = 0; i < group.Count(); i++) { CopyFrom(actions, group.GetByIndex(i), true); @@ -407,6 +408,7 @@ GuiApplication INativeWindow* nativeWindow = GetCurrentController()->WindowService()->GetWindow(location); if (nativeWindow) { + // TODO: (enumerable) foreach for (vint i = 0; i < windows.Count(); i++) { GuiWindow* window = windows[i]; @@ -554,7 +556,8 @@ GuiApplication Helpers ***********************************************************************/ - GuiApplication* application=0; + GuiApplication* application = nullptr; + bool GACUI_UNITTEST_ONLY_SKIP_THREAD_LOCAL_STORAGE_DISPOSE_STORAGES = false; GuiApplication* GetApplication() { @@ -628,7 +631,10 @@ GuiApplicationMain DestroyPluginManager(); theme::FinalizeTheme(); - ThreadLocalStorage::DisposeStorages(); + if (!GACUI_UNITTEST_ONLY_SKIP_THREAD_LOCAL_STORAGE_DISPOSE_STORAGES) + { + ThreadLocalStorage::DisposeStorages(); + } FinalizeGlobalStorage(); #ifndef VCZH_DEBUG_NO_REFLECTION ResetGlobalTypeManager(); @@ -793,6 +799,7 @@ GuiControl arguments.controlSignal = ControlSignal::ParentLineChanged; ControlSignalTrigerred.Execute(arguments); } + // TODO: (enumerable) foreach for(vint i=0;iOnParentLineChanged(); @@ -806,6 +813,7 @@ GuiControl arguments.controlSignal = ControlSignal::ServiceAdded; ControlSignalTrigerred.Execute(arguments); } + // TODO: (enumerable) foreach for(vint i=0;iOnParentLineChanged(); @@ -821,6 +829,7 @@ GuiControl void GuiControl::OnBeforeReleaseGraphicsHost() { + // TODO: (enumerable) foreach for(vint i=0;iOnBeforeReleaseGraphicsHost(); @@ -839,6 +848,7 @@ GuiControl } VisuallyEnabledChanged.Execute(GetNotifyEventArguments()); + // TODO: (enumerable) foreach for (vint i = 0; i < children.Count(); i++) { children[i]->UpdateVisuallyEnabled(); @@ -862,6 +872,7 @@ GuiControl } DisplayFontChanged.Execute(GetNotifyEventArguments()); + // TODO: (enumerable) foreach for (vint i = 0; i < children.Count(); i++) { children[i]->UpdateDisplayFont(); @@ -989,8 +1000,12 @@ GuiControl GuiControl::GuiControl(theme::ThemeName themeName) :controlThemeName(themeName) - , displayFont(GetCurrentController()->ResourceService()->GetDefaultFont()) { + if (auto controller = GetCurrentController()) + { + displayFont = controller->ResourceService()->GetDefaultFont(); + } + { boundsComposition = new GuiBoundsComposition; boundsComposition->SetAssociatedControl(this); @@ -1042,6 +1057,7 @@ GuiControl delete tooltipControl; } + // TODO: (enumerable) foreach for (vint i = 0; i < children.Count(); i++) { delete children[i]; @@ -1502,6 +1518,7 @@ GuiInstanceRootObject { if (alive) { + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = rootObject->runningAnimations.Count() - 1; i >= 0; i--) { auto animation = rootObject->runningAnimations[i]; @@ -1600,6 +1617,7 @@ GuiInstanceRootObject } subscriptions.Clear(); + // TODO: (enumerable) foreach for (vint i = 0; iGetBoundsComposition()->GetBounds().GetSize()); + Rect bounds(Point(0, 0), control->GetBoundsComposition()->GetCachedBounds().GetSize()); return CalculatePopupPosition(windowSize, control, controlWindow, bounds, preferredTopBottomSide); } @@ -3227,7 +3245,7 @@ GuiPopup /*********************************************************************** -.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSBASICCOMPOSITION.CPP +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSBOUNDSCOMPOSITION.CPP ***********************************************************************/ namespace vl @@ -3243,109 +3261,125 @@ namespace vl GuiBoundsComposition ***********************************************************************/ - Rect GuiBoundsComposition::GetPreferredBoundsInternal(bool considerPreferredMinSize) + Size GuiBoundsComposition::Layout_CalculateMinSize() { - Rect result = GetBoundsInternal(compositionBounds, considerPreferredMinSize); - if (GetParent() && IsAlignedToParent()) + Size minSize = Layout_CalculateMinSizeHelper(); + if (minSize.x < expectedBounds.Width()) minSize.x = expectedBounds.Width(); + if (minSize.y < expectedBounds.Height()) minSize.y = expectedBounds.Height(); + return minSize; + } + + Size GuiBoundsComposition::Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) + { + vint offsetW = 0; + vint offsetH = 0; + + if (alignmentToParent.left == -1 && alignmentToParent.right == -1) { - if (alignmentToParent.left >= 0) + offsetW = expectedBounds.x1; + } + else + { + if (alignmentToParent.left != -1) { - vint offset = alignmentToParent.left - result.x1; - result.x1 += offset; - result.x2 += offset; + offsetW += alignmentToParent.left - parentInternalMargin.left; } - if (alignmentToParent.top >= 0) + if (alignmentToParent.right != -1) { - vint offset = alignmentToParent.top - result.y1; - result.y1 += offset; - result.y2 += offset; - } - if (alignmentToParent.right >= 0) - { - result.x2 += alignmentToParent.right; - } - if (alignmentToParent.bottom >= 0) - { - result.y2 += alignmentToParent.bottom; + offsetW += alignmentToParent.right - parentInternalMargin.right; } } - return result; - } - GuiBoundsComposition::GuiBoundsComposition() - { - } - - GuiBoundsComposition::~GuiBoundsComposition() - { - } - - bool GuiBoundsComposition::GetSizeAffectParent() - { - return sizeAffectParent; - } - - void GuiBoundsComposition::SetSizeAffectParent(bool value) - { - sizeAffectParent = value; - } - - bool GuiBoundsComposition::IsSizeAffectParent() - { - return sizeAffectParent; - } - - Rect GuiBoundsComposition::GetBounds() - { - Rect result = GetPreferredBounds(); - if (GetParent() && IsAlignedToParent()) + if (alignmentToParent.top == -1 && alignmentToParent.bottom == -1) { - Size clientSize = GetParent()->GetClientArea().GetSize(); - if (alignmentToParent.left >= 0 && alignmentToParent.right >= 0) + offsetH = expectedBounds.y1; + } + else + { + if (alignmentToParent.top != -1) { - result.x1 = alignmentToParent.left; - result.x2 = clientSize.x - alignmentToParent.right; + offsetH += alignmentToParent.top - parentInternalMargin.top; } - else if (alignmentToParent.left >= 0) + if (alignmentToParent.bottom != -1) { - vint width = result.Width(); - result.x1 = alignmentToParent.left; - result.x2 = result.x1 + width; - } - else if (alignmentToParent.right >= 0) - { - vint width = result.Width(); - result.x2 = clientSize.x - alignmentToParent.right; - result.x1 = result.x2 - width; - } - - if (alignmentToParent.top >= 0 && alignmentToParent.bottom >= 0) - { - result.y1 = alignmentToParent.top; - result.y2 = clientSize.y - alignmentToParent.bottom; - } - else if (alignmentToParent.top >= 0) - { - vint height = result.Height(); - result.y1 = alignmentToParent.top; - result.y2 = result.y1 + height; - } - else if (alignmentToParent.bottom >= 0) - { - vint height = result.Height(); - result.y2 = clientSize.y - alignmentToParent.bottom; - result.y1 = result.y2 - height; + offsetH += alignmentToParent.bottom - parentInternalMargin.bottom; } } - UpdatePreviousBounds(result); - return result; + + return { cachedMinSize.x + offsetW,cachedMinSize.y + offsetH }; } - void GuiBoundsComposition::SetBounds(Rect value) + Rect GuiBoundsComposition::Layout_CalculateBounds(Size parentSize) { - if (compositionBounds != value) + if (auto parent = GetParent()) { - compositionBounds = value; + Rect result; + Rect parentBounds({}, parentSize); + Margin parentInternalMargin = parent->GetInternalMargin(); + + if (alignmentToParent.left != -1 && alignmentToParent.right != -1) + { + result.x1 = parentBounds.x1 + alignmentToParent.left; + result.x2 = parentBounds.x2 - alignmentToParent.right; + } + else if (alignmentToParent.left != -1) + { + result.x1 = parentBounds.x1 + alignmentToParent.left; + result.x2 = result.x1 + cachedMinSize.x; + } + else if (alignmentToParent.right != -1) + { + result.x2 = parentBounds.x2 - alignmentToParent.right; + result.x1 = result.x2 - cachedMinSize.x; + } + else + { + result.x1 = expectedBounds.x1 + parentInternalMargin.left; + result.x2 = result.x1 + cachedMinSize.x; + } + + if (alignmentToParent.top != -1 && alignmentToParent.bottom != -1) + { + result.y1 = parentBounds.y1 + alignmentToParent.top; + result.y2 = parentBounds.y2 - alignmentToParent.bottom; + } + else if (alignmentToParent.top != -1) + { + result.y1 = parentBounds.y1 + alignmentToParent.top; + result.y2 = result.y1 + cachedMinSize.y; + } + else if (alignmentToParent.bottom != -1) + { + result.y2 = parentBounds.y2 - alignmentToParent.bottom; + result.y1 = result.y2 - cachedMinSize.y; + } + else + { + result.y1 = expectedBounds.y1 + parentInternalMargin.top; + result.y2 = result.y1 + cachedMinSize.y; + } + + return result; + } + else + { + return Rect(expectedBounds.LeftTop(), cachedMinSize); + } + } + + Rect GuiBoundsComposition::GetExpectedBounds() + { + return expectedBounds; + } + + void GuiBoundsComposition::SetExpectedBounds(Rect value) + { + if (value.x2 < value.x1) value.x2 = value.x1; + if (value.y2 < value.y1) value.y2 = value.y1; + + if (expectedBounds != value) + { + expectedBounds = value; InvokeOnCompositionStateChanged(); } } @@ -3373,7 +3407,7 @@ GuiBoundsComposition } /*********************************************************************** -.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITIONBASE.CPP +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITION.CPP ***********************************************************************/ namespace vl @@ -3382,8 +3416,6 @@ namespace vl { namespace compositions { - using namespace collections; - using namespace controls; using namespace elements; void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition) @@ -3391,73 +3423,28 @@ namespace vl composition->InvokeOnCompositionStateChanged(); } - Size InvokeGetMinPreferredClientSizeInternal(GuiGraphicsComposition* composition, bool considerPreferredMinSize) - { - return composition->GetMinPreferredClientSizeInternal(considerPreferredMinSize); - } - - Rect InvokeGetPreferredBoundsInternal(GuiGraphicsComposition* composition, bool considerPreferredMinSize) - { - return composition->GetPreferredBoundsInternal(considerPreferredMinSize); - } - - Rect InvokeGetBoundsInternal(GuiGraphicsSite* composition, Rect expectedBounds, bool considerPreferredMinSize) - { - return composition->GetBoundsInternal(expectedBounds, considerPreferredMinSize); - } - -/*********************************************************************** -GuiWindowComposition -***********************************************************************/ - - GuiWindowComposition::GuiWindowComposition() - { - } - - GuiWindowComposition::~GuiWindowComposition() - { - } - - Rect GuiWindowComposition::GetBounds() - { - Rect bounds; - if (relatedHostRecord) - { - if (auto window = relatedHostRecord->host->GetNativeWindow()) - { - bounds = Rect(Point(0, 0), window->Convert(window->GetClientSize())); - } - } - UpdatePreviousBounds(bounds); - return bounds; - } - - void GuiWindowComposition::SetMargin(Margin value) - { - } - /*********************************************************************** GuiGraphicsComposition ***********************************************************************/ void GuiGraphicsComposition::OnControlParentChanged(controls::GuiControl* control) { - if(associatedControl && associatedControl!=control) + if (associatedControl && associatedControl != control) { - if(associatedControl->GetParent()) + if (associatedControl->GetParent()) { associatedControl->GetParent()->OnChildRemoved(associatedControl); } - if(control) + if (control) { control->OnChildInserted(associatedControl); } } else { - for(vint i=0;iOnControlParentChanged(control); + child->OnControlParentChanged(control); } } } @@ -3469,7 +3456,7 @@ GuiGraphicsComposition void GuiGraphicsComposition::OnChildRemoved(GuiGraphicsComposition* child) { - child->OnControlParentChanged(0); + child->OnControlParentChanged(nullptr); } void GuiGraphicsComposition::OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent) @@ -3479,12 +3466,16 @@ GuiGraphicsComposition void GuiGraphicsComposition::OnParentLineChanged() { - for (vint i = 0; i < children.Count(); i++) + for (auto child : children) { - children[i]->OnParentLineChanged(); + child->OnParentLineChanged(); } } + void GuiGraphicsComposition::OnCompositionStateChanged() + { + } + void GuiGraphicsComposition::OnRenderContextChanged() { } @@ -3502,9 +3493,9 @@ GuiGraphicsComposition } } - for (vint i = 0; i < children.Count(); i++) + for (auto child : children) { - children[i]->UpdateRelatedHostRecord(record); + child->UpdateRelatedHostRecord(record); } if (HasEventReceiver()) @@ -3523,23 +3514,24 @@ GuiGraphicsComposition { if (associatedControl) { - for (vint i = 0; i < children.Count(); i++) + for (auto child : children) { - children[i]->OnControlParentChanged(0); + child->OnControlParentChanged(nullptr); } } associatedControl = control; if (associatedControl) { - for (vint i = 0; i < children.Count(); i++) + for (auto child : children) { - children[i]->OnControlParentChanged(associatedControl); + child->OnControlParentChanged(associatedControl); } } } void GuiGraphicsComposition::InvokeOnCompositionStateChanged() { + OnCompositionStateChanged(); if (relatedHostRecord && GetEventuallyVisible()) { relatedHostRecord->host->RequestRender(); @@ -3560,13 +3552,15 @@ GuiGraphicsComposition GuiGraphicsComposition::GuiGraphicsComposition() { sharedPtrDestructorProc = &GuiGraphicsComposition::SharedPtrDestructorProc; + CachedMinSizeChanged.SetAssociatedComposition(this); + CachedBoundsChanged.SetAssociatedComposition(this); } GuiGraphicsComposition::~GuiGraphicsComposition() { - for(vint i=0;iIsClipperCoverWholeTarget()) { - Rect bounds = GetBounds(); - bounds.x1 += margin.left; - bounds.y1 += margin.top; - bounds.x2 -= margin.right; - bounds.y2 -= margin.bottom; - + Rect bounds = GetCachedBounds(); if (bounds.x1 <= bounds.x2 && bounds.y1 <= bounds.y2) { bounds.x1 += offset.x; @@ -3742,25 +3731,18 @@ GuiGraphicsComposition renderer->Render(bounds); } } + if (children.Count() > 0) { - bounds.x1 += internalMargin.left; - bounds.y1 += internalMargin.top; - bounds.x2 -= internalMargin.right; - bounds.y2 -= internalMargin.bottom; - if (bounds.x1 <= bounds.x2 && bounds.y1 <= bounds.y2) + renderTarget->PushClipper(bounds); + if (!renderTarget->IsClipperCoverWholeTarget()) { - offset = bounds.GetSize(); - renderTarget->PushClipper(bounds); - if (!renderTarget->IsClipperCoverWholeTarget()) + for (auto child : children) { - for (vint i = 0; i < children.Count(); i++) - { - children[i]->Render(Size(bounds.x1, bounds.y1)); - } + child->Render(Size(bounds.x1, bounds.y1)); } - renderTarget->PopClipper(); } + renderTarget->PopClipper(); } isRendering = false; } @@ -3784,18 +3766,16 @@ GuiGraphicsComposition GuiGraphicsComposition* GuiGraphicsComposition::FindComposition(Point location, bool forMouseEvent) { if (!visible) return 0; - Rect bounds = GetBounds(); + Rect bounds = GetCachedBounds(); Rect relativeBounds = Rect(Point(0, 0), bounds.GetSize()); if (relativeBounds.Contains(location)) { - Rect clientArea = GetClientArea(); + // TODO: (enumerable) foreach:reversed for (vint i = children.Count() - 1; i >= 0; i--) { GuiGraphicsComposition* child = children[i]; - Rect childBounds = child->GetBounds(); - vint offsetX = childBounds.x1 + (clientArea.x1 - bounds.x1); - vint offsetY = childBounds.y1 + (clientArea.y1 - bounds.y1); - Point newLocation = location - Size(offsetX, offsetY); + Rect childBounds = child->GetCachedBounds(); + Point newLocation = location - Size(childBounds.x1, childBounds.y1); GuiGraphicsComposition* childResult = child->FindComposition(newLocation, forMouseEvent); if (childResult) { @@ -3821,23 +3801,6 @@ GuiGraphicsComposition transparentToMouse = value; } - Rect GuiGraphicsComposition::GetGlobalBounds() - { - Rect bounds = GetBounds(); - GuiGraphicsComposition* composition = parent; - while (composition) - { - Rect clientArea = composition->GetClientArea(); - Rect parentBounds = composition->GetBounds(); - bounds.x1 += clientArea.x1; - bounds.x2 += clientArea.x1; - bounds.y1 += clientArea.y1; - bounds.y2 += clientArea.y1; - composition = composition->parent; - } - return bounds; - } - controls::GuiControl* GuiGraphicsComposition::GetAssociatedControl() { return associatedControl; @@ -3923,20 +3886,6 @@ GuiGraphicsComposition return nullptr; } - Margin GuiGraphicsComposition::GetMargin() - { - return margin; - } - - void GuiGraphicsComposition::SetMargin(Margin value) - { - if (margin != value) - { - margin = value; - InvokeOnCompositionStateChanged(); - } - } - Margin GuiGraphicsComposition::GetInternalMargin() { return internalMargin; @@ -3944,6 +3893,11 @@ GuiGraphicsComposition void GuiGraphicsComposition::SetInternalMargin(Margin value) { + if (value.left < 0) value.left = 0; + if (value.top < 0) value.top = 0; + if (value.right < 0) value.right = 0; + if (value.bottom < 0) value.bottom = 0; + if (internalMargin != value) { internalMargin = value; @@ -3958,130 +3912,30 @@ GuiGraphicsComposition void GuiGraphicsComposition::SetPreferredMinSize(Size value) { + if (value.x < 0) value.x = 0; + if (value.y < 0) value.y = 0; + if (preferredMinSize != value) { preferredMinSize = value; InvokeOnCompositionStateChanged(); } } - - Rect GuiGraphicsComposition::GetClientArea() - { - Rect bounds=GetBounds(); - bounds.x1+=margin.left+internalMargin.left; - bounds.y1+=margin.top+internalMargin.top; - bounds.x2-=margin.right+internalMargin.right; - bounds.y2-=margin.bottom+internalMargin.bottom; - return bounds; - } - - void GuiGraphicsComposition::ForceCalculateSizeImmediately() - { - isRendering = true; - for (vint i = 0; i < children.Count(); i++) - { - children[i]->ForceCalculateSizeImmediately(); - } - isRendering = false; - InvokeOnCompositionStateChanged(); - } - - Size GuiGraphicsComposition::GetMinPreferredClientSize() - { - return GetMinPreferredClientSizeInternal(true); - } - - Rect GuiGraphicsComposition::GetPreferredBounds() - { - return GetPreferredBoundsInternal(true); - } + } + } +} /*********************************************************************** -GuiGraphicsSite +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITION_HELPERS.CPP ***********************************************************************/ - Rect GuiGraphicsSite::GetBoundsInternal(Rect expectedBounds, bool considerPreferredMinSize) - { - Size minSize = GetMinPreferredClientSizeInternal(considerPreferredMinSize); - if (considerPreferredMinSize) - { - if (minSize.x < preferredMinSize.x) minSize.x = preferredMinSize.x; - if (minSize.y < preferredMinSize.y) minSize.y = preferredMinSize.y; - } - - minSize.x += margin.left + margin.right + internalMargin.left + internalMargin.right; - minSize.y += margin.top + margin.bottom + internalMargin.top + internalMargin.bottom; - vint w = expectedBounds.Width(); - vint h = expectedBounds.Height(); - if (minSize.x < w) minSize.x = w; - if (minSize.y < h) minSize.y = h; - return Rect(expectedBounds.LeftTop(), minSize); - } - - void GuiGraphicsSite::UpdatePreviousBounds(Rect bounds) - { - if (previousBounds != bounds) - { - previousBounds = bounds; - BoundsChanged.Execute(GuiEventArgs(this)); - InvokeOnCompositionStateChanged(); - } - } - - Size GuiGraphicsSite::GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) - { - Size minSize; - if (minSizeLimitation != GuiGraphicsComposition::NoLimit) - { - if (ownedElement) - { - IGuiGraphicsRenderer* renderer = ownedElement->GetRenderer(); - if (renderer) - { - minSize = renderer->GetMinSize(); - } - } - } - if (minSizeLimitation == GuiGraphicsComposition::LimitToElementAndChildren) - { - vint childCount = Children().Count(); - for (vint i = 0; i < childCount; i++) - { - GuiGraphicsComposition* child = children[i]; - if (child->IsSizeAffectParent()) - { - Rect childBounds = InvokeGetPreferredBoundsInternal(child, considerPreferredMinSize); - if (minSize.x < childBounds.x2) minSize.x = childBounds.x2; - if (minSize.y < childBounds.y2) minSize.y = childBounds.y2; - } - } - } - return minSize; - } - - Rect GuiGraphicsSite::GetPreferredBoundsInternal(bool considerPreferredMinSize) - { - return GetBoundsInternal(Rect(Point(0, 0), GetMinPreferredClientSize()), considerPreferredMinSize); - } - - GuiGraphicsSite::GuiGraphicsSite() - { - BoundsChanged.SetAssociatedComposition(this); - } - - GuiGraphicsSite::~GuiGraphicsSite() - { - } - - bool GuiGraphicsSite::IsSizeAffectParent() - { - return true; - } - - Rect GuiGraphicsSite::GetPreviousCalculatedBounds() - { - return previousBounds; - } +namespace vl +{ + namespace presentation + { + namespace compositions + { + using namespace controls; /*********************************************************************** Helper Functions @@ -4129,10 +3983,9 @@ Helper Functions if (!finalized) { - vint count = value->Children().Count(); - for (vint i = 0; i < count; i++) + for (auto child : value->Children()) { - NotifyFinalizeInstance(value->Children()[i]); + NotifyFinalizeInstance(child); } } } @@ -4169,6 +4022,7 @@ Helper Functions } else { + // TODO: (enumerable) foreach:reversed for (vint i = value->Children().Count() - 1; i >= 0; i--) { SafeDeleteCompositionInternal(value->Children().Get(i)); @@ -4200,6 +4054,166 @@ Helper Functions } } +/*********************************************************************** +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITION_LAYOUT.CPP +***********************************************************************/ + +namespace vl +{ + namespace presentation + { + namespace compositions + { + using namespace elements; + +/*********************************************************************** +GuiGraphicsComposition +***********************************************************************/ + + Size GuiGraphicsComposition::Layout_CalculateMinSizeHelper() + { + Size minSize; + if (minSize.x < preferredMinSize.x) minSize.x = preferredMinSize.x; + if (minSize.y < preferredMinSize.y) minSize.y = preferredMinSize.y; + + if (minSizeLimitation != GuiGraphicsComposition::NoLimit) + { + if (ownedElement) + { + IGuiGraphicsRenderer* renderer = ownedElement->GetRenderer(); + if (renderer) + { + auto elementSize = renderer->GetMinSize(); + if (minSize.x < elementSize.x) minSize.x = elementSize.x; + if (minSize.y < elementSize.y) minSize.y = elementSize.y; + } + } + } + + vint offsetW = internalMargin.left + internalMargin.right; + vint offsetH = internalMargin.top + internalMargin.bottom; + minSize.x += offsetW; + minSize.y += offsetH; + + for (auto child : children) + { + child->Layout_UpdateMinSize(); + } + + if (minSizeLimitation == GuiGraphicsComposition::LimitToElementAndChildren) + { + for (auto child : children) + { + Size minClientSize = child->Layout_CalculateMinClientSizeForParent(internalMargin); + Size minBoundsSize(minClientSize.x + offsetW, minClientSize.y + offsetH); + if (minSize.x < minBoundsSize.x) minSize.x = minBoundsSize.x; + if (minSize.y < minBoundsSize.y) minSize.y = minBoundsSize.y; + } + } + return minSize; + } + + void GuiGraphicsComposition::Layout_SetCachedMinSize(Size value) + { + if (value.x < 0) value.x = 0; + if (value.y < 0) value.y = 0; + + if (cachedMinSize != value) + { + cachedMinSize = value; + CachedMinSizeChanged.Execute(GuiEventArgs(this)); + InvokeOnCompositionStateChanged(); + } + } + + void GuiGraphicsComposition::Layout_SetCachedBounds(Rect value) + { + if (value.x2 < value.x1) value.x2 = value.x1; + if (value.y2 < value.y1) value.y2 = value.y1; + + if (cachedBounds != value) + { + cachedBounds = value; + CachedBoundsChanged.Execute(GuiEventArgs(this)); + InvokeOnCompositionStateChanged(); + } + } + + void GuiGraphicsComposition::Layout_UpdateMinSize() + { + Layout_SetCachedMinSize(Layout_CalculateMinSize()); + } + + void GuiGraphicsComposition::Layout_UpdateBounds(Size parentSize) + { + Layout_SetCachedBounds(Layout_CalculateBounds(parentSize)); + for (auto child : children) + { + child->Layout_UpdateBounds(cachedBounds.GetSize()); + } + } + + Size GuiGraphicsComposition::GetCachedMinSize() + { + return cachedMinSize; + } + + Size GuiGraphicsComposition::GetCachedMinClientSize() + { + auto minSize = cachedMinSize; + minSize.x -= internalMargin.left + internalMargin.right; + minSize.y -= internalMargin.top + internalMargin.bottom; + return minSize; + } + + Rect GuiGraphicsComposition::GetCachedBounds() + { + return cachedBounds; + } + + Rect GuiGraphicsComposition::GetCachedClientArea() + { + Rect bounds = cachedBounds; + bounds.x1 += internalMargin.left; + bounds.y1 += internalMargin.top; + bounds.x2 -= internalMargin.right; + bounds.y2 -= internalMargin.bottom; + if (bounds.x2 < bounds.x1) bounds.x2 = bounds.x1; + if (bounds.y2 < bounds.y1) bounds.y2 = bounds.y1; + return bounds; + } + + Rect GuiGraphicsComposition::GetGlobalBounds() + { + Rect bounds = cachedBounds; + GuiGraphicsComposition* composition = parent; + while (composition) + { + Rect clientArea = composition->GetCachedClientArea(); + bounds.x1 += clientArea.x1; + bounds.x2 += clientArea.x1; + bounds.y1 += clientArea.y1; + bounds.y2 += clientArea.y1; + composition = composition->parent; + } + return bounds; + } + + void GuiGraphicsComposition::ForceCalculateSizeImmediately() + { + Size parentSize; + if (parent) + { + parentSize = parent->cachedBounds.GetSize(); + } + + Layout_UpdateMinSize(); + Layout_UpdateBounds(parentSize); + } + } + } +} + /*********************************************************************** .\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSEVENTRECEIVER.CPP ***********************************************************************/ @@ -4255,6 +4269,37 @@ Event Receiver } } +/*********************************************************************** +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSWINDOWCOMPOSITION.CPP +***********************************************************************/ + +namespace vl +{ + namespace presentation + { + namespace compositions + { + +/*********************************************************************** +GuiWindowComposition +***********************************************************************/ + + Rect GuiWindowComposition::Layout_CalculateBounds(Size parentSize) + { + Rect bounds; + if (relatedHostRecord) + { + if (auto window = relatedHostRecord->host->GetNativeWindow()) + { + bounds = Rect(Point(0, 0), window->Convert(window->GetClientSize())); + } + } + return bounds; + } + } + } +} + /*********************************************************************** .\APPLICATION\GRAPHICSHOST\GUIGRAPHICSHOST.CPP ***********************************************************************/ @@ -4288,6 +4333,7 @@ GuiGraphicsTimerManager void GuiGraphicsTimerManager::Play() { + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = callbacks.Count() - 1; i >= 0; i--) { auto callback = callbacks[i]; @@ -4311,6 +4357,7 @@ GuiGraphicsHost void GuiGraphicsHost::DisconnectCompositionInternal(GuiGraphicsComposition* composition) { + // TODO: (enumerable) foreach for(vint i=0;iChildren().Count();i++) { DisconnectCompositionInternal(composition->Children().Get(i)); @@ -4367,6 +4414,7 @@ GuiGraphicsHost GuiCharEventArgs arguments(composition); (NativeWindowCharInfo&)arguments=info; + // TODO: (enumerable) foreach:reversed for(vint i=compositions.Count()-1;i>=0;i--) { compositions[i]->GetEventReceiver()->previewCharInput.Execute(arguments); @@ -4376,6 +4424,7 @@ GuiGraphicsHost } } + // TODO: (enumerable) foreach for(vint i=0;iGetEventReceiver()->*eventReceiverEvent).Execute(arguments); @@ -4404,6 +4453,7 @@ GuiGraphicsHost GuiKeyEventArgs arguments(composition); (NativeWindowKeyInfo&)arguments = info; + // TODO: (enumerable) foreach:reversed for (vint i = compositions.Count() - 1; i >= 0; i--) { compositions[i]->GetEventReceiver()->previewKey.Execute(arguments); @@ -4413,6 +4463,7 @@ GuiGraphicsHost } } + // TODO: (enumerable) foreach for (vint i = 0; i < compositions.Count(); i++) { (compositions[i]->GetEventReceiver()->*eventReceiverEvent).Execute(arguments); @@ -4449,9 +4500,9 @@ GuiGraphicsHost GuiGraphicsComposition* parent=composition->GetParent(); if(parent) { - Rect parentBounds=parent->GetBounds(); - Rect clientArea=parent->GetClientArea(); - Rect childBounds=composition->GetBounds(); + Rect parentBounds=parent->GetCachedBounds(); + Rect clientArea=parent->GetCachedClientArea(); + Rect childBounds=composition->GetCachedBounds(); x+=childBounds.x1+(clientArea.x1-parentBounds.x1); y+=childBounds.y1+(clientArea.y1-parentBounds.y1); @@ -4531,7 +4582,7 @@ GuiGraphicsHost void GuiGraphicsHost::Moving(NativeRect& bounds, bool fixSizeOnly, bool draggingBorder) { NativeRect oldBounds = hostRecord.nativeWindow->GetBounds(); - minSize = windowComposition->GetPreferredBounds().GetSize(); + minSize = windowComposition->GetCachedMinSize(); NativeSize minWindowSize = hostRecord.nativeWindow->Convert(minSize) + (oldBounds.GetSize() - hostRecord.nativeWindow->GetClientSize()); if (bounds.Width() < minWindowSize.x) { @@ -4577,7 +4628,9 @@ GuiGraphicsHost if (previousClientSize != size) { previousClientSize = size; - minSize = windowComposition->GetPreferredBounds().GetSize(); + windowComposition->Layout_UpdateMinSize(); + windowComposition->Layout_UpdateBounds(hostRecord.nativeWindow->Convert(size)); + minSize = windowComposition->GetCachedMinSize(); needRender = true; } } @@ -4678,6 +4731,7 @@ GuiGraphicsHost } vint firstDifferentIndex = mouseEnterCompositions.Count(); + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < mouseEnterCompositions.Count(); i++) { if (i == newCompositions.Count()) @@ -4692,6 +4746,7 @@ GuiGraphicsHost } } + // TODO: (enumerable) foreach:reversed Linq:Take for (vint i = mouseEnterCompositions.Count() - 1; i >= firstDifferentIndex; i--) { GuiGraphicsComposition* composition = mouseEnterCompositions[i]; @@ -4702,6 +4757,7 @@ GuiGraphicsHost } CopyFrom(mouseEnterCompositions, newCompositions); + // TODO: (enumerable) foreach Linq:Skip for (vint i = firstDifferentIndex; i < mouseEnterCompositions.Count(); i++) { GuiGraphicsComposition* composition = mouseEnterCompositions[i]; @@ -4734,6 +4790,7 @@ GuiGraphicsHost void GuiGraphicsHost::MouseLeaved() { + // TODO: (enumerable) foreach:reversed for(vint i=mouseEnterCompositions.Count()-1;i>=0;i--) { GuiGraphicsComposition* composition=mouseEnterCompositions[i]; @@ -4883,11 +4940,13 @@ GuiGraphicsHost default: { supressPaint = true; - auto bounds = windowComposition->GetBounds(); - auto preferred = windowComposition->GetPreferredBounds(); - auto width = bounds.Width() > preferred.Width() ? bounds.Width() : preferred.Width(); - auto height = bounds.Height() > preferred.Height() ? bounds.Height() : preferred.Height(); - controlHost->UpdateClientSizeAfterRendering(preferred.GetSize(), Size(width, height)); + auto bounds = windowComposition->GetCachedBounds(); + windowComposition->Layout_UpdateMinSize(); + auto preferred = windowComposition->GetCachedMinSize(); + auto width = bounds.Width() > preferred.x ? bounds.Width() : preferred.x; + auto height = bounds.Height() > preferred.y ? bounds.Height() : preferred.y; + controlHost->UpdateClientSizeAfterRendering(preferred, Size(width, height)); + windowComposition->Layout_UpdateBounds({ width,height }); supressPaint = false; } } @@ -4899,6 +4958,7 @@ GuiGraphicsHost ProcList procs; CopyFrom(procs, afterRenderProcs); afterRenderProcs.Clear(); + // TODO: (enumerable) foreach for (vint i = 0; i < procs.Count(); i++) { procs[i](); @@ -4908,6 +4968,7 @@ GuiGraphicsHost ProcMap procs; CopyFrom(procs, afterRenderKeyedProcs); afterRenderKeyedProcs.Clear(); + // TODO: (enumerable) foreach for (vint i = 0; i < procs.Count(); i++) { procs.Values()[i](); @@ -4966,7 +5027,7 @@ GuiGraphicsHost _nativeWindow->InstallListener(this); GetCurrentController()->CallbackService()->InstallListener(this); previousClientSize = _nativeWindow->GetClientSize(); - minSize = windowComposition->GetPreferredBounds().GetSize(); + minSize = windowComposition->GetCachedMinSize(); _nativeWindow->SetCaretPoint(_nativeWindow->Convert(caretPoint)); needRender = true; } @@ -5018,6 +5079,10 @@ GuiGraphicsHost { return false; } + if(focusedComposition == composition) + { + return true; + } if(focusedComposition && focusedComposition->HasEventReceiver()) { GuiEventArgs arguments; @@ -5281,6 +5346,7 @@ GuiAltActionManager { if (currentAltHost) { + // TODO: (enumerable) foreach on group (key, value[]) vint count = actions.Count(); for (vint i = 0; i < count; i++) { @@ -5324,6 +5390,7 @@ GuiAltActionManager } } + // TODO: (enumerable) foreach on dictionary count = currentActiveAltActions.Count(); auto window = dynamic_cast(currentAltHost->GetAltComposition()->GetRelatedControlHost()); for (vint i = 0; i < count; i++) @@ -5347,6 +5414,7 @@ GuiAltActionManager vint GuiAltActionManager::FilterTitles() { + // TODO: (enumerable) foreach on dictionary vint count = currentActiveAltTitles.Count(); vint visibles = 0; for (vint i = 0; i < count; i++) @@ -5715,6 +5783,7 @@ GuiTabActionManager void InsertPrioritized(List& controls, vint index, Group& prioritized) { + // TODO: (enumerable) Linq:SelectMany vint count = prioritized.Count(); for (vint i = 0; i < count; i++) { @@ -5737,6 +5806,7 @@ GuiTabActionManager InsertPrioritized(controlsInOrder, 0, prioritized); } + // TODO: (enumerable) foreach for (vint i = 0; i < controlsInOrder.Count(); i++) { Group prioritized; @@ -6094,6 +6164,7 @@ GuiSelectableButton::GroupController GuiSelectableButton::GroupController::~GroupController() { + // TODO: (enumerable) foreach:reversed for(vint i=buttons.Count()-1;i>=0;i--) { buttons[i]->SetGroupController(0); @@ -6131,6 +6202,7 @@ GuiSelectableButton::MutexGroupController if(!suppress) { suppress=true; + // TODO: (enumerable) foreach for(vint i=0;iSetSelected(buttons[i]==button); @@ -6485,13 +6557,13 @@ GuiScrollView } ct->GetEventReceiver()->horizontalWheel.Detach(hWheelHandler); ct->GetEventReceiver()->verticalWheel.Detach(vWheelHandler); - ct->BoundsChanged.Detach(containerBoundsChangedHandler); + ct->CachedBoundsChanged.Detach(containerCachedBoundsChangedHandler); hScrollHandler = nullptr; vScrollHandler = nullptr; hWheelHandler = nullptr; vWheelHandler = nullptr; - containerBoundsChangedHandler = nullptr; + containerCachedBoundsChangedHandler = nullptr; supressScrolling = false; } @@ -6508,7 +6580,7 @@ GuiScrollView } hWheelHandler = ct->GetEventReceiver()->horizontalWheel.AttachMethod(this, &GuiScrollView::OnHorizontalWheel); vWheelHandler = ct->GetEventReceiver()->verticalWheel.AttachMethod(this, &GuiScrollView::OnVerticalWheel); - containerBoundsChangedHandler = ct->BoundsChanged.AttachMethod(this, &GuiScrollView::OnContainerBoundsChanged); + containerCachedBoundsChangedHandler = ct->CachedBoundsChanged.AttachMethod(this, &GuiScrollView::OnContainerCachedBoundsChanged); CalculateView(); } @@ -6518,7 +6590,7 @@ GuiScrollView CalculateView(); } - void GuiScrollView::OnContainerBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiScrollView::OnContainerCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { CalculateView(); } @@ -6584,7 +6656,7 @@ GuiScrollView auto ct = TypedControlTemplateObject(true); auto hScroll = ct->GetHorizontalScroll(); auto vScroll = ct->GetVerticalScroll(); - Size viewSize = ct->GetContainerComposition()->GetBounds().GetSize(); + Size viewSize = ct->GetContainerComposition()->GetCachedBounds().GetSize(); auto hVisible = hScroll ? hScroll->GetVisible() : false; auto vVisible = vScroll ? vScroll->GetVisible() : false; @@ -6631,7 +6703,7 @@ GuiScrollView GuiScrollView::GuiScrollView(theme::ThemeName themeName) :GuiControl(themeName) { - containerComposition->BoundsChanged.AttachMethod(this, &GuiScrollView::OnContainerBoundsChanged); + containerComposition->CachedBoundsChanged.AttachMethod(this, &GuiScrollView::OnContainerCachedBoundsChanged); } vint GuiScrollView::GetSmallMove() @@ -6709,7 +6781,7 @@ GuiScrollView Size GuiScrollView::GetViewSize() { - Size viewSize = TypedControlTemplateObject(true)->GetContainerComposition()->GetBounds().GetSize(); + Size viewSize = TypedControlTemplateObject(true)->GetContainerComposition()->GetCachedBounds().GetSize(); return viewSize; } @@ -6783,13 +6855,13 @@ GuiScrollContainer Size GuiScrollContainer::QueryFullSize() { - return containerComposition->GetBounds().GetSize(); + return containerComposition->GetCachedBounds().GetSize(); } void GuiScrollContainer::UpdateView(Rect viewBounds) { auto leftTop = Point(-viewBounds.x1, -viewBounds.y1); - containerComposition->SetBounds(Rect(leftTop, Size(0, 0))); + containerComposition->SetExpectedBounds(Rect(leftTop, Size(0, 0))); } GuiScrollContainer::GuiScrollContainer(theme::ThemeName themeName) @@ -7944,6 +8016,7 @@ DataMultipleFilter void DataMultipleFilter::SetCallback(IDataProcessorCallback* value) { DataFilterBase::SetCallback(value); + // TODO: (enumerable) foreach for (vint i = 0; i < filters.Count(); i++) { filters[i]->SetCallback(value); @@ -8698,6 +8771,7 @@ DataProvider currentSorter = nullptr; } + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < columns.Count(); i++) { columns[i]->sortingState = @@ -8712,6 +8786,7 @@ DataProvider vint DataProvider::GetSortedColumn() { + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < columns.Count(); i++) { auto state = columns[i]->sortingState; @@ -8725,6 +8800,7 @@ DataProvider bool DataProvider::IsSortOrderAscending() { + // TODO: (enumerable) foreach for (vint i = 0; i < columns.Count(); i++) { auto state = columns[i]->sortingState; @@ -9191,6 +9267,7 @@ GuiBindableListView::ItemSource void GuiBindableListView::ItemSource::NotifyAllColumnsUpdate() { + // TODO: (enumerable) foreach for (vint i = 0; i < columnItemViewCallbacks.Count(); i++) { columnItemViewCallbacks[i]->OnColumnChanged(); @@ -9845,10 +9922,10 @@ GuiComboBoxBase return IGuiMenuService::Horizontal; } - void GuiComboBoxBase::OnBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiComboBoxBase::OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { Size size=GetPreferredMenuClientSize(); - size.x=boundsComposition->GetBounds().Width(); + size.x=boundsComposition->GetCachedBounds().Width(); SetPreferredMenuClientSize(size); } @@ -9858,7 +9935,7 @@ GuiComboBoxBase CreateSubMenu(); SetCascadeAction(false); - boundsComposition->BoundsChanged.AttachMethod(this, &GuiComboBoxBase::OnBoundsChanged); + boundsComposition->CachedBoundsChanged.AttachMethod(this, &GuiComboBoxBase::OnCachedBoundsChanged); } GuiComboBoxBase::~GuiComboBoxBase() @@ -9968,7 +10045,7 @@ GuiComboBoxListControl Size adoptedSize = containedListControl->GetAdoptedSize(expectedSize); Size clientSize = GetPreferredMenuClientSize(); - vint height = adoptedSize.y + subMenu->GetClientSize().y - containedListControl->GetBoundsComposition()->GetBounds().Height(); + vint height = adoptedSize.y + subMenu->GetClientSize().y - containedListControl->GetBoundsComposition()->GetCachedBounds().Height(); if (clientSize.y != height) { clientSize.y = height; @@ -10013,7 +10090,7 @@ GuiComboBoxListControl AdoptSubMenuSize(); } - void GuiComboBoxListControl::OnListControlBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiComboBoxListControl::OnListControlCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { auto flag = GetDisposedFlag(); GetApplication()->InvokeLambdaInMainThread(GetRelatedControlHost(), [=]() @@ -10083,7 +10160,7 @@ GuiComboBoxListControl containedListControl->AdoptedSizeInvalidated.AttachMethod(this, &GuiComboBoxListControl::OnListControlAdoptedSizeInvalidated); containedListControl->ItemLeftButtonDown.AttachMethod(this, &GuiComboBoxListControl::OnListControlItemMouseDown); containedListControl->ItemRightButtonDown.AttachMethod(this, &GuiComboBoxListControl::OnListControlItemMouseDown); - boundsChangedHandler = containedListControl->GetBoundsComposition()->BoundsChanged.AttachMethod(this, &GuiComboBoxListControl::OnListControlBoundsChanged); + boundsChangedHandler = containedListControl->GetBoundsComposition()->CachedBoundsChanged.AttachMethod(this, &GuiComboBoxListControl::OnListControlCachedBoundsChanged); boundsComposition->GetEventReceiver()->keyDown.AttachMethod(this, &GuiComboBoxListControl::OnKeyDown); auto itemProvider = containedListControl->GetItemProvider(); @@ -10098,7 +10175,7 @@ GuiComboBoxListControl GuiComboBoxListControl::~GuiComboBoxListControl() { containedListControl->GetItemProvider()->DetachCallback(this); - containedListControl->GetBoundsComposition()->BoundsChanged.Detach(boundsChangedHandler); + containedListControl->GetBoundsComposition()->CachedBoundsChanged.Detach(boundsChangedHandler); boundsChangedHandler = nullptr; } @@ -10310,6 +10387,7 @@ DefaultDataGridItemTemplate DefaultListViewItemTemplate::OnInitialize(); { textTable = new GuiTableComposition; + textTable->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); textTable->SetAlignmentToParent(Margin(0, 0, 0, 0)); textTable->SetRowsAndColumns(1, 1); textTable->SetRowOption(0, GuiCellOption::MinSizeOption()); @@ -10345,6 +10423,7 @@ DefaultDataGridItemTemplate cell->AddChild(composition); } + // TODO: (enumerable) foreach for (vint i = 0; i < dataVisualizers.Count(); i++) { dataVisualizers[i]->BeforeVisualizeCell(dataGrid->GetItemProvider(), itemIndex, i); @@ -10446,7 +10525,6 @@ DefaultDataGridItemTemplate { textTable->SetColumnOption(i, GuiCellOption::AbsoluteOption(dataGrid->columnItemView->GetColumnSize(i))); } - textTable->UpdateCellBounds(); } } @@ -11181,12 +11259,16 @@ MainColumnVisualizerTemplate GuiCellComposition* cell = new GuiCellComposition; table->AddChild(cell); cell->SetSite(0, 1, 3, 1); - cell->SetMargin(Margin(0, 0, 8, 0)); + + auto textBounds = new GuiBoundsComposition; + cell->AddChild(textBounds); + textBounds->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement); + textBounds->SetAlignmentToParent(Margin(0, 0, 8, 0)); text = GuiSolidLabelElement::Create(); text->SetAlignments(Alignment::Left, Alignment::Center); text->SetEllipse(true); - cell->SetOwnedElement(Ptr(text)); + textBounds->SetOwnedElement(Ptr(text)); } table->SetAlignmentToParent(Margin(0, 0, 0, 0)); @@ -11229,13 +11311,18 @@ SubColumnVisualizerTemplate void SubColumnVisualizerTemplate::Initialize(bool fixTextColor) { + + SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); + + auto textBounds = new GuiBoundsComposition; + AddChild(textBounds); + textBounds->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement); + textBounds->SetAlignmentToParent(Margin(8, 0, 8, 0)); + text = GuiSolidLabelElement::Create(); text->SetVerticalAlignment(Alignment::Center); text->SetEllipse(true); - - SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); - SetMargin(Margin(8, 0, 8, 0)); - SetOwnedElement(Ptr(text)); + textBounds->SetOwnedElement(Ptr(text)); TextChanged.AttachMethod(this, &SubColumnVisualizerTemplate::OnTextChanged); FontChanged.AttachMethod(this, &SubColumnVisualizerTemplate::OnFontChanged); @@ -11480,6 +11567,7 @@ RangedItemArrangerBase startIndex = 0; if (callback) { + // TODO: (enumerable) foreach for (vint i = 0; i < visibleStyles.Count(); i++) { DeleteStyle(visibleStyles[i]); @@ -11521,6 +11609,7 @@ RangedItemArrangerBase } vint newEndIndex = newStartIndex + newVisibleStyles.Count() - 1; + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < visibleStyles.Count(); i++) { vint index = startIndex + i; @@ -11543,6 +11632,7 @@ RangedItemArrangerBase { vint newStartIndex = startIndex; BeginPlaceItem(false, viewBounds, newStartIndex); + // TODO: (enumerable) foreach for (vint i = 0; i < visibleStyles.Count(); i++) { auto style = visibleStyles[i]; @@ -11634,6 +11724,7 @@ RangedItemArrangerBase } visibleStyles.RemoveRange(0, visibleCount); + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < visibleStyles.Count(); i++) { visibleStyles[i].key->SetIndex(startIndex + i); @@ -11698,6 +11789,7 @@ RangedItemArrangerBase vint RangedItemArrangerBase::GetVisibleIndex(GuiListControl::ItemStyle* style) { + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < visibleStyles.Count(); i++) { if (visibleStyles[i].key == style) @@ -11755,6 +11847,7 @@ FreeHeightItemArranger EnsureOffsetForItem(heights.Count() - 1); if (forMoving) { + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < heights.Count(); i++) { if (offsets[i] + heights[i] >= newBounds.Top()) @@ -12369,9 +12462,13 @@ FixedHeightMultiColumnItemArranger void FixedHeightMultiColumnItemArranger::CalculateRange(vint itemHeight, Rect bounds, vint& rows, vint& startColumn) { - rows = bounds.Height() / itemHeight; + vint w = bounds.Width(); + vint h = bounds.Height(); + if (w <= 0) w = 1; + + rows = h / itemHeight; if (rows < 1) rows = 1; - startColumn = bounds.Left() / bounds.Width(); + startColumn = bounds.Left() / w; } void FixedHeightMultiColumnItemArranger::BeginPlaceItem(bool forMoving, Rect newBounds, vint& newStartIndex) @@ -12380,10 +12477,14 @@ FixedHeightMultiColumnItemArranger pi_totalWidth = 0; if (forMoving) { + vint w = newBounds.Width(); + vint h = newBounds.Height(); + if (w <= 0) w = 1; + pim_itemHeight = itemHeight; - vint rows = newBounds.Height() / itemHeight; + vint rows = h / itemHeight; if (rows < 1) rows = 1; - vint columns = newBounds.Left() / newBounds.Width(); + vint columns = newBounds.Left() / w; newStartIndex = rows * columns; } } @@ -12442,7 +12543,6 @@ FixedHeightMultiColumnItemArranger } FixedHeightMultiColumnItemArranger::FixedHeightMultiColumnItemArranger() - :itemHeight(1) { } @@ -12585,7 +12685,7 @@ GuiListControl::ItemCallback Ptr GuiListControl::ItemCallback::InstallStyle(ItemStyle* style, vint itemIndex, compositions::GuiBoundsComposition* itemComposition) { - auto handler = style->BoundsChanged.AttachMethod(this, &ItemCallback::OnStyleBoundsChanged); + auto handler = style->CachedBoundsChanged.AttachMethod(this, &ItemCallback::OnStyleCachedBoundsChanged); listControl->GetContainerComposition()->AddChild(itemComposition ? itemComposition : style); listControl->OnStyleInstalled(itemIndex, style); return handler; @@ -12597,11 +12697,11 @@ GuiListControl::ItemCallback auto handler = installedStyles.Values()[index]; listControl->OnStyleUninstalled(style); listControl->GetContainerComposition()->RemoveChild(style); - style->BoundsChanged.Detach(handler); + style->CachedBoundsChanged.Detach(handler); return style; } - void GuiListControl::ItemCallback::OnStyleBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiListControl::ItemCallback::OnStyleCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { listControl->CalculateView(); } @@ -12618,6 +12718,7 @@ GuiListControl::ItemCallback void GuiListControl::ItemCallback::ClearCache() { + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < installedStyles.Count(); i++) { auto style = UninstallStyle(i); @@ -12667,7 +12768,7 @@ GuiListControl::ItemCallback Size GuiListControl::ItemCallback::GetStylePreferredSize(compositions::GuiBoundsComposition* style) { - Size size = style->GetPreferredBounds().GetSize(); + Size size = style->GetCachedMinSize(); return listControl->axis->RealSizeToVirtualSize(size); } @@ -12679,14 +12780,14 @@ GuiListControl::ItemCallback Rect GuiListControl::ItemCallback::GetStyleBounds(compositions::GuiBoundsComposition* style) { - Rect bounds = style->GetBounds(); + Rect bounds = style->GetCachedBounds(); return listControl->axis->RealRectToVirtualRect(listControl->GetViewSize(), bounds); } void GuiListControl::ItemCallback::SetStyleBounds(compositions::GuiBoundsComposition* style, Rect bounds) { Rect newBounds = listControl->axis->VirtualRectToRealRect(listControl->GetViewSize(), bounds); - return style->SetBounds(newBounds); + return style->SetExpectedBounds(newBounds); } compositions::GuiGraphicsComposition* GuiListControl::ItemCallback::GetContainerComposition() @@ -12813,7 +12914,7 @@ GuiListControl } } - void GuiListControl::OnClientBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiListControl::OnClientCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { auto args = GetNotifyEventArguments(); AdoptedSizeInvalidated.Execute(args); @@ -12944,7 +13045,7 @@ GuiListControl { ContextChanged.AttachMethod(this, &GuiListControl::OnContextChanged); VisuallyEnabledChanged.AttachMethod(this, &GuiListControl::OnVisuallyEnabledChanged); - containerComposition->BoundsChanged.AttachMethod(this, &GuiListControl::OnClientBoundsChanged); + containerComposition->CachedBoundsChanged.AttachMethod(this, &GuiListControl::OnClientCachedBoundsChanged); ItemTemplateChanged.SetAssociatedComposition(boundsComposition); ArrangerChanged.SetAssociatedComposition(boundsComposition); @@ -13058,8 +13159,8 @@ GuiListControl { if (itemArranger) { - Size controlSize = boundsComposition->GetPreviousCalculatedBounds().GetSize(); - Size viewSize = containerComposition->GetPreviousCalculatedBounds().GetSize(); + Size controlSize = boundsComposition->GetCachedBounds().GetSize(); + Size viewSize = containerComposition->GetCachedBounds().GetSize(); vint x = controlSize.x - viewSize.x; vint y = controlSize.y - viewSize.y; @@ -13405,6 +13506,8 @@ GuiSelectableListControl if(selectedItems.Count()>0) { selectedItems.Clear(); + selectedItemIndexStart = -1; + selectedItemIndexEnd = -1; OnItemSelectionCleared(); NotifySelectionChanged(); } @@ -13421,6 +13524,7 @@ ItemProviderBase { CHECK_ERROR(!callingOnItemModified, L"ItemProviderBase::InvokeOnItemModified(vint, vint, vint)#Canning modify the observable data source during its item modified event, which will cause this event to be executed recursively."); callingOnItemModified = true; + // TODO: (enumerable) foreach for (vint i = 0; i < callbacks.Count(); i++) { callbacks[i]->OnItemModified(start, count, newCount); @@ -13434,6 +13538,7 @@ ItemProviderBase ItemProviderBase::~ItemProviderBase() { + // TODO: (enumerable) foreach for(vint i=0;iOnAttached(0); @@ -13611,10 +13716,10 @@ ListViewColumnItemArranger listView->ColumnClicked.Execute(args); } - void ListViewColumnItemArranger::ColumnBoundsChanged(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void ListViewColumnItemArranger::ColumnCachedBoundsChanged(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { GuiBoundsComposition* buttonBounds=columnHeaderButtons[index]->GetBoundsComposition(); - vint size=buttonBounds->GetBounds().Width(); + vint size=buttonBounds->GetCachedBounds().Width(); if(size>columnItemView->GetColumnSize(index)) { columnItemView->SetColumnSize(index, size); @@ -13650,11 +13755,11 @@ ListViewColumnItemArranger if(index!=-1) { GuiBoundsComposition* buttonBounds=columnHeaderButtons[index]->GetBoundsComposition(); - Rect bounds=buttonBounds->GetBounds(); + Rect bounds=buttonBounds->GetCachedBounds(); Rect newBounds(bounds.LeftTop(), Size(bounds.Width()+offset, bounds.Height())); - buttonBounds->SetBounds(newBounds); + buttonBounds->SetExpectedBounds(newBounds); - vint finalSize=buttonBounds->GetBounds().Width(); + vint finalSize=buttonBounds->GetCachedBounds().Width(); columnItemView->SetColumnSize(index, finalSize); } } @@ -13665,12 +13770,12 @@ ListViewColumnItemArranger FixedHeightItemArranger::RearrangeItemBounds(); vint count = columnHeaders->GetParent()->Children().Count(); columnHeaders->GetParent()->MoveChild(columnHeaders, count - 1); - columnHeaders->SetBounds(Rect(Point(-viewBounds.Left(), 0), Size(0, 0))); + columnHeaders->SetExpectedBounds(Rect(Point(-viewBounds.Left(), 0), Size(0, 0))); } vint ListViewColumnItemArranger::GetWidth() { - vint width=columnHeaders->GetBounds().Width()-SplitterWidth; + vint width=columnHeaders->GetCachedBounds().Width()-SplitterWidth; if(widthGetBounds().Height(); + return columnHeaders->GetCachedBounds().Height(); } Size ListViewColumnItemArranger::OnCalculateTotalSize() @@ -13692,6 +13797,7 @@ ListViewColumnItemArranger void ListViewColumnItemArranger::DeleteColumnButtons() { + // TODO: (enumerable) foreach:reversed for(vint i=columnHeaders->GetStackItems().Count()-1;i>=0;i--) { GuiStackItemComposition* item=columnHeaders->GetStackItems().Get(i); @@ -13719,7 +13825,7 @@ ListViewColumnItemArranger button->SetText(listViewItemView->GetColumnText(i)); button->SetSubMenu(columnItemView->GetDropdownPopup(i), false); button->SetColumnSortingState(columnItemView->GetSortingState(i)); - button->GetBoundsComposition()->SetBounds(Rect(Point(0, 0), Size(columnItemView->GetColumnSize(i), 0))); + button->GetBoundsComposition()->SetExpectedBounds(Rect(Point(0, 0), Size(columnItemView->GetColumnSize(i), 0))); } } else @@ -13748,9 +13854,9 @@ ListViewColumnItemArranger button->SetText(listViewItemView->GetColumnText(i)); button->SetSubMenu(columnItemView->GetDropdownPopup(i), false); button->SetColumnSortingState(columnItemView->GetSortingState(i)); - button->GetBoundsComposition()->SetBounds(Rect(Point(0, 0), Size(columnItemView->GetColumnSize(i), 0))); + button->GetBoundsComposition()->SetExpectedBounds(Rect(Point(0, 0), Size(columnItemView->GetColumnSize(i), 0))); button->Clicked.AttachLambda([this, i](GuiGraphicsComposition* sender, GuiEventArgs& args) { ColumnClicked(i, sender, args); }); - button->GetBoundsComposition()->BoundsChanged.AttachLambda([this, i](GuiGraphicsComposition* sender, GuiEventArgs& args) { ColumnBoundsChanged(i, sender, args); }); + button->GetBoundsComposition()->CachedBoundsChanged.AttachLambda([this, i](GuiGraphicsComposition* sender, GuiEventArgs& args) { ColumnCachedBoundsChanged(i, sender, args); }); columnHeaderButtons.Add(button); if (i > 0) { @@ -14088,6 +14194,7 @@ ListViewItemProvider void ListViewItemProvider::NotifyAllColumnsUpdate() { + // TODO: (enumerable) foreach for (vint i = 0; i < columnItemViewCallbacks.Count(); i++) { columnItemViewCallbacks[i]->OnColumnChanged(); @@ -14421,6 +14528,7 @@ BigIconListViewItemTemplate { auto table = new GuiTableComposition; AddChild(table); + table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetRowsAndColumns(2, 3); table->SetRowOption(0, GuiCellOption::MinSizeOption()); table->SetRowOption(1, GuiCellOption::MinSizeOption()); @@ -14501,6 +14609,7 @@ SmallIconListViewItemTemplate { auto table = new GuiTableComposition; AddChild(table); + table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetRowsAndColumns(3, 2); table->SetRowOption(0, GuiCellOption::PercentageOption(0.5)); table->SetRowOption(1, GuiCellOption::MinSizeOption()); @@ -14579,6 +14688,7 @@ ListListViewItemTemplate { auto table = new GuiTableComposition; AddChild(table); + table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetRowsAndColumns(3, 2); table->SetRowOption(0, GuiCellOption::PercentageOption(0.5)); table->SetRowOption(1, GuiCellOption::MinSizeOption()); @@ -14601,11 +14711,15 @@ ListListViewItemTemplate auto cell = new GuiCellComposition; table->AddChild(cell); cell->SetSite(0, 1, 3, 1); - cell->SetMargin(Margin(0, 0, 16, 0)); + + auto textBounds = new GuiBoundsComposition; + cell->AddChild(textBounds); + textBounds->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement); + textBounds->SetAlignmentToParent(Margin(0, 0, 16, 0)); text = GuiSolidLabelElement::Create(); text->SetAlignments(Alignment::Left, Alignment::Center); - cell->SetOwnedElement(Ptr(text)); + textBounds->SetOwnedElement(Ptr(text)); } } @@ -14790,6 +14904,7 @@ InformationListViewItemTemplate auto table = new GuiTableComposition; AddChild(table); + table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetRowsAndColumns(3, 3); table->SetRowOption(0, GuiCellOption::PercentageOption(0.5)); table->SetRowOption(1, GuiCellOption::MinSizeOption()); @@ -14797,7 +14912,6 @@ InformationListViewItemTemplate table->SetColumnOption(0, GuiCellOption::MinSizeOption()); table->SetColumnOption(1, GuiCellOption::PercentageOption(1.0)); table->SetColumnOption(2, GuiCellOption::MinSizeOption()); - table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetAlignmentToParent(Margin(0, 0, 0, 0)); table->SetCellPadding(4); { @@ -14871,11 +14985,11 @@ InformationListViewItemTemplate cell->SetSite(i + 1, 0, 1, 1); auto dataTable = new GuiTableComposition; + dataTable->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); dataTable->SetRowsAndColumns(1, 2); dataTable->SetRowOption(0, GuiCellOption::MinSizeOption()); dataTable->SetColumnOption(0, GuiCellOption::MinSizeOption()); dataTable->SetColumnOption(1, GuiCellOption::PercentageOption(1.0)); - dataTable->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); dataTable->SetAlignmentToParent(Margin(0, 0, 0, 0)); cell->AddChild(dataTable); { @@ -14945,6 +15059,7 @@ DetailListViewItemTemplate { textTable = new GuiTableComposition; + textTable->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); textTable->SetAlignmentToParent(Margin(0, 0, 0, 0)); textTable->SetRowsAndColumns(1, 1); textTable->SetRowOption(0, GuiCellOption::MinSizeOption()); @@ -14957,6 +15072,7 @@ DetailListViewItemTemplate auto table = new GuiTableComposition; cell->AddChild(table); + table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetRowsAndColumns(3, 2); table->SetRowOption(0, GuiCellOption::PercentageOption(0.5)); table->SetRowOption(1, GuiCellOption::MinSizeOption()); @@ -14979,12 +15095,16 @@ DetailListViewItemTemplate auto cell = new GuiCellComposition; table->AddChild(cell); cell->SetSite(0, 1, 3, 1); - cell->SetMargin(Margin(0, 0, 8, 0)); + + auto textBounds = new GuiBoundsComposition; + cell->AddChild(textBounds); + textBounds->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement); + textBounds->SetAlignmentToParent(Margin(0, 0, 8, 0)); text = GuiSolidLabelElement::Create(); text->SetAlignments(Alignment::Left, Alignment::Center); text->SetEllipse(true); - cell->SetOwnedElement(Ptr(text)); + textBounds->SetOwnedElement(Ptr(text)); } } } @@ -15014,7 +15134,11 @@ DetailListViewItemTemplate auto cell = new GuiCellComposition; textTable->AddChild(cell); cell->SetSite(0, i + 1, 1, 1); - cell->SetMargin(Margin(8, 0, 8, 0)); + + auto textBounds = new GuiBoundsComposition; + cell->AddChild(textBounds); + textBounds->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElement); + textBounds->SetAlignmentToParent(Margin(8, 0, 8, 0)); subItems[i] = GuiSolidLabelElement::Create(); subItems[i]->SetAlignments(Alignment::Left, Alignment::Center); @@ -15022,7 +15146,7 @@ DetailListViewItemTemplate subItems[i]->SetEllipse(true); subItems[i]->SetText(view->GetSubItem(itemIndex, i)); subItems[i]->SetColor(listView->TypedControlTemplateObject(true)->GetSecondaryTextColor()); - cell->SetOwnedElement(Ptr(subItems[i])); + textBounds->SetOwnedElement(Ptr(subItems[i])); } OnColumnChanged(); } @@ -15048,7 +15172,6 @@ DetailListViewItemTemplate { textTable->SetColumnOption(i, GuiCellOption::AbsoluteOption(columnItemView->GetColumnSize(i))); } - textTable->UpdateCellBounds(); } } } @@ -15923,6 +16046,7 @@ NodeRootProviderBase void NodeRootProviderBase::OnBeforeItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount) { + // TODO: (enumerable) foreach for(vint i=0;iOnBeforeItemModified(parentNode, start, count, newCount); @@ -15931,6 +16055,7 @@ NodeRootProviderBase void NodeRootProviderBase::OnAfterItemModified(INodeProvider* parentNode, vint start, vint count, vint newCount) { + // TODO: (enumerable) foreach for(vint i=0;iOnAfterItemModified(parentNode, start, count, newCount); @@ -15939,6 +16064,7 @@ NodeRootProviderBase void NodeRootProviderBase::OnItemExpanded(INodeProvider* node) { + // TODO: (enumerable) foreach for(vint i=0;iOnItemExpanded(node); @@ -15947,6 +16073,7 @@ NodeRootProviderBase void NodeRootProviderBase::OnItemCollapsed(INodeProvider* node) { + // TODO: (enumerable) foreach for(vint i=0;iOnItemCollapsed(node); @@ -16466,6 +16593,7 @@ DefaultTreeItemTemplate table = new GuiTableComposition; AddChild(table); + table->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); table->SetRowsAndColumns(3, 4); table->SetRowOption(0, GuiCellOption::PercentageOption(0.5)); table->SetRowOption(1, GuiCellOption::MinSizeOption()); @@ -16824,6 +16952,7 @@ IGuiAnimationCoroutine { waitingAnimation->Pause(); } + // TODO: (enumerable) foreach on group for (vint i = 0; i < groupAnimations.Count(); i++) { for (auto animation : groupAnimations.GetByIndex(i)) @@ -16839,6 +16968,7 @@ IGuiAnimationCoroutine { waitingAnimation->Resume(); } + // TODO: (enumerable) foreach on group for (vint i = 0; i < groupAnimations.Count(); i++) { for (auto animation : groupAnimations.GetByIndex(i)) @@ -16861,6 +16991,7 @@ IGuiAnimationCoroutine } } + // TODO: (enumerable) foreach:reversed on group for (vint i = groupAnimations.Count() - 1; i >= 0; i--) { auto& animations = groupAnimations.GetByIndex(i); @@ -17099,6 +17230,7 @@ GuiCommonDatePickerLook void GuiCommonDatePickerLook::SelectDay(vint day) { + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < dateDays.Count(); i++) { const DateTime& dt = dateDays[i]; @@ -17385,8 +17517,6 @@ GuiCommonScrollViewLook { tableComposition->SetColumnOption(1, GuiCellOption::AbsoluteOption(0)); } - - tableComposition->UpdateCellBounds(); } void GuiCommonScrollViewLook::hScroll_OnVisibleChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) @@ -17415,6 +17545,7 @@ GuiCommonScrollViewLook tableComposition = new GuiTableComposition; AddChild(tableComposition); + tableComposition->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); tableComposition->SetAlignmentToParent(Margin(0, 0, 0, 0)); tableComposition->SetRowsAndColumns(2, 2); tableComposition->SetRowOption(0, GuiCellOption::PercentageOption(1.0)); @@ -17573,11 +17704,11 @@ GuiCommonScrollBehavior { if (scrollTemplate->GetVisuallyEnabled()) { - if (arguments.x < partialView->GetBounds().x1) + if (arguments.x < partialView->GetCachedBounds().x1) { scrollTemplate->GetCommands()->BigDecrease(); } - else if (arguments.x >= partialView->GetBounds().x2) + else if (arguments.x >= partialView->GetCachedBounds().x2) { scrollTemplate->GetCommands()->BigIncrease(); } @@ -17593,11 +17724,11 @@ GuiCommonScrollBehavior { if (scrollTemplate->GetVisuallyEnabled()) { - if (arguments.y < partialView->GetBounds().y1) + if (arguments.y < partialView->GetCachedBounds().y1) { scrollTemplate->GetCommands()->BigDecrease(); } - else if (arguments.y >= partialView->GetBounds().y2) + else if (arguments.y >= partialView->GetCachedBounds().y2) { scrollTemplate->GetCommands()->BigIncrease(); } @@ -17613,9 +17744,9 @@ GuiCommonScrollBehavior { if (dragging) { - auto bounds = partialView->GetParent()->GetBounds(); + auto bounds = partialView->GetParent()->GetCachedBounds(); vint totalPixels = bounds.x2 - bounds.x1; - vint currentOffset = partialView->GetBounds().x1; + vint currentOffset = partialView->GetCachedBounds().x1; vint newOffset = currentOffset + (arguments.x - location.x); SetScroll(totalPixels, newOffset); } @@ -17630,9 +17761,9 @@ GuiCommonScrollBehavior { if (dragging) { - auto bounds = partialView->GetParent()->GetBounds(); + auto bounds = partialView->GetParent()->GetCachedBounds(); vint totalPixels = bounds.y2 - bounds.y1; - vint currentOffset = partialView->GetBounds().y1; + vint currentOffset = partialView->GetCachedBounds().y1; vint newOffset = currentOffset + (arguments.y - location.y); SetScroll(totalPixels, newOffset); } @@ -17643,14 +17774,14 @@ GuiCommonScrollBehavior vint GuiCommonScrollBehavior::GetHorizontalTrackerHandlerPosition(compositions::GuiBoundsComposition* handle, vint totalSize, vint pageSize, vint position) { - vint width = handle->GetParent()->GetBounds().Width() - handle->GetBounds().Width(); + vint width = handle->GetParent()->GetCachedBounds().Width() - handle->GetCachedBounds().Width(); vint max = totalSize - pageSize; return max == 0 ? 0 : width * position / max; } vint GuiCommonScrollBehavior::GetVerticalTrackerHandlerPosition(compositions::GuiBoundsComposition* handle, vint totalSize, vint pageSize, vint position) { - vint height = handle->GetParent()->GetBounds().Height() - handle->GetBounds().Height(); + vint height = handle->GetParent()->GetCachedBounds().Height() - handle->GetCachedBounds().Height(); vint max = totalSize - pageSize; return max == 0 ? 0 : height * position / max; } @@ -18549,8 +18680,8 @@ GuiDocumentCommonInterface if (index != -1) { auto item = documentItems.Values()[index]; - auto size = item->container->GetBounds().GetSize(); - item->container->SetBounds(Rect(location.LeftTop(), Size(0, 0))); + auto size = item->container->GetCachedBounds().GetSize(); + item->container->SetExpectedBounds(Rect(location.LeftTop(), Size(0, 0))); item->visible = true; return size; } @@ -19276,7 +19407,7 @@ GuiTextBoxCommonInterface::DefaultCallback vint GuiTextBoxCommonInterface::DefaultCallback::GetPageRows() { - return textComposition->GetBounds().Height()/textElement->GetLines().GetRowHeight(); + return textComposition->GetCachedBounds().Height()/textElement->GetLines().GetRowHeight(); } bool GuiTextBoxCommonInterface::DefaultCallback::BeforeModify(TextPos start, TextPos end, const WString& originalText, WString& inputText) @@ -19353,7 +19484,7 @@ GuiTextBoxCommonInterface } Rect bounds = textElement->GetLines().GetRectFromTextPos(pos); - Rect view = Rect(textElement->GetViewPosition(), textComposition->GetBounds().GetSize()); + Rect view = Rect(textElement->GetViewPosition(), textComposition->GetCachedBounds().GetSize()); Point viewPoint = view.LeftTop(); if (view.x2 > view.x1 && view.y2 > view.y1) @@ -19389,6 +19520,7 @@ GuiTextBoxCommonInterface arguments.newBegin = newBegin; arguments.newEnd = newEnd; arguments.editVersion = editVersion; + // TODO: (enumerable) foreach for (vint i = 0; i < textEditCallbacks.Count(); i++) { textEditCallbacks[i]->TextCaretChanged(arguments); @@ -19419,6 +19551,7 @@ GuiTextBoxCommonInterface arguments.inputText=inputText; arguments.editVersion=editVersion; arguments.keyInput=asKeyInput; + // TODO: (enumerable) foreach for(vint i=0;iTextEditPreview(arguments); @@ -19452,6 +19585,7 @@ GuiTextBoxCommonInterface arguments.inputText=inputText; arguments.editVersion=editVersion; arguments.keyInput=asKeyInput; + // TODO: (enumerable) foreach for(vint i=0;iTextEditNotify(arguments); @@ -19460,6 +19594,7 @@ GuiTextBoxCommonInterface Move(end, false); + // TODO: (enumerable) foreach for(vint i=0;iTextEditFinished(editVersion); @@ -19768,6 +19903,7 @@ GuiTextBoxCommonInterface focusableComposition->GetEventReceiver()->keyDown.AttachMethod(this, &GuiTextBoxCommonInterface::OnKeyDown); focusableComposition->GetEventReceiver()->charInput.AttachMethod(this, &GuiTextBoxCommonInterface::OnCharInput); + // TODO: (enumerable) foreach for(vint i=0;iAttach(textElement, elementModifyLock, textComposition ,editVersion); @@ -19877,6 +20013,7 @@ GuiTextBoxCommonInterface undoRedoProcessor=0; } + // TODO: (enumerable) foreach for(vint i=0;iDetach(); @@ -20451,7 +20588,7 @@ GuiSinglelineTextBox::DefaultTextElementOperatorCallback newX+=marginX; vint minX=-TextMargin; - vint maxX=textElement->GetLines().GetMaxWidth()+TextMargin-textComposition->GetBounds().Width(); + vint maxX=textElement->GetLines().GetMaxWidth()+TextMargin-textComposition->GetCachedBounds().Width(); if(newX>=maxX) { newX=maxX-1; @@ -24251,9 +24388,9 @@ GuiRibbonGroup } } - void GuiRibbonGroup::OnBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiRibbonGroup::OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { - dropdownMenu->GetBoundsComposition()->SetPreferredMinSize(Size(0, containerComposition->GetBounds().Height())); + dropdownMenu->GetBoundsComposition()->SetPreferredMinSize(Size(0, containerComposition->GetCachedBounds().Height())); } void GuiRibbonGroup::OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) @@ -24344,7 +24481,7 @@ GuiRibbonGroup LargeImageChanged.SetAssociatedComposition(boundsComposition); TextChanged.AttachMethod(this, &GuiRibbonGroup::OnTextChanged); - boundsComposition->BoundsChanged.AttachMethod(this, &GuiRibbonGroup::OnBoundsChanged); + boundsComposition->CachedBoundsChanged.AttachMethod(this, &GuiRibbonGroup::OnCachedBoundsChanged); responsiveView->BeforeSwitchingView.AttachMethod(this, &GuiRibbonGroup::OnBeforeSwitchingView); dropdownButton->BeforeSubMenuOpening.AttachMethod(this, &GuiRibbonGroup::OnBeforeSubMenuOpening); } @@ -24710,6 +24847,7 @@ GuiRibbonToolstripsGroupCollection GuiRibbonToolstrips ***********************************************************************/ +// TODO: (enumerable) foreach #define ARRLEN(X) sizeof(X) / sizeof(*X) void GuiRibbonToolstrips::BeforeControlTemplateUninstalled_() @@ -24754,6 +24892,7 @@ GuiRibbonToolstrips if (groups.Count() <= count) { auto containers = viewIndex == 0 ? longContainers : shortContainers; + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < groups.Count(); i++) { containers[i]->GetToolstripItems().Add(groups[i]); @@ -24814,6 +24953,7 @@ GuiRibbonToolstrips vint minMiddle = firstGroupCount; vint maxMiddle = groups.Count() - lastGroupCount - 1; + // TODO: (enumerable) foreach:indexed for (vint j = 0; j < groups.Count(); j++) { shortContainers[ @@ -24837,6 +24977,7 @@ GuiRibbonToolstrips .Aggregate([](vint a, vint b) {return a + b; }); vint delta = abs(count2 - count1); + // TODO: (enumerable) foreach for (vint i = 0; i < groups.Count(); i++) { auto groupCount = groups[i]->GetToolstripItems().Count(); @@ -24856,6 +24997,7 @@ GuiRibbonToolstrips } } + // TODO: (enumerable) foreach:indexed for (vint j = 0; j < groups.Count(); j++) { longContainers[j < firstGroupCount ? 0 : 1]->GetToolstripItems().Add(groups[j]); @@ -24873,6 +25015,7 @@ GuiRibbonToolstrips responsiveView->BeforeSwitchingView.AttachMethod(this, &GuiRibbonToolstrips::OnBeforeSwitchingView); vint toolbarIndex = 0; + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < sizeof(views) / sizeof(*views); i++) { auto containers = i == 0 ? longContainers : shortContainers; @@ -25349,8 +25492,8 @@ GuiBindableRibbonGalleryList void GuiBindableRibbonGalleryList::UpdateLayoutSizeOffset() { - auto cSize = itemList->GetContainerComposition()->GetBounds(); - auto bSize = itemList->GetBoundsComposition()->GetBounds(); + auto cSize = itemList->GetContainerComposition()->GetCachedBounds(); + auto bSize = itemList->GetBoundsComposition()->GetCachedBounds(); layout->SetSizeOffset(Size(bSize.Width() - cSize.Width(), bSize.Height() - cSize.Height())); if (layout->GetItemWidth() > 0) @@ -25358,7 +25501,7 @@ GuiBindableRibbonGalleryList vint columns = layout->GetVisibleItemCount(); if (columns == 0) columns = 1; vint rows = (visibleItemCount + columns - 1) / columns; - vint height = (vint)(layout->GetBounds().Height()*(rows + 0.5)); + vint height = (vint)(layout->GetCachedBounds().Height()*(rows + 0.5)); groupContainer->GetBoundsComposition()->SetPreferredMinSize(Size(0, height)); } else @@ -25372,6 +25515,7 @@ GuiBindableRibbonGalleryList auto pos = IndexToGalleryPos(itemList->GetSelectedItemIndex()); if (pos.group != -1 && pos.item != -1) { + // TODO: (enumerable) foreach for (vint i = 0; i < groupedItemSource.Count(); i++) { auto group = groupedItemSource[i]; @@ -25406,13 +25550,14 @@ GuiBindableRibbonGalleryList StopPreview(arguments.itemIndex); } - void GuiBindableRibbonGalleryList::OnBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) + void GuiBindableRibbonGalleryList::OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments) { UpdateLayoutSizeOffset(); - auto bounds = boundsComposition->GetBounds(); + auto bounds = boundsComposition->GetCachedBounds(); subMenu->GetBoundsComposition()->SetPreferredMinSize(Size(bounds.Width() + 20, 1)); + // TODO: (enumerable) foreach for (vint i = 0; i < groupedItemSource.Count(); i++) { auto group = groupedItemSource[i]; @@ -25637,7 +25782,7 @@ GuiBindableRibbonGalleryList RequestedScrollUp.AttachMethod(this, &GuiBindableRibbonGalleryList::OnRequestedScrollUp); RequestedScrollDown.AttachMethod(this, &GuiBindableRibbonGalleryList::OnRequestedScrollDown); RequestedDropdown.AttachMethod(this, &GuiBindableRibbonGalleryList::OnRequestedDropdown); - boundsComposition->BoundsChanged.AttachMethod(this, &GuiBindableRibbonGalleryList::OnBoundsChanged); + boundsComposition->CachedBoundsChanged.AttachMethod(this, &GuiBindableRibbonGalleryList::OnCachedBoundsChanged); itemListArranger->UnblockScrollUpdate(); } @@ -27479,148 +27624,143 @@ namespace vl GuiFlowComposition ***********************************************************************/ - void GuiFlowComposition::UpdateFlowItemBounds(bool forceUpdate) + void GuiFlowComposition::Layout_UpdateFlowItemLayout(vint maxVirtualWidth) { - if (forceUpdate || needUpdate) + for (auto item : layout_flowItems) { - needUpdate = false; - InvokeOnCompositionStateChanged(); - - auto clientMargin = axis->RealMarginToVirtualMargin(extraMargin); - if (clientMargin.left < 0) clientMargin.left = 0; - if (clientMargin.top < 0) clientMargin.top = 0; - if (clientMargin.right < 0) clientMargin.right = 0; - if (clientMargin.bottom < 0) clientMargin.bottom = 0; - - auto realFullSize = previousBounds.GetSize(); - auto clientSize = axis->RealSizeToVirtualSize(realFullSize); - clientSize.x -= (clientMargin.left + clientMargin.right); - clientSize.y -= (clientMargin.top + clientMargin.bottom); - - flowItemBounds.Resize(flowItems.Count()); - for (vint i = 0; i < flowItems.Count(); i++) - { - flowItemBounds[i] = Rect(Point(0, 0), flowItems[i]->GetMinSize()); - } - - vint currentIndex = 0; - vint rowTop = 0; - - while (currentIndex < flowItems.Count()) - { - auto itemSize = axis->RealSizeToVirtualSize(flowItemBounds[currentIndex].GetSize()); - vint rowWidth = itemSize.x; - vint rowHeight = itemSize.y; - vint rowItemCount = 1; - - for (vint i = currentIndex + 1; i < flowItems.Count(); i++) - { - itemSize = axis->RealSizeToVirtualSize(flowItemBounds[i].GetSize()); - vint itemWidth = itemSize.x + columnPadding; - if (rowWidth + itemWidth > clientSize.x) - { - break; - } - rowWidth += itemWidth; - if (rowHeight < itemSize.y) - { - rowHeight = itemSize.y; - } - rowItemCount++; - } - - vint baseLine = 0; - Array itemBaseLines(rowItemCount); - for (vint i = 0; i < rowItemCount; i++) - { - vint index = currentIndex + i; - vint itemBaseLine = 0; - itemSize = axis->RealSizeToVirtualSize(flowItemBounds[index].GetSize()); - - auto option = flowItems[index]->GetFlowOption(); - switch (option.baseline) - { - case GuiFlowOption::FromTop: - itemBaseLine = option.distance; - break; - case GuiFlowOption::FromBottom: - itemBaseLine = itemSize.y - option.distance; - break; - case GuiFlowOption::Percentage: - itemBaseLine = (vint)(itemSize.y*option.percentage); - break; - } - - itemBaseLines[i] = itemBaseLine; - if (baseLine < itemBaseLine) - { - baseLine = itemBaseLine; - } - } - - vint rowUsedWidth = 0; - for (vint i = 0; i < rowItemCount; i++) - { - vint index = currentIndex + i; - itemSize = axis->RealSizeToVirtualSize(flowItemBounds[index].GetSize()); - - vint itemLeft = 0; - vint itemTop = rowTop + baseLine - itemBaseLines[i]; - - switch (alignment) - { - case FlowAlignment::Left: - itemLeft = rowUsedWidth + i * columnPadding; - break; - case FlowAlignment::Center: - itemLeft = rowUsedWidth + i * columnPadding + (clientSize.x - rowWidth) / 2; - break; - case FlowAlignment::Extend: - if (i == 0) - { - itemLeft = rowUsedWidth; - } - else - { - itemLeft = rowUsedWidth + (vint)((double)(clientSize.x - rowWidth) * i / (rowItemCount - 1)) + i * columnPadding; - } - break; - } - - flowItemBounds[index] = axis->VirtualRectToRealRect( - realFullSize, - Rect( - Point( - itemLeft + clientMargin.left, - itemTop + clientMargin.top - ), - itemSize - ) - ); - rowUsedWidth += itemSize.x; - } - - rowTop += rowHeight + rowPadding; - currentIndex += rowItemCount; - } - - minHeight = rowTop == 0 ? 0 : rowTop - rowPadding; + item->Layout_SetCachedMinSize(item->Layout_CalculateMinSizeHelper()); } + + if (layout_lastVirtualWidth != maxVirtualWidth) + { + layout_invalid = true; + layout_lastVirtualWidth = maxVirtualWidth; + } + + if (!layout_invalid) return; + layout_invalid = false; + + vint currentIndex = 0; + vint rowTop = 0; + + while (currentIndex < layout_flowItems.Count()) + { + auto currentItemVirtualMinSize = axis->RealSizeToVirtualSize(layout_flowItems[currentIndex]->GetCachedMinSize()); + vint rowWidth = currentItemVirtualMinSize.x; + vint rowHeight = currentItemVirtualMinSize.y; + vint rowItemCount = 1; + + for (vint i = currentIndex + 1; i < layout_flowItems.Count(); i++) + { + auto itemSize = axis->RealSizeToVirtualSize(layout_flowItems[i]->GetCachedMinSize()); + vint itemWidth = itemSize.x + columnPadding; + if (rowWidth + itemWidth > maxVirtualWidth) + { + break; + } + rowWidth += itemWidth; + if (rowHeight < itemSize.y) + { + rowHeight = itemSize.y; + } + rowItemCount++; + } + + vint baseLine = 0; + Array itemBaseLines(rowItemCount); + for (vint i = 0; i < rowItemCount; i++) + { + vint index = currentIndex + i; + vint itemBaseLine = 0; + auto itemSize = axis->RealSizeToVirtualSize(layout_flowItems[index]->GetCachedMinSize()); + + auto option = layout_flowItems[index]->GetFlowOption(); + switch (option.baseline) + { + case GuiFlowOption::FromTop: + itemBaseLine = option.distance; + break; + case GuiFlowOption::FromBottom: + itemBaseLine = itemSize.y - option.distance; + break; + case GuiFlowOption::Percentage: + itemBaseLine = (vint)(itemSize.y*option.percentage); + break; + } + + itemBaseLines[i] = itemBaseLine; + if (baseLine < itemBaseLine) + { + baseLine = itemBaseLine; + } + } + + vint rowUsedWidth = 0; + for (vint i = 0; i < rowItemCount; i++) + { + vint index = currentIndex + i; + auto itemSize = axis->RealSizeToVirtualSize(layout_flowItems[index]->GetCachedMinSize()); + + vint itemLeft = 0; + vint itemTop = rowTop + baseLine - itemBaseLines[i]; + + switch (alignment) + { + case FlowAlignment::Left: + itemLeft = rowUsedWidth + i * columnPadding; + break; + case FlowAlignment::Center: + itemLeft = rowUsedWidth + i * columnPadding + (maxVirtualWidth - rowWidth) / 2; + break; + case FlowAlignment::Right: + itemLeft = rowUsedWidth + i * columnPadding + (maxVirtualWidth - rowWidth); + break; + case FlowAlignment::Extend: + if (i == 0) + { + itemLeft = rowUsedWidth; + } + else + { + itemLeft = rowUsedWidth + (vint)((double)(maxVirtualWidth - rowWidth) * i / (rowItemCount - 1)) + i * columnPadding; + } + break; + } + + layout_flowItems[index]->layout_virtualBounds = Rect({ itemLeft,itemTop }, itemSize); + rowUsedWidth += itemSize.x; + } + + rowTop += rowHeight + rowPadding; + currentIndex += rowItemCount; + } + + layout_minVirtualHeight = rowTop == 0 ? 0 : rowTop - rowPadding; } - void GuiFlowComposition::OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments) + Size GuiFlowComposition::Layout_UpdateFlowItemLayoutByConstraint(Size constraintSize) { - UpdateFlowItemBounds(true); + Size extraSize( + extraMargin.left + extraMargin.right, + extraMargin.top + extraMargin.bottom + ); + constraintSize.x -= extraSize.x; + constraintSize.y -= extraSize.y; + if (constraintSize.x < 0) constraintSize.x = 0; + if (constraintSize.y < 0) constraintSize.y = 0; + + vint maxVirtualWidth = axis->RealSizeToVirtualSize(constraintSize).x; + Layout_UpdateFlowItemLayout(maxVirtualWidth); + return extraSize; } void GuiFlowComposition::OnChildInserted(GuiGraphicsComposition* child) { GuiBoundsComposition::OnChildInserted(child); auto item = dynamic_cast(child); - if (item && !flowItems.Contains(item)) + if (item && !layout_flowItems.Contains(item)) { - flowItems.Add(item); - needUpdate = true; + layout_flowItems.Add(item); } } @@ -27630,64 +27770,69 @@ GuiFlowComposition auto item = dynamic_cast(child); if (item) { - flowItems.Remove(item); - needUpdate = true; + layout_flowItems.Remove(item); } } - - Size GuiFlowComposition::GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) + + void GuiFlowComposition::OnCompositionStateChanged() { - Size minSize = GuiBoundsComposition::GetMinPreferredClientSizeInternal(considerPreferredMinSize); - if (GetMinSizeLimitation() == GuiGraphicsComposition::LimitToElementAndChildren) + GuiBoundsComposition::OnCompositionStateChanged(); + layout_invalid = true; + } + + Size GuiFlowComposition::Layout_CalculateMinSize() + { + Size minSize = GuiBoundsComposition::Layout_CalculateMinSize(); + + if (GetMinSizeLimitation() == GuiGraphicsComposition::LimitToElementAndChildren && layout_flowItems.Count() > 0) { - auto clientSize = axis->VirtualSizeToRealSize(Size(0, minHeight)); - for (auto item : flowItems) - { - auto itemSize = InvokeGetPreferredBoundsInternal(item, considerPreferredMinSize).GetSize(); - if (clientSize.x < itemSize.x) clientSize.x = itemSize.x; - if (clientSize.y < itemSize.y) clientSize.y = itemSize.y; - } - if (minSize.x < clientSize.x) minSize.x = clientSize.x; - if (minSize.y < clientSize.y) minSize.y = clientSize.y; + Size cachedSize = cachedBounds.GetSize(); + Size constraintSize( + minSize.x > cachedSize.x ? minSize.x : cachedSize.x, + minSize.y > cachedSize.y ? minSize.y : cachedSize.y + ); + + Size extraSize = Layout_UpdateFlowItemLayoutByConstraint(constraintSize); + Size minFlowSize = axis->VirtualSizeToRealSize(Size(0, layout_minVirtualHeight)); + minFlowSize.x += extraSize.x; + minFlowSize.y += extraSize.y; + + if (minSize.x < minFlowSize.x) minSize.x = minFlowSize.x; + if (minSize.y < minFlowSize.y) minSize.y = minFlowSize.y; } - vint x = 0; - vint y = 0; - if (extraMargin.left > 0) x += extraMargin.left; - if (extraMargin.right > 0) x += extraMargin.right; - if (extraMargin.top > 0) y += extraMargin.top; - if (extraMargin.bottom > 0) y += extraMargin.bottom; - return minSize + Size(x, y); + return minSize; } - GuiFlowComposition::GuiFlowComposition() - :axis(new GuiDefaultAxis) - { - BoundsChanged.AttachMethod(this, &GuiFlowComposition::OnBoundsChanged); - } - - GuiFlowComposition::~GuiFlowComposition() + Rect GuiFlowComposition::Layout_CalculateBounds(Size parentSize) { + Rect bounds = GuiBoundsComposition::Layout_CalculateBounds(parentSize); + Size extraSize = Layout_UpdateFlowItemLayoutByConstraint(bounds.GetSize()); + Size contentSize( + bounds.Width() - extraSize.x, + bounds.Height() - extraSize.y + ); + for (auto item : layout_flowItems) + { + item->Layout_SetFlowItemBounds(contentSize, item->layout_virtualBounds); + } + return bounds; } const GuiFlowComposition::ItemCompositionList& GuiFlowComposition::GetFlowItems() { - return flowItems; + return layout_flowItems; } bool GuiFlowComposition::InsertFlowItem(vint index, GuiFlowItemComposition* item) { - index = flowItems.Insert(index, item); - if (!AddChild(item)) + index = layout_flowItems.Insert(index, item); + if (AddChild(item)) { - flowItems.RemoveAt(index); - return false; - } - else - { - needUpdate = true; return true; } + layout_flowItems.RemoveAt(index); + return false; } @@ -27701,7 +27846,6 @@ GuiFlowComposition if (extraMargin != value) { extraMargin = value; - needUpdate = true; InvokeOnCompositionStateChanged(); } } @@ -27716,7 +27860,6 @@ GuiFlowComposition if (rowPadding != value) { rowPadding = value; - needUpdate = true; InvokeOnCompositionStateChanged(); } } @@ -27731,7 +27874,6 @@ GuiFlowComposition if (columnPadding != value) { columnPadding = value; - needUpdate = true; InvokeOnCompositionStateChanged(); } } @@ -27746,7 +27888,6 @@ GuiFlowComposition if (value) { axis = value; - needUpdate = true; InvokeOnCompositionStateChanged(); } } @@ -27761,99 +27902,44 @@ GuiFlowComposition if (alignment != value) { alignment = value; - needUpdate = true; InvokeOnCompositionStateChanged(); } } - void GuiFlowComposition::ForceCalculateSizeImmediately() - { - GuiBoundsComposition::ForceCalculateSizeImmediately(); - UpdateFlowItemBounds(true); - } - - Rect GuiFlowComposition::GetBounds() - { - if (!needUpdate) - { - for (vint i = 0; i < flowItems.Count(); i++) - { - if (flowItemBounds[i].GetSize() != flowItems[i]->GetMinSize()) - { - needUpdate = true; - break; - } - } - } - - if (needUpdate) - { - UpdateFlowItemBounds(true); - } - - bounds = GuiBoundsComposition::GetBounds(); - return bounds; - } - /*********************************************************************** GuiFlowItemComposition ***********************************************************************/ - void GuiFlowItemComposition::OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent) + void GuiFlowItemComposition::Layout_SetFlowItemBounds(Size contentSize, Rect virtualBounds) { - GuiGraphicsSite::OnParentChanged(oldParent, newParent); - flowParent = newParent == 0 ? 0 : dynamic_cast(newParent); + Rect result = layout_flowParent->axis->VirtualRectToRealRect(contentSize, virtualBounds); + + result.x1 += layout_flowParent->extraMargin.left; + result.x2 += layout_flowParent->extraMargin.left; + result.y1 += layout_flowParent->extraMargin.top; + result.y2 += layout_flowParent->extraMargin.top; + + result.x1 -= extraMargin.left; + result.y1 -= extraMargin.top; + result.x2 += extraMargin.right; + result.y2 += extraMargin.bottom; + + Layout_SetCachedBounds(result); } - Size GuiFlowItemComposition::GetMinSize() + void GuiFlowItemComposition::OnParentLineChanged() { - return GetBoundsInternal(bounds, true).GetSize(); + layout_flowParent = dynamic_cast(GetParent()); + GuiGraphicsComposition::OnParentLineChanged(); } GuiFlowItemComposition::GuiFlowItemComposition() { SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); - } - - GuiFlowItemComposition::~GuiFlowItemComposition() - { - } - - bool GuiFlowItemComposition::IsSizeAffectParent() - { - return false; - } - - Rect GuiFlowItemComposition::GetBounds() - { - Rect result = bounds; - if(flowParent) + CachedMinSizeChanged.AttachLambda([this](GuiGraphicsComposition* sender, GuiEventArgs& arguments) { - flowParent->UpdateFlowItemBounds(false); - vint index = flowParent->flowItems.IndexOf(this); - if (index != -1) - { - result = flowParent->flowItemBounds[index]; - } - - result = Rect( - result.Left() - extraMargin.left, - result.Top() - extraMargin.top, - result.Right() + extraMargin.right, - result.Bottom() + extraMargin.bottom - ); - } - UpdatePreviousBounds(result); - return result; - } - - void GuiFlowItemComposition::SetBounds(Rect value) - { - if (bounds != value) - { - bounds = value; - InvokeOnCompositionStateChanged(); - } + if (layout_flowParent) layout_flowParent->layout_invalid = true; + }); } Margin GuiFlowItemComposition::GetExtraMargin() @@ -27880,11 +27966,8 @@ GuiFlowItemComposition if (option != value) { option = value; - if (flowParent) - { - flowParent->needUpdate = true; - InvokeOnCompositionStateChanged(); - } + if (layout_flowParent) layout_flowParent->layout_invalid = true; + InvokeOnCompositionStateChanged(); } } } @@ -27943,6 +28026,7 @@ GuiRepeatCompositionBase auto item = InsertRepeatComposition(index); templateItem->SetAlignmentToParent(Margin(0, 0, 0, 0)); + templateItem->SetContext(itemContext); item->SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); item->AddChild(templateItem); @@ -27953,7 +28037,8 @@ GuiRepeatCompositionBase void GuiRepeatCompositionBase::ClearItems() { - for (vint i = GetRepeatCompositionCount() - 1; i >= 0; i--) + vint count = GetRepeatCompositionCount(); + for (vint i = count - 1; i >= 0; i--) { RemoveItem(i); } @@ -28030,23 +28115,46 @@ GuiRepeatCompositionBase } } + description::Value GuiRepeatCompositionBase::GetContext() + { + return itemContext; + } + + void GuiRepeatCompositionBase::SetContext(const description::Value& value) + { + if (itemContext != value) + { + itemContext = value; + vint count = GetRepeatCompositionCount(); + for (vint i = 0; i < count; i++) + { + auto rc = GetRepeatComposition(i); + auto it = dynamic_cast(rc->Children()[0]); + it->SetContext(itemContext); + } + + GuiEventArgs arguments(dynamic_cast(this)); + ContextChanged.Execute(arguments); + } + } + /*********************************************************************** GuiRepeatStackComposition ***********************************************************************/ vint GuiRepeatStackComposition::GetRepeatCompositionCount() { - return stackItems.Count(); + return GetStackItems().Count(); } GuiGraphicsComposition* GuiRepeatStackComposition::GetRepeatComposition(vint index) { - return stackItems[index]; + return GetStackItems()[index]; } GuiGraphicsComposition* GuiRepeatStackComposition::InsertRepeatComposition(vint index) { - CHECK_ERROR(0 <= index && index <= stackItems.Count(), L"GuiRepeatStackComposition::InsertRepeatComposition(vint)#Index out of range."); + CHECK_ERROR(0 <= index && index <= GetStackItems().Count(), L"GuiRepeatStackComposition::InsertRepeatComposition(vint)#Index out of range."); auto item = new GuiStackItemComposition; InsertStackItem(index, item); return item; @@ -28054,28 +28162,39 @@ GuiRepeatStackComposition GuiGraphicsComposition* GuiRepeatStackComposition::RemoveRepeatComposition(vint index) { - auto item = stackItems[index]; + auto item = GetStackItems()[index]; RemoveChild(item); return item; } + GuiRepeatStackComposition::GuiRepeatStackComposition() + { + ItemInserted.SetAssociatedComposition(this); + ItemRemoved.SetAssociatedComposition(this); + ContextChanged.SetAssociatedComposition(this); + } + + GuiRepeatStackComposition::~GuiRepeatStackComposition() + { + } + /*********************************************************************** GuiRepeatFlowComposition ***********************************************************************/ vint GuiRepeatFlowComposition::GetRepeatCompositionCount() { - return flowItems.Count(); + return GetFlowItems().Count(); } GuiGraphicsComposition* GuiRepeatFlowComposition::GetRepeatComposition(vint index) { - return flowItems[index]; + return GetFlowItems()[index]; } GuiGraphicsComposition* GuiRepeatFlowComposition::InsertRepeatComposition(vint index) { - CHECK_ERROR(0 <= index && index <= flowItems.Count(), L"GuiRepeatStackComposition::InsertRepeatComposition(vint)#Index out of range."); + CHECK_ERROR(0 <= index && index <= GetFlowItems().Count(), L"GuiRepeatStackComposition::InsertRepeatComposition(vint)#Index out of range."); auto item = new GuiFlowItemComposition; InsertFlowItem(index, item); return item; @@ -28083,10 +28202,21 @@ GuiRepeatFlowComposition GuiGraphicsComposition* GuiRepeatFlowComposition::RemoveRepeatComposition(vint index) { - auto item = flowItems[index]; + auto item = GetFlowItems()[index]; RemoveChild(item); return item; } + + GuiRepeatFlowComposition::GuiRepeatFlowComposition() + { + ItemInserted.SetAssociatedComposition(this); + ItemRemoved.SetAssociatedComposition(this); + ContextChanged.SetAssociatedComposition(this); + } + + GuiRepeatFlowComposition::~GuiRepeatFlowComposition() + { + } } } } @@ -28169,10 +28299,6 @@ GuiResponsiveCompositionBase CurrentLevelChanged.SetAssociatedComposition(this); } - GuiResponsiveCompositionBase::~GuiResponsiveCompositionBase() - { - } - ResponsiveDirection GuiResponsiveCompositionBase::GetDirection() { return direction; @@ -28216,10 +28342,6 @@ GuiResponsiveSharedCollection { } - GuiResponsiveSharedCollection::~GuiResponsiveSharedCollection() - { - } - /*********************************************************************** GuiResponsiveViewCollection ***********************************************************************/ @@ -28257,10 +28379,6 @@ GuiResponsiveViewCollection { } - GuiResponsiveViewCollection::~GuiResponsiveViewCollection() - { - } - /*********************************************************************** GuiResponsiveSharedComposition ***********************************************************************/ @@ -28318,10 +28436,6 @@ GuiResponsiveSharedComposition SetMinSizeLimitation(LimitToElementAndChildren); } - GuiResponsiveSharedComposition::~GuiResponsiveSharedComposition() - { - } - controls::GuiControl* GuiResponsiveSharedComposition::GetShared() { return shared; @@ -28351,6 +28465,7 @@ GuiResponsiveViewComposition else { levelCount = 0; + // TODO: (enumerable) foreach for (vint i = 0; i < views.Count(); i++) { auto view = views[i]; @@ -28377,6 +28492,7 @@ GuiResponsiveViewComposition { vint old = currentLevel; currentLevel = 0; + // TODO: (enumerable) foreach:reversed for (vint i = views.Count() - 1; i >= 0; i--) { auto view = views[i]; @@ -28532,14 +28648,6 @@ GuiResponsiveFixedComposition InvokeOnCompositionStateChanged(); } - GuiResponsiveFixedComposition::GuiResponsiveFixedComposition() - { - } - - GuiResponsiveFixedComposition::~GuiResponsiveFixedComposition() - { - } - vint GuiResponsiveFixedComposition::GetLevelCount() { return 1; @@ -28660,7 +28768,7 @@ GuiResponsiveStackComposition { if (!ignored.Contains(child)) { - Size childSize = child->GetPreferredBounds().GetSize(); + Size childSize = child->GetCachedBounds().GetSize(); vint childSizeToCompare = direction == ResponsiveDirection::Horizontal ? childSize.x : direction == ResponsiveDirection::Vertical ? childSize.y : @@ -28693,14 +28801,6 @@ GuiResponsiveStackComposition return true; } - GuiResponsiveStackComposition::GuiResponsiveStackComposition() - { - } - - GuiResponsiveStackComposition::~GuiResponsiveStackComposition() - { - } - vint GuiResponsiveStackComposition::GetLevelCount() { return levelCount; @@ -28794,14 +28894,6 @@ GuiResponsiveGroupComposition GuiResponsiveCompositionBase::OnResponsiveChildLevelUpdated(); } - GuiResponsiveGroupComposition::GuiResponsiveGroupComposition() - { - } - - GuiResponsiveGroupComposition::~GuiResponsiveGroupComposition() - { - } - vint GuiResponsiveGroupComposition::GetLevelCount() { return levelCount; @@ -28858,99 +28950,112 @@ GuiResponsiveGroupComposition GuiResponsiveContainerComposition ***********************************************************************/ -#define RESPONSIVE_INVALID_SIZE Size(-1, -1) - - void GuiResponsiveContainerComposition::AdjustLevel() + std::strong_ordering GuiResponsiveContainerComposition::Layout_CompareSize(Size first, Size second) { - if (!responsiveTarget) return; - const Size containerSize = GetBounds().GetSize(); - const Size responsiveOriginalSize = responsiveTarget->GetPreferredBounds().GetSize(); - const bool testX = (vint)responsiveTarget->GetDirection() & (vint)ResponsiveDirection::Horizontal; - const bool testY = (vint)responsiveTarget->GetDirection() & (vint)ResponsiveDirection::Vertical; + auto ordX = testX ? first.x <=> second.x : std::strong_ordering::equivalent; + auto ordY = testY ? first.y <=> second.y : std::strong_ordering::equivalent; -#define RESPONSIVE_IF_CONTAINER(OP, SIZE) ((testX && (containerSize).x OP SIZE.x) || (testY && (containerSize).y OP SIZE.y)) - - if (upperLevelSize != RESPONSIVE_INVALID_SIZE && RESPONSIVE_IF_CONTAINER(>=, upperLevelSize)) + if (ordX == std::strong_ordering::less || ordY == std::strong_ordering::less) { - upperLevelSize = RESPONSIVE_INVALID_SIZE; + return std::strong_ordering::less; } - - if (upperLevelSize == RESPONSIVE_INVALID_SIZE && RESPONSIVE_IF_CONTAINER(>=, responsiveOriginalSize)) + if (ordX == std::strong_ordering::greater || ordY == std::strong_ordering::greater) { - while (true) - { - if (responsiveTarget->GetCurrentLevel() == responsiveTarget->GetLevelCount() - 1) - { - break; - } - else if (responsiveTarget->LevelUp()) - { - responsiveTarget->ForceCalculateSizeImmediately(); - auto currentSize = responsiveTarget->GetPreferredBounds().GetSize(); - if (RESPONSIVE_IF_CONTAINER(<, currentSize)) - { - upperLevelSize = currentSize; - responsiveTarget->LevelDown(); - break; - } - } - else - { - break; - } - } + return std::strong_ordering::greater; } - else - { - while (true) - { - responsiveTarget->ForceCalculateSizeImmediately(); - auto currentSize = responsiveTarget->GetPreferredBounds().GetSize(); - if (RESPONSIVE_IF_CONTAINER(>=, currentSize)) - { - break; - } - - if (responsiveTarget->GetCurrentLevel() == 0) - { - break; - } - else if(responsiveTarget->LevelDown()) - { - upperLevelSize = currentSize; - } - else - { - break; - } - } - } - -#undef RESPONSIVE_IF_CONTAINER + return std::strong_ordering::equivalent; } - void GuiResponsiveContainerComposition::OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments) + void GuiResponsiveContainerComposition::Layout_AdjustLevelUp(Size containerSize) { - if (auto control = GetRelatedControl()) + while (true) { - control->TryDelayExecuteIfNotDeleted([=]() + if (responsiveTarget->GetCurrentLevel() == responsiveTarget->GetLevelCount() - 1) break; + if (Layout_CompareSize(minSizeLowerBound, minSizeUpperBound) == std::strong_ordering::less) { - AdjustLevel(); - }); + if (Layout_CompareSize(containerSize, minSizeUpperBound) == std::strong_ordering::less) break; + } + else + { + if (Layout_CompareSize(containerSize, minSizeUpperBound) != std::strong_ordering::greater) break; + } + + if (!responsiveTarget->LevelUp()) break; + responsiveTarget->Layout_UpdateMinSize(); + minSizeUpperBound = responsiveTarget->GetCachedMinSize(); + if (Layout_CompareSize(containerSize, minSizeUpperBound) == std::strong_ordering::less) + { + responsiveTarget->LevelDown(); + responsiveTarget->Layout_UpdateMinSize(); + break; + } + minSizeLowerBound = minSizeUpperBound; } - else + } + + void GuiResponsiveContainerComposition::Layout_AdjustLevelDown(Size containerSize) + { + while (true) { - AdjustLevel(); + if (responsiveTarget->GetCurrentLevel() == 0) break; + if (Layout_CompareSize(containerSize, minSizeLowerBound) != std::strong_ordering::less) break; + + if (!responsiveTarget->LevelDown()) break; + responsiveTarget->Layout_UpdateMinSize(); + minSizeUpperBound = minSizeLowerBound; + minSizeLowerBound = responsiveTarget->GetCachedMinSize(); } } + Rect GuiResponsiveContainerComposition::Layout_CalculateBounds(Size parentSize) + { + auto bounds = GuiBoundsComposition::Layout_CalculateBounds(parentSize); + + if (responsiveTarget) + { + bool needAdjust = false; + auto containerSize = bounds.GetSize(); + auto ordering = std::strong_ordering::equivalent; + + if (containerSize != cachedBounds.GetSize()) + { + ordering = Layout_CompareSize(containerSize, cachedBounds.GetSize()); + needAdjust = true; + } + + if (responsiveTarget) + { + if (responsiveTarget->GetCachedMinSize() != minSizeLowerBound) + { + minSizeLowerBound = responsiveTarget->GetCachedMinSize(); + if (minSizeUpperBound.x < minSizeLowerBound.x) minSizeUpperBound.x = minSizeLowerBound.x; + if (minSizeUpperBound.y < minSizeLowerBound.y) minSizeUpperBound.y = minSizeLowerBound.y; + } + + if (Layout_CompareSize(containerSize, minSizeLowerBound) == std::strong_ordering::less) + { + ordering = std::strong_ordering::less; + needAdjust = true; + } + } + + if (needAdjust) + { + if (ordering == std::strong_ordering::less) + { + Layout_AdjustLevelDown(containerSize); + } + else if (ordering == std::strong_ordering::greater) + { + Layout_AdjustLevelUp(containerSize); + } + } + } + + return bounds; + } + GuiResponsiveContainerComposition::GuiResponsiveContainerComposition() - :upperLevelSize(RESPONSIVE_INVALID_SIZE) - { - BoundsChanged.AttachMethod(this, &GuiResponsiveContainerComposition::OnBoundsChanged); - } - - GuiResponsiveContainerComposition::~GuiResponsiveContainerComposition() { } @@ -28969,7 +29074,6 @@ GuiResponsiveContainerComposition } responsiveTarget = value; - upperLevelSize = RESPONSIVE_INVALID_SIZE; if (responsiveTarget) { @@ -28977,13 +29081,22 @@ GuiResponsiveContainerComposition while (responsiveTarget->LevelUp()); AddChild(responsiveTarget); - GuiEventArgs arguments(this); - OnBoundsChanged(this, arguments); + responsiveTarget->Layout_UpdateMinSize(); + minSizeUpperBound = responsiveTarget->GetCachedMinSize(); + minSizeLowerBound = responsiveTarget->GetCachedMinSize(); + testX = (vint)responsiveTarget->GetDirection() & (vint)ResponsiveDirection::Horizontal; + testY = (vint)responsiveTarget->GetDirection() & (vint)ResponsiveDirection::Vertical; + Layout_AdjustLevelDown(cachedBounds.GetSize()); + } + else + { + minSizeUpperBound = {}; + minSizeLowerBound = {}; + testX = false; + testY = false; } } } - -#undef RESPONSIVE_INVALID_SIZE } } } @@ -29008,15 +29121,6 @@ namespace vl GuiSharedSizeItemComposition ***********************************************************************/ - void GuiSharedSizeItemComposition::Update() - { - if (parentRoot) - { - parentRoot->ForceCalculateSizeImmediately(); - } - InvokeOnCompositionStateChanged(); - } - void GuiSharedSizeItemComposition::OnParentLineChanged() { GuiBoundsComposition::OnParentLineChanged(); @@ -29065,15 +29169,28 @@ GuiSharedSizeItemComposition } } + Size GuiSharedSizeItemComposition::Layout_CalculateMinSize() + { + if (parentRoot) + { + return cachedMinSize; + } + else + { + return GuiBoundsComposition::Layout_CalculateMinSize(); + } + } + + Size GuiSharedSizeItemComposition::Layout_CalculateOriginalMinSize() + { + return GuiBoundsComposition::Layout_CalculateMinSize(); + } + GuiSharedSizeItemComposition::GuiSharedSizeItemComposition() { SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); } - GuiSharedSizeItemComposition::~GuiSharedSizeItemComposition() - { - } - const WString& GuiSharedSizeItemComposition::GetGroup() { return group; @@ -29084,7 +29201,7 @@ GuiSharedSizeItemComposition if (group != value) { group = value; - Update(); + InvokeOnCompositionStateChanged(); } } @@ -29098,7 +29215,7 @@ GuiSharedSizeItemComposition if (sharedWidth != value) { sharedWidth = value; - Update(); + InvokeOnCompositionStateChanged(); } } @@ -29112,7 +29229,7 @@ GuiSharedSizeItemComposition if (sharedHeight != value) { sharedHeight = value; - Update(); + InvokeOnCompositionStateChanged(); } } @@ -29133,24 +29250,27 @@ GuiSharedSizeRootComposition } } + void GuiSharedSizeRootComposition::CalculateOriginalMinSizes() + { + for (auto item : childItems) + { + item->originalMinSize = item->Layout_CalculateOriginalMinSize(); + } + } + void GuiSharedSizeRootComposition::CollectSizes(collections::Dictionary& widths, collections::Dictionary& heights) { for (auto item : childItems) { auto group = item->GetGroup(); - auto minSize = item->GetPreferredMinSize(); - auto size = InvokeGetPreferredBoundsInternal(item, false).GetSize(); - if (item->GetSharedWidth()) { - AddSizeComponent(widths, group, size.x); + AddSizeComponent(widths, group, item->originalMinSize.x); } if (item->GetSharedHeight()) { - AddSizeComponent(heights, group, size.y); + AddSizeComponent(heights, group, item->originalMinSize.y); } - - item->SetPreferredMinSize(minSize); } } @@ -29159,7 +29279,7 @@ GuiSharedSizeRootComposition for (auto item : childItems) { auto group = item->GetGroup(); - auto size = item->GetPreferredMinSize(); + auto size = item->originalMinSize; if (item->GetSharedWidth()) { @@ -29170,42 +29290,18 @@ GuiSharedSizeRootComposition size.y = heights[group]; } - item->SetPreferredMinSize(size); + item->Layout_SetCachedMinSize(size); } } - GuiSharedSizeRootComposition::GuiSharedSizeRootComposition() - { - } - - GuiSharedSizeRootComposition::~GuiSharedSizeRootComposition() - { - } - - void GuiSharedSizeRootComposition::ForceCalculateSizeImmediately() + Size GuiSharedSizeRootComposition::Layout_CalculateMinSize() { itemWidths.Clear(); itemHeights.Clear(); - + CalculateOriginalMinSizes(); CollectSizes(itemWidths, itemHeights); AlignSizes(itemWidths, itemHeights); - GuiBoundsComposition::ForceCalculateSizeImmediately(); - } - - Rect GuiSharedSizeRootComposition::GetBounds() - { - Dictionary widths, heights; - CollectSizes(widths, heights); - bool minSizeModified = CompareEnumerable(itemWidths, widths) != 0 || CompareEnumerable(itemHeights, heights) != 0; - - if (minSizeModified) - { - CopyFrom(itemWidths, widths); - CopyFrom(itemHeights, heights); - AlignSizes(itemWidths, itemHeights); - GuiBoundsComposition::ForceCalculateSizeImmediately(); - } - return GuiBoundsComposition::GetBounds(); + return GuiBoundsComposition::Layout_CalculateMinSize(); } } } @@ -29226,15 +29322,42 @@ namespace vl GuiSideAlignedComposition ***********************************************************************/ - GuiSideAlignedComposition::GuiSideAlignedComposition() - :direction(Top) - ,maxLength(10) - ,maxRatio(1.0) - { - } - - GuiSideAlignedComposition::~GuiSideAlignedComposition() + Rect GuiSideAlignedComposition::Layout_CalculateBounds(Size parentSize) { + Rect result; + if (auto parent = GetParent()) + { + Rect bounds({}, parentSize); + vint w = (vint)(bounds.Width() * maxRatio); + vint h = (vint)(bounds.Height() * maxRatio); + if (w > maxLength) w = maxLength; + if (h > maxLength) h = maxLength; + switch (direction) + { + case Left: + { + bounds.x2 = bounds.x1 + w; + } + break; + case Top: + { + bounds.y2 = bounds.y1 + h; + } + break; + case Right: + { + bounds.x1 = bounds.x2 - w; + } + break; + case Bottom: + { + bounds.y1 = bounds.y2 - h; + } + break; + } + result = bounds; + } + return result; } GuiSideAlignedComposition::Direction GuiSideAlignedComposition::GetDirection() @@ -29281,65 +29404,34 @@ GuiSideAlignedComposition } } - bool GuiSideAlignedComposition::IsSizeAffectParent() - { - return false; - } - - Rect GuiSideAlignedComposition::GetBounds() - { - Rect result; - GuiGraphicsComposition* parent = GetParent(); - if (parent) - { - Rect bounds = parent->GetBounds(); - vint w = (vint)(bounds.Width()*maxRatio); - vint h = (vint)(bounds.Height()*maxRatio); - if (w > maxLength) w = maxLength; - if (h > maxLength) h = maxLength; - switch (direction) - { - case Left: - { - bounds.x2 = bounds.x1 + w; - } - break; - case Top: - { - bounds.y2 = bounds.y1 + h; - } - break; - case Right: - { - bounds.x1 = bounds.x2 - w; - } - break; - case Bottom: - { - bounds.y1 = bounds.y2 - h; - } - break; - } - result = bounds; - } - UpdatePreviousBounds(result); - return result; - } - /*********************************************************************** GuiPartialViewComposition ***********************************************************************/ - GuiPartialViewComposition::GuiPartialViewComposition() - :wRatio(0.0) - ,wPageSize(1.0) - ,hRatio(0.0) - ,hPageSize(1.0) + Rect GuiPartialViewComposition::Layout_CalculateBounds(Size parentSize) { - } + Rect result; + if (auto parent = GetParent()) + { + Rect bounds({}, parentSize); + vint w = bounds.Width(); + vint h = bounds.Height(); + vint pw = (vint)(wPageSize * w); + vint ph = (vint)(hPageSize * h); - GuiPartialViewComposition::~GuiPartialViewComposition() - { + vint ow = preferredMinSize.x - pw; + if (ow < 0) ow = 0; + vint oh = preferredMinSize.y - ph; + if (oh < 0) oh = 0; + + w -= ow; + h -= oh; + pw += ow; + ph += oh; + + result = Rect(Point((vint)(wRatio * w), (vint)(hRatio * h)), Size(pw, ph)); + } + return result; } double GuiPartialViewComposition::GetWidthRatio() @@ -29397,39 +29489,6 @@ GuiPartialViewComposition InvokeOnCompositionStateChanged(); } } - - bool GuiPartialViewComposition::IsSizeAffectParent() - { - return false; - } - - Rect GuiPartialViewComposition::GetBounds() - { - Rect result; - GuiGraphicsComposition* parent = GetParent(); - if (parent) - { - Rect bounds = parent->GetBounds(); - vint w = bounds.Width(); - vint h = bounds.Height(); - vint pw = (vint)(wPageSize*w); - vint ph = (vint)(hPageSize*h); - - vint ow = preferredMinSize.x - pw; - if (ow < 0) ow = 0; - vint oh = preferredMinSize.y - ph; - if (oh < 0) oh = 0; - - w -= ow; - h -= oh; - pw += ow; - ph += oh; - - result = Rect(Point((vint)(wRatio*w), (vint)(hRatio*h)), Size(pw, ph)); - } - UpdatePreviousBounds(result); - return result; - } } } } @@ -29450,93 +29509,108 @@ namespace vl GuiStackComposition ***********************************************************************/ - void GuiStackComposition::UpdateStackItemBounds() + void GuiStackComposition::Layout_UpdateStackItemMinSizes() { - if (stackItemBounds.Count() != stackItems.Count()) + for (auto item : layout_stackItems) { - stackItemBounds.Resize(stackItems.Count()); + item->Layout_SetCachedMinSize(item->Layout_CalculateMinSizeHelper()); } - stackItemTotalSize = Size(0, 0); - Point offset; - for (vint i = 0; i < stackItems.Count(); i++) - { - vint offsetX = 0; - vint offsetY = 0; - Size itemSize = stackItems[i]->GetMinSize(); - stackItemBounds[i] = Rect(offset, itemSize); + if (!layout_invalid) return; + layout_invalid = false; -#define ACCUMULATE(U, V) \ - { \ - if (stackItemTotalSize.V < itemSize.V) \ - { \ - stackItemTotalSize.V = itemSize.V; \ - } \ - if (i > 0) \ - { \ - stackItemTotalSize.U += padding; \ - } \ - stackItemTotalSize.U += itemSize.U; \ - } \ + Point virtualOffset; + layout_stackItemTotalSize = Size(0, 0); + for (auto [item, index] : indexed(layout_stackItems)) + { + Size itemSize = item->GetCachedMinSize(); switch (direction) { case GuiStackComposition::Horizontal: case GuiStackComposition::ReversedHorizontal: - ACCUMULATE(x, y) + { + if (layout_stackItemTotalSize.y < itemSize.y) + { + layout_stackItemTotalSize.y = itemSize.y; + } + if (index > 0) + { + layout_stackItemTotalSize.x += padding; + } + layout_stackItemTotalSize.x += itemSize.x; + } break; case GuiStackComposition::Vertical: case GuiStackComposition::ReversedVertical: - ACCUMULATE(y, x) + { + if (layout_stackItemTotalSize.x < itemSize.x) + { + layout_stackItemTotalSize.x = itemSize.x; + } + if (index > 0) + { + layout_stackItemTotalSize.y += padding; + } + layout_stackItemTotalSize.y += itemSize.y; + } break; } -#undef ACCUMULATE - offset.x += itemSize.x + padding; - offset.y += itemSize.y + padding; + item->layout_virtualOffset = virtualOffset; + virtualOffset.x += itemSize.x + padding; + virtualOffset.y += itemSize.y + padding; } - EnsureStackItemVisible(); } - void GuiStackComposition::EnsureStackItemVisible() + void GuiStackComposition::Layout_UpdateStackItemBounds(Rect contentBounds) { -#define ADJUSTMENT(U, V) \ - if (itemBounds.U() <= 0) \ - { \ - adjustment -= itemBounds.U(); \ - InvokeOnCompositionStateChanged(); \ - } \ - else \ - { \ - vint overflow = itemBounds.V() - previousBounds.V(); \ - if (overflow > 0) \ - { \ - adjustment -= overflow; \ - InvokeOnCompositionStateChanged(); \ - } \ - } \ - - if (ensuringVisibleStackItem) + if (layout_ensuringVisibleStackItem) { - Rect itemBounds = ensuringVisibleStackItem->GetBounds(); + Rect itemBounds( + layout_ensuringVisibleStackItem->layout_virtualOffset, + layout_ensuringVisibleStackItem->GetCachedMinSize() + ); + switch (direction) { case Horizontal: case ReversedHorizontal: - ADJUSTMENT(Left, Right) + if (itemBounds.x1 <= 0) + { + layout_adjustment = -itemBounds.x1; + } + else + { + vint overflow = itemBounds.x2 - contentBounds.x2; + if (overflow > 0) + { + layout_adjustment = -overflow; + } + } break; case Vertical: case ReversedVertical: - ADJUSTMENT(Top, Bottom) + if (itemBounds.y1 <= 0) + { + layout_adjustment = -itemBounds.y1; + } + else + { + vint overflow = itemBounds.y2 - contentBounds.y2; + if (overflow > 0) + { + layout_adjustment = -overflow; + } + } break; } } -#undef ADJUSTMENT - } - void GuiStackComposition::OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments) - { - EnsureStackItemVisible(); + for (auto item : layout_stackItems) + { + item->Layout_SetStackItemBounds(contentBounds, item->layout_virtualOffset); + } } void GuiStackComposition::OnChildInserted(GuiGraphicsComposition* child) @@ -29545,11 +29619,10 @@ GuiStackComposition GuiStackItemComposition* item = dynamic_cast(child); if (item) { - if (!stackItems.Contains(item)) + if (!layout_stackItems.Contains(item)) { - stackItems.Add(item); + layout_stackItems.Add(item); } - UpdateStackItemBounds(); } } @@ -29559,71 +29632,77 @@ GuiStackComposition GuiStackItemComposition* item = dynamic_cast(child); if (item) { - stackItems.Remove(item); - if (item == ensuringVisibleStackItem) + layout_stackItems.Remove(item); + if (item == layout_ensuringVisibleStackItem) { - ensuringVisibleStackItem = 0; + layout_ensuringVisibleStackItem = nullptr; } - UpdateStackItemBounds(); } } - - Size GuiStackComposition::GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) + + void GuiStackComposition::OnCompositionStateChanged() { - Size minSize = GuiBoundsComposition::GetMinPreferredClientSizeInternal(considerPreferredMinSize); + GuiBoundsComposition::OnCompositionStateChanged(); + layout_invalid = true; + } + + Size GuiStackComposition::Layout_CalculateMinSize() + { + Layout_UpdateStackItemMinSizes(); + + Size minStackSize; if (GetMinSizeLimitation() == GuiGraphicsComposition::LimitToElementAndChildren) { - if (!ensuringVisibleStackItem || direction == Vertical || direction == ReversedVertical) + if (!layout_ensuringVisibleStackItem || direction == Vertical || direction == ReversedVertical) { - if (minSize.x < stackItemTotalSize.x) - { - minSize.x = stackItemTotalSize.x; - } + minStackSize.x = layout_stackItemTotalSize.x; } - if (!ensuringVisibleStackItem || direction == Horizontal || direction == ReversedHorizontal) + if (!layout_ensuringVisibleStackItem || direction == Horizontal || direction == ReversedHorizontal) { - if (minSize.y < stackItemTotalSize.y) - { - minSize.y = stackItemTotalSize.y; - } + minStackSize.y = layout_stackItemTotalSize.y; } } - vint x = 0; - vint y = 0; - if (extraMargin.left > 0) x += extraMargin.left; - if (extraMargin.right > 0) x += extraMargin.right; - if (extraMargin.top > 0) y += extraMargin.top; - if (extraMargin.bottom > 0) y += extraMargin.bottom; - return minSize + Size(x, y); + minStackSize.x += extraMargin.left; + minStackSize.x += extraMargin.right; + minStackSize.y += extraMargin.top; + minStackSize.y += extraMargin.bottom; + + Size minClientSize = GuiBoundsComposition::Layout_CalculateMinSize(); + return Size( + minStackSize.x > minClientSize.x ? minStackSize.x : minClientSize.x, + minStackSize.y > minClientSize.y ? minStackSize.y : minClientSize.y + ); + return minStackSize; } - GuiStackComposition::GuiStackComposition() - { - BoundsChanged.AttachMethod(this, &GuiStackComposition::OnBoundsChanged); - } - - GuiStackComposition::~GuiStackComposition() + Rect GuiStackComposition::Layout_CalculateBounds(Size parentSize) { + Rect bounds = GuiBoundsComposition::Layout_CalculateBounds(parentSize); + Rect contentBounds( + extraMargin.left, + extraMargin.top, + bounds.Width() - extraMargin.right, + bounds.Height() - extraMargin.bottom + ); + Layout_UpdateStackItemBounds(contentBounds); + return bounds; } const GuiStackComposition::ItemCompositionList& GuiStackComposition::GetStackItems() { - return stackItems; + return layout_stackItems; } bool GuiStackComposition::InsertStackItem(vint index, GuiStackItemComposition* item) { - index = stackItems.Insert(index, item); - if (!AddChild(item)) - { - stackItems.RemoveAt(index); - return false; - } - else + index = layout_stackItems.Insert(index, item); + if (AddChild(item)) { return true; } + layout_stackItems.RemoveAt(index); + return false; } GuiStackComposition::Direction GuiStackComposition::GetDirection() @@ -29633,8 +29712,11 @@ GuiStackComposition void GuiStackComposition::SetDirection(Direction value) { - direction = value; - EnsureStackItemVisible(); + if (direction != value) + { + direction = value; + InvokeOnCompositionStateChanged(); + } } vint GuiStackComposition::GetPadding() @@ -29644,31 +29726,11 @@ GuiStackComposition void GuiStackComposition::SetPadding(vint value) { - padding = value; - EnsureStackItemVisible(); - } - - void GuiStackComposition::ForceCalculateSizeImmediately() - { - GuiBoundsComposition::ForceCalculateSizeImmediately(); - UpdateStackItemBounds(); - } - - Rect GuiStackComposition::GetBounds() - { - for (vint i = 0; i < stackItems.Count(); i++) + if (padding != value) { - if (stackItemBounds[i].GetSize() != stackItems[i]->GetMinSize()) - { - UpdateStackItemBounds(); - break; - } + padding = value; + InvokeOnCompositionStateChanged(); } - - Rect bounds = GuiBoundsComposition::GetBounds(); - previousBounds = bounds; - UpdatePreviousBounds(previousBounds); - return bounds; } Margin GuiStackComposition::GetExtraMargin() @@ -29678,32 +29740,34 @@ GuiStackComposition void GuiStackComposition::SetExtraMargin(Margin value) { - extraMargin=value; - EnsureStackItemVisible(); + if (value.left < 0) value.left = 0; + if (value.top < 0) value.top = 0; + if (value.right < 0) value.right = 0; + if (value.bottom < 0) value.bottom = 0; + + if (extraMargin != value) + { + extraMargin = value; + InvokeOnCompositionStateChanged(); + } } bool GuiStackComposition::IsStackItemClipped() { - Rect clientArea = GetClientArea(); + Rect clientArea = GetCachedClientArea(); switch(direction) { case Horizontal: case ReversedHorizontal: { - vint width = stackItemTotalSize.x - + (extraMargin.left > 0 ? extraMargin.left : 0) - + (extraMargin.right > 0 ? extraMargin.right : 0) - ; + vint width = layout_stackItemTotalSize.x + extraMargin.left + extraMargin.right; return width > clientArea.Width(); } break; case Vertical: case ReversedVertical: { - vint height = stackItemTotalSize.y - + (extraMargin.top > 0 ? extraMargin.top : 0) - + (extraMargin.bottom > 0 ? extraMargin.bottom : 0) - ; + vint height = layout_stackItemTotalSize.y + extraMargin.top + extraMargin.bottom; return height > clientArea.Height(); } break; @@ -29713,113 +29777,99 @@ GuiStackComposition bool GuiStackComposition::EnsureVisible(vint index) { - if (0 <= index && index < stackItems.Count()) + if (0 <= index && index < layout_stackItems.Count()) { - ensuringVisibleStackItem = stackItems[index]; + layout_ensuringVisibleStackItem = layout_stackItems[index]; } else { - ensuringVisibleStackItem = 0; + layout_ensuringVisibleStackItem = nullptr; } - EnsureStackItemVisible(); - return ensuringVisibleStackItem != 0; + InvokeOnCompositionStateChanged(); + return layout_ensuringVisibleStackItem != nullptr; } /*********************************************************************** GuiStackItemComposition ***********************************************************************/ - void GuiStackItemComposition::OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent) + void GuiStackItemComposition::Layout_SetStackItemBounds(Rect contentBounds, Point virtualOffset) { - GuiGraphicsSite::OnParentChanged(oldParent, newParent); - stackParent = newParent == 0 ? 0 : dynamic_cast(newParent); + vint x = 0; + vint y = 0; + switch (layout_stackParent->direction) + { + case GuiStackComposition::Horizontal: + x = contentBounds.x1 + virtualOffset.x; + y = contentBounds.y1; + break; + case GuiStackComposition::ReversedHorizontal: + x = contentBounds.x2 - virtualOffset.x - cachedMinSize.x; + y = contentBounds.y1; + break; + case GuiStackComposition::Vertical: + x = contentBounds.x1; + y = contentBounds.y1 + virtualOffset.y; + break; + case GuiStackComposition::ReversedVertical: + x = contentBounds.x1; + y = contentBounds.y2 - virtualOffset.y - cachedMinSize.y; + break; + } + switch (layout_stackParent->direction) + { + case GuiStackComposition::Horizontal: + x += layout_stackParent->layout_adjustment; + break; + case GuiStackComposition::ReversedHorizontal: + x -= layout_stackParent->layout_adjustment; + break; + case GuiStackComposition::Vertical: + y += layout_stackParent->layout_adjustment; + break; + case GuiStackComposition::ReversedVertical: + y -= layout_stackParent->layout_adjustment; + break; + } + + vint w = 0; + vint h = 0; + switch (layout_stackParent->direction) + { + case GuiStackComposition::Horizontal: + case GuiStackComposition::ReversedHorizontal: + w = cachedMinSize.x; + h = contentBounds.Height(); + break; + case GuiStackComposition::Vertical: + case GuiStackComposition::ReversedVertical: + w = contentBounds.Width(); + h = cachedMinSize.y; + break; + } + + Rect result( + x - extraMargin.left, + y - extraMargin.top, + x + w + extraMargin.right, + y + h + extraMargin.bottom + ); + Layout_SetCachedBounds(result); } - Size GuiStackItemComposition::GetMinSize() + void GuiStackItemComposition::OnParentLineChanged() { - return GetBoundsInternal(bounds, true).GetSize(); + layout_stackParent = dynamic_cast(GetParent()); + GuiGraphicsComposition::OnParentLineChanged(); } GuiStackItemComposition::GuiStackItemComposition() - :stackParent(0) { SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); - } - - GuiStackItemComposition::~GuiStackItemComposition() - { - } - - bool GuiStackItemComposition::IsSizeAffectParent() - { - return false; - } - - Rect GuiStackItemComposition::GetBounds() - { - Rect result = bounds; - if(stackParent) + CachedMinSizeChanged.AttachLambda([this](GuiGraphicsComposition* sender, GuiEventArgs& arguments) { - vint index = stackParent->stackItems.IndexOf(this); - if (index != -1) - { - result = stackParent->stackItemBounds[index]; - } - - Rect parentBounds = stackParent->previousBounds; - Margin margin = stackParent->extraMargin; - if (margin.left <= 0) margin.left = 0; - if (margin.top <= 0) margin.top = 0; - if (margin.right <= 0) margin.right = 0; - if (margin.bottom <= 0) margin.bottom = 0; - - auto x = result.Left(); - auto y = result.Top(); - auto w = result.Width(); - auto h = result.Height(); - - switch (stackParent->direction) - { - case GuiStackComposition::Horizontal: - x += margin.left + stackParent->adjustment; - y = margin.top; - h = parentBounds.Height() - margin.top - margin.bottom; - break; - case GuiStackComposition::ReversedHorizontal: - x = parentBounds.Width() - margin.right - x - w + stackParent->adjustment; - y = margin.top; - h = parentBounds.Height() - margin.top - margin.bottom; - break; - case GuiStackComposition::Vertical: - x = margin.left; - y += margin.top + stackParent->adjustment; - w = parentBounds.Width() - margin.left - margin.right; - break; - case GuiStackComposition::ReversedVertical: - x = margin.left; - y = parentBounds.Height() - margin.bottom - y - h + stackParent->adjustment; - w = parentBounds.Width() - margin.left - margin.right; - break; - } - - result = Rect( - x - extraMargin.left, - y - extraMargin.top, - x + w + extraMargin.right, - y + h + extraMargin.bottom - ); - } - UpdatePreviousBounds(result); - return result; - } - - void GuiStackItemComposition::SetBounds(Rect value) - { - if (bounds != value) - { - bounds = value; - InvokeOnCompositionStateChanged(); - } + if (layout_stackParent) layout_stackParent->layout_invalid = true; + }); } Margin GuiStackItemComposition::GetExtraMargin() @@ -29902,17 +29952,20 @@ GuiTableComposition } using namespace update_cell_bounds_helpers; - vint GuiTableComposition::GetSiteIndex(vint _rows, vint _columns, vint _row, vint _column) + Rect GuiTableComposition::Layout_CalculateCellArea(Rect tableBounds) { - return _row*_columns + _column; + Rect bounds(Point(0, 0), tableBounds.GetSize()); + vint borderThickness = borderVisible ? cellPadding : 0; + bounds.x1 += borderThickness; + bounds.y1 += borderThickness; + bounds.x2 -= borderThickness; + bounds.y2 -= borderThickness; + if (bounds.x2 < bounds.x1) bounds.x2 = bounds.x1; + if (bounds.y2 < bounds.y1) bounds.y2 = bounds.y1; + return bounds; } - void GuiTableComposition::SetSitedCell(vint _row, vint _column, GuiCellComposition* cell) - { - cellCompositions[GetSiteIndex(rows, columns, _row, _column)] = cell; - } - - void GuiTableComposition::UpdateCellBoundsInternal( + void GuiTableComposition::Layout_UpdateCellBoundsInternal( collections::Array& dimSizes, vint& dimSize, vint& dimSizeWithPercentage, @@ -29923,113 +29976,38 @@ GuiTableComposition vint(*getLocation)(GuiCellComposition*), vint(*getSpan)(GuiCellComposition*), vint(*getRow)(vint, vint), - vint(*getCol)(vint, vint), - vint maxPass + vint(*getCol)(vint, vint) ) { - for (vint pass = 0; pass < maxPass; pass++) + for (vint i = 0; i < this->*dim1; i++) { - for (vint i = 0; i < this->*dim1; i++) - { - GuiCellOption option = dimOptions[i]; - if (pass == 0) - { - dimSizes[i] = 0; - } - switch (option.composeType) - { - case GuiCellOption::Absolute: - { - dimSizes[i] = option.absolute; - } - break; - case GuiCellOption::MinSize: - { - for (vint j = 0; j < this->*dim2; j++) - { - GuiCellComposition* cell = GetSitedCell(getRow(i, j), getCol(i, j)); - if (cell) - { - bool accept = false; - if (pass == 0) - { - accept = getSpan(cell) == 1; - } - else - { - accept = getLocation(cell) + getSpan(cell) == i + 1; - } - if (accept) - { - vint size = getSize(cell->GetPreferredBounds().GetSize()); - vint span = getSpan(cell); - for (vint k = 1; k < span; k++) - { - size -= dimSizes[i - k] + cellPadding; - } - if (dimSizes[i] < size) - { - dimSizes[i] = size; - } - } - } - } - } - break; - default:; - } - } + dimSizes[i] = 0; } - bool percentageExists = false; for (vint i = 0; i < this->*dim1; i++) { GuiCellOption option = dimOptions[i]; - if (option.composeType == GuiCellOption::Percentage) + switch (option.composeType) { - if (0.001 < option.percentage) + case GuiCellOption::Absolute: { - percentageExists = true; + dimSizes[i] = option.absolute; } - } - } - - if (percentageExists) - { - for (vint i = 0; i < this->*dim1; i++) - { - GuiCellOption option = dimOptions[i]; - if (option.composeType == GuiCellOption::Percentage) + break; + case GuiCellOption::MinSize: { - if (0.001 < option.percentage) + for (vint j = 0; j < this->*dim2; j++) { - for (vint j = 0; j < this->*dim2; j++) + if (auto cell = GetSitedCell(getRow(i, j), getCol(i, j))) { - GuiCellComposition* cell = GetSitedCell(getRow(i, j), getCol(i, j)); - if (cell) + if (getSpan(cell) == 1) { - vint size = getSize(cell->GetPreferredBounds().GetSize()); - vint start = getLocation(cell); + vint size = getSize(cell->GetCachedMinSize()); vint span = getSpan(cell); - size -= (span - 1)*cellPadding; - double totalPercentage = 0; - - for (vint k = start; k < start + span; k++) + for (vint k = 1; k < span; k++) { - if (dimOptions[k].composeType == GuiCellOption::Percentage) - { - if (0.001 < dimOptions[k].percentage) - { - totalPercentage += dimOptions[k].percentage; - } - } - else - { - size -= dimSizes[k]; - } + size -= dimSizes[i - k] + cellPadding; } - - size = (vint)ceil(size*option.percentage / totalPercentage); if (dimSizes[i] < size) { dimSizes[i] = size; @@ -30038,20 +30016,45 @@ GuiTableComposition } } } + break; + default:; } + } - vint percentageTotalSize = 0; + { for (vint i = 0; i < this->*dim1; i++) { GuiCellOption option = dimOptions[i]; if (option.composeType == GuiCellOption::Percentage) { - if (0.001 < option.percentage) + for (vint j = 0; j < this->*dim2; j++) { - vint size = (vint)ceil(dimSizes[i] / option.percentage); - if (percentageTotalSize < size) + GuiCellComposition* cell = GetSitedCell(getRow(i, j), getCol(i, j)); + if (cell) { - percentageTotalSize = size; + vint size = getSize(cell->GetCachedMinSize()); + vint start = getLocation(cell); + vint span = getSpan(cell); + size -= (span - 1)*cellPadding; + double totalPercentage = 0; + + for (vint k = start; k < start + span; k++) + { + if (dimOptions[k].composeType == GuiCellOption::Percentage) + { + totalPercentage += dimOptions[k].percentage; + } + else + { + size -= dimSizes[k]; + } + } + + size = (vint)ceil(size*option.percentage / totalPercentage); + if (dimSizes[i] < size) + { + dimSizes[i] = size; + } } } } @@ -30063,9 +30066,20 @@ GuiTableComposition GuiCellOption option = dimOptions[i]; if (option.composeType == GuiCellOption::Percentage) { - if (0.001 < option.percentage) + totalPercentage += option.percentage; + } + } + + vint percentageTotalSize = 0; + for (vint i = 0; i < this->*dim1; i++) + { + GuiCellOption option = dimOptions[i]; + if (option.composeType == GuiCellOption::Percentage) + { + vint size = (vint)ceil(dimSizes[i] * totalPercentage / option.percentage); + if (percentageTotalSize < size) { - totalPercentage += option.percentage; + percentageTotalSize = size; } } } @@ -30075,13 +30089,10 @@ GuiTableComposition GuiCellOption option = dimOptions[i]; if (option.composeType == GuiCellOption::Percentage) { - if (0.001 < option.percentage) + vint size = (vint)ceil(percentageTotalSize * option.percentage / totalPercentage); + if (dimSizes[i] < size) { - vint size = (vint)ceil(percentageTotalSize*option.percentage / totalPercentage); - if (dimSizes[i] < size) - { - dimSizes[i] = size; - } + dimSizes[i] = size; } } } @@ -30097,7 +30108,7 @@ GuiTableComposition } } - void GuiTableComposition::UpdateCellBoundsPercentages( + void GuiTableComposition::Layout_UpdateCellBoundsPercentages( collections::Array& dimSizes, vint dimSize, vint maxDimSize, @@ -30108,6 +30119,7 @@ GuiTableComposition { double totalPercentage = 0; vint percentageCount = 0; + // TODO: (enumerable) foreach for (vint i = 0; i < dimOptions.Count(); i++) { GuiCellOption option = dimOptions[i]; @@ -30117,8 +30129,9 @@ GuiTableComposition percentageCount++; } } - if (percentageCount > 0 && totalPercentage > 0.001) + if (percentageCount > 0 && totalPercentage > 0) { + // TODO: (enumerable) foreach for (vint i = 0; i < dimOptions.Count(); i++) { GuiCellOption option = dimOptions[i]; @@ -30131,7 +30144,144 @@ GuiTableComposition } } - vint GuiTableComposition::UpdateCellBoundsOffsets( + vint GuiTableComposition::GetSiteIndex(vint _rows, vint _columns, vint _row, vint _column) + { + return _row * _columns + _column; + } + + void GuiTableComposition::SetSitedCell(vint _row, vint _column, GuiCellComposition* cell) + { + layout_cellCompositions[GetSiteIndex(rows, columns, _row, _column)] = cell; + layout_invalid = true; + } + + void GuiTableComposition::OnCompositionStateChanged() + { + GuiBoundsComposition::OnCompositionStateChanged(); + ConfigChanged.Execute(GuiEventArgs(this)); + layout_invalid = true; + } + + Size GuiTableComposition::Layout_CalculateMinSize() + { + for (auto child : Children()) + { + if (auto cell = dynamic_cast(child)) + { + cell->Layout_SetCachedMinSize(cell->Layout_CalculateMinSizeHelper()); + } + } + + if (layout_invalid) + { + layout_invalid = false; + layout_invalidCellBounds = true; + + layout_rowOffsets.Resize(rows); + layout_rowSizes.Resize(rows); + layout_columnOffsets.Resize(columns); + layout_columnSizes.Resize(columns); + layout_rowTotal = (rows - 1) * cellPadding; + layout_columnTotal = (columns - 1) * cellPadding; + layout_rowTotalWithPercentage = layout_rowTotal; + layout_columnTotalWithPercentage = layout_columnTotal; + + Layout_UpdateCellBoundsInternal( + layout_rowSizes, + layout_rowTotal, + layout_rowTotalWithPercentage, + rowOptions, + &GuiTableComposition::rows, + &GuiTableComposition::columns, + &Y, + &RL, + &RS, + &First, + &Second + ); + Layout_UpdateCellBoundsInternal( + layout_columnSizes, + layout_columnTotal, + layout_columnTotalWithPercentage, + columnOptions, + &GuiTableComposition::columns, + &GuiTableComposition::rows, + &X, + &CL, + &CS, + &Second, + &First + ); + } + + Size minTableSize; + if (GetMinSizeLimitation() == GuiGraphicsComposition::LimitToElementAndChildren) + { + vint offset = (borderVisible ? 2 * cellPadding : 0); + minTableSize.x = layout_columnTotalWithPercentage + offset; + minTableSize.y = layout_rowTotalWithPercentage + offset; + } + + Size minClientSize = GuiBoundsComposition::Layout_CalculateMinSize(); + return Size( + minTableSize.x > minClientSize.x ? minTableSize.x : minClientSize.x, + minTableSize.y > minClientSize.y ? minTableSize.y : minClientSize.y + ); + } + + Rect GuiTableComposition::Layout_CalculateBounds(Size parentSize) + { + Rect bounds = GuiBoundsComposition::Layout_CalculateBounds(parentSize); + + if (layout_lastTableSize != bounds.GetSize()) + { + layout_invalidCellBounds = true; + layout_lastTableSize = bounds.GetSize(); + } + + if (layout_invalidCellBounds) + { + layout_invalidCellBounds = false; + + Size area = Layout_CalculateCellArea(bounds).GetSize(); + Layout_UpdateCellBoundsPercentages( + layout_rowSizes, + layout_rowTotal, + area.y, + rowOptions + ); + Layout_UpdateCellBoundsPercentages( + layout_columnSizes, + layout_columnTotal, + area.x, + columnOptions + ); + + layout_rowExtending = Layout_UpdateCellBoundsOffsets(layout_rowOffsets, layout_rowSizes, area.y); + layout_columnExtending = Layout_UpdateCellBoundsOffsets(layout_columnOffsets, layout_columnSizes, area.x); + + for (vint i = 0; i < rows; i++) + { + for (vint j = 0; j < columns; j++) + { + vint index = GetSiteIndex(rows, columns, i, j); + layout_cellBounds[index] = Rect(Point(layout_columnOffsets[j], layout_rowOffsets[i]), Size(layout_columnSizes[j], layout_rowSizes[i])); + } + } + + for (auto child : Children()) + { + if (auto cell = dynamic_cast(child)) + { + cell->Layout_SetCellBounds(); + } + } + } + + return bounds; + } + + vint GuiTableComposition::Layout_UpdateCellBoundsOffsets( collections::Array& offsets, collections::Array& sizes, vint max @@ -30145,39 +30295,15 @@ GuiTableComposition vint last = offsets.Count() - 1; vint right = offsets[last] + sizes[last]; - return max - right; - } - - void GuiTableComposition::OnRenderContextChanged() - { - if(GetRenderTarget()) - { - UpdateCellBounds(); - } - } - - Size GuiTableComposition::GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) - { - vint offset = (borderVisible ? 2 * cellPadding : 0); - return Size(tableContentMinSize.x + offset, tableContentMinSize.y + offset); + return max > right ? max - right : 0; } GuiTableComposition::GuiTableComposition() - :rows(0) - , columns(0) - , cellPadding(0) - , borderVisible(true) - , rowExtending(0) - , columnExtending(0) { ConfigChanged.SetAssociatedComposition(this); SetRowsAndColumns(1, 1); } - GuiTableComposition::~GuiTableComposition() - { - } - vint GuiTableComposition::GetRows() { return rows; @@ -30193,15 +30319,16 @@ GuiTableComposition if (_rows <= 0 || _columns <= 0) return false; rowOptions.Resize(_rows); columnOptions.Resize(_columns); - cellCompositions.Resize(_rows*_columns); - cellBounds.Resize(_rows*_columns); + layout_cellCompositions.Resize(_rows*_columns); + layout_cellBounds.Resize(_rows*_columns); for (vint i = 0; i < _rows*_columns; i++) { - cellCompositions[i] = 0; - cellBounds[i] = Rect(); + layout_cellCompositions[i] = nullptr; + layout_cellBounds[i] = Rect(); } rows = _rows; columns = _columns; + // TODO: (enumerable) foreach vint childCount = Children().Count(); for (vint i = 0; i < childCount; i++) { @@ -30211,14 +30338,13 @@ GuiTableComposition cell->OnTableRowsAndColumnsChanged(); } } - ConfigChanged.Execute(GuiEventArgs(this)); - UpdateCellBounds(); + InvokeOnCompositionStateChanged(); return true; } GuiCellComposition* GuiTableComposition::GetSitedCell(vint _row, vint _column) { - return cellCompositions[GetSiteIndex(rows, columns, _row, _column)]; + return layout_cellCompositions[GetSiteIndex(rows, columns, _row, _column)]; } GuiCellOption GuiTableComposition::GetRowOption(vint _row) @@ -30228,11 +30354,15 @@ GuiTableComposition void GuiTableComposition::SetRowOption(vint _row, GuiCellOption option) { + if (option.composeType == GuiCellOption::Percentage && option.percentage < 0.001) + { + option.percentage = 0; + } + if (rowOptions[_row] != option) { rowOptions[_row] = option; - UpdateCellBounds(); - ConfigChanged.Execute(GuiEventArgs(this)); + InvokeOnCompositionStateChanged(); } } @@ -30243,11 +30373,15 @@ GuiTableComposition void GuiTableComposition::SetColumnOption(vint _column, GuiCellOption option) { + if (option.composeType == GuiCellOption::Percentage && option.percentage < 0.001) + { + option.percentage = 0; + } + if (columnOptions[_column] != option) { columnOptions[_column] = option; - UpdateCellBounds(); - ConfigChanged.Execute(GuiEventArgs(this)); + InvokeOnCompositionStateChanged(); } } @@ -30259,8 +30393,11 @@ GuiTableComposition void GuiTableComposition::SetCellPadding(vint value) { if (value < 0) value = 0; - cellPadding = value; - UpdateCellBounds(); + if (cellPadding != value) + { + cellPadding = value; + InvokeOnCompositionStateChanged(); + } } bool GuiTableComposition::GetBorderVisible() @@ -30273,118 +30410,10 @@ GuiTableComposition if (borderVisible != value) { borderVisible = value; - UpdateCellBounds(); + InvokeOnCompositionStateChanged(); } } - Rect GuiTableComposition::GetCellArea() - { - Rect bounds(Point(0, 0), GuiBoundsComposition::GetBounds().GetSize()); - vint borderThickness = borderVisible ? cellPadding : 0; - bounds.x1 += margin.left + internalMargin.left + borderThickness; - bounds.y1 += margin.top + internalMargin.top + borderThickness; - bounds.x2 -= margin.right + internalMargin.right + borderThickness; - bounds.y2 -= margin.bottom + internalMargin.bottom + borderThickness; - if (bounds.x2 < bounds.x1) bounds.x2 = bounds.x1; - if (bounds.y2 < bounds.y1) bounds.y2 = bounds.y1; - return bounds; - } - - void GuiTableComposition::UpdateCellBounds() - { - rowOffsets.Resize(rows); - rowSizes.Resize(rows); - columnOffsets.Resize(columns); - columnSizes.Resize(columns); - - vint rowTotal = (rows - 1) * cellPadding; - vint columnTotal = (columns - 1) * cellPadding; - vint rowTotalWithPercentage = rowTotal; - vint columnTotalWithPercentage = columnTotal; - - UpdateCellBoundsInternal( - rowSizes, - rowTotal, - rowTotalWithPercentage, - rowOptions, - &GuiTableComposition::rows, - &GuiTableComposition::columns, - &Y, - &RL, - &RS, - &First, - &Second, - 1 - ); - UpdateCellBoundsInternal( - columnSizes, - columnTotal, - columnTotalWithPercentage, - columnOptions, - &GuiTableComposition::columns, - &GuiTableComposition::rows, - &X, - &CL, - &CS, - &Second, - &First, - 1 - ); - - Rect area = GetCellArea(); - UpdateCellBoundsPercentages(rowSizes, rowTotal, area.Height(), rowOptions); - UpdateCellBoundsPercentages(columnSizes, columnTotal, area.Width(), columnOptions); - rowExtending = UpdateCellBoundsOffsets(rowOffsets, rowSizes, area.Height()); - columnExtending = UpdateCellBoundsOffsets(columnOffsets, columnSizes, area.Width()); - - for (vint i = 0; i < rows; i++) - { - for (vint j = 0; j < columns; j++) - { - vint index = GetSiteIndex(rows, columns, i, j); - cellBounds[index] = Rect(Point(columnOffsets[j], rowOffsets[i]), Size(columnSizes[j], rowSizes[i])); - } - } - - tableContentMinSize = Size(columnTotalWithPercentage, rowTotalWithPercentage); - InvokeOnCompositionStateChanged(); - } - - void GuiTableComposition::ForceCalculateSizeImmediately() - { - GuiBoundsComposition::ForceCalculateSizeImmediately(); - UpdateCellBounds(); - UpdateCellBounds(); - } - - Rect GuiTableComposition::GetBounds() - { - Rect cached = previousBounds; - Rect result = GuiBoundsComposition::GetBounds(); - - bool cellMinSizeModified = false; - SortedList cells; - for (auto cell : cellCompositions) - { - if (cell && !cells.Contains(cell)) - { - cells.Add(cell); - Size newSize = cell->GetPreferredBounds().GetSize(); - if (cell->lastPreferredSize != newSize) - { - cell->lastPreferredSize = newSize; - cellMinSizeModified = true; - } - } - } - - if (cached != result || cellMinSizeModified) - { - UpdateCellBounds(); - } - return result; - } - /*********************************************************************** GuiCellComposition ***********************************************************************/ @@ -30397,7 +30426,7 @@ GuiCellComposition { for (vint c = 0; c < columnSpan; c++) { - table->SetSitedCell(row + r, column + c, 0); + table->SetSitedCell(row + r, column + c, nullptr); } } } @@ -30424,23 +30453,23 @@ GuiCellComposition bool GuiCellComposition::SetSiteInternal(vint _row, vint _column, vint _rowSpan, vint _columnSpan) { - if (tableParent) + if (layout_tableParent) { - if (_row < 0 || _row >= tableParent->rows || _column < 0 || _column >= tableParent->columns) return false; - if (_rowSpan<1 || _row + _rowSpan>tableParent->rows || _columnSpan<1 || _column + _columnSpan>tableParent->columns) return false; + if (_row < 0 || _row >= layout_tableParent->rows || _column < 0 || _column >= layout_tableParent->columns) return false; + if (_rowSpan<1 || _row + _rowSpan>layout_tableParent->rows || _columnSpan<1 || _column + _columnSpan>layout_tableParent->columns) return false; for (vint r = 0; r < _rowSpan; r++) { for (vint c = 0; c < _columnSpan; c++) { - GuiCellComposition* cell = tableParent->GetSitedCell(_row + r, _column + c); + GuiCellComposition* cell = layout_tableParent->GetSitedCell(_row + r, _column + c); if (cell && cell != this) { return false; } } } - ClearSitedCells(tableParent); + ClearSitedCells(layout_tableParent); } row = _row; @@ -30448,32 +30477,31 @@ GuiCellComposition rowSpan = _rowSpan; columnSpan = _columnSpan; - if (tableParent) + if (layout_tableParent) { - SetSitedCells(tableParent); + SetSitedCells(layout_tableParent); } return true; } void GuiCellComposition::OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent) { - GuiGraphicsSite::OnParentChanged(oldParent, newParent); - if (tableParent) + GuiGraphicsComposition::OnParentChanged(oldParent, newParent); + if (layout_tableParent) { - ClearSitedCells(tableParent); + ClearSitedCells(layout_tableParent); } - tableParent = dynamic_cast(newParent); - if (!tableParent || !SetSiteInternal(row, column, rowSpan, columnSpan)) + layout_tableParent = dynamic_cast(newParent); + if (!layout_tableParent || !SetSiteInternal(row, column, rowSpan, columnSpan)) { ResetSiteInternal(); } - if (tableParent) + if (layout_tableParent) { if (row != -1 && column != -1) { SetSiteInternal(row, column, rowSpan, columnSpan); } - tableParent->UpdateCellBounds(); } } @@ -30485,23 +30513,51 @@ GuiCellComposition } } - GuiCellComposition::GuiCellComposition() - :row(-1) - ,column(-1) - ,rowSpan(1) - ,columnSpan(1) - ,tableParent(0) + void GuiCellComposition::Layout_SetCellBounds() { - SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); + Rect result; + if (layout_tableParent && row != -1 && column != -1) + { + Rect bounds1, bounds2; + { + vint index = layout_tableParent->GetSiteIndex(layout_tableParent->rows, layout_tableParent->columns, row, column); + bounds1 = layout_tableParent->layout_cellBounds[index]; + } + { + vint index = layout_tableParent->GetSiteIndex(layout_tableParent->rows, layout_tableParent->columns, row + rowSpan - 1, column + columnSpan - 1); + bounds2 = layout_tableParent->layout_cellBounds[index]; + + if (row + rowSpan == layout_tableParent->rows) + { + bounds2.y2 += layout_tableParent->layout_rowExtending; + } + if (column + columnSpan == layout_tableParent->columns) + { + bounds2.x2 += layout_tableParent->layout_columnExtending; + } + } + vint offset = layout_tableParent->borderVisible ? layout_tableParent->cellPadding : 0; + result = Rect(bounds1.x1 + offset, bounds1.y1 + offset, bounds2.x2 + offset, bounds2.y2 + offset); + } + else + { + result = Rect(); + } + Layout_SetCachedBounds(result); } - GuiCellComposition::~GuiCellComposition() + GuiCellComposition::GuiCellComposition() { + SetMinSizeLimitation(GuiGraphicsComposition::LimitToElementAndChildren); + CachedMinSizeChanged.AttachLambda([this](GuiGraphicsComposition* sender, GuiEventArgs& arguments) + { + if (layout_tableParent) layout_tableParent->layout_invalid = true; + }); } GuiTableComposition* GuiCellComposition::GetTableParent() { - return tableParent; + return layout_tableParent; } vint GuiCellComposition::GetRow() @@ -30531,56 +30587,17 @@ GuiCellComposition return false; } - if (tableParent) - { - tableParent->UpdateCellBounds(); - } + InvokeOnCompositionStateChanged(); return true; } - Rect GuiCellComposition::GetBounds() - { - Rect result; - if(tableParent && row!=-1 && column!=-1) - { - Rect bounds1, bounds2; - { - vint index=tableParent->GetSiteIndex(tableParent->rows, tableParent->columns, row, column); - bounds1=tableParent->cellBounds[index]; - } - { - vint index=tableParent->GetSiteIndex(tableParent->rows, tableParent->columns, row+rowSpan-1, column+columnSpan-1); - bounds2=tableParent->cellBounds[index]; - if(tableParent->GetMinSizeLimitation()==GuiGraphicsComposition::NoLimit) - { - if(row+rowSpan==tableParent->rows) - { - bounds2.y2+=tableParent->rowExtending; - } - if(column+columnSpan==tableParent->columns) - { - bounds2.x2+=tableParent->columnExtending; - } - } - } - vint offset = tableParent->borderVisible ? tableParent->cellPadding : 0; - result = Rect(bounds1.x1 + offset, bounds1.y1 + offset, bounds2.x2 + offset, bounds2.y2 + offset); - } - else - { - result = Rect(); - } - UpdatePreviousBounds(result); - return result; - } - /*********************************************************************** GuiTableSplitterCompositionBase ***********************************************************************/ void GuiTableSplitterCompositionBase::OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent) { - GuiGraphicsSite::OnParentChanged(oldParent, newParent); + GuiGraphicsComposition::OnParentChanged(oldParent, newParent); tableParent = dynamic_cast(newParent); } @@ -30705,35 +30722,27 @@ GuiTableSplitterCompositionBase vint Rect::* dimV2 ) { - Rect result(0, 0, 0, 0); + Rect result; if (tableParent) { if (0 < cellsBefore && cellsBefore < tableParent->*cells) { vint offset = tableParent->borderVisible ? tableParent->cellPadding : 0; result.*dimU1 = offset; - result.*dimU2 = offset + (tableParent->GetCellArea().*dimSize)(); + result.*dimU2 = offset + (tableParent->Layout_CalculateCellArea(tableParent->GetCachedBounds()).*dimSize)(); result.*dimV1 = offset + cellOffsets[cellsBefore] - tableParent->cellPadding; result.*dimV2 = (result.*dimV1) + tableParent->cellPadding; } } - UpdatePreviousBounds(result); return result; } GuiTableSplitterCompositionBase::GuiTableSplitterCompositionBase() - :tableParent(0) - , dragging(false) { - SetAssociatedCursor(GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::SizeNS)); GetEventReceiver()->leftButtonDown.AttachMethod(this, &GuiTableSplitterCompositionBase::OnLeftButtonDown); GetEventReceiver()->leftButtonUp.AttachMethod(this, &GuiTableSplitterCompositionBase::OnLeftButtonUp); } - GuiTableSplitterCompositionBase::~GuiTableSplitterCompositionBase() - { - } - GuiTableComposition* GuiTableSplitterCompositionBase::GetTableParent() { return tableParent; @@ -30748,24 +30757,36 @@ GuiRowSplitterComposition OnMouseMoveHelper( rowsToTheTop, &GuiTableComposition::rows, - tableParent->rowSizes, + tableParent->layout_rowSizes, arguments.y - draggingPoint.y, &GuiTableComposition::GetRowOption, &GuiTableComposition::SetRowOption ); } + + Rect GuiRowSplitterComposition::Layout_CalculateBounds(Size parentSize) + { + return GetBoundsHelper( + rowsToTheTop, + &GuiTableComposition::rows, + &Rect::Width, + tableParent->layout_rowOffsets, + &Rect::x1, + &Rect::x2, + &Rect::y1, + &Rect::y2 + ); + } GuiRowSplitterComposition::GuiRowSplitterComposition() - :rowsToTheTop(0) { - SetAssociatedCursor(GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::SizeNS)); + if (auto controller = GetCurrentController()) + { + SetAssociatedCursor(controller->ResourceService()->GetSystemCursor(INativeCursor::SizeNS)); + } GetEventReceiver()->mouseMove.AttachMethod(this, &GuiRowSplitterComposition::OnMouseMove); } - GuiRowSplitterComposition::~GuiRowSplitterComposition() - { - } - vint GuiRowSplitterComposition::GetRowsToTheTop() { return rowsToTheTop; @@ -30780,20 +30801,6 @@ GuiRowSplitterComposition } } - Rect GuiRowSplitterComposition::GetBounds() - { - return GetBoundsHelper( - rowsToTheTop, - &GuiTableComposition::rows, - &Rect::Width, - tableParent->rowOffsets, - &Rect::x1, - &Rect::x2, - &Rect::y1, - &Rect::y2 - ); - } - /*********************************************************************** GuiColumnSplitterComposition ***********************************************************************/ @@ -30803,24 +30810,36 @@ GuiColumnSplitterComposition OnMouseMoveHelper( columnsToTheLeft, &GuiTableComposition::columns, - tableParent->columnSizes, + tableParent->layout_columnSizes, arguments.x - draggingPoint.x, &GuiTableComposition::GetColumnOption, &GuiTableComposition::SetColumnOption ); } + + Rect GuiColumnSplitterComposition::Layout_CalculateBounds(Size parentSize) + { + return GetBoundsHelper( + columnsToTheLeft, + &GuiTableComposition::columns, + &Rect::Height, + tableParent->layout_columnOffsets, + &Rect::y1, + &Rect::y2, + &Rect::x1, + &Rect::x2 + ); + } GuiColumnSplitterComposition::GuiColumnSplitterComposition() - :columnsToTheLeft(0) { - SetAssociatedCursor(GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::SizeWE)); + if (auto controller = GetCurrentController()) + { + SetAssociatedCursor(controller->ResourceService()->GetSystemCursor(INativeCursor::SizeWE)); + } GetEventReceiver()->mouseMove.AttachMethod(this, &GuiColumnSplitterComposition::OnMouseMove); } - GuiColumnSplitterComposition::~GuiColumnSplitterComposition() - { - } - vint GuiColumnSplitterComposition::GetColumnsToTheLeft() { return columnsToTheLeft; @@ -30834,20 +30853,6 @@ GuiColumnSplitterComposition InvokeOnCompositionStateChanged(); } } - - Rect GuiColumnSplitterComposition::GetBounds() - { - return GetBoundsHelper( - columnsToTheLeft, - &GuiTableComposition::columns, - &Rect::Height, - tableParent->columnOffsets, - &Rect::y1, - &Rect::y2, - &Rect::x1, - &Rect::x2 - ); - } } } } @@ -31114,6 +31119,7 @@ GuiDocumentElement::GuiDocumentElementRenderer void GuiDocumentElement::GuiDocumentElementRenderer::RenderTargetChangedInternal(IGuiGraphicsRenderTarget* oldRenderTarget, IGuiGraphicsRenderTarget* newRenderTarget) { + // TODO: (enumerable) foreach for(vint i=0;iembeddedObjects.Count(); j++) { auto eo = cache->embeddedObjects.Values()[j]; @@ -31372,6 +31381,7 @@ GuiDocumentElement::GuiDocumentElementRenderer { if (auto cache = oldCaches[index + i]) { + // TODO: (enumerable) foreach on dictionary for (vint j = 0; j < cache->embeddedObjects.Count(); j++) { auto id = cache->embeddedObjects.Keys()[j]; @@ -31453,6 +31463,7 @@ GuiDocumentElement::GuiDocumentElementRenderer } if (!renderTarget) return; + // TODO: (enumerable) foreach:indexed for(vint i=0;iSetBounds({ {},clientSize }); } + + for (auto listener : mainWindow->listeners) + { + listener->Moved(); + } } } @@ -35001,9 +35017,9 @@ GuiHostedController::INativeControllerListener return; } - for (auto hostedWindow : createdWindows) + for (auto visibleWindow : From(wmManager->ordinaryWindowsInOrder).Concat(wmManager->topMostedWindowsInOrder)) { - for (auto listener : hostedWindow->listeners) + for (auto listener : visibleWindow->id->listeners) { if (listener->NeedRefresh()) { @@ -35028,6 +35044,7 @@ GuiHostedController::INativeControllerListener bool failureByResized = false; bool failureByLostDevice = false; + // TODO: (enumerable) foreach:reversed for (vint i = wmManager->ordinaryWindowsInOrder.Count() - 1; i >= 0; i--) { auto hostedWindow = wmManager->ordinaryWindowsInOrder[i]->id; @@ -35042,6 +35059,7 @@ GuiHostedController::INativeControllerListener } } } + // TODO: (enumerable) foreach:reversed for (vint i = wmManager->topMostedWindowsInOrder.Count() - 1; i >= 0; i--) { auto hostedWindow = wmManager->topMostedWindowsInOrder[i]->id; @@ -35321,6 +35339,7 @@ GuiHostedController::INativeWindowService { wmManager->Stop(); + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = createdWindows.Count() - 1; i >= 0; i--) { auto hostedWindow = createdWindows[i]; @@ -36962,6 +36981,7 @@ DocumentModel void DocumentModel::GetText(stream::TextWriter& writer, bool skipNonTextContent) { + // TODO: (enumerable) Linq:Aggregate for(vint i=0;i paragraph=paragraphs[i]; @@ -37046,6 +37066,7 @@ namespace vl void VisitContainer(DocumentContainerRun* run)override { + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = run->runs.Count() - 1; i >= 0; i--) { auto childRun = run->runs[i]; @@ -37417,6 +37438,7 @@ namespace vl StreamWriter writer(encoderStream); GenerateHtmlVisitor visitor(model.Obj(), writer); + // TODO: (enumerable) foreach for (auto paragraph : model->paragraphs) { writer.WriteString(L"

runs.Count() - 1; i >= 0; i--) { Ptr subRun = run->runs[i]; @@ -37934,6 +37957,7 @@ Clear all runs that have an empty length void VisitContainer(DocumentContainerRun* run) { + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = run->runs.Count() - 1; i >= 0; i--) { vint oldStart = start; @@ -38018,6 +38042,7 @@ Remove DocumentStylePropertiesRun if it is empty or contains no text run void VisitContainer(DocumentContainerRun* run) { + // TODO: (enumerable) foreach:indexed(alterable) for (vint i = 0; i < run->runs.Count(); i++) { Ptr subRun = run->runs[i]; @@ -38026,6 +38051,7 @@ Remove DocumentStylePropertiesRun if it is empty or contains no text run if (replacedRuns.Count() > 0) { run->runs.RemoveAt(i); + // TODO: (enumerable) foreach for (vint j = 0; j < replacedRuns.Count(); j++) { run->runs.Insert(i + j, replacedRuns[j]); @@ -38242,6 +38268,7 @@ Merge sibling runs if they are exactly the same void VisitContainer(DocumentContainerRun* run) { + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = 0; i < run->runs.Count() - 1; i++) { auto currentRun = run->runs[i]; @@ -38259,6 +38286,7 @@ Merge sibling runs if they are exactly the same } } + // TODO: (enumerable) foreach for (vint i = 0; i < run->runs.Count() - 1; i++) { run->runs[i]->Accept(this); @@ -38591,6 +38619,7 @@ Clone the current run with its children textRun->text = text; CloneRunVisitor visitor(textRun); + // TODO: (enumerable) foreach:reversed for (vint i = styleRuns.Count() - 1; i >= 0; i--) { styleRuns[i]->Accept(&visitor); @@ -38768,6 +38797,7 @@ If a run decides that itself should be cut, then leftRun and rightRun contains n Ptr leftContainer = CopyRun(run).Cast(); Ptr rightContainer = CopyRun(run).Cast(); + // TODO: (enumerable) foreach for (vint i = 0; iruns.Count(); i++) { (iruns.Add(run->runs[i]); @@ -39240,6 +39270,7 @@ ClearStyleVisitor : Remove all styles that intersect with the specified range void VisitContainer(DocumentContainerRun* run) { + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = run->runs.Count() - 1; i >= 0; i--) { Ptr subRun = run->runs[i]; @@ -39251,6 +39282,7 @@ ClearStyleVisitor : Remove all styles that intersect with the specified range if (replacedRuns.Count() != 1 || replacedRuns[0] != subRun) { run->runs.RemoveAt(i); + // TODO: (enumerable) foreach for (vint j = 0; jruns.Insert(i + j, replacedRuns[j]); @@ -39416,6 +39448,7 @@ If a run decides that itself should be removed, then replacedRuns contains all r void VisitContainer(DocumentContainerRun* run) { if (start == end) return; + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = run->runs.Count() - 1; i >= 0; i--) { Ptr subRun = run->runs[i]; @@ -39429,6 +39462,7 @@ If a run decides that itself should be removed, then replacedRuns contains all r if (replacedRuns.Count() == 0 || subRun != replacedRuns[0]) { run->runs.RemoveAt(i); + // TODO: (enumerable) foreach for (vint j = 0; jruns.Insert(i + j, replacedRuns[j]); @@ -39708,6 +39742,7 @@ Calculate if all text in the specified range has some common styles void VisitContainer(DocumentContainerRun* run) { + // TODO: (enumerable) foreach:reversed for (vint i = run->runs.Count() - 1; i >= 0; i--) { Ptr subRun = run->runs[i]; @@ -39830,6 +39865,7 @@ Calculate if all text in the specified range has a common style name void VisitContainer(DocumentContainerRun* run) { + // TODO: (enumerable) foreach:reversed for (vint i = run->runs.Count() - 1; i >= 0; i--) { Ptr subRun = run->runs[i]; @@ -40014,6 +40050,7 @@ DocumentModel::EditRangeOperations CollectStyleName(paragraph.Obj(), styleNames); } + // TODO: (enumerable) foreach:alterable for(vint i=0;i oldNames, newNames; CopyFrom(oldNames, model->styles.Keys()); CopyFrom(newNames, model->styles.Keys()); + // TODO: (enumerable) foreach:indexed(allow-set) for(vint i=0;ialignment = newEndRuns->alignment; } + + // TODO: (enumerable) foreach for(vint i=0;iruns.Count();i++) { endParagraph->runs.Insert(i, newEndRuns->runs[i]); } + // TODO: (enumerable) foreach:indexed for(vint i=1;i> runs(text.Count()); + // TODO: (enumerable) foreach:indexed for(vint i=0;i paragraph=CopyStyledText(styleRuns, text[i]); @@ -41418,6 +41460,7 @@ DocumentModel stylesElement->name.value=L"Styles"; doc->subNodes.Add(stylesElement); + // TODO: (enumerable) foreach for(vint i=0;i= 0; i--) { loading.Remove(loading.Keys()[i], name); @@ -44781,6 +44826,7 @@ View Model (IFileDialogViewModel) } auto folder = rootFolder; + // TODO: (enumerable) foreach:reversed for (vint i = fragments.Count() - 1; i >= 0; i--) { auto fragment = fragments[i]; @@ -45045,6 +45091,7 @@ View Model (IFileDialogViewModel) } } + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = folderOfUnexistings.Count() - 1; i >= 0; i--) { if (filesystem::Folder(folderOfUnexistings[i]).Exists()) @@ -45142,6 +45189,7 @@ View Model (IFileDialogViewModel) auto&& sExt = WString::Unmanaged(L".") + extension.Value(); vint lExt = sExt.Length(); + // TODO: (enumerable) foreach for (vint i = 0; i < confirmedSelection.Count(); i++) { WString& selection = confirmedSelection[i]; @@ -54583,6 +54631,7 @@ SharedAsyncService { CopyFrom(items, taskItems); taskItems.RemoveRange(0, items.Count()); + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for(vint i=delayItems.Count()-1;i>=0;i--) { Ptr item=delayItems[i]; @@ -54743,6 +54792,7 @@ SharedCallbackService void SharedCallbackService::InvokeGlobalTimer() { + // TODO: (enumerable) foreach for(vint i=0;iGlobalTimer(); @@ -54751,6 +54801,7 @@ SharedCallbackService void SharedCallbackService::InvokeClipboardUpdated() { + // TODO: (enumerable) foreach for(vint i=0;iClipboardUpdated(); @@ -54759,6 +54810,7 @@ SharedCallbackService void SharedCallbackService::InvokeGlobalShortcutKeyActivated(vint id) { + // TODO: (enumerable) foreach for (vint i = 0; i < listeners.Count(); i++) { listeners[i]->GlobalShortcutKeyActivated(id); @@ -54767,6 +54819,7 @@ SharedCallbackService void SharedCallbackService::InvokeNativeWindowCreated(INativeWindow* window) { + // TODO: (enumerable) foreach for(vint i=0;iNativeWindowCreated(window); @@ -54775,6 +54828,7 @@ SharedCallbackService void SharedCallbackService::InvokeNativeWindowDestroying(INativeWindow* window) { + // TODO: (enumerable) foreach for(vint i=0;iNativeWindowDestroying(window); diff --git a/Import/GacUI.h b/Import/GacUI.h index b3cb1c49..305a2386 100644 --- a/Import/GacUI.h +++ b/Import/GacUI.h @@ -1072,8 +1072,6 @@ namespace vl namespace compositions { class GuiGraphicsComposition; - - extern void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); } namespace elements @@ -3945,7 +3943,7 @@ Workflow to C++ Codegen Helpers #endif /*********************************************************************** -.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITIONBASE.H +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 @@ -3955,8 +3953,8 @@ GacUI::Composition System Interfaces: ***********************************************************************/ -#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITIONBASE -#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITIONBASE +#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITION +#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITION namespace vl @@ -3985,8 +3983,14 @@ namespace vl namespace compositions { + class GuiGraphicsComposition_Trivial; + class GuiGraphicsComposition_Controlled; + class GuiGraphicsComposition_Specialized; + class GuiWindowComposition; class GuiGraphicsHost; + extern void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); + /*********************************************************************** Basic Construction ***********************************************************************/ @@ -3999,11 +4003,14 @@ Basic Construction { typedef collections::List CompositionList; + friend class GuiGraphicsComposition_Trivial; + friend class GuiGraphicsComposition_Controlled; + friend class GuiGraphicsComposition_Specialized; + friend class GuiWindowComposition; friend class controls::GuiControl; friend class GuiGraphicsHost; - friend void InvokeOnCompositionStateChanged(GuiGraphicsComposition* composition); - friend Size InvokeGetMinPreferredClientSizeInternal(GuiGraphicsComposition* composition, bool considerPreferredMinSize); - friend Rect InvokeGetPreferredBoundsInternal(GuiGraphicsComposition* composition, bool considerPreferredMinSize); + + friend void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); public: ///

/// Minimum size limitation. @@ -4027,7 +4034,9 @@ Basic Construction INativeWindow* nativeWindow = nullptr; }; - protected: + private: + bool isRendering = false; + CompositionList children; GuiGraphicsComposition* parent = nullptr; Ptr ownedElement; @@ -4041,29 +4050,27 @@ Basic Construction INativeCursor* associatedCursor = nullptr; INativeWindowListener::HitTestResult associatedHitTestResult = INativeWindowListener::NoDecision; - Margin margin; + protected: Margin internalMargin; Size preferredMinSize; - bool isRendering = false; - virtual void OnControlParentChanged(controls::GuiControl* control); virtual void OnChildInserted(GuiGraphicsComposition* child); virtual void OnChildRemoved(GuiGraphicsComposition* child); virtual void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent); virtual void OnParentLineChanged(); + virtual void OnCompositionStateChanged(); virtual void OnRenderContextChanged(); void UpdateRelatedHostRecord(GraphicsHostRecord* record); void SetAssociatedControl(controls::GuiControl* control); void InvokeOnCompositionStateChanged(); - virtual Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize) = 0; - virtual Rect GetPreferredBoundsInternal(bool considerPreferredMinSize) = 0; - + private: static bool SharedPtrDestructorProc(DescriptableObject* obj, bool forceDisposing); - public: + GuiGraphicsComposition(); + public: ~GuiGraphicsComposition(); bool IsRendering(); @@ -4138,9 +4145,6 @@ Basic Construction /// Set is the composition transparent to mouse events. /// Set to true to make this composition transparent to mouse events. void SetTransparentToMouse(bool value); - /// Get the bounds in the top composition space. - /// The bounds in the top composition space. - Rect GetGlobalBounds(); /// Get the associated control. A control is associated to a composition only when the composition represents the bounds of this control. Such a composition usually comes from a control template. /// The associated control. @@ -4174,87 +4178,157 @@ Basic Construction /// The related cursor. INativeCursor* GetRelatedCursor(); - /// Get the margin. - /// The margin. - virtual Margin GetMargin(); - /// Set the margin. - /// The margin. - virtual void SetMargin(Margin value); /// Get the internal margin. /// The internal margin. - virtual Margin GetInternalMargin(); + Margin GetInternalMargin(); /// Set the internal margin. /// The internal margin. - virtual void SetInternalMargin(Margin value); + void SetInternalMargin(Margin value); /// Get the preferred minimum size. /// The preferred minimum size. - virtual Size GetPreferredMinSize(); + Size GetPreferredMinSize(); /// Set the preferred minimum size. /// The preferred minimum size. - virtual void SetPreferredMinSize(Size value); - /// Get the client area. - /// The client area. - virtual Rect GetClientArea(); - /// Force to calculate layout and size immediately - virtual void ForceCalculateSizeImmediately(); + void SetPreferredMinSize(Size value); - /// Get the preferred minimum client size. - /// The preferred minimum client size. - Size GetMinPreferredClientSize(); - /// Get the preferred bounds. - /// The preferred bounds. - Rect GetPreferredBounds(); - - /// Test is the size calculation affected by the parent. - /// Returns true if the size calculation is affected by the parent. - virtual bool IsSizeAffectParent()=0; - /// Get the bounds. - /// The bounds. - virtual Rect GetBounds()=0; - }; - - /// - /// A general implementation for . - /// - class GuiGraphicsSite : public GuiGraphicsComposition, public Description - { - friend Rect InvokeGetBoundsInternal(GuiGraphicsSite* composition, Rect expectedBounds, bool considerPreferredMinSize); protected: - Rect previousBounds; + Size cachedMinSize; + Rect cachedBounds; - /// Calculate the final bounds from an expected bounds. - /// The final bounds according to some configuration like margin, minimum size, etc.. - /// The expected bounds. - virtual Rect GetBoundsInternal(Rect expectedBounds, bool considerPreferredMinSize); + virtual Size Layout_CalculateMinSize() = 0; + virtual Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) = 0; + virtual Rect Layout_CalculateBounds(Size parentSize) = 0; - void UpdatePreviousBounds(Rect bounds); - Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override; - Rect GetPreferredBoundsInternal(bool considerPreferredMinSize)override; + /// + /// Calculate a proper minimum size using all configurations in this class. + /// All children's will be called. + /// All children's will be called. + /// + /// + Size Layout_CalculateMinSizeHelper(); + + /// + /// Update a size that affects and . + /// + /// The minimum size to update + void Layout_SetCachedMinSize(Size value); + + /// + /// Update a bounds that affects and and . + /// + /// The minimum size to update + void Layout_SetCachedBounds(Rect value); + + /// + /// Call and . + /// + void Layout_UpdateMinSize(); + + /// + /// Call and and all children's . + /// + /// + void Layout_UpdateBounds(Size parentSize); public: - GuiGraphicsSite(); - ~GuiGraphicsSite(); - /// Event that will be raised when the final bounds is changed. - compositions::GuiNotifyEvent BoundsChanged; - - bool IsSizeAffectParent()override; + /// Event that will be raised when the minimum size is updated. + compositions::GuiNotifyEvent CachedMinSizeChanged; - /// Get the previous calculated bounds, ignoring any surrounding changes that could affect the bounds. - /// The previous calculated bounds. - Rect GetPreviousCalculatedBounds(); + /// Event that will be raised when the bounds is updated. + compositions::GuiNotifyEvent CachedBoundsChanged; + + /// Get the updated minimum size. + /// The updated minimum size. + Size GetCachedMinSize(); + + /// Get the updated minimum client size. It is the minimum size removing the internal margin. + /// The updated minimum client size. + Size GetCachedMinClientSize(); + + /// Get the updated bounds. + /// The updated bounds. + Rect GetCachedBounds(); + + /// Get the updated client bounds. It is the bounds removing the internal margin. + /// The updated client bounds. + Rect GetCachedClientArea(); + + /// Get the bounds in the top composition space. + /// The bounds in the top composition space. + Rect GetGlobalBounds(); + + /// + /// Force this composition calculate its layout. + /// + void ForceCalculateSizeImmediately(); }; - - /// - /// Represents a composition for the client area in an . - /// - class GuiWindowComposition : public GuiGraphicsSite, public Description - { - public: - GuiWindowComposition(); - ~GuiWindowComposition(); - Rect GetBounds()override; - void SetMargin(Margin value)override; +/*********************************************************************** +Categories +***********************************************************************/ + + /// + /// A trivial composition is a composition that can be placed anywhere needed. + /// This class is not reflectable, it is for classification only. + /// All controlled children's minimum sizes are supposed to be done in . + /// All controlled children's bounds are supposed to be done in . + /// + class GuiGraphicsComposition_Trivial : public GuiGraphicsComposition + { + protected: + GuiGraphicsComposition_Trivial() = default; + }; + + /// + /// A controlled composition is a composition that must be placed inside a certain type of parent composition. + /// Its layout calculation are taken over by its parent. + /// This class is not reflectable, it is for classification only. + /// + class GuiGraphicsComposition_Controlled : public GuiGraphicsComposition + { + protected: + GuiGraphicsComposition_Controlled() = default; + + Size Layout_CalculateMinSize()override + { + // Making Layout_UpdateMinSize does nothing + return cachedMinSize; + } + + Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) override + { + // A controlled composition could affect its parent's layout + // but it is done inside the parent + return { 0,0 }; + } + + Rect Layout_CalculateBounds(Size parentSize) override + { + // Making Layout_UpdateBounds does nothing + return cachedBounds; + } + }; + + /// + /// A specialized composition is a composition that can be placed anywhere needed. + /// But its layout calculation are designed for special purposes. + /// This class is not reflectable, it is for classification only. + /// + class GuiGraphicsComposition_Specialized : public GuiGraphicsComposition + { + protected: + GuiGraphicsComposition_Specialized() = default; + + Size Layout_CalculateMinSize()override + { + return Layout_CalculateMinSizeHelper(); + } + + Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) override + { + // A controlled composition could not affect its parent's layout + return { 0,0 }; + } }; /*********************************************************************** @@ -4283,7 +4357,7 @@ Helper Functions #endif /*********************************************************************** -.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSBASICCOMPOSITION.H +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSBOUNDSCOMPOSITION.H ***********************************************************************/ /*********************************************************************** Vczh Library++ 3.0 @@ -4293,8 +4367,8 @@ GacUI::Composition System Interfaces: ***********************************************************************/ -#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSBASICCOMPOSITION -#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSBASICCOMPOSITION +#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSBOUNDSCOMPOSITION +#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSBOUNDSCOMPOSITION namespace vl @@ -4311,30 +4385,25 @@ Basic Compositions /// /// Represents a composition that is free to change the expected bounds. /// - class GuiBoundsComposition : public GuiGraphicsSite, public Description + class GuiBoundsComposition : public GuiGraphicsComposition_Trivial, public Description { protected: - bool sizeAffectParent = true; - Rect compositionBounds; + Rect expectedBounds; Margin alignmentToParent{ -1,-1,-1,-1 }; - Rect GetPreferredBoundsInternal(bool considerPreferredMinSize)override; + Size Layout_CalculateMinSize() override; + Size Layout_CalculateMinClientSizeForParent(Margin parentInternalMargin) override; + Rect Layout_CalculateBounds(Size parentSize) override; public: - GuiBoundsComposition(); - ~GuiBoundsComposition(); + GuiBoundsComposition() = default; + ~GuiBoundsComposition() = default; - /// Get if the parent composition's size calculation is aware of the configuration of this composition. If you want to bind Bounds, PreferredMinSize, AlignmentToParent or other similar properties to some properties of parent compositions, this property should be set to false to prevent from infinite size glowing. - /// Returns true if it is awared. - bool GetSizeAffectParent(); - /// Set if the parent composition's size calculation is aware of the configuration of this composition. - /// Set to true to be awared. - void SetSizeAffectParent(bool value); - - bool IsSizeAffectParent()override; - Rect GetBounds()override; + /// Get the expected bounds. + /// The expected bounds. + Rect GetExpectedBounds(); /// Set the expected bounds. /// The expected bounds. - void SetBounds(Rect value); + void SetExpectedBounds(Rect value); /// Get the alignment to its parent. -1 in each alignment component means that the corressponding side is not aligned to its parent. /// The alignment to its parent. @@ -4352,6 +4421,48 @@ Basic Compositions #endif +/*********************************************************************** +.\APPLICATION\GRAPHICSCOMPOSITIONS\GUIGRAPHICSWINDOWCOMPOSITION.H +***********************************************************************/ +/*********************************************************************** +Vczh Library++ 3.0 +Developer: Zihan Chen(vczh) +GacUI::Composition System + +Interfaces: +***********************************************************************/ + +#ifndef VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITIONBASE +#define VCZH_PRESENTATION_COMPOSITION_GUIGRAPHICSCOMPOSITIONBASE + + +namespace vl +{ + namespace presentation + { + namespace compositions + { + class GuiGraphicsHost; + + /// + /// Represents a composition for the client area in an . + /// + class GuiWindowComposition : public GuiGraphicsComposition_Specialized, public Description + { + friend class GuiGraphicsHost; + protected: + Rect Layout_CalculateBounds(Size parentSize) override; + + public: + GuiWindowComposition() = default; + ~GuiWindowComposition() = default; + }; + } + } +} + +#endif + /*********************************************************************** .\APPLICATION\GRAPHICSHOST\GUIGRAPHICSHOST_ALT.H ***********************************************************************/ @@ -4934,6 +5045,8 @@ namespace vl { namespace compositions { + class GuiWindowComposition; + class GuiTableComposition; class GuiCellComposition; class GuiTableSplitterCompositionBase; @@ -5002,6 +5115,8 @@ Flow Compositions Left, /// Align to the center. Center, + /// Align to the Right. + Right, /// Extend to the entire row. Extend, }; @@ -5014,27 +5129,30 @@ Flow Compositions friend class GuiFlowItemComposition; typedef collections::List ItemCompositionList; + private: + bool layout_invalid = true; + vint layout_lastVirtualWidth = 0; + ItemCompositionList layout_flowItems; + vint layout_minVirtualHeight = 0; + + void Layout_UpdateFlowItemLayout(vint maxVirtualWidth); + Size Layout_UpdateFlowItemLayoutByConstraint(Size constraintSize); + protected: Margin extraMargin; vint rowPadding = 0; vint columnPadding = 0; FlowAlignment alignment = FlowAlignment::Left; - Ptr axis; + Ptr axis = Ptr(new GuiDefaultAxis); - ItemCompositionList flowItems; - collections::Array flowItemBounds; - Rect bounds; - vint minHeight = 0; - bool needUpdate = false; - - void UpdateFlowItemBounds(bool forceUpdate); - void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments); - void OnChildInserted(GuiGraphicsComposition* child)override; - void OnChildRemoved(GuiGraphicsComposition* child)override; - Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override; + void OnChildInserted(GuiGraphicsComposition* child) override; + void OnChildRemoved(GuiGraphicsComposition* child) override; + void OnCompositionStateChanged() override; + Size Layout_CalculateMinSize() override; + Rect Layout_CalculateBounds(Size parentSize) override; public: - GuiFlowComposition(); - ~GuiFlowComposition(); + GuiFlowComposition() = default; + ~GuiFlowComposition() = default; /// Get all flow items inside the flow composition. /// All flow items inside the flow composition. @@ -5079,9 +5197,6 @@ Flow Compositions /// Set the alignment for rows. /// The alignment. void SetAlignment(FlowAlignment value); - - void ForceCalculateSizeImmediately()override; - Rect GetBounds()override; }; /// @@ -5089,14 +5204,17 @@ Flow Compositions /// struct GuiFlowOption { - /// Base line calculation algorithm + /// + /// Specify the the relationship between this item and the baseline of the row that this item currently belongs to. + /// The height of a row is the maximum value of minimum heights of all items in it. + /// enum BaselineType { - /// By percentage of the height from the top. + /// Top of this item is "percentage" times of the item height above the baseline. Percentage, - /// By a distance from the top. + /// Top of this item is "distance" above the baseline. FromTop, - /// By a distance from the bottom. + /// Bottom of this item is "distance" below the baseline. FromBottom, }; @@ -5113,24 +5231,23 @@ Flow Compositions /// /// Represents a flow item composition of a . /// - class GuiFlowItemComposition : public GuiGraphicsSite, public Description + class GuiFlowItemComposition : public GuiGraphicsComposition_Controlled, public Description { friend class GuiFlowComposition; + private: + GuiFlowComposition* layout_flowParent = nullptr; + Rect layout_virtualBounds; + + void Layout_SetFlowItemBounds(Size contentSize, Rect virtualBounds); protected: - GuiFlowComposition* flowParent; - Rect bounds; Margin extraMargin; GuiFlowOption option; - void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent)override; - Size GetMinSize(); + void OnParentLineChanged() override; + public: GuiFlowItemComposition(); - ~GuiFlowItemComposition(); - - bool IsSizeAffectParent()override; - Rect GetBounds()override; - void SetBounds(Rect value); + ~GuiFlowItemComposition() = default; /// Get the extra margin for this flow item. An extra margin is used to enlarge the bounds of the flow item, but only the non-extra part will be used for deciding the flow item layout. /// The extra margin for this flow item. @@ -5189,6 +5306,7 @@ GuiResponsiveCompositionBase /// Base class for responsive layout compositions. class GuiResponsiveCompositionBase abstract : public GuiBoundsComposition, public Description { + friend class GuiResponsiveContainerComposition; protected: GuiResponsiveCompositionBase* responsiveParent = nullptr; ResponsiveDirection direction = ResponsiveDirection::Both; @@ -5200,7 +5318,7 @@ GuiResponsiveCompositionBase public: GuiResponsiveCompositionBase(); - ~GuiResponsiveCompositionBase(); + ~GuiResponsiveCompositionBase() = default; /// LevelCount changed event. GuiNotifyEvent LevelCountChanged; @@ -5244,7 +5362,7 @@ GuiResponsiveViewComposition public: GuiResponsiveSharedCollection(GuiResponsiveViewComposition* _view); - ~GuiResponsiveSharedCollection(); + ~GuiResponsiveSharedCollection() = default; }; class GuiResponsiveViewCollection : public collections::ObservableListBase @@ -5259,7 +5377,7 @@ GuiResponsiveViewComposition public: GuiResponsiveViewCollection(GuiResponsiveViewComposition* _view); - ~GuiResponsiveViewCollection(); + ~GuiResponsiveViewCollection() = default; }; /// Represents a composition, which will pick up a shared control and install inside it, when it is displayed by a [T:vl.presentation.compositions.GuiResponsiveViewComposition] @@ -5274,7 +5392,7 @@ GuiResponsiveViewComposition public: GuiResponsiveSharedComposition(); - ~GuiResponsiveSharedComposition(); + ~GuiResponsiveSharedComposition() = default; /// Get the selected shared control. /// The selected shared control. @@ -5342,8 +5460,8 @@ Others void OnResponsiveChildLevelUpdated()override; public: - GuiResponsiveFixedComposition(); - ~GuiResponsiveFixedComposition(); + GuiResponsiveFixedComposition() = default; + ~GuiResponsiveFixedComposition() = default; vint GetLevelCount()override; vint GetCurrentLevel()override; @@ -5368,8 +5486,8 @@ Others bool ChangeLevel(bool levelDown); public: - GuiResponsiveStackComposition(); - ~GuiResponsiveStackComposition(); + GuiResponsiveStackComposition() = default; + ~GuiResponsiveStackComposition() = default; vint GetLevelCount()override; vint GetCurrentLevel()override; @@ -5393,8 +5511,8 @@ Others void OnResponsiveChildLevelUpdated()override; public: - GuiResponsiveGroupComposition(); - ~GuiResponsiveGroupComposition(); + GuiResponsiveGroupComposition() = default; + ~GuiResponsiveGroupComposition() = default; vint GetLevelCount()override; vint GetCurrentLevel()override; @@ -5409,16 +5527,22 @@ GuiResponsiveContainerComposition /// A composition which will automatically tell its target responsive composition to switch between views according to its size. class GuiResponsiveContainerComposition : public GuiBoundsComposition, public Description { - protected: + private: GuiResponsiveCompositionBase* responsiveTarget = nullptr; - Size upperLevelSize; + Size minSizeUpperBound; + Size minSizeLowerBound; + bool testX = false; + bool testY = false; - void AdjustLevel(); - void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments); + std::strong_ordering Layout_CompareSize(Size first, Size second); + void Layout_AdjustLevelUp(Size containerSize); + void Layout_AdjustLevelDown(Size containerSize); + public: + Rect Layout_CalculateBounds(Size parentSize) override; public: GuiResponsiveContainerComposition(); - ~GuiResponsiveContainerComposition(); + ~GuiResponsiveContainerComposition() = default; /// Get the responsive composition to control. /// The responsive composition to control. @@ -5458,17 +5582,20 @@ namespace vl /// A shared size composition that shares the same size with all other that has a same group name. class GuiSharedSizeItemComposition : public GuiBoundsComposition, public Description { + friend class GuiSharedSizeRootComposition; protected: GuiSharedSizeRootComposition* parentRoot = nullptr; WString group; bool sharedWidth = false; bool sharedHeight = false; + Size originalMinSize; - void Update(); - void OnParentLineChanged()override; + void OnParentLineChanged() override; + Size Layout_CalculateMinSize() override; + Size Layout_CalculateOriginalMinSize(); public: GuiSharedSizeItemComposition(); - ~GuiSharedSizeItemComposition(); + ~GuiSharedSizeItemComposition() = default; /// Get the group name of this item. /// The group name. @@ -5500,14 +5627,14 @@ namespace vl collections::List childItems; void AddSizeComponent(collections::Dictionary& sizes, const WString& group, vint sizeComponent); + void CalculateOriginalMinSizes(); void CollectSizes(collections::Dictionary& widths, collections::Dictionary& heights); void AlignSizes(collections::Dictionary& widths, collections::Dictionary& heights); - public: - GuiSharedSizeRootComposition(); - ~GuiSharedSizeRootComposition(); - void ForceCalculateSizeImmediately()override; - Rect GetBounds()override; + Size Layout_CalculateMinSize() override; + public: + GuiSharedSizeRootComposition() = default; + ~GuiSharedSizeRootComposition() = default; }; } } @@ -5544,7 +5671,7 @@ Specialized Compositions /// /// Represents a composition that is aligned to one border of the parent composition. /// - class GuiSideAlignedComposition : public GuiGraphicsSite, public Description + class GuiSideAlignedComposition : public GuiGraphicsComposition_Specialized, public Description { public: /// The border to align. @@ -5560,12 +5687,15 @@ Specialized Compositions Bottom, }; protected: - Direction direction; - vint maxLength; - double maxRatio; + Direction direction = Top; + vint maxLength = 10; + double maxRatio = 1.0; + + Rect Layout_CalculateBounds(Size parentSize) override; + public: - GuiSideAlignedComposition(); - ~GuiSideAlignedComposition(); + GuiSideAlignedComposition() = default; + ~GuiSideAlignedComposition() = default; /// Get the border to align. /// The border to align. @@ -5585,25 +5715,24 @@ Specialized Compositions /// Set the maximum ratio to limit the size according to the size of the parent. /// The maximum ratio to limit the size according to the size of the parent. void SetMaxRatio(double value); - - bool IsSizeAffectParent()override; - Rect GetBounds()override; }; /// /// Represents a composition that its location and size are decided by the client area of the parent composition by setting ratios. /// - class GuiPartialViewComposition : public GuiGraphicsSite, public Description + class GuiPartialViewComposition : public GuiGraphicsComposition_Specialized, public Description { protected: - double wRatio; - double wPageSize; - double hRatio; - double hPageSize; + double wRatio = 0.0; + double wPageSize = 1.0; + double hRatio = 0.0; + double hPageSize = 1.0; + + Rect Layout_CalculateBounds(Size parentSize) override; public: - GuiPartialViewComposition(); - ~GuiPartialViewComposition(); + GuiPartialViewComposition() = default; + ~GuiPartialViewComposition() = default; /// Get the width ratio to decided the horizontal location. Value in [0, 1-pageSize]. /// The width ratio to decided the horizontal location. @@ -5629,9 +5758,6 @@ Specialized Compositions /// Set the page size to decide the vertical size. Value in [0, 1]. /// The page size to decide the vertical size. void SetHeightPageSize(double value); - - bool IsSizeAffectParent()override; - Rect GetBounds()override; }; } } @@ -5686,28 +5812,30 @@ Stack Compositions /// Stack items is layouted from bottom to top. ReversedVertical, }; + + private: + bool layout_invalid = true; + ItemCompositionList layout_stackItems; + GuiStackItemComposition* layout_ensuringVisibleStackItem = nullptr; + vint layout_adjustment = 0; + Size layout_stackItemTotalSize; + + void Layout_UpdateStackItemMinSizes(); + void Layout_UpdateStackItemBounds(Rect contentBounds); protected: + Direction direction = Horizontal; - ItemCompositionList stackItems; - GuiStackItemComposition* ensuringVisibleStackItem = nullptr; - vint padding = 0; - vint adjustment = 0; Margin extraMargin; - collections::Array stackItemBounds; - Size stackItemTotalSize; - Rect previousBounds; - - void UpdateStackItemBounds(); - void EnsureStackItemVisible(); - void OnBoundsChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments); - void OnChildInserted(GuiGraphicsComposition* child)override; - void OnChildRemoved(GuiGraphicsComposition* child)override; - Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override; + void OnChildInserted(GuiGraphicsComposition* child) override; + void OnChildRemoved(GuiGraphicsComposition* child) override; + void OnCompositionStateChanged() override; + Size Layout_CalculateMinSize() override; + Rect Layout_CalculateBounds(Size parentSize) override; public: - GuiStackComposition(); - ~GuiStackComposition(); + GuiStackComposition() = default; + ~GuiStackComposition() = default; /// Get all stack items inside the stack composition. /// All stack items inside the stack composition. @@ -5731,9 +5859,6 @@ Stack Compositions /// The stack item padding. void SetPadding(vint value); - void ForceCalculateSizeImmediately()override; - Rect GetBounds()override; - /// Get the extra margin inside the stack composition. /// The extra margin inside the stack composition. Margin GetExtraMargin(); @@ -5752,25 +5877,22 @@ Stack Compositions /// /// Represents a stack item composition of a . /// - class GuiStackItemComposition : public GuiGraphicsSite, public Description + class GuiStackItemComposition : public GuiGraphicsComposition_Controlled, public Description { friend class GuiStackComposition; + private: + GuiStackComposition* layout_stackParent = nullptr; + Point layout_virtualOffset; + + void Layout_SetStackItemBounds(Rect contentBounds, Point virtualOffset); + protected: - GuiStackComposition* stackParent; - Rect bounds; Margin extraMargin; - void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent)override; - Size GetMinSize(); + void OnParentLineChanged() override; public: GuiStackItemComposition(); - ~GuiStackItemComposition(); - - bool IsSizeAffectParent()override; - Rect GetBounds()override; - /// Set the expected bounds of a stack item. In most of the cases only the size of the bounds is used. - /// The expected bounds of a stack item. - void SetBounds(Rect value); + ~GuiStackItemComposition() = default; /// Get the extra margin for this stack item. An extra margin is used to enlarge the bounds of the stack item, but only the non-extra part will be used for deciding the stack item layout. /// The extra margin for this stack item. @@ -5815,6 +5937,7 @@ namespace vl protected: ItemStyleProperty itemTemplate; Ptr itemSource; + description::Value itemContext; Ptr itemChangedHandler; virtual vint GetRepeatCompositionCount() = 0; @@ -5835,6 +5958,8 @@ namespace vl GuiItemNotifyEvent ItemInserted; /// An event called before a new item is removed. GuiItemNotifyEvent ItemRemoved; + /// Context changed event. This event raises when the font of the control is changed. + GuiNotifyEvent ContextChanged; /// Get the item style provider. /// The item style provider. @@ -5849,6 +5974,13 @@ namespace vl /// Set the item source. /// The item source. Null is acceptable if you want to clear all data. void SetItemSource(Ptr value); + + /// Get the context of this composition. The all item templates (if it has) will see this context property. + /// The context of this composition. + description::Value GetContext(); + /// Set the context of this composition. + /// The context of this composition. + void SetContext(const description::Value& value); }; /// Bindable stack composition. @@ -5859,7 +5991,10 @@ namespace vl GuiGraphicsComposition* GetRepeatComposition(vint index)override; GuiGraphicsComposition* InsertRepeatComposition(vint index)override; GuiGraphicsComposition* RemoveRepeatComposition(vint index)override; + public: + GuiRepeatStackComposition(); + ~GuiRepeatStackComposition(); }; /// Bindable flow composition. @@ -5870,7 +6005,10 @@ namespace vl GuiGraphicsComposition* GetRepeatComposition(vint index)override; GuiGraphicsComposition* InsertRepeatComposition(vint index)override; GuiGraphicsComposition* RemoveRepeatComposition(vint index)override; + public: + GuiRepeatFlowComposition(); + ~GuiRepeatFlowComposition(); }; } } @@ -5909,14 +6047,22 @@ Table Compositions /// struct GuiCellOption { - /// Sizing algorithm + /// Size configuration enum ComposeType { - /// Set the size to an absolute value. + /// + /// Set the size to an absolute value. + /// The size will not change even if affected cell's minimum size is bigger that this. + /// Absolute, - /// Set the size to a percentage number of the whole table. + /// + /// Set the size to a percentage number of the whole table. + /// Percentage, - /// Set the size to the minimum size of the cell element. + /// + /// Set the size to the minimum size of the cell element. + /// Only cells that take one row or column at this position are considered. + /// MinSize, }; @@ -5977,59 +6123,65 @@ Table Compositions friend class GuiTableSplitterCompositionBase; friend class GuiRowSplitterComposition; friend class GuiColumnSplitterComposition; + private: + bool layout_invalid = true; + bool layout_invalidCellBounds = false; + Size layout_lastTableSize; + + collections::Array layout_cellCompositions; + collections::Array layout_cellBounds; + collections::Array layout_rowOffsets; + collections::Array layout_columnOffsets; + collections::Array layout_rowSizes; + collections::Array layout_columnSizes; + vint layout_rowTotal = 0; + vint layout_columnTotal = 0; + vint layout_rowTotalWithPercentage = 0; + vint layout_columnTotalWithPercentage = 0; + vint layout_rowExtending = 0; + vint layout_columnExtending = 0; + + Rect Layout_CalculateCellArea(Rect tableBounds); + void Layout_UpdateCellBoundsInternal( + collections::Array& dimSizes, + vint& dimSize, + vint& dimSizeWithPercentage, + collections::Array& dimOptions, + vint GuiTableComposition::* dim1, + vint GuiTableComposition::* dim2, + vint (*getSize)(Size), + vint (*getLocation)(GuiCellComposition*), + vint (*getSpan)(GuiCellComposition*), + vint (*getRow)(vint, vint), + vint (*getCol)(vint, vint) + ); + void Layout_UpdateCellBoundsPercentages( + collections::Array& dimSizes, + vint dimSize, + vint maxDimSize, + collections::Array& dimOptions + ); + vint Layout_UpdateCellBoundsOffsets( + collections::Array& offsets, + collections::Array& sizes, + vint max + ); protected: - vint rows; - vint columns; - vint cellPadding; - bool borderVisible; - vint rowExtending; - vint columnExtending; + vint rows = 0; + vint columns = 0; + vint cellPadding = 0; + bool borderVisible = true; collections::Array rowOptions; collections::Array columnOptions; - collections::Array cellCompositions; - - collections::Array cellBounds; - collections::Array rowOffsets; - collections::Array columnOffsets; - collections::Array rowSizes; - collections::Array columnSizes; - Size tableContentMinSize; - - vint GetSiteIndex(vint _rows, vint _columns, vint _row, vint _column); - void SetSitedCell(vint _row, vint _column, GuiCellComposition* cell); - - void UpdateCellBoundsInternal( - collections::Array& dimSizes, - vint& dimSize, - vint& dimSizeWithPercentage, - collections::Array& dimOptions, - vint GuiTableComposition::* dim1, - vint GuiTableComposition::* dim2, - vint (*getSize)(Size), - vint (*getLocation)(GuiCellComposition*), - vint (*getSpan)(GuiCellComposition*), - vint (*getRow)(vint, vint), - vint (*getCol)(vint, vint), - vint maxPass - ); - void UpdateCellBoundsPercentages( - collections::Array& dimSizes, - vint dimSize, - vint maxDimSize, - collections::Array& dimOptions - ); - vint UpdateCellBoundsOffsets( - collections::Array& offsets, - collections::Array& sizes, - vint max - ); - - void OnRenderContextChanged()override; - Size GetMinPreferredClientSizeInternal(bool considerPreferredMinSize)override; + vint GetSiteIndex(vint _rows, vint _columns, vint _row, vint _column); + void SetSitedCell(vint _row, vint _column, GuiCellComposition* cell); + void OnCompositionStateChanged() override; + Size Layout_CalculateMinSize() override; + Rect Layout_CalculateBounds(Size parentSize) override; public: GuiTableComposition(); - ~GuiTableComposition(); + ~GuiTableComposition() = default; /// Event that will be raised with row numbers, column numbers or options are changed. compositions::GuiNotifyEvent ConfigChanged; @@ -6080,29 +6232,21 @@ Table Compositions /// Set the border visibility. /// Set to true to let the border thickness equal to the cell padding, otherwise zero. void SetBorderVisible(bool value); - /// Get the cell area in the space of the table's parent composition's client area. - /// The cell area. - Rect GetCellArea(); - /// Update the sizing of the table and cells after all rows' and columns' sizing options are prepared. - void UpdateCellBounds(); - - void ForceCalculateSizeImmediately()override; - Rect GetBounds()override; }; /// /// Represents a cell composition of a . /// - class GuiCellComposition : public GuiGraphicsSite, public Description + class GuiCellComposition : public GuiGraphicsComposition_Controlled, public Description { friend class GuiTableComposition; + private: + GuiTableComposition* layout_tableParent = nullptr; protected: - vint row; - vint rowSpan; - vint column; - vint columnSpan; - GuiTableComposition* tableParent; - Size lastPreferredSize; + vint row = -1; + vint rowSpan = 1; + vint column = -1; + vint columnSpan = 1; void ClearSitedCells(GuiTableComposition* table); void SetSitedCells(GuiTableComposition* table); @@ -6110,9 +6254,10 @@ Table Compositions bool SetSiteInternal(vint _row, vint _column, vint _rowSpan, vint _columnSpan); void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent)override; void OnTableRowsAndColumnsChanged(); + void Layout_SetCellBounds(); public: GuiCellComposition(); - ~GuiCellComposition(); + ~GuiCellComposition() = default; /// Get the owner table composition. /// The owner table composition. @@ -6137,16 +6282,14 @@ Table Compositions /// The total numbers of acrossed rows for this cell composition. /// The total numbers of acrossed columns for this cell composition. bool SetSite(vint _row, vint _column, vint _rowSpan, vint _columnSpan); - - Rect GetBounds()override; }; - class GuiTableSplitterCompositionBase : public GuiGraphicsSite, public Description + class GuiTableSplitterCompositionBase : public GuiGraphicsComposition_Specialized, public Description { protected: - GuiTableComposition* tableParent; + GuiTableComposition* tableParent = nullptr; - bool dragging; + bool dragging = false; Point draggingPoint; void OnParentChanged(GuiGraphicsComposition* oldParent, GuiGraphicsComposition* newParent)override; @@ -6174,7 +6317,7 @@ Table Compositions ); public: GuiTableSplitterCompositionBase(); - ~GuiTableSplitterCompositionBase(); + ~GuiTableSplitterCompositionBase() = default; /// Get the owner table composition. /// The owner table composition. @@ -6187,12 +6330,13 @@ Table Compositions class GuiRowSplitterComposition : public GuiTableSplitterCompositionBase, public Description { protected: - vint rowsToTheTop; + vint rowsToTheTop = 0; void OnMouseMove(GuiGraphicsComposition* sender, GuiMouseEventArgs& arguments); + Rect Layout_CalculateBounds(Size parentSize) override; public: GuiRowSplitterComposition(); - ~GuiRowSplitterComposition(); + ~GuiRowSplitterComposition() = default; /// Get the number of rows that above the splitter. /// The number of rows that above the splitter. @@ -6200,8 +6344,6 @@ Table Compositions /// Set the number of rows that above the splitter. /// The number of rows that above the splitter void SetRowsToTheTop(vint value); - - Rect GetBounds()override; }; /// @@ -6210,12 +6352,13 @@ Table Compositions class GuiColumnSplitterComposition : public GuiTableSplitterCompositionBase, public Description { protected: - vint columnsToTheLeft; + vint columnsToTheLeft = 0; void OnMouseMove(GuiGraphicsComposition* sender, GuiMouseEventArgs& arguments); + Rect Layout_CalculateBounds(Size parentSize) override; public: GuiColumnSplitterComposition(); - ~GuiColumnSplitterComposition(); + ~GuiColumnSplitterComposition() = default; /// Get the number of columns that before the splitter. /// The number of columns that before the splitter. @@ -6223,8 +6366,6 @@ Table Compositions /// Set the number of columns that before the splitter. /// The number of columns that before the splitter void SetColumnsToTheLeft(vint value); - - Rect GetBounds()override; }; } } @@ -6268,6 +6409,11 @@ namespace vl { namespace presentation { + namespace compositions + { + extern void InvokeOnCompositionStateChanged(compositions::GuiGraphicsComposition* composition); + } + namespace elements { @@ -6986,6 +7132,7 @@ Window CopyFrom(remainings, orderedWindows); orderedWindows.Clear(); + // TODO: (enumerable) foreach:reversed for (vint i = windows.Count() - 1; i >= 0; i--) { orderedWindows.Add(windows[i]); @@ -9096,7 +9243,7 @@ Basic Construction /// The font to render the text. virtual const FontProperties& GetDisplayFont(); /// Get the context of this control. The control template and all item templates (if it has) will see this context property. - /// The context of this context. + /// The context of this control. virtual description::Value GetContext(); /// Set the context of this control. /// The context of this control. @@ -13280,13 +13427,13 @@ Scroll View Ptr vScrollHandler; Ptr hWheelHandler; Ptr vWheelHandler; - Ptr containerBoundsChangedHandler; + Ptr containerCachedBoundsChangedHandler; bool horizontalAlwaysVisible = true; bool verticalAlwaysVisible = true; void UpdateDisplayFont()override; - void OnContainerBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnContainerCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnHorizontalScroll(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnVerticalScroll(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnHorizontalWheel(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); @@ -13688,7 +13835,7 @@ List Control Ptr InstallStyle(ItemStyle* style, vint itemIndex, compositions::GuiBoundsComposition* itemComposition); ItemStyle* UninstallStyle(vint index); - void OnStyleBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnStyleCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: ItemCallback(GuiListControl* _listControl); ~ItemCallback(); @@ -13757,7 +13904,7 @@ List Control collections::Dictionary> visibleStyles; void UpdateDisplayFont()override; - void OnClientBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnClientCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnVisuallyEnabledChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnContextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnItemMouseEvent(compositions::GuiItemMouseEvent& itemEvent, ItemStyle* style, compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); @@ -14146,7 +14293,7 @@ Predefined ItemArranger vint pim_itemHeight = 0; protected: - vint itemHeight; + vint itemHeight = 1; void CalculateRange(vint itemHeight, Rect bounds, vint& rows, vint& startColumn); @@ -17438,7 +17585,7 @@ ComboBox Base protected: IGuiMenuService::Direction GetSubMenuDirection()override; - void OnBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); public: /// Create a control with a specified default theme. /// The theme name for retriving a default control template. @@ -17498,7 +17645,7 @@ ComboBox with GuiListControl void OnVisuallyEnabledChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnAfterSubMenuOpening(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnListControlAdoptedSizeInvalidated(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); - void OnListControlBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnListControlCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnListControlItemMouseDown(compositions::GuiGraphicsComposition* sender, compositions::GuiItemMouseEventArgs& arguments); void OnKeyDown(compositions::GuiGraphicsComposition* sender, compositions::GuiKeyEventArgs& arguments); @@ -17873,7 +18020,7 @@ ListViewColumnItemArranger vint splitterLatestX = 0; void ColumnClicked(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); - void ColumnBoundsChanged(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void ColumnCachedBoundsChanged(vint index, compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void ColumnHeaderSplitterLeftButtonDown(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void ColumnHeaderSplitterLeftButtonUp(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); void ColumnHeaderSplitterMouseMove(compositions::GuiGraphicsComposition* sender, compositions::GuiMouseEventArgs& arguments); @@ -20243,7 +20390,7 @@ Ribbon Containers bool IsAltAvailable()override; compositions::IGuiAltActionHost* GetActivatingAltHost()override; - void OnBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnTextChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnBeforeSwitchingView(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnBeforeSubMenuOpening(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); @@ -20671,7 +20818,7 @@ Ribbon Gallery List void OnItemListSelectionChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnItemListItemMouseEnter(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); void OnItemListItemMouseLeave(compositions::GuiGraphicsComposition* sender, compositions::GuiItemEventArgs& arguments); - void OnBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); + void OnCachedBoundsChanged(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRequestedDropdown(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRequestedScrollUp(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); void OnRequestedScrollDown(compositions::GuiGraphicsComposition* sender, compositions::GuiEventArgs& arguments); diff --git a/Import/GacUICompiler.cpp b/Import/GacUICompiler.cpp index 0fb005e5..d6208adf 100644 --- a/Import/GacUICompiler.cpp +++ b/Import/GacUICompiler.cpp @@ -96,6 +96,7 @@ namespace vl return nullptr; } + // TODO: (enumerable) foreach on dictionary for (auto [fileName, index] : indexed(output->cppFiles.Keys())) { WString code = output->cppFiles.Values()[index]; @@ -658,6 +659,7 @@ GuiInstanceGradientAnimation::InitStruct tds.Add(td); auto ref = Ptr(new WfConstructorExpression); + // TODO: (enumerable) foreach:alterable for (vint i = 0; i < tds.Count(); i++) { auto currentTd = tds[i]; @@ -2167,6 +2169,7 @@ GuiDefaultInstanceLoader block->statements.Add(stat); } + // TODO: (enumerable) foreach for (vint i = 0; i < values.Count(); i++) { auto refCollection = Ptr(new WfReferenceExpression); @@ -2549,6 +2552,7 @@ GuiInstanceLoaderManager void GetVirtualTypes(collections::List& typeNames)override { + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < typeInfos.Count(); i++) { if (typeInfos.Values()[i]->parentTypeName != GlobalStringKey::Empty) @@ -3973,6 +3977,7 @@ GuiDataProcessorDeserializer inferExpr->type = funcType; funcType->result = CopyType(decl->returnType); + // TODO: (enumerable) Linq:Select for (vint i = 0; i < decl->arguments.Count(); i++) { funcType->arguments.Add(CopyType(itemType)); @@ -4180,6 +4185,7 @@ namespace vl codes.Add(code); }; + // TODO: (enumerable) Linq:Select for (vint i = 0; i < compiled->modules.Count(); i++) { manager->AddModule(compiled->modules[i].module); @@ -4203,6 +4209,7 @@ namespace vl } else { + // TODO: (enumerable) foreach for (vint i = 0; i < compiled->modules.Count(); i++) { auto module = compiled->modules[i]; @@ -4212,6 +4219,7 @@ namespace vl } auto sp = Workflow_GetScriptPosition(context); + // TODO: (enumerable) foreach for (vint i = 0; i < manager->errors.Count(); i++) { auto error = manager->errors[i]; @@ -4312,6 +4320,7 @@ Shared Script Type Resolver (Script) Workflow_GenerateAssembly(context, Path_Shared, errors, false, context.compilerCallback); if (auto compiled = Workflow_GetModule(context, Path_Shared, {})) { + // TODO: (enumerable) foreach for (vint i = 0; i < compiled->modules.Count(); i++) { auto& module = compiled->modules[i]; @@ -4474,6 +4483,7 @@ Instance Type Resolver (Instance) L"\" should have the class name specified in the ref.Class attribute.")); } + // TODO: (enumerable) Linq:Take for (auto [localized, index] : indexed(From(obj->localizeds).Where([](Ptr ls) {return ls->defaultStrings; })) ) @@ -5290,6 +5300,7 @@ GuiInstanceLocalizedStringsBase } else { + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < textDesc->parameters.Count(); i++) { auto defaultParameter = defaultDesc->parameters[defaultDesc->positions[i]]; @@ -5369,6 +5380,7 @@ GuiInstanceLocalizedStringsBase func->anonymity = WfFunctionAnonymity::Named; func->name.value = functionName; func->returnType = GetTypeFromTypeInfo(TypeInfoRetriver::CreateTypeInfo().Obj()); + // TODO: (enumerable) foreach for (vint i = 0; i < textDesc->positions.Count(); i++) { auto type = textDesc->parameters[textDesc->positions[i]]; @@ -5506,6 +5518,7 @@ GuiInstanceLocalizedStringsBase auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < textDesc->parameters.Count(); i++) { auto varDesc = Ptr(new WfVariableDeclaration); @@ -5523,6 +5536,7 @@ GuiInstanceLocalizedStringsBase { Ptr resultExpr; + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < textDesc->texts.Count(); i++) { if (textDesc->texts[i] != L"") @@ -6342,6 +6356,7 @@ GuiAttSetterRepr { GuiValueRepr::CloneBody(repr); + // TODO: (enumerable) foreach on dictionary for (auto [name, index] : indexed(setters.Keys())) { auto src = setters.Values()[index]; @@ -6357,6 +6372,7 @@ GuiAttSetterRepr repr->setters.Add(name, dst); } + // TODO: (enumerable) foreach on dictionary for (auto [name, index] : indexed(eventHandlers.Keys())) { auto src = eventHandlers.Values()[index]; @@ -6371,6 +6387,7 @@ GuiAttSetterRepr repr->eventHandlers.Add(name, dst); } + // TODO: (enumerable) foreach on dictionary for (auto [name, index] : indexed(environmentVariables.Keys())) { auto src = environmentVariables.Values()[index]; @@ -6407,6 +6424,7 @@ GuiAttSetterRepr xml->attributes.Add(attName); } + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < setters.Count(); i++) { auto key = setters.Keys()[i]; @@ -6468,6 +6486,7 @@ GuiAttSetterRepr } } + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < eventHandlers.Count(); i++) { auto key = eventHandlers.Keys()[i]; @@ -6488,6 +6507,7 @@ GuiAttSetterRepr } } + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < environmentVariables.Count(); i++) { auto key = environmentVariables.Keys()[i]; @@ -7047,6 +7067,7 @@ GuiInstanceContext attClass->value.value = className; xmlInstance->attributes.Add(attClass); + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < namespaces.Count(); i++) { auto key = namespaces.Keys()[i]; @@ -7060,6 +7081,7 @@ GuiInstanceContext } xmlInstance->attributes.Add(xmlns); + // TODO: (enumerable) Linq:Aggregate for (vint j = 0; j < value->namespaces.Count(); j++) { auto ns = value->namespaces[j]; @@ -7133,6 +7155,7 @@ GuiInstanceContext attStyles->name.value = L"ref.Styles"; xmlInstance->attributes.Add(attStyles); + // TODO: (enumerable) Linq:Aggregate for (vint j = 0; j < stylePaths.Count(); j++) { if (j != 0) @@ -7511,6 +7534,7 @@ GuiCompositionInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { const auto& values = arguments.GetByIndex(index); @@ -7669,6 +7693,7 @@ GuiTableCompositionInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { if (prop == _Rows) @@ -7703,6 +7728,7 @@ GuiTableCompositionInstanceLoader block->statements.Add(stat); } + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < rows.Count(); i++) { auto refComposition = Ptr(new WfReferenceExpression); @@ -7725,6 +7751,7 @@ GuiTableCompositionInstanceLoader block->statements.Add(stat); } + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < columns.Count(); i++) { auto refComposition = Ptr(new WfReferenceExpression); @@ -7798,6 +7825,7 @@ GuiCellCompositionInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { if (prop == _Site) @@ -8028,6 +8056,7 @@ GuiDocumentItemInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { const auto& values = arguments.GetByIndex(index); @@ -8119,6 +8148,7 @@ GuiDocumentInstanceLoaderBase { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { const auto& values = arguments.GetByIndex(index); @@ -8384,6 +8414,7 @@ GuiTreeViewInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { if (prop == _Nodes) @@ -8560,6 +8591,7 @@ GuiTreeNodeInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { if (prop == GlobalStringKey::Empty) @@ -8793,6 +8825,7 @@ GuiControlInstanceLoader { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { const auto& values = arguments.GetByIndex(index); @@ -9258,6 +9291,7 @@ namespace vl { auto block = Ptr(new WfBlockStatement); + // TODO: (enumerable) foreach on group for (auto [prop, index] : indexed(arguments.Keys())) { const auto& values = arguments.GetByIndex(index); @@ -9640,6 +9674,7 @@ ExecuteQueryVisitor { if (setter) { + // TODO: (enumerable) foreach on group for (auto [attribute, index] : indexed(setter->setters.Keys())) { auto setterValue = setter->setters.Values()[index]; @@ -9751,6 +9786,7 @@ ApplyStyle void ApplyStyleInternal(Ptr src, Ptr dst) { + // TODO: (enumerable) foreach on dictionary for (auto [attribute, srcIndex] : indexed(src->setters.Keys())) { auto srcValue = src->setters.Values()[srcIndex]; @@ -9776,6 +9812,7 @@ ApplyStyle } } + // TODO: (enumerable) foreach for (auto [eventName, srcIndex] : indexed(src->eventHandlers.Keys())) { if (!dst->eventHandlers.Keys().Contains(eventName)) @@ -9785,6 +9822,7 @@ ApplyStyle } } + // TODO: (enumerable) foreach for (auto [varName, srcIndex] : indexed(src->environmentVariables.Keys())) { if (!dst->environmentVariables.Keys().Contains(varName)) @@ -10601,6 +10639,7 @@ WorkflowEventNamesVisitor void Visit(GuiAttSetterRepr* repr)override { + // TODO: (enumerable) foreach on dictionary for (auto [setter, index] : indexed(repr->setters.Values())) { auto loader = GetInstanceLoaderManager()->GetLoader(resolvedTypeInfo.typeName); @@ -10639,6 +10678,7 @@ WorkflowEventNamesVisitor } } + // TODO: (enumerable) foreach on dictionary for (auto [handler, index] : indexed(repr->eventHandlers.Values())) { if (handler->binding == GlobalStringKey::Empty) @@ -10994,6 +11034,7 @@ Workflow_GenerateInstanceClass CopyFrom(unprocessed, memberDecls); ReplaceDeclImplVisitor visitor(notImplemented, unprocessed); + // TODO: (enumerable) foreach for (vint i = 0; i < unprocessed.Count(); i++) { unprocessed[i]->Accept(&visitor); @@ -11019,6 +11060,7 @@ Workflow_GenerateInstanceClass call->type = CopyType(instanceClass->baseTypes[0]); baseTypeContext = baseTypeResourceItem->GetContent().Cast(); + // TODO: (enumerable) foreach for (auto parameter : baseTypeContext->parameters) { auto parameterTypeInfoTuple = getDefaultType(parameter->className.ToString()); @@ -11839,6 +11881,7 @@ WorkflowReferenceNamesVisitor auto loader = GetInstanceLoaderManager()->GetLoader(resolvedTypeInfo.typeName); + // TODO: (enumerable) foreach on dictionary for (auto [setter, index] : indexed(repr->setters.Values())) { List possibleInfos; @@ -12130,6 +12173,7 @@ WorkflowReferenceNamesVisitor for (vint i = 0; i < candidatePropertyTypeInfos.Count(); i++) { const auto& typeInfos = candidatePropertyTypeInfos[i].info->acceptableTypes; + // TODO: (enumerable) foreach for (vint j = 0; j < typeInfos.Count(); j++) { if (resolvedTypeInfo.typeInfo->GetTypeDescriptor()->CanConvertTo(typeInfos[j]->GetTypeDescriptor())) @@ -12153,9 +12197,11 @@ WorkflowReferenceNamesVisitor + resolvedTypeInfo.typeName.ToString() + L"\" because it only accepts value of the following types: "; + // TODO: (enumerable) foreach for (vint i = 0; i < candidatePropertyTypeInfos.Count(); i++) { const auto& typeInfos = candidatePropertyTypeInfos[i].info->acceptableTypes; + // TODO: (enumerable) LinqLAggregate for (vint j = 0; j < typeInfos.Count(); j++) { if (i != 0 || j != 0) @@ -12218,6 +12264,7 @@ WorkflowReferenceNamesVisitor { List propertyNames; loader->GetPropertyNames(precompileContext, resolvedTypeInfo, propertyNames); + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = propertyNames.Count() - 1; i >= 0; i--) { auto info = loader->GetPropertyType(precompileContext, { resolvedTypeInfo, propertyNames[i] }); @@ -12498,6 +12545,7 @@ WorkflowGenerateBindingVisitor { WORKFLOW_ENVIRONMENT_VARIABLE_ADD + // TODO: (enumerable) foreach on dictionary for (auto [setter, index] : indexed(repr->setters.Values())) { auto propertyName = repr->setters.Keys()[index]; @@ -12518,6 +12566,7 @@ WorkflowGenerateBindingVisitor } } + // TODO: (enumerable) foreach on dictionary for (auto [handler, index] : indexed(repr->eventHandlers.Values())) { if (reprTypeInfo.typeInfo) @@ -12789,6 +12838,7 @@ WorkflowGenerateCreatingVisitor else if (errorCount == errors.Count()) { WString propNames; + // TODO: (enumerable) Linq:Aggregate for (auto [pairedProp, propIndex] : indexed(pairedProps)) { if (propIndex > 0)propNames += L", "; @@ -12819,6 +12869,7 @@ WorkflowGenerateCreatingVisitor WORKFLOW_ENVIRONMENT_VARIABLE_ADD Group usedProps; + // TODO: (enumerable) foreach:reversed on dictionary for (auto prop : From(repr->setters.Keys()).Reverse()) { auto setter = repr->setters[prop]; @@ -12869,6 +12920,7 @@ WorkflowGenerateCreatingVisitor { WORKFLOW_ENVIRONMENT_VARIABLE_ADD + // TODO: (enumerable) foreach on dictionary for (auto [prop, index] : indexed(repr->setters.Keys())) { auto setter = repr->setters.Values()[index]; @@ -13394,6 +13446,7 @@ Workflow_GenerateEventHandler auto expectedType = GetTypeDescriptor(); List types; types.Add(argumentType); + // TODO: (enumerable) foreach for (vint i = 0; i < types.Count(); i++) { auto type = types[i]; @@ -13708,6 +13761,7 @@ Variable void Workflow_CreateVariablesForReferenceValues(Ptr ctorClass, types::ResolvingResult& resolvingResult) { const auto& typeInfos = resolvingResult.typeInfos; + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < typeInfos.Count(); i++) { auto key = typeInfos.Keys()[i]; @@ -13744,6 +13798,7 @@ Parser if (availableAfter.row != 0 || availableAfter.column != 0) { + // TODO: (enumerable) Linq:Skip for (vint i = errorCount; i < errors.Count(); i++) { auto& error = errors[i]; diff --git a/Import/GacUIReflection.cpp b/Import/GacUIReflection.cpp index 33df9a91..1ad41c62 100644 --- a/Import/GacUIReflection.cpp +++ b/Import/GacUIReflection.cpp @@ -1187,6 +1187,7 @@ Type Declaration (Extra) BEGIN_ENUM_ITEM(FlowAlignment) ENUM_CLASS_ITEM(Left) ENUM_CLASS_ITEM(Center) + ENUM_CLASS_ITEM(Right) ENUM_CLASS_ITEM(Extend) END_ENUM_ITEM(FlowAlignment) @@ -1269,7 +1270,6 @@ Type Declaration (Class) ***********************************************************************/ BEGIN_CLASS_MEMBER(GuiGraphicsComposition) - CLASS_MEMBER_EXTERNALMETHOD(SafeDelete, NO_PARAMETER, void(GuiGraphicsComposition::*)(), vl::presentation::compositions::SafeDeleteComposition) CLASS_MEMBER_GUIEVENT_COMPOSITION(leftButtonDown) @@ -1303,7 +1303,6 @@ Type Declaration (Class) CLASS_MEMBER_PROPERTY_FAST(Visible) CLASS_MEMBER_PROPERTY_READONLY_FAST(EventuallyVisible) CLASS_MEMBER_PROPERTY_FAST(MinSizeLimitation) - CLASS_MEMBER_PROPERTY_READONLY_FAST(GlobalBounds) CLASS_MEMBER_PROPERTY_FAST(TransparentToMouse) CLASS_MEMBER_PROPERTY_READONLY_FAST(AssociatedControl) CLASS_MEMBER_PROPERTY_FAST(AssociatedCursor) @@ -1311,13 +1310,8 @@ Type Declaration (Class) CLASS_MEMBER_PROPERTY_READONLY_FAST(RelatedControl) CLASS_MEMBER_PROPERTY_READONLY_FAST(RelatedControlHost) CLASS_MEMBER_PROPERTY_READONLY_FAST(RelatedCursor) - CLASS_MEMBER_PROPERTY_FAST(Margin) CLASS_MEMBER_PROPERTY_FAST(InternalMargin) CLASS_MEMBER_PROPERTY_FAST(PreferredMinSize) - CLASS_MEMBER_PROPERTY_READONLY_FAST(ClientArea) - CLASS_MEMBER_PROPERTY_READONLY_FAST(MinPreferredClientSize) - CLASS_MEMBER_PROPERTY_READONLY_FAST(PreferredBounds) - CLASS_MEMBER_PROPERTY_READONLY_FAST(Bounds) CLASS_MEMBER_METHOD_RENAME(GetChildren, Children, NO_PARAMETER) CLASS_MEMBER_PROPERTY_READONLY(Children, GetChildren) @@ -1328,28 +1322,26 @@ Type Declaration (Class) CLASS_MEMBER_METHOD(MoveChild, {L"child" _ L"newIndex"}) CLASS_MEMBER_METHOD(Render, {L"size"}) CLASS_MEMBER_METHOD(FindComposition, {L"location" _ L"forMouseEvent"}) - CLASS_MEMBER_METHOD(ForceCalculateSizeImmediately, NO_PARAMETER) - CLASS_MEMBER_METHOD(IsSizeAffectParent, NO_PARAMETER) + + CLASS_MEMBER_GUIEVENT(CachedMinSizeChanged) + CLASS_MEMBER_GUIEVENT(CachedBoundsChanged) + CLASS_MEMBER_PROPERTY_EVENT_READONLY_FAST(CachedMinSize, CachedMinSizeChanged) + CLASS_MEMBER_PROPERTY_EVENT_READONLY_FAST(CachedMinClientSize, CachedMinSizeChanged) + CLASS_MEMBER_PROPERTY_EVENT_READONLY_FAST(CachedBounds, CachedBoundsChanged) + CLASS_MEMBER_PROPERTY_EVENT_READONLY_FAST(CachedClientArea, CachedBoundsChanged) + CLASS_MEMBER_PROPERTY_READONLY_FAST(GlobalBounds) END_CLASS_MEMBER(GuiGraphicsComposition) - BEGIN_CLASS_MEMBER(GuiGraphicsSite) - CLASS_MEMBER_BASE(GuiGraphicsComposition) - - CLASS_MEMBER_PROPERTY_GUIEVENT_READONLY_FAST(Bounds) - CLASS_MEMBER_PROPERTY_READONLY_FAST(PreviousCalculatedBounds) - END_CLASS_MEMBER(GuiGraphicsSite) - BEGIN_CLASS_MEMBER(GuiWindowComposition) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) CLASS_MEMBER_CONSTRUCTOR(GuiWindowComposition*(), NO_PARAMETER) END_CLASS_MEMBER(GuiWindowComposition) BEGIN_CLASS_MEMBER(GuiBoundsComposition) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) CLASS_MEMBER_CONSTRUCTOR(GuiBoundsComposition*(), NO_PARAMETER) - CLASS_MEMBER_PROPERTY_FAST(SizeAffectParent) - CLASS_MEMBER_PROPERTY_EVENT_FAST(Bounds, BoundsChanged) + CLASS_MEMBER_PROPERTY_FAST(ExpectedBounds) CLASS_MEMBER_PROPERTY_FAST(AlignmentToParent) CLASS_MEMBER_METHOD(IsAlignedToParent, NO_PARAMETER) @@ -1371,10 +1363,9 @@ Type Declaration (Class) END_CLASS_MEMBER(GuiStackComposition) BEGIN_CLASS_MEMBER(GuiStackItemComposition) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) CLASS_MEMBER_CONSTRUCTOR(GuiStackItemComposition*(), NO_PARAMETER) - CLASS_MEMBER_PROPERTY_EVENT_FAST(Bounds, BoundsChanged) CLASS_MEMBER_PROPERTY_FAST(ExtraMargin) END_CLASS_MEMBER(GuiStackItemComposition) @@ -1400,12 +1391,10 @@ Type Declaration (Class) CLASS_MEMBER_METHOD(SetRowOption, {L"row" _ L"option"}) CLASS_MEMBER_METHOD(GetColumnOption, {L"column"}) CLASS_MEMBER_METHOD(SetColumnOption, {L"column" _ L"option"}) - CLASS_MEMBER_METHOD(GetCellArea, NO_PARAMETER) - CLASS_MEMBER_METHOD(UpdateCellBounds, NO_PARAMETER) END_CLASS_MEMBER(GuiTableComposition) BEGIN_CLASS_MEMBER(GuiCellComposition) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) CLASS_MEMBER_CONSTRUCTOR(GuiCellComposition*(), NO_PARAMETER) CLASS_MEMBER_PROPERTY_READONLY_FAST(TableParent) @@ -1418,7 +1407,7 @@ Type Declaration (Class) END_CLASS_MEMBER(GuiCellComposition) BEGIN_CLASS_MEMBER(GuiTableSplitterCompositionBase) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) CLASS_MEMBER_PROPERTY_READONLY_FAST(TableParent) END_CLASS_MEMBER(GuiRowSplitterComposition) @@ -1452,16 +1441,15 @@ Type Declaration (Class) END_CLASS_MEMBER(GuiFlowComposition) BEGIN_CLASS_MEMBER(GuiFlowItemComposition) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) 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_BASE(GuiGraphicsComposition) CLASS_MEMBER_CONSTRUCTOR(GuiSideAlignedComposition*(), NO_PARAMETER) CLASS_MEMBER_PROPERTY_FAST(Direction) @@ -1470,7 +1458,7 @@ Type Declaration (Class) END_CLASS_MEMBER(GuiSideAlignedComposition) BEGIN_CLASS_MEMBER(GuiPartialViewComposition) - CLASS_MEMBER_BASE(GuiGraphicsSite) + CLASS_MEMBER_BASE(GuiGraphicsComposition) CLASS_MEMBER_CONSTRUCTOR(GuiPartialViewComposition*(), NO_PARAMETER) CLASS_MEMBER_PROPERTY_FAST(WidthRatio) @@ -1498,6 +1486,7 @@ Type Declaration (Class) CLASS_MEMBER_GUIEVENT(ItemRemoved) CLASS_MEMBER_PROPERTY_FAST(ItemTemplate) CLASS_MEMBER_PROPERTY_FAST(ItemSource) + CLASS_MEMBER_PROPERTY_GUIEVENT_FAST(Context) END_CLASS_MEMBER(GuiRepeatCompositionBase) BEGIN_CLASS_MEMBER(GuiRepeatStackComposition) diff --git a/Import/GacUIReflection.h b/Import/GacUIReflection.h index 33910604..6bfe0b9d 100644 --- a/Import/GacUIReflection.h +++ b/Import/GacUIReflection.h @@ -260,10 +260,10 @@ Type List (Compositions) F(presentation::compositions::IGuiAltActionContainer)\ F(presentation::compositions::IGuiAltActionHost)\ F(presentation::compositions::IGuiTabAction)\ + F(presentation::compositions::GuiRepeatCompositionBase)\ #define GUIREFLECTIONCOMPOSITION_CLASS_TYPELIST(F)\ F(presentation::compositions::GuiGraphicsComposition)\ - F(presentation::compositions::GuiGraphicsSite)\ F(presentation::compositions::GuiWindowComposition)\ F(presentation::compositions::GuiBoundsComposition)\ F(presentation::compositions::GuiStackComposition)\ @@ -279,7 +279,6 @@ 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::GuiResponsiveCompositionBase)\ @@ -359,6 +358,7 @@ Type List (Controls) F(presentation::theme::ThemeName)\ F(presentation::theme::ITheme)\ F(presentation::theme::ThemeTemplates)\ + F(presentation::controls::GuiDisposedFlag)\ F(presentation::controls::GuiDialogBase)\ F(presentation::controls::GuiMessageDialog)\ F(presentation::controls::GuiColorDialog)\ @@ -439,7 +439,6 @@ Type List (Controls) F(presentation::controls::list::DataProvider)\ #define GUIREFLECTIONCONTROLS_CLASS_TYPELIST(F)\ - F(presentation::controls::GuiDisposedFlag)\ F(presentation::controls::GuiControl)\ F(presentation::controls::GuiCustomControl)\ F(presentation::controls::GuiLabel)\ diff --git a/Import/Skins/DarkSkin/DarkSkin.cpp b/Import/Skins/DarkSkin/DarkSkin.cpp index 8dcab760..5484c495 100644 --- a/Import/Skins/DarkSkin/DarkSkin.cpp +++ b/Import/Skins/DarkSkin/DarkSkin.cpp @@ -1571,13 +1571,13 @@ Closures void __vwsnf185_DarkSkin_darkskin_RibbonIconLabelTemplateConstructor___vwsn_darkskin_RibbonIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetImage(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->GetImage(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::Ptr<::vl::presentation::INativeImage>>(__vwsn_value_); if ((__vwsn_old_.Obj() == __vwsn_new_.Obj())) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetImage(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->SetImage(__vwsn_new_); } //------------------------------------------------------------------- @@ -1589,13 +1589,13 @@ Closures void __vwsnf186_DarkSkin_darkskin_RibbonIconLabelTemplateConstructor___vwsn_darkskin_RibbonIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetEnabled(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->GetEnabled(); auto __vwsn_new_ = ::vl::__vwsn::Unbox(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetEnabled(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->SetEnabled(__vwsn_new_); } //------------------------------------------------------------------- @@ -1607,13 +1607,13 @@ Closures void __vwsnf187_DarkSkin_darkskin_RibbonIconLabelTemplateConstructor___vwsn_darkskin_RibbonIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetFrameIndex(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->GetFrameIndex(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::vint>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetFrameIndex(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->SetFrameIndex(__vwsn_new_); } //------------------------------------------------------------------- @@ -2603,13 +2603,13 @@ Closures void __vwsnf239_DarkSkin_darkskin_RibbonSmallIconLabelTemplateConstructor___vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetImage(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->GetImage(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::Ptr<::vl::presentation::INativeImage>>(__vwsn_value_); if ((__vwsn_old_.Obj() == __vwsn_new_.Obj())) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetImage(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->SetImage(__vwsn_new_); } //------------------------------------------------------------------- @@ -2635,13 +2635,13 @@ Closures void __vwsnf240_DarkSkin_darkskin_RibbonSmallIconLabelTemplateConstructor___vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetEnabled(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->GetEnabled(); auto __vwsn_new_ = ::vl::__vwsn::Unbox(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetEnabled(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->SetEnabled(__vwsn_new_); } //------------------------------------------------------------------- @@ -2653,13 +2653,13 @@ Closures void __vwsnf241_DarkSkin_darkskin_RibbonSmallIconLabelTemplateConstructor___vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetFrameIndex(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->GetFrameIndex(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::vint>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetFrameIndex(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_3.Obj())->SetFrameIndex(__vwsn_new_); } //------------------------------------------------------------------- @@ -2671,13 +2671,13 @@ Closures void __vwsnf242_DarkSkin_darkskin_RibbonSmallIconLabelTemplateConstructor___vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_5.Obj())->GetText(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->GetText(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::WString>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_5.Obj())->SetText(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->SetText(__vwsn_new_); } //------------------------------------------------------------------- @@ -2689,13 +2689,13 @@ Closures void __vwsnf243_DarkSkin_darkskin_RibbonSmallIconLabelTemplateConstructor___vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_5.Obj())->GetColor(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->GetColor(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::Color>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_5.Obj())->SetColor(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->SetColor(__vwsn_new_); } //------------------------------------------------------------------- @@ -2707,13 +2707,13 @@ Closures void __vwsnf244_DarkSkin_darkskin_RibbonSmallIconLabelTemplateConstructor___vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_5.Obj())->GetFont(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->GetFont(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::FontProperties>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_5.Obj())->SetFont(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->SetFont(__vwsn_new_); } //------------------------------------------------------------------- @@ -3962,13 +3962,13 @@ Closures void __vwsnf312_DarkSkin_darkskin_SinglelineTextBoxTemplateConstructor___vwsn_darkskin_SinglelineTextBoxTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_1.Obj())->GetColor(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetColor(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::Color>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_1.Obj())->SetColor(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetColor(__vwsn_new_); } //------------------------------------------------------------------- @@ -6137,13 +6137,13 @@ Closures void __vwsnf80_DarkSkin_darkskin_DocumentTextBoxTemplateConstructor___vwsn_darkskin_DocumentTextBoxTemplate_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const { - auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_1.Obj())->GetColor(); + auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->GetColor(); auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::Color>(__vwsn_value_); if ((__vwsn_old_ == __vwsn_new_)) { return; } - ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_1.Obj())->SetColor(__vwsn_new_); + ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_2.Obj())->SetColor(__vwsn_new_); } //------------------------------------------------------------------- @@ -21953,7 +21953,7 @@ Closures void __vwsnc64_DarkSkin_darkskin_GroupBoxTemplateConstructor___vwsn_darkskin_GroupBoxTemplate_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_activator_() { - auto __vwsn_bind_activator_result_ = [&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = (static_cast<::vl::vint>(1) + (::vl::__vwsn::This(__vwsn_bind_cache_0)->GetBounds().y2 / static_cast<::vl::vint>(2))); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }(); + auto __vwsn_bind_activator_result_ = [&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = (static_cast<::vl::vint>(1) + (::vl::__vwsn::This(__vwsn_bind_cache_0)->GetCachedBounds().y2 / static_cast<::vl::vint>(2))); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }(); ::vl::__vwsn::EventInvoke(this->ValueChanged)(::vl::__vwsn::Box(__vwsn_bind_activator_result_)); } @@ -21968,7 +21968,7 @@ Closures { (__vwsn_bind_opened_ = true); (__vwsn_bind_cache_0 = [&](){ try{ return __vwsnthis_0->titleBounds; } catch(...){ return static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); } }()); - (__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0)->BoundsChanged, ::vl::Func(this, &__vwsnc64_DarkSkin_darkskin_GroupBoxTemplateConstructor___vwsn_darkskin_GroupBoxTemplate_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }()); + (__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0)->CachedBoundsChanged, ::vl::Func(this, &__vwsnc64_DarkSkin_darkskin_GroupBoxTemplateConstructor___vwsn_darkskin_GroupBoxTemplate_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }()); return true; } return false; @@ -21991,7 +21991,7 @@ Closures (__vwsn_bind_closed_ = true); if (static_cast(__vwsn_bind_handler_0_0)) { - ::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0)->BoundsChanged, __vwsn_bind_handler_0_0); + ::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0)->CachedBoundsChanged, __vwsn_bind_handler_0_0); (__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>()); } (__vwsn_bind_cache_0 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)); @@ -22014,7 +22014,7 @@ Closures void __vwsnc65_DarkSkin_darkskin_GroupBoxTemplateConstructor___vwsn_darkskin_GroupBoxTemplate_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_activator_() { - auto __vwsn_bind_activator_result_ = [&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = (::vl::__vwsn::This(__vwsn_bind_cache_0)->GetBounds().y2 / static_cast<::vl::vint>(2)); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }(); + auto __vwsn_bind_activator_result_ = [&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = (::vl::__vwsn::This(__vwsn_bind_cache_0)->GetCachedBounds().y2 / static_cast<::vl::vint>(2)); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }(); ::vl::__vwsn::EventInvoke(this->ValueChanged)(::vl::__vwsn::Box(__vwsn_bind_activator_result_)); } @@ -22029,7 +22029,7 @@ Closures { (__vwsn_bind_opened_ = true); (__vwsn_bind_cache_0 = [&](){ try{ return __vwsnthis_0->titleBounds; } catch(...){ return static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); } }()); - (__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0)->BoundsChanged, ::vl::Func(this, &__vwsnc65_DarkSkin_darkskin_GroupBoxTemplateConstructor___vwsn_darkskin_GroupBoxTemplate_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }()); + (__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0)->CachedBoundsChanged, ::vl::Func(this, &__vwsnc65_DarkSkin_darkskin_GroupBoxTemplateConstructor___vwsn_darkskin_GroupBoxTemplate_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }()); return true; } return false; @@ -22052,7 +22052,7 @@ Closures (__vwsn_bind_closed_ = true); if (static_cast(__vwsn_bind_handler_0_0)) { - ::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0)->BoundsChanged, __vwsn_bind_handler_0_0); + ::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0)->CachedBoundsChanged, __vwsn_bind_handler_0_0); (__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>()); } (__vwsn_bind_cache_0 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)); @@ -26183,22 +26183,29 @@ Class (::darkskin::DocumentTextBoxTemplateConstructor) { ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } - (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->container)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + (this->__vwsn_precompile_2 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_2)); + } + (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + { + ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->container)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } - (this->__vwsn_precompile_1 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); { - ::vl::__vwsn::This(this->container)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_1)); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); } { - ::vl::__vwsn::This(this->self)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); + ::vl::__vwsn::This(this->self)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_1)); } { auto __vwsn_created_subscription_ = ::vl::Ptr<::vl::reflection::description::IValueSubscription>(new ::vl_workflow_global::__vwsnc24_DarkSkin_darkskin_DocumentTextBoxTemplateConstructor___vwsn_darkskin_DocumentTextBoxTemplate_Initialize__vl_reflection_description_IValueSubscription(this)); @@ -26217,7 +26224,8 @@ Class (::darkskin::DocumentTextBoxTemplateConstructor) : container(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , self(static_cast<::darkskin::DocumentTextBoxTemplate*>(nullptr)) , __vwsn_precompile_0(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) - , __vwsn_precompile_1(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) + , __vwsn_precompile_1(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_2(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) { } @@ -26259,9 +26267,6 @@ Class (::darkskin::DocumentViewerTemplateConstructor) ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -26280,7 +26285,7 @@ Class (::darkskin::DocumentViewerTemplateConstructor) ::vl::__vwsn::This(this->look)->SetHScrollTemplate(vl::Func(::vl_workflow_global::__vwsnf82_DarkSkin_darkskin_DocumentViewerTemplateConstructor___vwsn_darkskin_DocumentViewerTemplate_Initialize_(this))); } { - ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->look)); @@ -27492,9 +27497,6 @@ Class (::darkskin::ListViewTemplateConstructor) ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -27513,7 +27515,7 @@ Class (::darkskin::ListViewTemplateConstructor) ::vl::__vwsn::This(this->look)->SetHScrollTemplate(vl::Func(::vl_workflow_global::__vwsnf119_DarkSkin_darkskin_ListViewTemplateConstructor___vwsn_darkskin_ListViewTemplate_Initialize_(this))); } { - ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->look)); @@ -27969,9 +27971,6 @@ Class (::darkskin::MultilineTextBoxTemplateConstructor) ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -27990,7 +27989,7 @@ Class (::darkskin::MultilineTextBoxTemplateConstructor) ::vl::__vwsn::This(this->look)->SetHScrollTemplate(vl::Func(::vl_workflow_global::__vwsnf310_DarkSkin_darkskin_MultilineTextBoxTemplateConstructor___vwsn_darkskin_MultilineTextBoxTemplate_Initialize_(this))); } { - ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->look)); @@ -28827,25 +28826,32 @@ Class (::darkskin::RibbonGroupMenuTemplateConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_1)); } - (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->container)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(3); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + (this->__vwsn_precompile_3 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_3.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#333337"))); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_3)); + } + (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + { + ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(3); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->container)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } - (this->__vwsn_precompile_2 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); { - ::vl::__vwsn::This(this->__vwsn_precompile_2.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#333337"))); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); } { - ::vl::__vwsn::This(this->container)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_2)); - } - { - ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); + ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_2)); } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetContainerComposition(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); @@ -28856,7 +28862,8 @@ Class (::darkskin::RibbonGroupMenuTemplateConstructor) : container(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , __vwsn_precompile_0(static_cast<::darkskin::RibbonGroupMenuTemplate*>(nullptr)) , __vwsn_precompile_1(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) - , __vwsn_precompile_2(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) + , __vwsn_precompile_2(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_3(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) { } @@ -28928,9 +28935,6 @@ Class (::darkskin::RibbonGroupTemplateConstructor) ::vl::__vwsn::This(this->table)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_1)); } (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiCellComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(5); __vwsn_temp__.y = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); } @@ -28939,7 +28943,7 @@ Class (::darkskin::RibbonGroupTemplateConstructor) } (this->__vwsn_precompile_3 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(2); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(2); __vwsn_temp__.bottom = static_cast<::vl::vint>(2); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); @@ -29076,21 +29080,28 @@ Class (::darkskin::RibbonIconLabelTemplateConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetColumnOption(static_cast<::vl::vint>(1), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = static_cast(1.0); return __vwsn_temp__; }()); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiCellComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); } - (this->__vwsn_precompile_2 = ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiImageFrameElement>())); + (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_2.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->__vwsn_precompile_2.Obj())->SetHorizontalAlignment(::vl::presentation::Alignment::Center); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + (this->__vwsn_precompile_3 = ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiImageFrameElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_3.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); } { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_2)); + ::vl::__vwsn::This(this->__vwsn_precompile_3.Obj())->SetHorizontalAlignment(::vl::presentation::Alignment::Center); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_3)); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_2)); } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_1)); @@ -29130,7 +29141,8 @@ Class (::darkskin::RibbonIconLabelTemplateConstructor) , self(static_cast<::darkskin::RibbonIconLabelTemplate*>(nullptr)) , __vwsn_precompile_0(static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr)) , __vwsn_precompile_1(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) - , __vwsn_precompile_2(::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>()) + , __vwsn_precompile_2(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_3(::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>()) { } @@ -30167,54 +30179,58 @@ Class (::darkskin::RibbonSmallIconLabelTemplateConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetColumnOption(static_cast<::vl::vint>(2), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = static_cast(1.0); return __vwsn_temp__; }()); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiCellComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); } - (this->__vwsn_precompile_2 = ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiImageFrameElement>())); + (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_2.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->__vwsn_precompile_2.Obj())->SetHorizontalAlignment(::vl::presentation::Alignment::Center); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + (this->__vwsn_precompile_3 = ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiImageFrameElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_3.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); } { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_2)); + ::vl::__vwsn::This(this->__vwsn_precompile_3.Obj())->SetHorizontalAlignment(::vl::presentation::Alignment::Center); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_3)); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_2)); } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_1)); } - (this->__vwsn_precompile_3 = new ::vl::presentation::compositions::GuiCellComposition()); + (this->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiCellComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); + } + (this->__vwsn_precompile_5 = new ::vl::presentation::compositions::GuiSharedSizeItemComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_5)->SetSharedWidth(true); } { - ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); - } - (this->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiSharedSizeItemComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetSharedWidth(true); + ::vl::__vwsn::This(this->__vwsn_precompile_5)->SetGroup(::vl::WString::Unmanaged(L"MenuItem-Text")); } { - ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetGroup(::vl::WString::Unmanaged(L"MenuItem-Text")); + ::vl::__vwsn::This(this->__vwsn_precompile_5)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); + } + (this->__vwsn_precompile_6 = ::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidLabelElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_6.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); } { - ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); - } - (this->__vwsn_precompile_5 = ::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidLabelElement>())); - { - ::vl::__vwsn::This(this->__vwsn_precompile_5.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); + ::vl::__vwsn::This(this->__vwsn_precompile_5)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_6)); } { - ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_5)); + ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_5)); } { - ::vl::__vwsn::This(this->__vwsn_precompile_3)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_4)); - } - { - ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_3)); + ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_4)); } (this->container = new ::vl::presentation::compositions::GuiCellComposition()); { @@ -30266,10 +30282,11 @@ Class (::darkskin::RibbonSmallIconLabelTemplateConstructor) , self(static_cast<::darkskin::RibbonSmallIconLabelTemplate*>(nullptr)) , __vwsn_precompile_0(static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr)) , __vwsn_precompile_1(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) - , __vwsn_precompile_2(::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>()) - , __vwsn_precompile_3(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) - , __vwsn_precompile_4(static_cast<::vl::presentation::compositions::GuiSharedSizeItemComposition*>(nullptr)) - , __vwsn_precompile_5(::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement>()) + , __vwsn_precompile_2(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_3(::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement>()) + , __vwsn_precompile_4(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) + , __vwsn_precompile_5(static_cast<::vl::presentation::compositions::GuiSharedSizeItemComposition*>(nullptr)) + , __vwsn_precompile_6(::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement>()) { } @@ -30801,49 +30818,56 @@ Class (::darkskin::RibbonToolstripMenuTemplateConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_5)); } - (this->container = new ::vl::presentation::compositions::GuiCellComposition()); - { - ::vl::__vwsn::This(this->container)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(3); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); - } - { - ::vl::__vwsn::This(this->container)->SetSite(static_cast<::vl::vint>(2), static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(2)); - } - { - ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); - } (this->__vwsn_precompile_8 = new ::vl::presentation::compositions::GuiCellComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_8)->SetAssociatedHitTestResult(::vl::presentation::INativeWindowListener::HitTestResult::BorderBottom); + ::vl::__vwsn::This(this->__vwsn_precompile_8)->SetSite(static_cast<::vl::vint>(2), static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(2)); + } + (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + { + ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(3); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->__vwsn_precompile_8)->SetSite(static_cast<::vl::vint>(3), static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); - } - (this->__vwsn_precompile_9 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBackgroundElement>())); - { - ::vl::__vwsn::This(this->__vwsn_precompile_9.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#007ACC"))); + ::vl::__vwsn::This(this->container)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } { - ::vl::__vwsn::This(this->__vwsn_precompile_8)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_9)); + ::vl::__vwsn::This(this->__vwsn_precompile_8)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); } { ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_8)); } - (this->__vwsn_precompile_10 = new ::vl::presentation::compositions::GuiCellComposition()); + (this->__vwsn_precompile_9 = new ::vl::presentation::compositions::GuiCellComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_10)->SetAssociatedHitTestResult(::vl::presentation::INativeWindowListener::HitTestResult::BorderRightBottom); + ::vl::__vwsn::This(this->__vwsn_precompile_9)->SetAssociatedHitTestResult(::vl::presentation::INativeWindowListener::HitTestResult::BorderBottom); } { - ::vl::__vwsn::This(this->__vwsn_precompile_10)->SetSite(static_cast<::vl::vint>(3), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); + ::vl::__vwsn::This(this->__vwsn_precompile_9)->SetSite(static_cast<::vl::vint>(3), static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); } - (this->__vwsn_precompile_11 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBackgroundElement>())); + (this->__vwsn_precompile_10 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBackgroundElement>())); { - ::vl::__vwsn::This(this->__vwsn_precompile_11.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#007ACC"))); + ::vl::__vwsn::This(this->__vwsn_precompile_10.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#007ACC"))); } { - ::vl::__vwsn::This(this->__vwsn_precompile_10)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_11)); + ::vl::__vwsn::This(this->__vwsn_precompile_9)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_10)); } { - ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_10)); + ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_9)); + } + (this->__vwsn_precompile_11 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetAssociatedHitTestResult(::vl::presentation::INativeWindowListener::HitTestResult::BorderRightBottom); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetSite(static_cast<::vl::vint>(3), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); + } + (this->__vwsn_precompile_12 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBackgroundElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_12.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#007ACC"))); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_12)); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_11)); } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_4)); @@ -30860,7 +30884,7 @@ Class (::darkskin::RibbonToolstripMenuTemplateConstructor) } RibbonToolstripMenuTemplateConstructor::RibbonToolstripMenuTemplateConstructor() - : container(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) + : container(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , content(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) , __vwsn_precompile_0(static_cast<::darkskin::RibbonToolstripMenuTemplate*>(nullptr)) , __vwsn_precompile_1(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) @@ -30871,9 +30895,10 @@ Class (::darkskin::RibbonToolstripMenuTemplateConstructor) , __vwsn_precompile_6(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , __vwsn_precompile_7(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) , __vwsn_precompile_8(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) - , __vwsn_precompile_9(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) - , __vwsn_precompile_10(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) - , __vwsn_precompile_11(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) + , __vwsn_precompile_9(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) + , __vwsn_precompile_10(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) + , __vwsn_precompile_11(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) + , __vwsn_precompile_12(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) { } @@ -31029,9 +31054,6 @@ Class (::darkskin::ScrollViewTemplateConstructor) ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -31053,7 +31075,7 @@ Class (::darkskin::ScrollViewTemplateConstructor) ::vl::__vwsn::This(this->look)->SetHScrollTemplate(vl::Func(::vl_workflow_global::__vwsnf277_DarkSkin_darkskin_ScrollViewTemplateConstructor___vwsn_darkskin_ScrollViewTemplate_Initialize_(this))); } { - ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->look)); @@ -31216,22 +31238,29 @@ Class (::darkskin::SinglelineTextBoxTemplateConstructor) { ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } - (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->container)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + (this->__vwsn_precompile_2 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_2)); + } + (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + { + ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->container)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } - (this->__vwsn_precompile_1 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); { - ::vl::__vwsn::This(this->container)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_1)); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); } { - ::vl::__vwsn::This(this->self)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); + ::vl::__vwsn::This(this->self)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_1)); } { auto __vwsn_created_subscription_ = ::vl::Ptr<::vl::reflection::description::IValueSubscription>(new ::vl_workflow_global::__vwsnc192_DarkSkin_darkskin_SinglelineTextBoxTemplateConstructor___vwsn_darkskin_SinglelineTextBoxTemplate_Initialize__vl_reflection_description_IValueSubscription(this)); @@ -31247,7 +31276,8 @@ Class (::darkskin::SinglelineTextBoxTemplateConstructor) : container(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , self(static_cast<::darkskin::SinglelineTextBoxTemplate*>(nullptr)) , __vwsn_precompile_0(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) - , __vwsn_precompile_1(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) + , __vwsn_precompile_1(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_2(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) { } @@ -31817,9 +31847,6 @@ Class (::darkskin::TextListTemplateConstructor) ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -31838,7 +31865,7 @@ Class (::darkskin::TextListTemplateConstructor) ::vl::__vwsn::This(this->look)->SetHScrollTemplate(vl::Func(::vl_workflow_global::__vwsnf125_DarkSkin_darkskin_TextListTemplateConstructor___vwsn_darkskin_TextListTemplate_Initialize_(this))); } { - ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->look)); @@ -32398,25 +32425,32 @@ Class (::darkskin::ToolstripMenuTemplateConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_1)); } - (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); { - ::vl::__vwsn::This(this->container)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(3); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + (this->__vwsn_precompile_3 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); + { + ::vl::__vwsn::This(this->__vwsn_precompile_3.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#333337"))); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_3)); + } + (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + { + ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(3); __vwsn_temp__.top = static_cast<::vl::vint>(3); __vwsn_temp__.right = static_cast<::vl::vint>(3); __vwsn_temp__.bottom = static_cast<::vl::vint>(3); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->container)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } - (this->__vwsn_precompile_2 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBorderElement>())); { - ::vl::__vwsn::This(this->__vwsn_precompile_2.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#333337"))); + ::vl::__vwsn::This(this->__vwsn_precompile_2)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); } { - ::vl::__vwsn::This(this->container)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_2)); - } - { - ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); + ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_2)); } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetContainerComposition(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); @@ -32427,7 +32461,8 @@ Class (::darkskin::ToolstripMenuTemplateConstructor) : container(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , __vwsn_precompile_0(static_cast<::darkskin::ToolstripMenuTemplate*>(nullptr)) , __vwsn_precompile_1(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) - , __vwsn_precompile_2(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) + , __vwsn_precompile_2(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_3(::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement>()) { } @@ -32789,9 +32824,6 @@ Class (::darkskin::ToolstripTemplateConstructor) void ToolstripTemplateConstructor::__vwsn_darkskin_ToolstripTemplate_Initialize(::darkskin::ToolstripTemplate* __vwsn_this_) { (this->__vwsn_precompile_0 = __vwsn_this_); - { - ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(2); __vwsn_temp__.top = static_cast<::vl::vint>(2); __vwsn_temp__.right = static_cast<::vl::vint>(2); __vwsn_temp__.bottom = static_cast<::vl::vint>(2); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } @@ -32802,10 +32834,24 @@ Class (::darkskin::ToolstripTemplateConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_1)); } + (this->container = new ::vl::presentation::compositions::GuiBoundsComposition()); + { + ::vl::__vwsn::This(this->container)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(2); __vwsn_temp__.top = static_cast<::vl::vint>(2); __vwsn_temp__.right = static_cast<::vl::vint>(2); __vwsn_temp__.bottom = static_cast<::vl::vint>(2); return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(this->container)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); + } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetContainerComposition(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->container)); + } } ToolstripTemplateConstructor::ToolstripTemplateConstructor() - : __vwsn_precompile_0(static_cast<::darkskin::ToolstripTemplate*>(nullptr)) + : container(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_0(static_cast<::darkskin::ToolstripTemplate*>(nullptr)) , __vwsn_precompile_1(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>()) { } @@ -33012,9 +33058,6 @@ Class (::darkskin::TreeViewTemplateConstructor) ::vl::__vwsn::This(this->self)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_0)); } (this->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -33033,7 +33076,7 @@ Class (::darkskin::TreeViewTemplateConstructor) ::vl::__vwsn::This(this->look)->SetHScrollTemplate(vl::Func(::vl_workflow_global::__vwsnf130_DarkSkin_darkskin_TreeViewTemplateConstructor___vwsn_darkskin_TreeViewTemplate_Initialize_(this))); } { - ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->look)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->look)); diff --git a/Import/Skins/DarkSkin/DarkSkin.h b/Import/Skins/DarkSkin/DarkSkin.h index 13982c96..17762781 100644 --- a/Import/Skins/DarkSkin/DarkSkin.h +++ b/Import/Skins/DarkSkin/DarkSkin.h @@ -1370,7 +1370,8 @@ namespace darkskin ::vl::presentation::compositions::GuiBoundsComposition* container; ::darkskin::DocumentTextBoxTemplate* self; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_0; - ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_1; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_1; + ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_2; void __vwsn_darkskin_DocumentTextBoxTemplate_Initialize(::darkskin::DocumentTextBoxTemplate* __vwsn_this_); public: DocumentTextBoxTemplateConstructor(); @@ -2381,7 +2382,8 @@ namespace darkskin ::vl::presentation::compositions::GuiBoundsComposition* container; ::darkskin::RibbonGroupMenuTemplate* __vwsn_precompile_0; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_1; - ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_2; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; + ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_3; void __vwsn_darkskin_RibbonGroupMenuTemplate_Initialize(::darkskin::RibbonGroupMenuTemplate* __vwsn_this_); public: RibbonGroupMenuTemplateConstructor(); @@ -2467,7 +2469,8 @@ namespace darkskin ::darkskin::RibbonIconLabelTemplate* self; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; - ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement> __vwsn_precompile_2; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; + ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement> __vwsn_precompile_3; void __vwsn_darkskin_RibbonIconLabelTemplate_Initialize(::darkskin::RibbonIconLabelTemplate* __vwsn_this_); public: RibbonIconLabelTemplateConstructor(); @@ -2877,10 +2880,11 @@ namespace darkskin ::darkskin::RibbonSmallIconLabelTemplate* self; ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_0; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_1; - ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement> __vwsn_precompile_2; - ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_3; - ::vl::presentation::compositions::GuiSharedSizeItemComposition* __vwsn_precompile_4; - ::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement> __vwsn_precompile_5; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; + ::vl::Ptr<::vl::presentation::elements::GuiImageFrameElement> __vwsn_precompile_3; + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4; + ::vl::presentation::compositions::GuiSharedSizeItemComposition* __vwsn_precompile_5; + ::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement> __vwsn_precompile_6; void __vwsn_darkskin_RibbonSmallIconLabelTemplate_Initialize(::darkskin::RibbonSmallIconLabelTemplate* __vwsn_this_); public: RibbonSmallIconLabelTemplateConstructor(); @@ -3083,7 +3087,7 @@ namespace darkskin friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: - ::vl::presentation::compositions::GuiCellComposition* container; + ::vl::presentation::compositions::GuiBoundsComposition* container; ::vl::presentation::compositions::GuiCellComposition* content; ::darkskin::RibbonToolstripMenuTemplate* __vwsn_precompile_0; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_1; @@ -3094,9 +3098,10 @@ namespace darkskin ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_6; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_7; ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_8; - ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_9; - ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_10; - ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_11; + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_9; + ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_10; + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_11; + ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_12; void __vwsn_darkskin_RibbonToolstripMenuTemplate_Initialize(::darkskin::RibbonToolstripMenuTemplate* __vwsn_this_); public: RibbonToolstripMenuTemplateConstructor(); @@ -3252,7 +3257,8 @@ namespace darkskin ::vl::presentation::compositions::GuiBoundsComposition* container; ::darkskin::SinglelineTextBoxTemplate* self; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_0; - ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_1; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_1; + ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_2; void __vwsn_darkskin_SinglelineTextBoxTemplate_Initialize(::darkskin::SinglelineTextBoxTemplate* __vwsn_this_); public: SinglelineTextBoxTemplateConstructor(); @@ -3770,7 +3776,8 @@ namespace darkskin ::vl::presentation::compositions::GuiBoundsComposition* container; ::darkskin::ToolstripMenuTemplate* __vwsn_precompile_0; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_1; - ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_2; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_2; + ::vl::Ptr<::vl::presentation::elements::GuiSolidBorderElement> __vwsn_precompile_3; void __vwsn_darkskin_ToolstripMenuTemplate_Initialize(::darkskin::ToolstripMenuTemplate* __vwsn_this_); public: ToolstripMenuTemplateConstructor(); @@ -3924,6 +3931,7 @@ namespace darkskin friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; #endif protected: + ::vl::presentation::compositions::GuiBoundsComposition* container; ::darkskin::ToolstripTemplate* __vwsn_precompile_0; ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement> __vwsn_precompile_1; void __vwsn_darkskin_ToolstripTemplate_Initialize(::darkskin::ToolstripTemplate* __vwsn_this_); diff --git a/Import/Skins/DarkSkin/DarkSkinReflection.cpp b/Import/Skins/DarkSkin/DarkSkinReflection.cpp index 2f976733..c72d4912 100644 --- a/Import/Skins/DarkSkin/DarkSkinReflection.cpp +++ b/Import/Skins/DarkSkin/DarkSkinReflection.cpp @@ -391,6 +391,7 @@ namespace vl CLASS_MEMBER_METHOD(__vwsn_darkskin_DocumentTextBoxTemplate_Initialize, { L"__vwsn_this_" }) CLASS_MEMBER_FIELD(__vwsn_precompile_0) CLASS_MEMBER_FIELD(__vwsn_precompile_1) + CLASS_MEMBER_FIELD(__vwsn_precompile_2) CLASS_MEMBER_FIELD(container) CLASS_MEMBER_FIELD(self) END_CLASS_MEMBER(::darkskin::DocumentTextBoxTemplateConstructor) @@ -831,6 +832,7 @@ namespace vl 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(container) END_CLASS_MEMBER(::darkskin::RibbonGroupMenuTemplateConstructor) @@ -870,6 +872,7 @@ namespace vl 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(container) CLASS_MEMBER_FIELD(self) END_CLASS_MEMBER(::darkskin::RibbonIconLabelTemplateConstructor) @@ -1013,6 +1016,7 @@ namespace vl 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(container) CLASS_MEMBER_FIELD(self) END_CLASS_MEMBER(::darkskin::RibbonSmallIconLabelTemplateConstructor) @@ -1093,6 +1097,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) @@ -1181,6 +1186,7 @@ namespace vl CLASS_MEMBER_METHOD(__vwsn_darkskin_SinglelineTextBoxTemplate_Initialize, { L"__vwsn_this_" }) CLASS_MEMBER_FIELD(__vwsn_precompile_0) CLASS_MEMBER_FIELD(__vwsn_precompile_1) + CLASS_MEMBER_FIELD(__vwsn_precompile_2) CLASS_MEMBER_FIELD(container) CLASS_MEMBER_FIELD(self) END_CLASS_MEMBER(::darkskin::SinglelineTextBoxTemplateConstructor) @@ -1367,6 +1373,7 @@ namespace vl 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(container) END_CLASS_MEMBER(::darkskin::ToolstripMenuTemplateConstructor) @@ -1439,6 +1446,7 @@ namespace vl CLASS_MEMBER_METHOD(__vwsn_darkskin_ToolstripTemplate_Initialize, { L"__vwsn_this_" }) CLASS_MEMBER_FIELD(__vwsn_precompile_0) CLASS_MEMBER_FIELD(__vwsn_precompile_1) + CLASS_MEMBER_FIELD(container) END_CLASS_MEMBER(::darkskin::ToolstripTemplateConstructor) BEGIN_CLASS_MEMBER(::darkskin::TooltipTemplate) diff --git a/Import/VlppGlrParser.cpp b/Import/VlppGlrParser.cpp index 22e6276e..d0023eea 100644 --- a/Import/VlppGlrParser.cpp +++ b/Import/VlppGlrParser.cpp @@ -4363,6 +4363,7 @@ MergeInsExecContext { // check if all stack objects are the same bool sameStackObject = true; + // TODO: (enumerable) Linq:Skip for (vint index = 1; index < stacks.Count(); index++) { if (stacks[0] != stacks[index]) @@ -4388,6 +4389,7 @@ MergeInsExecContext // call this macro to create a one-time set for InsExec* NEW_MERGE_STACK_MAGIC_COUNTER; auto magicPush = MergeStack_MagicCounter; + // TODO: (enumerable) foreach for (vint index = 0; index < stacks.Count(); index++) { // do not visit the same stack object repeatly diff --git a/Import/VlppGlrParserCompiler.cpp b/Import/VlppGlrParserCompiler.cpp index 87ea5d77..5823e38e 100644 --- a/Import/VlppGlrParserCompiler.cpp +++ b/Import/VlppGlrParserCompiler.cpp @@ -2644,6 +2644,7 @@ AstClassSymbol List visited; visited.Add(newBaseClass); + // TODO: (enumerable) foreach:alterable for (vint i = 0; i < visited.Count(); i++) { auto currentSymbol = visited[i]; @@ -2828,6 +2829,7 @@ AstDefFile List visited; visited.Add(dependency); + // TODO: (enumerable) foreach for (vint i = 0; i < visited.Count(); i++) { auto currentName = visited[i]; @@ -2842,6 +2844,7 @@ AstDefFile return false; } auto current = ownerManager->Files()[currentName]; + // TODO: (enumerable) foreach for (vint j = 0; j < current->dependencies.Count(); j++) { auto dep = current->dependencies[j]; @@ -4210,6 +4213,7 @@ CalculateFirstSet while (true) { vint offset = 0; + // TODO: (enumerable) foreach:alterable for (auto [rule, index] : indexed(indirect.Keys())) { auto&& startRules1 = indirect.GetByIndex(index); @@ -5586,6 +5590,7 @@ FillMissingPrefixMergeClauses if (index != -1) { auto&& values = const_cast&>(references.GetByIndex(index)); + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = values.Count() - 1; i >= 0; i--) { if (values[i].clause == clause) @@ -5777,6 +5782,7 @@ CreateRewrittenRules originRule->name.value += L"_LRI_Original"; } + // TODO: (enumerable) foreach for (auto [ruleSymbol, index] : indexed(rContext.extractPrefixClauses.Keys())) { auto originRule = vContext.astRules[ruleSymbol]; @@ -6149,6 +6155,7 @@ RewriteRules (Unaffected) SortedList& knownOptionalStartRules ) { + // TODO: (enumerable) foreach on group for (auto [pmName, pmIndex] : indexed(pmClauses.Keys())) { // if originRule is not left recursive @@ -6245,6 +6252,7 @@ RewriteRules (Affected) } } + // TODO: (enumerable) foreach on group for (auto [pmName, pmIndex] : indexed(pmClauses.Keys())) { // if originRule is not left recursive @@ -6359,6 +6367,7 @@ RewriteRules (Affected) SortedList& knownOptionalStartRules ) { + // TODO: (enumerable) foreach on group for (auto [conflictedClause, conflictedIndex] : indexed(conflict->conflictedClauses.Keys())) { auto conflictedRuleSymbol = vContext.simpleUseClauseToReferencedRules[conflictedClause]; @@ -6410,6 +6419,7 @@ RewriteRules auto cont1 = c1->continuation; auto cont2 = c2->continuation; if (cont1->flags.Count() != cont2->flags.Count()) return false; + // TODO: (enumerable) foreach:indexed, flag not used, considering Linq:Zip, Any for (auto [flag, i] : indexed(cont1->flags)) { if (cont1->flags[i]->flag.value != cont2->flags[i]->flag.value) return false; @@ -6438,6 +6448,7 @@ RewriteRules { auto candidate = candidates[candidates.Count() - 1]; candidates.RemoveAt(candidates.Count() - 1); + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = candidates.Count() - 1; i >= 0; i--) { auto compare = candidates[i]; @@ -7175,6 +7186,7 @@ ExpandClauseVisitor auto alt = Ptr(new GlrAlternativeSyntax); alt->first = items[0]; alt->second = items[1]; + // TODO: (enumerable) Linq:Skip for (vint i = 2; i < items.Count(); i++) { auto newAlt = Ptr(new GlrAlternativeSyntax); @@ -7528,6 +7540,7 @@ RewriteSyntax void CreateRuleSymbols(SyntaxSymbolManager& syntaxManager, Group>& expandedRules) { + // TODO: (enumerable) foreach on group, sort pairs instead of calling Get for (auto ruleSymbol : From(expandedRules.Keys()) .OrderByKey([](auto&& a) { return a->Name(); }) ) @@ -8265,6 +8278,7 @@ ValidatePrefixMerge SortedList visited; CopyFrom(visiting, context.clauseToStartRules.GetByIndex(index)); + // TODO: (enumerable) visiting/visited for (vint i = 0; i < visiting.Count(); i++) { auto visitingRule = visiting[i]; @@ -9138,6 +9152,7 @@ CollectRuleAffectedSwitchesSecondPassVisitor vint indexSwitch = sContext.ruleAffectedSwitches.Keys().IndexOf(refRuleSymbol); if (indexSwitch != -1) { + // TODO: (enumerable) operate on GetByIndex returned list object directly for (auto&& name : sContext.ruleAffectedSwitches.GetByIndex(indexSwitch)) { if (!pushedSwitches.Contains(name)) @@ -15242,6 +15257,7 @@ SyntaxSymbolManager if (!visited.Contains(startState)) { vint startIndex = visited.Add(startState); + // TODO: (enumerable) Linq:Skip for (vint i = startIndex; i < visited.Count(); i++) { auto state = visited[i]; @@ -15503,6 +15519,7 @@ AutomatonBuilder (Syntax) */ CHECK_ERROR(elements.Count() > 0, L"vl::glr::parsergen::AutomatonBuilder::BuildSequenceSyntax(List&)#Elements must not be empty."); auto pair = elements[0](); + // TODO: (enumerable) Linq:Skip for (vint i = 1; i < elements.Count(); i++) { clauseDisplayText += L" "; @@ -15528,6 +15545,7 @@ AutomatonBuilder (Syntax) startPoses.Add(pair.begin, clauseDisplayText.Length()); clauseDisplayText += L"( "; + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < elements.Count(); i++) { if (i > 0) clauseDisplayText += L" | "; @@ -15647,6 +15665,7 @@ AutomatonBuilder (Clause) } clauseDisplayText += L"lrp:("; + // TODO: (enumerable) Linq:Aggregate for (vint i = 0; i < flags.Count(); i++) { if (i > 0) clauseDisplayText += L","; @@ -15674,6 +15693,7 @@ AutomatonBuilder (Clause) } clauseDisplayText += L"lri:("; + // TODO: (enumerable) Linq:Aggregate for (vint i = 0; i < flags.Count(); i++) { if (i > 0) clauseDisplayText += L","; @@ -16550,6 +16570,7 @@ SyntaxSymbolManager::BuildLeftRecEdge CopyFrom(newEdge->insBeforeInput, lrecPrefixEdge->insBeforeInput, true); CopyFrom(newEdge->insAfterInput, lrecPrefixEdge->insAfterInput, true); + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = newEdge->insBeforeInput.Count() - 1; i >= 0; i--) { if (newEdge->insBeforeInput[i].type == AstInsType::BeginObject) @@ -16558,6 +16579,7 @@ SyntaxSymbolManager::BuildLeftRecEdge newEdge->insBeforeInput.Insert(i + 2, { AstInsType::LriFetch }); } } + // TODO: (enumerable) foreach:indexed(alterable(reversed)) for (vint i = newEdge->insAfterInput.Count() - 1; i >= 0; i--) { if (newEdge->insAfterInput[i].type == AstInsType::BeginObject) @@ -16672,6 +16694,7 @@ SyntaxSymbolManager::EliminateSingleRulePrefix } } + // TODO: (enumerable) foreach on group for (auto [ruleSymbol, prefixIndex] : indexed(prefixEdges.Keys())) { auto&& prefixEdgesOfRule = prefixEdges.GetByIndex(prefixIndex); @@ -16693,6 +16716,7 @@ SyntaxSymbolManager::EliminateSingleRulePrefix // if their insBeforeInput are different // move prefixEdge's insBeforeInput to insAfterInput with help from LriStore and LriFetch SortedList compatibleInsBeforeInputPrefixRules; + // TODO: (enumerable) foreach on group for (auto [ruleSymbol, prefixIndex] : indexed(prefixEdges.Keys())) { // see if all prefixEdges are compatible @@ -16725,6 +16749,7 @@ SyntaxSymbolManager::EliminateSingleRulePrefix // for all prefixEdge that fails the above test // combine insBeforeInput with insAfterInput with the help from LriStore and LriFetch // properly move instructions from prefixEdge to endingEdge + // TODO: (enumerable) foreach on group for (auto [ruleSymbol, prefixIndex] : indexed(prefixEdges.Keys())) { bool compatible = compatibleInsBeforeInputPrefixRules.Contains(ruleSymbol); @@ -16849,6 +16874,7 @@ SyntaxSymbolManager::EliminateEpsilonEdges // all epsilon-NFAs of its clauses become one connected epsilon-NFA of this rule // we can build the compact-NFA out of this epsilon-NFA starting from the start state + // TODO: (enumerable) foreach:alterable for (vint i = 0; i < visited.Count(); i++) { auto current = visited[i]; @@ -17080,6 +17106,7 @@ SyntaxSymbolManager::FixLeftRecursionInjectEdge auto& endingStates = endingStatesArray[index]; auto& returnEdges = returnEdgesArray[index]; + // TODO: (enumerable) foreach:indexed(reversed) for (vint i = returnEdges.Count() - 1; i >= 0; i--) { auto endingState = endingStates[i]; @@ -17122,6 +17149,7 @@ SyntaxSymbolManager::FixLeftRecursionInjectEdge } } + // TODO: (enumerable) foreach on group for (auto [input, inputIndex] : indexed(acceptableInputs.Keys())) { auto [inputToken, returnEdgeCount] = input; @@ -17160,6 +17188,7 @@ SyntaxSymbolManager::FixLeftRecursionInjectEdge Group simpleUseRecords; // search for placeholder edges where their excluded return edges are all reuse edges + // TODO: (enumerable) foreach on group for (vint recordIndex = 0; recordIndex < placeholderRecords.Count(); recordIndex++) { auto [placeholderIndex, lrEdge, tokenEdge] = placeholderRecords[recordIndex]; @@ -17176,6 +17205,7 @@ SyntaxSymbolManager::FixLeftRecursionInjectEdge // for each group, if there are more than one placeholder edges // mark them as deleted except the first one SortedList recordsToRemove; + // TODO: (enumerable) foreach on group for (vint recordGroup = 0; recordGroup < simpleUseRecords.Count(); recordGroup++) { auto&& records = simpleUseRecords.GetByIndex(recordGroup); @@ -17187,6 +17217,7 @@ SyntaxSymbolManager::FixLeftRecursionInjectEdge // delete them in Group // this way is not recommended but the group is going to be discarded very soon + // TODO: (enumerable) foreach:reversed for (vint i = recordsToRemove.Count() - 1; i >= 0; i--) { const_cast&>(placeholderRecords).RemoveAt(recordsToRemove[i]); @@ -17222,7 +17253,8 @@ SyntaxSymbolManager::FixLeftRecursionInjectEdge CopyFrom(instructionPrefix, placeholderEdge->insBeforeInput, true); instructionPrefix.Add({ AstInsType::LriFetch }); - for (vint i = returnEdges.Count() - 1; i >= returnEdgeCount;i --) + // TODO: (enumerable) foreach:reversed + for (vint i = returnEdges.Count() - 1; i >= returnEdgeCount; i--) { auto endingState = endingStates[i]; auto returnEdge = returnEdges[i]; diff --git a/Import/VlppOS.Linux.cpp b/Import/VlppOS.Linux.cpp index 73bdd3bb..5df8a392 100644 --- a/Import/VlppOS.Linux.cpp +++ b/Import/VlppOS.Linux.cpp @@ -1298,6 +1298,7 @@ ThreadPoolLite } threadPoolData->taskFinishEvent.Wait(); + // TODO: (enumerable) foreach for (vint i = 0; i < threadPoolData->taskThreads.Count(); i++) { auto thread = threadPoolData->taskThreads[i]; diff --git a/Import/VlppOS.Windows.cpp b/Import/VlppOS.Windows.cpp index 1f610a49..ca0b5cc4 100644 --- a/Import/VlppOS.Windows.cpp +++ b/Import/VlppOS.Windows.cpp @@ -431,6 +431,7 @@ Utilities if (!connectedInternet) goto CLEANUP; // open request + // TODO: (enumerable) Linq:Select for (vint i = 0; i < request.acceptTypes.Count(); i++) { acceptTypes.Add(request.acceptTypes.Get(i).Buffer()); diff --git a/Import/VlppOS.cpp b/Import/VlppOS.cpp index db48ab7f..f5af9494 100644 --- a/Import/VlppOS.cpp +++ b/Import/VlppOS.cpp @@ -1082,6 +1082,7 @@ BroadcastStream vint BroadcastStream::Write(void* _buffer, vint _size) { + // TODO: (enumerable) foreach for(vint i=0;iWrite(_buffer, _size); diff --git a/Import/VlppReflection.cpp b/Import/VlppReflection.cpp index a4bb87ec..7e44bdcc 100644 --- a/Import/VlppReflection.cpp +++ b/Import/VlppReflection.cpp @@ -137,6 +137,7 @@ description::TypeManager { loaded = true; auto oldTypeVersion = typeVersion; + // TODO: (enumerable) foreach for (vint i = 0; i < typeLoaders.Count(); i++) { typeLoaders[i]->Load(this); @@ -157,6 +158,7 @@ description::TypeManager loaded = false; rootType = 0; auto oldTypeVersion = typeVersion; + // TODO: (enumerable) foreach for (vint i = 0; i < typeLoaders.Count(); i++) { typeLoaders[i]->Unload(this); @@ -865,6 +867,7 @@ MetaonlyTypeInfo default:; } WString result = elementType->GetTypeFriendlyName() + L"<"; + // TODO: (enumerable) Linq:Aggregate for (auto [type, i] : indexed(genericArguments)) { if (i > 0) result += L", "; @@ -1107,6 +1110,7 @@ IMethodInfo : context(_context) , metadata(_metadata) { + // TODO: (enumerable) foreach for (vint i = 0; i < metadata->parameters.Count(); i++) { parameters.Add(Ptr(new MetaonlyParameterInfo(context, metadata->parameters[i], metadata->ownerTypeDescriptor, this))); @@ -1443,6 +1447,7 @@ ITypeDescriptor serializableType = context->serializableTypes[metadata->typeName].Obj(); } + // TODO: (enumerable) foreach for (vint i = 0; i < metadata->methodGroups.Count(); i++) { methodGroups.Add(Ptr(new MetaonlyMethodGroupInfo(context, metadata, metadata->methodGroups[i]))); @@ -1659,6 +1664,7 @@ ITypeDescriptor IMethodGroupInfo* GetMethodGroupByName(const WString& name, bool inheritable) override { + // TODO: (enumerable) foreach for (vint i = 0; i < methodGroups.Count(); i++) { auto info = methodGroups[i].Obj(); @@ -1932,6 +1938,7 @@ LoadMetaonlyTypes void Load(ITypeManager* manager) override { + // TODO: (enumerable) foreach for (vint i = 0; i < context->tds.Count(); i++) { auto td = context->tds[i]; @@ -2533,6 +2540,7 @@ description::Value } else { + // TODO: (enumerable) foreach for(vint i=0;iGetType())) @@ -3430,6 +3439,7 @@ MethodInfoImpl bool MethodInfoImpl::AddParameter(Ptr parameter) { + // TODO: (enumerable) foreach for(vint i=0;iGetName()==parameter->GetName()) @@ -3969,6 +3979,7 @@ TypeDescriptorImpl { Load(); if (this == targetType) return true; + // TODO: (enumerable) foreach for (vint i = 0; i < baseTypeDescriptors.Count(); i++) { if (baseTypeDescriptors[i]->CanConvertTo(targetType)) return true; @@ -4004,6 +4015,7 @@ TypeDescriptorImpl } if(inheritable) { + // TODO: (enumerable) foreach for(vint i=0;iIsPropertyExists(name, true)) @@ -4025,6 +4037,7 @@ TypeDescriptorImpl } if(inheritable) { + // TODO: (enumerable) foreach for(vint i=0;iGetPropertyByName(name, true); @@ -4065,6 +4078,7 @@ TypeDescriptorImpl } if(inheritable) { + // TODO: (enumerable) foreach for(vint i=0;iIsEventExists(name, true)) @@ -4086,6 +4100,7 @@ TypeDescriptorImpl } if(inheritable) { + // TODO: (enumerable) foreach for(vint i=0;iGetEventByName(name, true); @@ -4126,6 +4141,7 @@ TypeDescriptorImpl } if(inheritable) { + // TODO: (enumerable) foreach for(vint i=0;iIsMethodGroupExists(name, true)) @@ -4147,6 +4163,7 @@ TypeDescriptorImpl } if(inheritable) { + // TODO: (enumerable) foreach for(vint i=0;iGetMethodGroupByName(name, true); diff --git a/Import/VlppRegex.cpp b/Import/VlppRegex.cpp index 6c1a7940..b28fad0b 100644 --- a/Import/VlppRegex.cpp +++ b/Import/VlppRegex.cpp @@ -79,6 +79,7 @@ RegexMatch_ : success(true) , result(_string, _result->start, _result->length) { + // TODO: (enumerable) foreach for (vint i = 0; i < _result->captures.Count(); i++) { CaptureRecord& capture = _result->captures[i]; @@ -994,6 +995,7 @@ RegexLexer_ expression->CollectCharSet(subsets); expressions.Add(expression); } + // TODO: (enumerable) foreach for (vint i = 0; i < expressions.Count(); i++) { Dictionary nfaStateMap; @@ -1006,9 +1008,11 @@ RegexLexer_ } // Mark all states in DFAs + // TODO: (enumerable) foreach for (vint i = 0; i < dfas.Count(); i++) { Ptr dfa = dfas[i]; + // TODO: (enumerable) foreach for (vint j = 0; j < dfa->states.Count(); j++) { if (dfa->states[j]->finalState) @@ -1024,12 +1028,14 @@ RegexLexer_ // Connect all DFAs to an e-NFA auto bigEnfa = Ptr(new Automaton); + // TODO: (enumerable) foreach for (vint i = 0; i < dfas.Count(); i++) { CopyFrom(bigEnfa->states, dfas[i]->states, true); CopyFrom(bigEnfa->transitions, dfas[i]->transitions, true); } bigEnfa->startState = bigEnfa->NewState(); + // TODO: (enumerable) foreach for (vint i = 0; i < dfas.Count(); i++) { bigEnfa->NewEpsilon(bigEnfa->startState, dfas[i]->startState); @@ -1039,12 +1045,14 @@ RegexLexer_ Dictionary nfaStateMap; Group dfaStateMap; auto bigNfa = EpsilonNfaToNfa(bigEnfa, PureEpsilonChecker, nfaStateMap); + // TODO: (enumerable) foreach on dictionary for (vint i = 0; i < nfaStateMap.Keys().Count(); i++) { void* userData = nfaStateMap.Values().Get(i)->userData; nfaStateMap.Keys()[i]->userData = userData; } auto bigDfa = NfaToDfa(bigNfa, dfaStateMap); + // TODO: (enumerable) foreach on group for (vint i = 0; i < dfaStateMap.Keys().Count(); i++) { void* userData = dfaStateMap.GetByIndex(i).Get(0)->userData; @@ -1346,6 +1354,7 @@ PureInterpretor { charMap[i] = charSetCount - 1; } + // TODO: (enumerable) foreach for (vint i = 0; i < charRanges.Count(); i++) { CharRange range = charRanges[i]; @@ -1377,6 +1386,7 @@ PureInterpretor } State* state = dfa->states[i].Obj(); + // TODO: (enumerable) foreach for (vint j = 0; j < state->transitions.Count(); j++) { Transition* dfaTransition = state->transitions[j]; @@ -1717,12 +1727,14 @@ RichInterpretor { datas = new UserData[dfa->states.Count()]; + // TODO: (enumerable) foreach for (vint i = 0; i < dfa->states.Count(); i++) { State* state = dfa->states[i].Obj(); vint charEdges = 0; vint nonCharEdges = 0; bool mustSave = false; + // TODO: (enumerable) foreach for (vint j = 0; j < state->transitions.Count(); j++) { if (state->transitions[j]->type == Transition::Chars) @@ -1762,6 +1774,7 @@ RichInterpretor bool found = false; // true means at least one transition matches the input StateSaver oldState = currentState; // Iterate through all transitions from the current state + // TODO: (enumerable) foreach:reversed for (vint i = currentState.minTransition; i < currentState.currentState->transitions.Count(); i++) { Transition* transition = currentState.currentState->transitions[i]; @@ -1972,6 +1985,7 @@ RichInterpretor // Find the next NegativeFail transition // Because when a negative lookahead regex failed to match, it is actually succeeded // Since a negative lookahead means we don't want to match this regex + // TODO: (enumerable) foreach:reversed for (vint i = 0; i < currentState.currentState->transitions.Count(); i++) { Transition* transition = currentState.currentState->transitions[i]; @@ -2185,6 +2199,7 @@ CharSetExpression range.begin = range.end; range.end = t; } + // TODO: (enumerable) foreach for (vint i = 0; i < ranges.Count(); i++) { if (!(rangeranges[i])) @@ -2389,6 +2404,7 @@ CharSetAlgorithm if (expression->reverse) { char32_t begin = 1; + // TODO: (enumerable) foreach for (vint i = 0; i < ranges.Count(); i++) { CharRange range = ranges[i]; @@ -2405,6 +2421,7 @@ CharSetAlgorithm } else { + // TODO: (enumerable) foreach for (vint i = 0; i < ranges.Count(); i++) { Process(expression, target, ranges[i]); @@ -2535,6 +2552,7 @@ SetNormalizedCharSetAlgorithm public: void Process(CharSetExpression* expression, NormalizedCharSet* target, CharRange range) { + // TODO: (enumerable) foreach for (vint j = 0; j < target->ranges.Count(); j++) { CharRange targetRange = target->ranges[j]; @@ -2643,6 +2661,7 @@ EpsilonNfaAlgorithm EpsilonNfa nfa; nfa.start = target->NewState(); nfa.end = target->NewState(); + // TODO: (enumerable) foreach for (vint i = 0; i < expression->ranges.Count(); i++) { target->NewChars(nfa.start, nfa.end, expression->ranges[i]); @@ -2949,6 +2968,7 @@ IsEqualAlgorithm { if (expression->reverse != expected->reverse)return false; if (expression->ranges.Count() != expected->ranges.Count())return false; + // TODO: (enumerable) foreach:indexed for (vint i = 0; i < expression->ranges.Count(); i++) { if (expression->ranges[i] != expected->ranges[i])return false; @@ -3881,6 +3901,7 @@ RegexNode auto target = Ptr(new CharSetExpression); target->reverse = false; CopyFrom(target->ranges, left->ranges); + // TODO: (enumerable) foreach for (vint i = 0; i < right->ranges.Count(); i++) { if (!target->AddRangeWithConflict(right->ranges[i])) @@ -4142,6 +4163,7 @@ Helpers if (!epsilonStates.Contains(sourceState)) { epsilonStates.Add(sourceState); + // TODO: (enumerable) foreach:alterable for (vint i = 0; i < sourceState->transitions.Count(); i++) { Transition* transition = sourceState->transitions[i]; @@ -4176,6 +4198,7 @@ Helpers target->startState = target->states[0].Obj(); CopyFrom(target->captureNames, source->captureNames); + // TODO: (enumerable) foreach for (vint i = 0; i < target->states.Count(); i++) { // Clear cache @@ -4192,6 +4215,7 @@ Helpers CollectEpsilon(targetState, sourceState, epsilonChecker, epsilonStates, transitions); // Iterate through all non-epsilon transitions + // TODO: (enumerable) foreach for (vint j = 0; j < transitions.Count(); j++) { Transition* transition = transitions[j]; @@ -4244,6 +4268,7 @@ Helpers if (transitionClass == nullptr) { + // TODO: (enumerable) foreach for (vint l = 0; l < orderedTransitionClasses.Count(); l++) { Transition* key = orderedTransitionClasses[l]; @@ -4283,6 +4308,7 @@ Helpers // Check if these NFA states represent a created DFA state State* dfaState = 0; + // TODO: (enumerable) foreach on dictionary for (vint k = 0; k < dfaStateMap.Count(); k++) { // Compare two NFA states set @@ -4295,6 +4321,7 @@ Helpers if (!dfaState) { dfaState = target->NewState(); + // TODO: (enumerable) foreach for (vint k = 0; k < transitionTargets.Count(); k++) { dfaStateMap.Add(dfaState, transitionTargets[k]); diff --git a/Tools/Reflection32.bin b/Tools/Reflection32.bin index 1032d10c..8b29d267 100644 Binary files a/Tools/Reflection32.bin and b/Tools/Reflection32.bin differ diff --git a/Tools/Reflection64.bin b/Tools/Reflection64.bin index 4f40d9bc..7799ca77 100644 Binary files a/Tools/Reflection64.bin and b/Tools/Reflection64.bin differ diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/AnimationTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/AnimationTabPage.xml index 8ebcbba1..28937bde 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/AnimationTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/AnimationTabPage.xml @@ -101,9 +101,9 @@ var sin = Math::Sin(angle); var cos = Math::Cos(angle); - var cx = (container.Bounds.x2 - container.Bounds.x1) / 2; - var cy = (container.Bounds.y2 - container.Bounds.y1) / 2; - var radiusBall = (ball.Bounds.x2 - ball.Bounds.x1) / 2; + var cx = (container.CachedBounds.x2 - container.CachedBounds.x1) / 2; + var cy = (container.CachedBounds.y2 - container.CachedBounds.y1) / 2; + var radiusBall = (ball.CachedBounds.x2 - ball.CachedBounds.x1) / 2; var radiusOrbit = Math::Min(cx, cy) - radiusBall; var x = cast int Math::Round(cos * radiusOrbit + cx); @@ -199,7 +199,7 @@ - +
<_>composeType:MinSize <_>composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DataGridTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DataGridTabPage.xml index 95619cb0..bb61b386 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DataGridTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DataGridTabPage.xml @@ -27,7 +27,7 @@ ]]> -
+
<_>composeType:MinSize <_>composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DatePickerTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DatePickerTabPage.xml index 07579004..9fe2fb04 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DatePickerTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DatePickerTabPage.xml @@ -2,7 +2,7 @@ -
+
<_>composeType:MinSize <_>composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentComponents.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentComponents.xml index 06aafd09..3d6d3daa 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentComponents.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentComponents.xml @@ -8,7 +8,7 @@ -
+
<_>composeType:MinSize <_>composeType:Percentage percentage:1.0 diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorBase.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorBase.xml index 82a94379..f1df7d54 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorBase.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorBase.xml @@ -168,7 +168,7 @@ Text="The document has been changed since the last time it was saved as a Private Format file. Do you want to save this file?" /> -
+
<_>composeType:MinSize <_>composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorRibbon.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorRibbon.xml index 5cc61734..062f84e9 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorRibbon.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/DocumentEditorRibbon.xml @@ -237,8 +237,8 @@ - - + + diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ElementTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ElementTabPage.xml index f4c4004e..61b250bd 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ElementTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ElementTabPage.xml @@ -1,6 +1,6 @@ -
+
<_>composeType:Absolute absolute:45 <_>composeType:Absolute absolute:45 diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ListViewTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ListViewTabPage.xml index 32f0f4ea..8c74b2fe 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ListViewTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ListViewTabPage.xml @@ -21,7 +21,7 @@ ]]> -
+
<_>composeType:MinSize <_>composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedDialogsTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedDialogsTabPage.xml index cc85417d..6a84a32d 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedDialogsTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedDialogsTabPage.xml @@ -52,7 +52,7 @@ -
+
<_>composeType:MinSize <_>composeType:Percentage percentage:1.0 @@ -169,7 +169,7 @@ ]]> -
+
<_>composeType:MinSize <_>composeType:MinSize @@ -259,7 +259,7 @@ -
+
<_>composeType:Absolute absolute:30 <_>composeType:MinSize @@ -295,7 +295,7 @@ -
+
<_>composeType:MinSize <_>composeType:MinSize @@ -365,7 +365,7 @@ -
+
<_>composeType:MinSize <_>composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedStringsTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedStringsTabPage.xml index d6a12d53..72044660 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedStringsTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/LocalizedStringsTabPage.xml @@ -44,7 +44,7 @@ -
+
<_>composeType:MinSize <_>composeType:Percentage percentage:1.0 diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/RepeatComponents.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/RepeatComponents.xml index 310bd216..cb072c0c 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/RepeatComponents.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/RepeatComponents.xml @@ -117,8 +117,7 @@ - - +
+
<_>composeType:Percentage percentage:1.0 <_>composeType:Absolute absolute:20 diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ResponsiveTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ResponsiveTabPage.xml index 90619309..7aa9a77c 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ResponsiveTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/ResponsiveTabPage.xml @@ -17,9 +17,9 @@ - + - + @@ -106,9 +106,9 @@ - + - + @@ -186,9 +186,9 @@ - + - + diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.cpp index c5e76bd2..dc541b1d 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.cpp @@ -487,9 +487,9 @@ Closures auto angle = (((circleRatio * ::vl::reflection::description::Math::Pi()) * static_cast(static_cast<::vl::vint>(2))) + (::vl::reflection::description::Math::Pi() * static_cast(1.5))); auto sin = ::vl::reflection::description::Math::Sin(angle); auto cos = ::vl::reflection::description::Math::Cos(angle); - auto cx = ((::vl::__vwsn::This(container)->GetBounds().x2 - ::vl::__vwsn::This(container)->GetBounds().x1) / static_cast<::vl::vint>(2)); - auto cy = ((::vl::__vwsn::This(container)->GetBounds().y2 - ::vl::__vwsn::This(container)->GetBounds().y1) / static_cast<::vl::vint>(2)); - auto radiusBall = ((::vl::__vwsn::This(ball)->GetBounds().x2 - ::vl::__vwsn::This(ball)->GetBounds().x1) / static_cast<::vl::vint>(2)); + auto cx = ((::vl::__vwsn::This(container)->GetCachedBounds().x2 - ::vl::__vwsn::This(container)->GetCachedBounds().x1) / static_cast<::vl::vint>(2)); + auto cy = ((::vl::__vwsn::This(container)->GetCachedBounds().y2 - ::vl::__vwsn::This(container)->GetCachedBounds().y1) / static_cast<::vl::vint>(2)); + auto radiusBall = ((::vl::__vwsn::This(ball)->GetCachedBounds().x2 - ::vl::__vwsn::This(ball)->GetCachedBounds().x1) / static_cast<::vl::vint>(2)); auto radiusOrbit = (::vl::reflection::description::Math::Min(cx, cy) - radiusBall); auto x = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((cos * static_cast(radiusOrbit)) + static_cast(cx)))); auto y = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((sin * static_cast(radiusOrbit)) + static_cast(cx)))); @@ -14891,6 +14891,9 @@ namespace demo { ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_3)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -15754,6 +15757,9 @@ Class (::demo::DataGridTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -16389,6 +16395,9 @@ Class (::demo::DatePickerTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -16664,6 +16673,9 @@ Class (::demo::DocumentBoxSubTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -16909,6 +16921,9 @@ Class (::demo::DocumentEditorBaseConstructor) ::vl::__vwsn::This(this->self)->AddComponent(static_cast<::vl::presentation::controls::GuiComponent*>(this->dialogQueryClose)); } (this->__vwsn_precompile_0 = new ::vl::presentation::compositions::GuiTableComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -17677,9 +17692,6 @@ Class (::demo::DocumentEditorRibbonConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_90)->SetDirection(::vl::presentation::compositions::GuiStackComposition::Direction::Horizontal); } (this->__vwsn_precompile_91 = new ::vl::presentation::compositions::GuiStackItemComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_91)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(10); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); - } (this->__vwsn_precompile_92 = ::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidLabelElement>())); { ::vl::__vwsn::This(this->__vwsn_precompile_92.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#FFFFFF"))); @@ -17691,7 +17703,7 @@ Class (::demo::DocumentEditorRibbonConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_92.Obj())->SetHorizontalAlignment(::vl::presentation::Alignment::Center); } { - ::vl::__vwsn::This(this->__vwsn_precompile_92.Obj())->SetText(::vl::WString::Unmanaged(L"Search:")); + ::vl::__vwsn::This(this->__vwsn_precompile_92.Obj())->SetText(::vl::WString::Unmanaged(L"Search: ")); } { ::vl::__vwsn::This(this->__vwsn_precompile_91)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_92)); @@ -19812,6 +19824,9 @@ Class (::demo::ElementTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(10)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -20411,10 +20426,6 @@ Class (::demo::EnglishNumbersControllerConstructor) { (this->__vwsn_precompile_0 = new ::vl::presentation::controls::GuiControl(::vl::presentation::theme::ThemeName::GroupBox)); } - (this->__vwsn_precompile_18 = ::vl::__vwsn::This(this->__vwsn_precompile_0)->GetContainerComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_18)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); - } (this->__vwsn_precompile_17 = ::vl::__vwsn::This(this->__vwsn_precompile_0)->GetBoundsComposition()); { ::vl::__vwsn::This(this->__vwsn_precompile_17)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }()); @@ -20427,7 +20438,7 @@ Class (::demo::EnglishNumbersControllerConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetPadding(static_cast<::vl::vint>(5)); } { - ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetDirection(::vl::presentation::compositions::GuiStackComposition::Direction::Vertical); @@ -20585,7 +20596,6 @@ Class (::demo::EnglishNumbersControllerConstructor) , __vwsn_precompile_15(static_cast<::vl::presentation::controls::GuiButton*>(nullptr)) , __vwsn_precompile_16(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , __vwsn_precompile_17(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) - , __vwsn_precompile_18(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(nullptr)) { } @@ -21168,6 +21178,9 @@ Class (::demo::HyperlinkWindowConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -21361,6 +21374,9 @@ Class (::demo::ListViewTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -21831,6 +21847,9 @@ Class (::demo::LocalizedColorDialogTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -21923,6 +21942,9 @@ Class (::demo::LocalizedDialogsTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -22103,6 +22125,9 @@ Class (::demo::LocalizedFileDialogTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -22738,6 +22763,9 @@ Class (::demo::LocalizedFontDialogTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -22865,6 +22893,9 @@ Class (::demo::LocalizedMessageDialogTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -23237,6 +23268,9 @@ Class (::demo::LocalizedStringsTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -24263,6 +24297,9 @@ Class (::demo::RepeatTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -24738,9 +24775,6 @@ Class (::demo::ResponsiveGroupControlConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(0), static_cast<::vl::vint>(5), static_cast<::vl::vint>(1)); } (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } @@ -24752,6 +24786,9 @@ Class (::demo::ResponsiveGroupControlConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_3)); } (this->responsive = new ::vl::presentation::compositions::GuiResponsiveGroupComposition()); + { + ::vl::__vwsn::This(this->responsive)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); + } (this->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiStackComposition()); { ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); @@ -25130,9 +25167,6 @@ Class (::demo::ResponsiveStackControlConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(0), static_cast<::vl::vint>(5), static_cast<::vl::vint>(1)); } (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } @@ -25144,6 +25178,9 @@ Class (::demo::ResponsiveStackControlConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_3)); } (this->responsive = new ::vl::presentation::compositions::GuiResponsiveStackComposition()); + { + ::vl::__vwsn::This(this->responsive)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); + } (this->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiStackComposition()); { ::vl::__vwsn::This(this->__vwsn_precompile_4)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); @@ -25675,9 +25712,6 @@ Class (::demo::ResponsiveViewControlConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_1)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(0), static_cast<::vl::vint>(5), static_cast<::vl::vint>(1)); } (this->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiBoundsComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); - } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } @@ -25870,6 +25904,9 @@ Class (::demo::ResponsiveViewControlConstructor) auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueList>(::vl::__vwsn::This(this->responsive)->GetSharedControls()); ::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->documentBox)); } + { + ::vl::__vwsn::This(this->responsive)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(1); __vwsn_temp__.top = static_cast<::vl::vint>(1); __vwsn_temp__.right = static_cast<::vl::vint>(1); __vwsn_temp__.bottom = static_cast<::vl::vint>(1); return __vwsn_temp__; }()); + } { ::vl::__vwsn::This(this->__vwsn_precompile_2)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->responsive)); } @@ -26776,6 +26813,9 @@ Class (::demo::TextBoxSubTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -26910,6 +26950,9 @@ Class (::demo::TextBoxTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -27171,6 +27214,9 @@ Class (::demo::TextListTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -27271,10 +27317,6 @@ Class (::demo::TextListTabPageConstructor) { (this->__vwsn_precompile_10 = new ::vl::presentation::controls::GuiControl(::vl::presentation::theme::ThemeName::GroupBox)); } - (this->__vwsn_precompile_40 = ::vl::__vwsn::This(this->__vwsn_precompile_10)->GetContainerComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_40)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); - } (this->__vwsn_precompile_39 = ::vl::__vwsn::This(this->__vwsn_precompile_10)->GetBoundsComposition()); { ::vl::__vwsn::This(this->__vwsn_precompile_39)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }()); @@ -27290,7 +27332,7 @@ Class (::demo::TextListTabPageConstructor) ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetPadding(static_cast<::vl::vint>(5)); } { - ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }()); } { ::vl::__vwsn::This(this->__vwsn_precompile_11)->SetDirection(::vl::presentation::compositions::GuiStackComposition::Direction::Vertical); @@ -27472,9 +27514,9 @@ Class (::demo::TextListTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_9)); } - (this->__vwsn_precompile_41 = new ::vl::presentation::compositions::GuiCellComposition()); + (this->__vwsn_precompile_40 = new ::vl::presentation::compositions::GuiCellComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_41)->SetSite(static_cast<::vl::vint>(1), static_cast<::vl::vint>(2), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); + ::vl::__vwsn::This(this->__vwsn_precompile_40)->SetSite(static_cast<::vl::vint>(1), static_cast<::vl::vint>(2), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1)); } { (this->bindableTextList = new ::vl::presentation::controls::GuiBindableTextList(::vl::presentation::theme::ThemeName::TextList)); @@ -27494,15 +27536,15 @@ Class (::demo::TextListTabPageConstructor) { ::vl::__vwsn::This(this->bindableTextList)->SetAlt(::vl::WString::Unmanaged(L"B")); } - (this->__vwsn_precompile_42 = ::vl::__vwsn::This(this->bindableTextList)->GetBoundsComposition()); + (this->__vwsn_precompile_41 = ::vl::__vwsn::This(this->bindableTextList)->GetBoundsComposition()); { - ::vl::__vwsn::This(this->__vwsn_precompile_42)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); + ::vl::__vwsn::This(this->__vwsn_precompile_41)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } { - ::vl::__vwsn::This(this->__vwsn_precompile_41)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this->bindableTextList)->GetBoundsComposition())); + ::vl::__vwsn::This(this->__vwsn_precompile_40)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this->bindableTextList)->GetBoundsComposition())); } { - ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_41)); + ::vl::__vwsn::This(this->__vwsn_precompile_0)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_40)); } { ::vl::__vwsn::This(::vl::__vwsn::This(this->self)->GetContainerComposition())->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_0)); @@ -27588,9 +27630,8 @@ Class (::demo::TextListTabPageConstructor) , __vwsn_precompile_37(static_cast<::vl::presentation::controls::GuiSelectableButton*>(nullptr)) , __vwsn_precompile_38(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) , __vwsn_precompile_39(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) - , __vwsn_precompile_40(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(nullptr)) - , __vwsn_precompile_41(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) - , __vwsn_precompile_42(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) + , __vwsn_precompile_40(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr)) + , __vwsn_precompile_41(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr)) { } @@ -27720,6 +27761,9 @@ Class (::demo::TreeViewTabPageConstructor) { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetCellPadding(static_cast<::vl::vint>(5)); } + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h index ced01994..9c1001b5 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoPartialClasses.h @@ -1728,7 +1728,6 @@ namespace demo ::vl::presentation::controls::GuiButton* __vwsn_precompile_15; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_16; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_17; - ::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_precompile_18; void __vwsn_demo_EnglishNumbersController_Initialize(::demo::EnglishNumbersController* __vwsn_this_); public: EnglishNumbersControllerConstructor(); @@ -3483,9 +3482,8 @@ namespace demo ::vl::presentation::controls::GuiSelectableButton* __vwsn_precompile_37; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_38; ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_39; - ::vl::presentation::compositions::GuiGraphicsComposition* __vwsn_precompile_40; - ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_41; - ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_42; + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_40; + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_41; void __vwsn_demo_TextListTabPage_Initialize(::demo::TextListTabPage* __vwsn_this_); public: TextListTabPageConstructor(); diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoReflection.cpp b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoReflection.cpp index f015ac17..0be72f05 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoReflection.cpp +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/Source/DemoReflection.cpp @@ -874,7 +874,6 @@ namespace vl 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_2) CLASS_MEMBER_FIELD(__vwsn_precompile_3) CLASS_MEMBER_FIELD(__vwsn_precompile_4) @@ -1967,7 +1966,6 @@ namespace vl CLASS_MEMBER_FIELD(__vwsn_precompile_4) CLASS_MEMBER_FIELD(__vwsn_precompile_40) CLASS_MEMBER_FIELD(__vwsn_precompile_41) - CLASS_MEMBER_FIELD(__vwsn_precompile_42) CLASS_MEMBER_FIELD(__vwsn_precompile_5) CLASS_MEMBER_FIELD(__vwsn_precompile_6) CLASS_MEMBER_FIELD(__vwsn_precompile_7) diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextBoxTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextBoxTabPage.xml index db22314d..7af870be 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextBoxTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextBoxTabPage.xml @@ -83,7 +83,7 @@ So as I pray, unlimited blade works.]]> ]]> -
+
composeType:MinSize composeType:Percentage percentage:1.0 @@ -116,7 +116,7 @@ So as I pray, unlimited blade works.]]> ]]> -
+
composeType:MinSize composeType:Percentage percentage:1.0 @@ -179,7 +179,7 @@ So as I pray, unlimited blade works.]]> ]]> -
+
composeType:Percentage percentage:1.0 composeType:MinSize diff --git a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextListTabPage.xml b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextListTabPage.xml index ea151f9f..d3a10d6b 100644 --- a/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextListTabPage.xml +++ b/Tutorial/GacUI_ControlTemplate/BlackSkin/UI/FullControlTest/TextListTabPage.xml @@ -7,7 +7,7 @@ -
+
<_>composeType:MinSize <_>composeType:Percentage percentage:1.0 @@ -66,8 +66,7 @@ - - +
+
<_>composeType:MinSize <_>composeType:Percentage percentage:1.0 diff --git a/Tutorial/GacUI_Controls/DocumentEditor/UI/Source/EditorBasePartialClasses.cpp b/Tutorial/GacUI_Controls/DocumentEditor/UI/Source/EditorBasePartialClasses.cpp index 7e903435..3b4b7845 100644 --- a/Tutorial/GacUI_Controls/DocumentEditor/UI/Source/EditorBasePartialClasses.cpp +++ b/Tutorial/GacUI_Controls/DocumentEditor/UI/Source/EditorBasePartialClasses.cpp @@ -2982,6 +2982,9 @@ namespace demo ::vl::__vwsn::This(this->self)->AddComponent(static_cast<::vl::presentation::controls::GuiComponent*>(this->dialogQueryClose)); } (this->__vwsn_precompile_0 = new ::vl::presentation::compositions::GuiTableComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } @@ -3757,6 +3760,9 @@ Class (::demo::HyperlinkWindowConstructor) ::vl::__vwsn::This(this->self)->SetText(::vl::WString::Unmanaged(L"Hyperlink")); } (this->__vwsn_precompile_0 = new ::vl::presentation::compositions::GuiTableComposition()); + { + ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } { ::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); } diff --git a/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.cpp b/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.cpp index 23b1e8ad..77846f9e 100644 --- a/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.cpp +++ b/Tutorial/GacUI_Controls/DocumentEditorRibbon/UI/Source/EditorRibbonPartialClasses.cpp @@ -1920,9 +1920,6 @@ namespace demo ::vl::__vwsn::This(this->__vwsn_precompile_13)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); } (this->__vwsn_precompile_14 = new ::vl::presentation::compositions::GuiStackItemComposition()); - { - ::vl::__vwsn::This(this->__vwsn_precompile_14)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(10); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }()); - } (this->__vwsn_precompile_15 = ::vl::Ptr<::vl::presentation::elements::GuiSolidLabelElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidLabelElement>())); { ::vl::__vwsn::This(this->__vwsn_precompile_15.Obj())->SetVerticalAlignment(::vl::presentation::Alignment::Center); @@ -1934,7 +1931,7 @@ namespace demo ::vl::__vwsn::This(this->__vwsn_precompile_15.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#FFFFFF"))); } { - ::vl::__vwsn::This(this->__vwsn_precompile_15.Obj())->SetText(::vl::WString::Unmanaged(L"Search:")); + ::vl::__vwsn::This(this->__vwsn_precompile_15.Obj())->SetText(::vl::WString::Unmanaged(L"Search: ")); } { ::vl::__vwsn::This(this->__vwsn_precompile_14)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_15)); diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 index aeed8564..84671534 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x64 differ diff --git a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 index d6e30cbb..f3666050 100644 Binary files a/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 and b/Tutorial/GacUI_HelloWorlds/UIRes/Xml.bin.x86 differ