summaryrefslogtreecommitdiff
path: root/redo/container.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
commit77bf566ebbcb62acd4d08d905d9542d6ff9b6b80 (patch)
treeeeb8e72bc3bf57f5be7f0c0af4319189ac6de838 /redo/container.go
parent155899c65ed32245e2ccad4197a10c77017d835b (diff)
...in with the new.
Diffstat (limited to 'redo/container.go')
-rw-r--r--redo/container.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/redo/container.go b/redo/container.go
deleted file mode 100644
index c855072..0000000
--- a/redo/container.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// 25 june 2014
-
-package ui
-
-type allocation struct {
- x int
- y int
- width int
- height int
- this Control
- neighbor Control
-}
-
-type sizingbase struct {
- xmargin int
- ymargintop int
- ymarginbottom int
- xpadding int
- ypadding int
-}
-
-type controlSizing interface {
- allocate(x int, y int, width int, height int, d *sizing) []*allocation
- preferredSize(*sizing) (int, int)
- commitResize(*allocation, *sizing)
- getAuxResizeInfo(*sizing)
-}
-
-// A container hosts a Control and resizes that Control based on changes in size to the parent Window.
-// container is used by Window, Tab, and Group to contain and control their respective Controls.
-// Tab and Group use containers for their content; as such, their commitResize() functions should only change the size of the Tab and Group themselves, and have their containers do the real work.
-// All containers must embed containerbase.
-type containerbase struct {
- child Control
-}
-
-// set to true to apply spacing to all windows
-var spaced bool = false
-
-func (c *container) resize(x, y, width, height int) {
- if c.child == nil { // no children; nothing to do
- return
- }
- d := c.beginResize()
- allocations := c.child.allocate(x + d.xmargin, y + d.ymargintop,
- width - (2 * d.xmargin), height - d.ymargintop - d.ymarginbottom, d)
- c.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)
- }
-}