func (gb *GroupBox) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr { if gb.composite != nil { switch msg { case win.WM_COMMAND, win.WM_NOTIFY: gb.composite.WndProc(hwnd, msg, wParam, lParam) case win.WM_SETTEXT: gb.titleChangedPublisher.Publish() case win.WM_SIZE, win.WM_SIZING: wbcb := gb.WidgetBase.ClientBounds() if !win.MoveWindow( gb.hWndGroupBox, int32(wbcb.X), int32(wbcb.Y), int32(wbcb.Width), int32(wbcb.Height), true) { lastError("MoveWindow") break } gbcb := gb.ClientBounds() gb.composite.SetBounds(gbcb) } } return gb.WidgetBase.WndProc(hwnd, msg, wParam, lParam) }
func (tw *TabWidget) onResize(lParam uintptr) { r := win.RECT{0, 0, win.GET_X_LPARAM(lParam), win.GET_Y_LPARAM(lParam)} if !win.MoveWindow(tw.hWndTab, r.Left, r.Top, r.Right-r.Left, r.Bottom-r.Top, true) { lastError("MoveWindow") return } tw.resizePages() }
// SetBounds returns the outer bounding box Rectangle of the *WindowBase, // including decorations. // // For a Form, like *MainWindow or *Dialog, the Rectangle is in screen // coordinates, for a child Window the coordinates are relative to its parent. func (wb *WindowBase) SetBounds(bounds Rectangle) error { if !win.MoveWindow( wb.hWnd, int32(bounds.X), int32(bounds.Y), int32(bounds.Width), int32(bounds.Height), true) { return lastError("MoveWindow") } return nil }