Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
19cb22fd
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
19cb22fd
编写于
1月 18, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v2.3.25 Fixed Chinese input and gtk3 issues for linux packagin
上级
2426cca4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
42 deletion
+20
-42
cef/cef-browser-window-lcl_windows.go
cef/cef-browser-window-lcl_windows.go
+18
-40
example/dev-test/lcl-browser/lcl-browser.go
example/dev-test/lcl-browser/lcl-browser.go
+2
-2
未找到文件。
cef/cef-browser-window-lcl_windows.go
浏览文件 @
19cb22fd
...
...
@@ -34,19 +34,19 @@ func (m *LCLBrowserWindow) HideTitle() {
win
.
SetWindowPos
(
m
.
Handle
(),
m
.
Handle
(),
0
,
0
,
0
,
0
,
win
.
SWP_NOSIZE
|
win
.
SWP_NOMOVE
|
win
.
SWP_NOZORDER
|
win
.
SWP_NOACTIVATE
|
win
.
SWP_FRAMECHANGED
)
}
//windows 窗口
拖拽区域
管理
var
wdrs
=
&
window
DragRegions
{}
//windows 窗口
标题栏
管理
var
wdrs
=
&
window
Caption
{}
type
window
DragRegions
struct
{
type
window
Caption
struct
{
canCaption
bool
}
func
(
m
*
window
DragRegions
)
toPoint
(
message
*
types
.
TMessage
)
(
x
,
y
int32
)
{
func
(
m
*
window
Caption
)
toPoint
(
message
*
types
.
TMessage
)
(
x
,
y
int32
)
{
return
int32
(
message
.
LParam
&
0xFFFF
),
int32
(
message
.
LParam
&
0xFFFF0000
>>
16
)
}
//鼠标在标题栏区域
func
(
m
*
window
DragRegions
)
isCaption
(
hWND
types
.
HWND
,
rgn
*
HRGN
,
message
*
types
.
TMessage
)
(
x
,
y
int32
,
caption
bool
)
{
func
(
m
*
window
Caption
)
isCaption
(
hWND
types
.
HWND
,
rgn
*
HRGN
,
message
*
types
.
TMessage
)
(
x
,
y
int32
,
caption
bool
)
{
dx
,
dy
:=
m
.
toPoint
(
message
)
p
:=
&
types
.
TPoint
{
X
:
dx
,
...
...
@@ -60,42 +60,31 @@ func (m *windowDragRegions) isCaption(hWND types.HWND, rgn *HRGN, message *types
func
(
m
*
LCLBrowserWindow
)
doOnRenderCompMsg
(
message
*
types
.
TMessage
,
lResult
*
types
.
LRESULT
,
aHandled
*
bool
)
{
if
m
.
regions
!=
nil
&&
m
.
regions
.
RegionsCount
()
>
0
{
switch
message
.
Msg
{
case
WM_GETMINMAXINFO
:
fmt
.
Println
(
"WM_GETMINMAXINFO"
)
case
WM_MOUSEMOVE
:
//fmt.Println("move")
case
WM_LBUTTONDBLCLK
:
case
WM_LBUTTONDOWN
:
case
WM_LBUTTONUP
:
fmt
.
Println
(
"l up"
,
wdrs
.
canCaption
)
case
WM_MOVE
,
WM_MOVING
:
fmt
.
Println
(
"move"
)
case
WM_NCLBUTTONDBLCLK
:
/*-- NC --*/
if
!
m
.
WindowProperty
()
.
CanCaptionDClkMaximize
{
break
}
fmt
.
Println
(
"nc ld click"
,
m
.
windowsState
)
fmt
.
Println
(
"nc ld click"
,
m
.
windowsState
,
m
.
WindowState
()
)
if
m
.
rgn
!=
nil
&&
wdrs
.
canCaption
{
if
ov
.
Major
==
6
{
//win.ReleaseCapture()
}
//SendMessage(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); // 最大化
//SendMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); // 最小化
//SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); // 关闭
//SendMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); // 最大化状态还原
if
m
.
windowsState
==
0
{
m
.
windowsState
=
types
.
WsMaximized
m
.
SetWindowState
(
types
.
WsMaximized
)
*
lResult
=
HTCAPTION
*
aHandled
=
true
win
.
ReleaseCapture
()
m
.
windowsState
=
m
.
WindowState
()
if
m
.
windowsState
==
types
.
WsNormal
{
rtl
.
PostMessage
(
m
.
Handle
(),
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
)
//var monitor = m.Monitor().WorkareaRect()
//m.SetBounds(monitor.Left, monitor.Top, monitor.Right-monitor.Left-1, monitor.Bottom-monitor.Top-1)
}
else
{
//需要先设置一次-不然不生效
m
.
SetWindowState
(
m
.
windowsState
)
m
.
windowsState
=
types
.
WsNormal
m
.
SetWindowState
(
types
.
WsNormal
)
rtl
.
SendMessage
(
m
.
Handle
(),
WM_SYSCOMMAND
,
SC_RESTORE
,
0
)
}
rtl
.
SendMessage
(
m
.
Handle
(),
WM_NCLBUTTONUP
,
0
,
0
)
return
}
case
WM_NCLBUTTONDOWN
:
...
...
@@ -103,25 +92,18 @@ func (m *LCLBrowserWindow) doOnRenderCompMsg(message *types.TMessage, lResult *t
if
m
.
rgn
!=
nil
&&
wdrs
.
canCaption
{
*
lResult
=
HTCAPTION
*
aHandled
=
true
//1 这个在windows7不正确
//WinDefWindowProc(m.hWnd, message.Msg, message.WParam, message.LParam)
//2 这个在windows7下正常
win
.
ReleaseCapture
()
rtl
.
Send
Message
(
m
.
Handle
(),
WM_NCLBUTTONDOWN
,
HTCAPTION
,
0
)
rtl
.
Post
Message
(
m
.
Handle
(),
WM_NCLBUTTONDOWN
,
HTCAPTION
,
0
)
rtl
.
SendMessage
(
m
.
Handle
(),
WM_NCLBUTTONUP
,
0
,
0
)
//rtl.SendMessage(m.Handle(), WM_NCLBUTTONUP, 0, 0)
return
}
case
WM_NCLBUTTONUP
:
fmt
.
Println
(
"nc l up"
,
wdrs
.
canCaption
)
case
WM_NCMOUSEMOVE
:
fmt
.
Println
(
"nc mouse move"
,
wdrs
.
canCaption
)
if
m
.
rgn
!=
nil
&&
wdrs
.
canCaption
{
WinDefWindowProc
(
m
.
Handle
(),
message
.
Msg
,
message
.
WParam
,
message
.
LParam
)
//
WinDefWindowProc(m.Handle(), message.Msg, message.WParam, message.LParam)
*
lResult
=
HTCAPTION
*
aHandled
=
true
break
return
}
case
WM_NCRBUTTONDOWN
:
fmt
.
Println
(
"nc r down"
,
wdrs
.
canCaption
)
...
...
@@ -129,7 +111,6 @@ func (m *LCLBrowserWindow) doOnRenderCompMsg(message *types.TMessage, lResult *t
fmt
.
Println
(
"nc r up"
,
wdrs
.
canCaption
)
case
WM_NCHITTEST
:
/*-- NCHITTEST --*/
if
m
.
rgn
!=
nil
{
//var hit = WinDefWindowProc(m.Handle(), message.Msg, message.WParam, message.LParam)
_
,
_
,
caption
:=
wdrs
.
isCaption
(
m
.
Handle
(),
m
.
rgn
,
message
)
//设置鼠标坐标是否在标题区域
wdrs
.
canCaption
=
caption
...
...
@@ -143,9 +124,6 @@ func (m *LCLBrowserWindow) doOnRenderCompMsg(message *types.TMessage, lResult *t
return
}
}
//other message -> WinDefWindowProc
*
lResult
=
WinDefWindowProc
(
m
.
Handle
(),
message
.
Msg
,
message
.
WParam
,
message
.
LParam
)
//m.InheritedWndProc(message)
}
}
...
...
@@ -162,7 +140,7 @@ func (m *LCLBrowserWindow) registerWindowsCompMsgEvent() {
}
})
m
.
TForm
.
SetOnConstrainedResize
(
func
(
sender
lcl
.
IObject
,
minWidth
,
minHeight
,
maxWidth
,
maxHeight
*
int32
)
{
m
.
windowsState
=
m
.
WindowState
()
//
m.windowsState = m.WindowState()
if
m
.
onConstrainedResizeEvent
!=
nil
{
m
.
onConstrainedResizeEvent
(
sender
,
minWidth
,
minHeight
,
maxWidth
,
maxHeight
)
}
...
...
example/dev-test/lcl-browser/lcl-browser.go
浏览文件 @
19cb22fd
...
...
@@ -29,12 +29,12 @@ func main() {
browserWindow
:=
window
.
AsLCLBrowserWindow
()
.
BrowserWindow
()
browserWindow
.
Constraints
()
.
SetMinWidth
(
300
)
browserWindow
.
Constraints
()
.
SetMinHeight
(
300
)
//
window.DisableResize()
window
.
DisableResize
()
//window.HideTitle()
//browserWindow.SetBorderStyle(types.BsNone)
//browserWindow.SetBorderStyle(types.BsSingle)
//browserWindow.SetBorderStyle(types.BsSingle)
//
window.HideTitle()
window
.
HideTitle
()
window
.
AsLCLBrowserWindow
()
.
BrowserWindow
()
.
SetOnCloseQuery
(
func
(
sender
lcl
.
IObject
,
canClose
*
bool
)
bool
{
fmt
.
Println
(
"lcl browser close query"
)
return
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录