summaryrefslogtreecommitdiff
path: root/newctrl/group_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-18 12:47:19 -0400
committerPietro Gagliardi <[email protected]>2014-10-18 12:47:19 -0400
commitb1ac28cc938d2de25357328d9da910a84a2cc8cc (patch)
treed34d26f0022dd0e9d9c7179bd59b1c4dbe7b6942 /newctrl/group_windows.go
parent0f6e65188af0c4b1d3e4dff17ceb96bbd8ebb271 (diff)
Fixed parenting weirdnesses.
Diffstat (limited to 'newctrl/group_windows.go')
-rw-r--r--newctrl/group_windows.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/newctrl/group_windows.go b/newctrl/group_windows.go
index ee406d8..d4acdda 100644
--- a/newctrl/group_windows.go
+++ b/newctrl/group_windows.go
@@ -9,6 +9,7 @@ type group struct {
*controlSingleHWNDWithText
child Control
margined bool
+ chainresize func(x int, y int, width int, height int, d *sizing)
}
func newGroup(text string, control Control) Group {
@@ -19,8 +20,9 @@ func newGroup(text string, control Control) Group {
controlSingleHWNDWithText: newControlSingleHWNDWithText(hwnd),
child: control,
}
- g.fpreferredSize = g.preferredSize
- g.fresize = g.resize
+ g.fpreferredSize = g.xpreferredSize
+ g.chainresize = g.fresize
+ g.fresize = g.xresize
g.fnTabStops = control.nTabStops // groupbox itself is not tabbable but the contents might be
g.SetText(text)
C.controlSetControlFont(g.hwnd)
@@ -50,7 +52,7 @@ const (
groupYMarginBottom = 7
)
-func (g *group) preferredSize(d *sizing) (width, height int) {
+func (g *group) xpreferredSize(d *sizing) (width, height int) {
var r C.RECT
width, height = g.child.preferredSize(d)
@@ -73,10 +75,9 @@ func (g *group) preferredSize(d *sizing) (width, height int) {
return int(r.right - r.left), int(r.bottom - r.top)
}
-func (g *group) resize(x int, y int, width int, height int, d *sizing) {
+func (g *group) xresize(x int, y int, width int, height int, d *sizing) {
// first, chain up to the container base to keep the Z-order correct
- // TODO use a variable for this
- g.controlSingleHWNDWithText.resize(x, y, width, height, d)
+ g.chainresize(x, y, width, height, d)
// now resize the child container
var r C.RECT