提交 77c196b4 编写于 作者: yanghye's avatar yanghye

v2.3.30 Fixed Chinese input and gtk3 issues for linux packagin,

And Windows Drag Region
上级 804f71b2
......@@ -48,9 +48,9 @@ type LCLBrowserWindow struct {
isClosing bool //
canClose bool //
onResize TNotifyEvent //
windowResize TNotifyEvent //
onActivate TNotifyEvent //
onShow TNotifyEvent //
onPaint TNotifyEvent //
onClose TCloseEvent //
onCloseQuery TCloseQueryEvent //
onActivateAfter lcl.TNotifyEvent //
......@@ -470,11 +470,6 @@ func (m *LCLBrowserWindow) EnableAllDefaultEvent() {
m.defaultChromiumEvent()
}
// SetOnPaint 事件,不会覆盖默认事件,返回值:false继续执行默认事件, true跳过默认事件
func (m *LCLBrowserWindow) SetOnPaint(fn TNotifyEvent) {
m.onPaint = fn
}
// SetOnResize 事件,不会覆盖默认事件,返回值:false继续执行默认事件, true跳过默认事件
func (m *LCLBrowserWindow) SetOnResize(fn TNotifyEvent) {
m.onResize = fn
......@@ -687,6 +682,9 @@ func (m *LCLBrowserWindow) resize(sender lcl.IObject) {
if m.isClosing {
return
}
if m.windowResize != nil {
m.windowResize(sender)
}
if m.chromium != nil {
m.chromium.NotifyMoveOrResizeStarted()
}
......
......@@ -141,28 +141,18 @@ func (m *LCLBrowserWindow) registerWindowsCompMsgEvent() {
m.doOnRenderCompMsg(message, lResult, aHandled)
}
})
m.TForm.SetOnPaint(func(sender lcl.IObject) {
var ret bool
if m.onPaint != nil {
ret = m.onPaint(sender)
m.windowResize = func(sender lcl.IObject) bool {
if m.WindowState() == types.WsMaximized && (m.WindowProperty()._CanHideCaption || m.BorderStyle() == types.BsNone || m.BorderStyle() == types.BsSingle) {
var monitor = m.Monitor().WorkareaRect()
m.SetBounds(monitor.Left, monitor.Top, monitor.Right-monitor.Left, monitor.Bottom-monitor.Top)
m.SetWindowState(types.WsMaximized)
}
if !ret {
if m.WindowState() == types.WsMaximized && (m.WindowProperty()._CanHideCaption || m.BorderStyle() == types.BsNone || m.BorderStyle() == types.BsSingle) {
var monitor = m.Monitor().WorkareaRect()
m.SetBounds(monitor.Left, monitor.Top, monitor.Right-monitor.Left, monitor.Bottom-monitor.Top)
m.SetWindowState(types.WsMaximized)
}
}
})
return false
}
} else {
if bwEvent.onRenderCompMsg != nil {
m.chromium.SetOnRenderCompMsg(bwEvent.onRenderCompMsg)
}
if m.onPaint != nil {
m.TForm.SetOnPaint(func(sender lcl.IObject) {
m.onPaint(sender)
})
}
}
}
......
......@@ -111,6 +111,7 @@ type IBrowserWindow interface {
//定义了LCL常用函数
type ILCLBrowserWindow interface {
IBrowserWindow
Handle() types.HWND //
BrowserWindow() *LCLBrowserWindow //返回 LCLBrowserWindow 窗口结构
EnableDefaultCloseEvent() //启用默认关闭事件
WindowParent() ITCefWindowParent //浏览器父窗口组件
......
......@@ -30,6 +30,7 @@ func main() {
browserWindow.Constraints().SetMinWidth(300)
browserWindow.Constraints().SetMinHeight(300)
window.HideTitle()
window.SetTitle("")
//window.DisableResize()
window.AsLCLBrowserWindow().BrowserWindow().SetOnCloseQuery(func(sender lcl.IObject, canClose *bool) bool {
fmt.Println("lcl browser close query")
......@@ -63,6 +64,10 @@ func main() {
})
cef.BrowserWindow.SetBrowserInitAfter(func(window cef.IBrowserWindow) {
//sys_tray.TrayMain()
//dwWinStyle := win.GetWindowLong(window.AsLCLBrowserWindow().Handle(), win.GWL_STYLE)
//dwWinStyle |= win.WS_THICKFRAME
//win.SetWindowLong(window.AsLCLBrowserWindow().Handle(), win.GWL_STYLE, uintptr(dwWinStyle))
})
cef.SetBrowserProcessStartAfterCallback(func(b bool) {
fmt.Println("主进程启动 创建一个内置http服务")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册