Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
1139de2b
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,发现更多精彩内容 >>
提交
1139de2b
编写于
7月 14, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
A: lcl custom window drag
上级
fbc1994d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
8 deletion
+16
-8
cef/application-callback.go
cef/application-callback.go
+9
-6
cef/browser-window-lcl.go
cef/browser-window-lcl.go
+3
-1
example/sys-dialog/sysdialog.go
example/sys-dialog/sysdialog.go
+4
-1
未找到文件。
cef/application-callback.go
浏览文件 @
1139de2b
...
...
@@ -45,12 +45,15 @@ func appWebKitInitialized() {
energyExtensionHandler
:=
V8HandlerRef
.
New
()
energyExtensionHandler
.
Execute
(
func
(
name
string
,
object
*
ICefV8Value
,
arguments
*
TCefV8ValueArray
,
retVal
*
ResultV8Value
,
exception
*
ResultString
)
bool
{
fmt
.
Println
(
"Execute"
,
name
,
consts
.
IsMessageLoop
,
application
.
SingleProcess
())
message
:=
&
ipcArgument
.
List
{
Id
:
-
1
,
BId
:
ipc
.
RenderChan
()
.
BrowserId
(),
Name
:
internalIPCDRAG
,
if
name
==
"mouseMove"
{
message
:=
&
ipcArgument
.
List
{
Id
:
-
1
,
BId
:
ipc
.
RenderChan
()
.
BrowserId
(),
Name
:
internalIPCDRAG
,
}
ipc
.
RenderChan
()
.
IPC
()
.
Send
(
message
.
Bytes
())
return
true
}
ipc
.
RenderChan
()
.
IPC
()
.
Send
(
message
.
Bytes
())
return
false
})
var
code
=
`
...
...
@@ -98,7 +101,7 @@ func appWebKitInitialized() {
mouseUp();
}
energyExtension.drag.mouseDown = function (e) {
if (!energyExtension.drag.enableDrag
&&
((e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight))) {
if (!energyExtension.drag.enableDrag
||
((e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight))) {
return
}
if (energyExtension.drag.war(e)) {
...
...
cef/browser-window-lcl.go
浏览文件 @
1139de2b
...
...
@@ -139,10 +139,12 @@ func (m *LCLBrowserWindow) Handle() types.HWND {
func
(
m
*
LCLBrowserWindow
)
RunOnMainThread
(
fn
func
())
{
runtime
.
LockOSThread
()
defer
runtime
.
UnlockOSThread
()
fmt
.
Println
(
"call-0-DMainThreadId:"
,
api
.
DMainThreadId
(),
api
.
DCurrentThreadId
())
if
api
.
DMainThreadId
()
==
api
.
DCurrentThreadId
()
{
fn
()
}
else
{
lcl
.
ThreadSync
(
func
()
{
QueueAsyncCall
(
func
(
id
int
)
{
//lcl.ThreadSync(func() {
fn
()
})
}
...
...
example/sys-dialog/sysdialog.go
浏览文件 @
1139de2b
...
...
@@ -9,6 +9,7 @@ import (
"github.com/energye/energy/v2/consts"
"github.com/energye/energy/v2/pkgs/assetserve"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/api"
"github.com/energye/golcl/lcl/types"
"strings"
//_ "net/http/pprof"
...
...
@@ -163,7 +164,9 @@ func main() {
dlgOpen
.
SetTitle
(
"打开"
)
ipc
.
On
(
"showDialog"
,
func
(
t
int
)
{
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
window
.
RunOnMainThread
(
func
()
{
fmt
.
Println
(
"call-1-DMainThreadId:"
,
api
.
DMainThreadId
(),
api
.
DCurrentThreadId
())
//cef.QueueAsyncCall(func(id int) {
switch
t
{
case
1
:
// InputComboEx
fmt
.
Println
(
lcl
.
InputComboEx
(
"选择"
,
"请选择一项:"
+
strings
.
Repeat
(
" "
,
50
),
[]
string
{
"第一项"
,
"第二项"
,
"第三项"
,
"第四项"
},
false
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录