diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-30 23:01:08 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-30 23:01:08 -0400 |
| commit | 155899c65ed32245e2ccad4197a10c77017d835b (patch) | |
| tree | 4c337130ff5d1640efc1e94258ab3b8a9eef0c55 /controlsize.go | |
| parent | 3d4e54822dc6117306d5a4ac0e79017c4810b657 (diff) | |
Out with the old...
Diffstat (limited to 'controlsize.go')
| -rw-r--r-- | controlsize.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/controlsize.go b/controlsize.go deleted file mode 100644 index 98563da..0000000 --- a/controlsize.go +++ /dev/null @@ -1,48 +0,0 @@ -// 25 june 2014 - -package ui - -type allocation struct { - x int - y int - width int - height int - this Control - neighbor Control -} - -type cSysSizeData struct { - xmargin int - ymargin int - xpadding int - ypadding int -} - -// for verification; see sysdata.go -type sysDataSizingFunctions interface { - beginResize() *sysSizeData - endResize(*sysSizeData) - translateAllocationCoords([]*allocation, int, int) - preferredSize(*sysSizeData) (int, int) - commitResize(*allocation, *sysSizeData) - getAuxResizeInfo(*sysSizeData) -} - -func (s *sysData) resizeWindow(width, height int) { - d := s.beginResize() - allocations := s.allocate(0, 0, width, height, d) - s.translateAllocationCoords(allocations, width, height) - // move in reverse so as to approximate right->left order so neighbors make sense - for i := len(allocations) - 1; i >= 0; i-- { - allocations[i].this.commitResize(allocations[i], d) - } - s.endResize(d) -} - -// non-layout controls: allocate() should just return a one-element slice; preferredSize(), commitResize(), and getAuxResizeInfo() should defer to their sysData equivalents -type controlSizing interface { - allocate(x int, y int, width int, height int, d *sysSizeData) []*allocation - preferredSize(d *sysSizeData) (width, height int) - commitResize(c *allocation, d *sysSizeData) - getAuxResizeInfo(d *sysSizeData) -} |
