func (c *container) beginResize() (d *sizing) { var baseX, baseY C.int var internalLeading C.LONG d = new(sizing) C.calculateBaseUnits(c.hwnd, &baseX, &baseY, &internalLeading) d.baseX = baseX d.baseY = baseY d.internalLeading = internalLeading if spaced { d.xmargin = fromdlgunitsX(marginDialogUnits, d) d.ymargintop = fromdlgunitsY(marginDialogUnits, d) d.ymarginbottom = d.ymargintop 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.ymargintop = fromdlgunitsY(groupYMarginTop, d) d.ymarginbottom = fromdlgunitsY(groupYMarginBottom, d) } return d }
func beginResize(hwnd C.HWND) (d *sizing) { var baseX, baseY C.int var internalLeading C.LONG d = new(sizing) C.calculateBaseUnits(hwnd, &baseX, &baseY, &internalLeading) d.baseX = baseX d.baseY = baseY d.internalLeading = internalLeading d.xpadding = fromdlgunitsX(paddingDialogUnits, d) d.ypadding = fromdlgunitsY(paddingDialogUnits, d) return d }