diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-18 12:47:19 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-18 12:47:19 -0400 |
| commit | b1ac28cc938d2de25357328d9da910a84a2cc8cc (patch) | |
| tree | d34d26f0022dd0e9d9c7179bd59b1c4dbe7b6942 /newctrl/table_windows.go | |
| parent | 0f6e65188af0c4b1d3e4dff17ceb96bbd8ebb271 (diff) | |
Fixed parenting weirdnesses.
Diffstat (limited to 'newctrl/table_windows.go')
| -rw-r--r-- | newctrl/table_windows.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/newctrl/table_windows.go b/newctrl/table_windows.go index 054a29b..ceeb504 100644 --- a/newctrl/table_windows.go +++ b/newctrl/table_windows.go @@ -21,6 +21,7 @@ type table struct { pushedrow C.int pushedcol C.int selected *event + chainresize func(x int, y int, width int, height int, d *sizing) } func finishNewTable(b *tablebase, ty reflect.Type) Table { @@ -36,8 +37,9 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table { pushedcol: -1, selected: newEvent(), } - t.fpreferredSize = t.preferredSize - t.fresize = t.resize + t.fpreferredSize = t.xpreferredSize + t.chainresize = t.fresize + t.fresize = t.xresize C.setTableSubclass(t.hwnd, unsafe.Pointer(t)) // LVS_EX_FULLROWSELECT gives us selection across the whole row, not just the leftmost column; this makes the list view work like on other platforms // LVS_EX_SUBITEMIMAGES gives us images in subitems, which will be important when both images and checkboxes are added @@ -221,13 +223,12 @@ const ( tableHeight = 50 ) -func (t *table) preferredSize(d *sizing) (width, height int) { +func (t *table) xpreferredSize(d *sizing) (width, height int) { return fromdlgunitsX(tableWidth, d), fromdlgunitsY(tableHeight, d) } -func (t *table) commitResize(x int, y int, width int, height int, d *sizing) { - // TODO use a variable for this - t.controlSingleHWND.resize(x, y, width, height, d) +func (t *table) xresize(x int, y int, width int, height int, d *sizing) { + t.chainresize(x, y, width, height, d) t.RLock() defer t.RUnlock() t.autoresize() |
