MCPcopy
hub / github.com/lxn/walk / startLayout

Method startLayout

form.go:681–706  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

679}
680
681func (fb *FormBase) startLayout() bool {
682 if fb.performLayout == nil || fb.inSizingLoop && !fb.startingLayoutViaSizingLoop {
683 return false
684 }
685
686 cs := fb.clientSizeFromSizePixels(fb.proposedSize)
687 min := CreateLayoutItemsForContainer(fb.clientComposite).MinSizeForSize(fb.proposedSize)
688
689 if cs.Width < min.Width || cs.Height < min.Height {
690 cs = maxSize(cs, min)
691 size := fb.sizeFromClientSizePixels(cs)
692 fb.SetSizePixels(size)
693 fb.Invalidate()
694 }
695
696 cbp := fb.window.ClientBoundsPixels()
697
698 fb.clientComposite.SetBoundsPixels(Rectangle{Y: cbp.Y, Width: cs.Width, Height: cs.Height})
699
700 cli := CreateLayoutItemsForContainer(fb)
701 cli.Geometry().ClientSize = cs
702
703 fb.performLayout <- cli
704
705 return true
706}
707
708func (fb *FormBase) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr {
709 switch msg {

Callers 5

RunMethod · 0.95
WndProcMethod · 0.95
PublishMethod · 0.80
RequestLayoutMethod · 0.80
ShowMethod · 0.80

Calls 10

maxSizeFunction · 0.85
MinSizeForSizeMethod · 0.65
SetSizePixelsMethod · 0.65
InvalidateMethod · 0.65
ClientBoundsPixelsMethod · 0.65
SetBoundsPixelsMethod · 0.65
GeometryMethod · 0.65

Tested by

no test coverage detected