summaryrefslogtreecommitdiff
path: root/redo/sizing_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-18 00:22:21 -0400
committerPietro Gagliardi <[email protected]>2014-07-18 00:22:21 -0400
commitd2f09a02225281fbd30fe068f228ca0f3fd26471 (patch)
treefe0148572c6336dd74b2113b3a4fcdc34b3fe4ae /redo/sizing_windows.go
parent7c6fa3b2fd773a31d4c0f8899b96c1f25a669ec1 (diff)
Fixed all the remaining compiler errors. C conversion works!
Diffstat (limited to 'redo/sizing_windows.go')
-rw-r--r--redo/sizing_windows.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/redo/sizing_windows.go b/redo/sizing_windows.go
index ede3101..d0c3937 100644
--- a/redo/sizing_windows.go
+++ b/redo/sizing_windows.go
@@ -2,10 +2,6 @@
package ui
-import (
- "fmt"
-)
-
// #include "winapi_windows.h"
import "C"
@@ -38,10 +34,10 @@ func (w *window) beginResize() (d *sizing) {
d.baseY = int(tm.tmHeight)
if w.spaced {
- d.xmargin = int(C.MulDiv(marginDialogUnits, d.baseX, 4))
- d.ymargin = int(C.MulDiv(marginDialogUnits, d.baseY, 8))
- d.xpadding = int(C.MulDiv(paddingDialogUnits, d.baseX, 4))
- d.ypadding = int(C.MulDiv(paddingDialogUnits, d.baseY, 8))
+ d.xmargin = int(C.MulDiv(marginDialogUnits, C.int(d.baseX), 4))
+ d.ymargin = int(C.MulDiv(marginDialogUnits, C.int(d.baseY), 8))
+ d.xpadding = int(C.MulDiv(paddingDialogUnits, C.int(d.baseX), 4))
+ d.ypadding = int(C.MulDiv(paddingDialogUnits, C.int(d.baseY), 8))
}
return d
@@ -75,11 +71,11 @@ func (w *widgetbase) commitResize(c *allocation, d *sizing) {
yoff = stdDlgSizes[s.ctype].yoffalt
}
if yoff != 0 {
- yoff = int(C.MulDiv(yoff, d.baseY, 8))
+ yoff = int(C.MulDiv(C.int(yoff), C.int(d.baseY), 8))
}
c.y += yoff
*/
- C.moveWindow(w.hwnd, int(c.x), int(c.y), int(c.width), int(c.height))
+ C.moveWindow(w.hwnd, C.int(c.x), C.int(c.y), C.int(c.width), C.int(c.height))
}
func (w *widgetbase) getAuxResizeInfo(d *sizing) {
@@ -185,8 +181,8 @@ func (w *widgetbase) preferredSize(d *sizing) (width int, height int) {
width = defaultWidth
}
height = stdDlgSizes[s.ctype].height
- width = f_MulDiv(width, d.baseX, 4) // equivalent to right of rect
- height = f_MulDiv(height, d.baseY, 8) // equivalent to bottom of rect
+ width = int(C.MulDiv(C.int(width), C.int(d.baseX), 4)) // equivalent to right of rect
+ height = int(C.MulDiv(C.int(height), C.int(d.baseY), 8)) // equivalent to bottom of rect
*/
return width, height
}