Skip to content

Commit

Permalink
U: 增加 lcl 窗口配置函数: 扩展事件-SetOnWndProc, SetOnPaint, 边框Frameless,Frameles…
Browse files Browse the repository at this point in the history
…sForLine, SetRoundRectRgn
  • Loading branch information
sxmxta committed Nov 9, 2023
1 parent 716f4ac commit bab26b6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cef/browser-window-lcl_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
package cef

import (
"github.com/energye/energy/v2/cef/winapi"
"github.com/energye/energy/v2/common"
et "github.com/energye/energy/v2/types"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/types"
)

Expand Down Expand Up @@ -61,6 +64,20 @@ func (m *LCLBrowserWindow) FramelessForLine() {
//TODO no impl
}

func (m *LCLBrowserWindow) SetRoundRectRgn(rgn int) {
if m.rgn == 0 && rgn > 0 {
m.rgn = rgn
m.SetOnPaint(func(sender lcl.IObject) {
hnd := winapi.CreateRoundRectRgn(0, 0, et.LongInt(m.Width()), et.LongInt(m.Height()), et.LongInt(m.rgn), et.LongInt(m.rgn))
winapi.SetWindowRgn(et.HWND(m.Handle()), hnd, true)
})
}
}

func (m *LCLBrowserWindow) Frameless() {

}

// Restore 非Windows平台,窗口还原
func (m *LCLBrowserWindow) Restore() {
if m.TForm == nil {
Expand Down

0 comments on commit bab26b6

Please sign in to comment.