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

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

And Windows Drag Region
上级 463fff8c
......@@ -85,6 +85,7 @@ func (m *browserWindow) OnFormCreate(sender lcl.IObject) {
}
})
m.cwcap = new(customWindowCaption)
m.cwcap.bw = &m.LCLBrowserWindow
}
func (m *browser) MainWindow() IBrowserWindow {
......
......@@ -24,16 +24,6 @@ import (
"time"
)
type IBaseWindow interface {
lcl.IWinControl
FormCreate()
WindowParent() ITCefWindowParent
Chromium() IChromium
ChromiumCreate(config *tCefChromiumConfig, defaultUrl string)
registerEvent()
registerDefaultEvent()
}
//LCLBrowserWindow 基于CEF lcl 窗口组件
//
//该窗口使用CEF和LCL组件实现,CEF<=1.106.xx版本 在windows、MacOSX可正常使用, Linux无法输入中文, CEF>=2.107.xx版本linux强制使用 ViewsFrameworkBrowserWindow 窗口组件
......@@ -90,6 +80,7 @@ func NewLCLWindow(windowProperty WindowProperty, owner ...lcl.IComponent) *LCLBr
}
window.windowProperty = &windowProperty
window.cwcap = new(customWindowCaption)
window.cwcap.bw = window
window.SetDoubleBuffered(true)
window.FormCreate()
window.SetShowInTaskBar()
......
......@@ -26,6 +26,7 @@ var (
)
type customWindowCaption struct {
bw *LCLBrowserWindow //
canCaption bool //当前鼠标是否在标题栏区域
canBorder bool //当前鼠标是否在边框
borderHT, borderWMSZ int //borderHT: 鼠标所在边框位置, borderWMSZ: 窗口改变大小边框方向 borderMD:
......@@ -181,6 +182,8 @@ func (m *customWindowCaption) isCaption(hWND types.HWND, message *types.TMessage
Y: dy,
}
WinScreenToClient(hWND, p)
p.X -= m.bw.WindowParent().Left()
p.Y -= m.bw.WindowParent().Top()
m.canCaption = WinPtInRegion(m.rgn, p.X, p.Y)
return p.X, p.Y, m.canCaption
}
......@@ -244,6 +247,8 @@ func (m *LCLBrowserWindow) doOnRenderCompMsg(message *types.TMessage, lResult *t
*aHandled = true
} else if m.WindowProperty()._EnableHideCaption && m.WindowProperty().EnableResize && m.WindowState() == types.WsNormal { //1.窗口隐藏标题栏 2.启用了调整窗口大小 3.非最大化、最小化、全屏状态
rect := m.BoundsRect()
//x -= m.WindowParent().Left()
//y -= m.WindowParent().Top()
if result, handled := m.cwcap.onCanBorder(x, y, &rect); handled {
*lResult = types.LRESULT(result)
*aHandled = true
......
......@@ -12,6 +12,7 @@ import (
"github.com/energye/energy/common"
"github.com/energye/energy/consts"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/types"
)
type ITCefWindowParent interface {
......@@ -25,6 +26,28 @@ type ITCefWindowParent interface {
SetOnExit(fn lcl.TNotifyEvent)
DestroyChildWindow() bool
Free()
Handle() types.HWND
Name() string
SetName(value string)
SetParent(value lcl.IWinControl)
Align() types.TAlign
SetAlign(value types.TAlign)
Anchors() types.TAnchors
SetAnchors(value types.TAnchors)
Visible() bool
SetVisible(value bool)
Enabled() bool
SetEnabled(value bool)
Left() int32
SetLeft(value int32)
Top() int32
SetTop(value int32)
Width() int32
SetWidth(value int32)
Height() int32
SetHeight(value int32)
BoundsRect() (result types.TRect)
SetBoundsRect(value types.TRect)
}
func NewCEFWindow(owner lcl.IComponent) ITCefWindowParent {
......
......@@ -29,11 +29,6 @@ func main() {
//browserWindow.Constraints().SetMinHeight(300)
window.HideTitle()
//window.AsLCLBrowserWindow().WindowParent().SetAlign(types.AlCustom)
//window.AsLCLBrowserWindow().WindowParent().SetTop(100)
//window.AsLCLBrowserWindow().WindowParent().SetLeft(100)
//window.AsLCLBrowserWindow().WindowParent().SetWidth(800)
//window.AsLCLBrowserWindow().WindowParent().SetHeight(500)
//window.AsLCLBrowserWindow().WindowParent().SetBoundsRect(types.Rect(100, 100, 800, 500))
//window.DisableResize()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册