summaryrefslogtreecommitdiff
path: root/newctrl/window_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-14 22:03:56 -0400
committerPietro Gagliardi <[email protected]>2014-10-14 22:04:32 -0400
commitb6991d9b126cba4b55793008f12b164907cf3e9f (patch)
treed6db4b9a54ea27a9d43c5808ccbe943c5c61c4ed /newctrl/window_windows.go
parent8fd3e653d162e1c79da213a4e36f4d51a5447e1e (diff)
Started the work for margins; implemented for Window.
Diffstat (limited to 'newctrl/window_windows.go')
-rw-r--r--newctrl/window_windows.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/newctrl/window_windows.go b/newctrl/window_windows.go
index 4dc5454..cfcb091 100644
--- a/newctrl/window_windows.go
+++ b/newctrl/window_windows.go
@@ -17,7 +17,8 @@ type window struct {
closing *event
- child Control
+ child Control
+ margined bool
}
func makeWindowWindowClass() error {
@@ -78,6 +79,14 @@ func (w *window) OnClosing(e func() bool) {
w.closing.setbool(e)
}
+func (w *window) Margined() bool {
+ return w.margined
+}
+
+func (w *window) SetMargined(margined bool) {
+ w.margined = margined
+}
+
//export storeWindowHWND
func storeWindowHWND(data unsafe.Pointer, hwnd C.HWND) {
w := (*window)(data)
@@ -87,7 +96,10 @@ func storeWindowHWND(data unsafe.Pointer, hwnd C.HWND) {
//export windowResize
func windowResize(data unsafe.Pointer, r *C.RECT) {
w := (*window)(data)
- TODO := &sizing{}
+ d := w.beginResize()
+ if w.margined {
+ marginRectDLU(r, marginDialogUnits, marginDialogUnits, marginDialogUnits, marginDialogUnits, d)
+ }
w.child.resize(int(r.left), int (r.top), int(r.right - r.left), int(r.bottom - r.top), TODO)
}