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

Method VisibleColumnsInDisplayOrder

tableview.go:627–657  ·  view source on GitHub ↗

VisibleColumnsInDisplayOrder returns a slice of visible columns in display order.

()

Source from the content-addressed store, hash-verified

625// VisibleColumnsInDisplayOrder returns a slice of visible columns in display
626// order.
627func (tv *TableView) VisibleColumnsInDisplayOrder() []*TableViewColumn {
628 visibleCols := tv.visibleColumns()
629 indices := make([]int32, len(visibleCols))
630
631 frozenCount := tv.visibleFrozenColumnCount()
632 normalCount := len(visibleCols) - frozenCount
633
634 if frozenCount > 0 {
635 if win.FALSE == win.SendMessage(tv.hwndFrozenLV, win.LVM_GETCOLUMNORDERARRAY, uintptr(frozenCount), uintptr(unsafe.Pointer(&indices[0]))) {
636 newError("LVM_GETCOLUMNORDERARRAY")
637 return nil
638 }
639 }
640 if normalCount > 0 {
641 if win.FALSE == win.SendMessage(tv.hwndNormalLV, win.LVM_GETCOLUMNORDERARRAY, uintptr(normalCount), uintptr(unsafe.Pointer(&indices[frozenCount]))) {
642 newError("LVM_GETCOLUMNORDERARRAY")
643 return nil
644 }
645 }
646
647 orderedCols := make([]*TableViewColumn, len(visibleCols))
648
649 for i, j := range indices {
650 if i >= frozenCount {
651 j += int32(frozenCount)
652 }
653 orderedCols[i] = visibleCols[j]
654 }
655
656 return orderedCols
657}
658
659// RowsPerPage returns the number of fully visible rows.
660func (tv *TableView) RowsPerPage() int {

Callers

nothing calls this directly

Calls 4

visibleColumnsMethod · 0.95
newErrorFunction · 0.85
SendMessageMethod · 0.65

Tested by

no test coverage detected