左右停靠代码带记录

Posted humd

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了左右停靠代码带记录相关的知识,希望对你有一定的参考价值。

技术图片
try (cui.unregisterDialogBar test) catch()
try (destroyDialog test) catch()
rollout test "左右停靠" width:168 height:90
(
    button dockL "DockL" pos:[8,8] width:48 height:48
    button unDockB "UnDock" pos:[104,8] width:48 height:48 enabled:false
    button dockR "DockR" pos:[56,8] width:48 height:48

    on dockL pressed do
    (   --停靠右边
        try(
        cui.RegisterDialogBar test
        cui.DockDialogBar test #cui_dock_left 
        SetINISetting "SctSet" "GlobalSet"  "Dock" "#cui_dock_left"
        unDockB.enabled = true
        DockStatus =  true
        ) catch()
    )
    on unDockB pressed do
    (   --弹出界面
        try(
        cui.UnRegisterDialogBar test
        SetINISetting "SctSet" "GlobalSet"  "Dock" "None"
        unDockB.enabled = false
        DockStatus =  false
        ) catch()
    )
    on dockR pressed do
    (   --停靠左边
        try(
        cui.RegisterDialogBar test
        cui.DockDialogBar test #cui_dock_right
        SetINISetting "SctSet" "GlobalSet"  "Dock" "#cui_dock_right"
        unDockB.enabled = true
        DockStatus =  true
        ) catch()
    )
)
CreateDialog test

--记忆停靠位置
if (getfiles (sysInfo.windowsdir + "" + "SctSet")).count <1 do
(
    SetINISetting "SctSet" "GlobalSet"  "Dock" "#cui_dock_left"
)

if (GetINISetting "SctSet" "GlobalSet"  "Dock") == "#cui_dock_left" do
(
    Cui.RegisterDialogBar test
    Cui.DockDialogBar test #cui_dock_left
)
if (GetINISetting "SctSet" "GlobalSet"  "Dock") == "#cui_dock_right" do
(
    Cui.RegisterDialogBar test
    Cui.DockDialogBar test #cui_dock_right
)
if (GetINISetting "SctSet" "GlobalSet"  "Dock") == "None" do
(
    Cui.RegisterDialogBar test
)
View Code

以上是关于左右停靠代码带记录的主要内容,如果未能解决你的问题,请参考以下文章

discuz X3.1 源代码阅读,记录代码片段

记录C#常用的代码片段

我可以通过代码将 iPad 键盘设置为停靠式/非停靠式/分体式吗?

如何使用代码停靠在父容器中

VsCode 代码片段-提升研发效率

提效小技巧——记录那些不常用的代码片段