MCPcopy Index your code
hub / github.com/lxn/walk / CreateLayoutItem

Method CreateLayoutItem

tabwidget.go:698–726  ·  view source on GitHub ↗
(ctx *LayoutContext)

Source from the content-addressed store, hash-verified

696}
697
698func (tw *TabWidget) CreateLayoutItem(ctx *LayoutContext) LayoutItem {
699 pages := make([]LayoutItem, tw.pages.Len())
700
701 bounds := tw.pageBounds()
702
703 li := &tabWidgetLayoutItem{
704 pagePos: bounds.Location(),
705 currentIndex: tw.CurrentIndex(),
706 nonClientSizePixels: tw.nonClientSizePixels,
707 }
708
709 for i := tw.pages.Len() - 1; i >= 0; i-- {
710 var page LayoutItem
711 if p := tw.pages.At(i); p.Layout() != nil {
712 page = CreateLayoutItemsForContainerWithContext(p, ctx)
713 } else {
714 page = NewGreedyLayoutItem()
715 }
716
717 lib := page.AsLayoutItemBase()
718 lib.ctx = ctx
719 lib.parent = li
720 pages[i] = page
721 }
722
723 li.children = pages
724
725 return li
726}
727
728type tabWidgetLayoutItem struct {
729 ContainerLayoutItemBase

Callers

nothing calls this directly

Calls 9

pageBoundsMethod · 0.95
CurrentIndexMethod · 0.95
AsLayoutItemBaseMethod · 0.95
NewGreedyLayoutItemFunction · 0.85
LocationMethod · 0.80
LayoutMethod · 0.65
LenMethod · 0.45
AtMethod · 0.45

Tested by

no test coverage detected