SetColumnsOrderable sets if the user can reorder columns by dragging and dropping column headers.
(enabled bool)
| 481 | // SetColumnsOrderable sets if the user can reorder columns by dragging and |
| 482 | // dropping column headers. |
| 483 | func (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. |
no test coverage detected