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

Method SetColumnsOrderable

tableview.go:483–501  ·  view source on GitHub ↗

SetColumnsOrderable sets if the user can reorder columns by dragging and dropping column headers.

(enabled bool)

Source from the content-addressed store, hash-verified

481// SetColumnsOrderable sets if the user can reorder columns by dragging and
482// dropping column headers.
483func (tv *TableView) SetColumnsOrderable(enabled bool) {
484 var hwnd win.HWND
485 if tv.hasFrozenColumn {
486 hwnd = tv.hwndFrozenLV
487 } else {
488 hwnd = tv.hwndNormalLV
489 }
490
491 exStyle := win.SendMessage(hwnd, win.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
492 if enabled {
493 exStyle |= win.LVS_EX_HEADERDRAGDROP
494 } else {
495 exStyle &^= win.LVS_EX_HEADERDRAGDROP
496 }
497 win.SendMessage(tv.hwndFrozenLV, win.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, exStyle)
498 win.SendMessage(tv.hwndNormalLV, win.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, exStyle)
499
500 tv.columnsOrderableChangedPublisher.Publish()
501}
502
503// ColumnsSizable returns if the user can change column widths by dragging
504// dividers in the header.

Callers 1

NewTableViewWithCfgFunction · 0.95

Calls 2

SendMessageMethod · 0.65
PublishMethod · 0.45

Tested by

no test coverage detected