summaryrefslogtreecommitdiff
path: root/redo/container_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'redo/container_windows.go')
-rw-r--r--redo/container_windows.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/redo/container_windows.go b/redo/container_windows.go
index c782c38..e1470cc 100644
--- a/redo/container_windows.go
+++ b/redo/container_windows.go
@@ -15,6 +15,7 @@ type container struct {
containerbase
hwnd C.HWND
nchildren int
+ isGroup bool
}
type sizing struct {
@@ -104,6 +105,11 @@ func fromdlgunitsY(du int, d *sizing) int {
const (
marginDialogUnits = 7
paddingDialogUnits = 4
+
+ groupXMargin = 6
+ // TODO
+ groupYMarginTop = 11 // note this value /includes the groupbox label/
+ groupYMarginBottom = 7
)
func (c *container) beginResize() (d *sizing) {
@@ -123,6 +129,13 @@ func (c *container) beginResize() (d *sizing) {
d.xpadding = fromdlgunitsX(paddingDialogUnits, d)
d.ypadding = fromdlgunitsY(paddingDialogUnits, d)
}
+ if c.isGroup {
+ // note that these values apply regardless of whether or not spaced is set
+ // this is because Windows groupboxes have the client rect spanning the entire size of the control, not just the active work area
+ // the measurements Microsoft give us are for spaced margining; let's just use them
+ d.xmargin = fromdlgunitsX(groupXMargin, d)
+ d.ymargin = fromdlgunitsY(groupYMarginTop, d)
+ }
return d
}