GetTopModal()

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » GetTopModal()
Version 2.2

説明

GetTopModal 関数は、最上位にあるモーダルのハンドルを返します。モーダルは、システムの通常操作を中断するポップアップの内部名です。モーダルは、開いている間、他のUI要素の使用をブロックします。

例えば、ウィンドウの設定ポップアップを開くときに、コマンドラインを使用することはできません。設定ポップアップはモーダルです。これは、UIの他の部分が開いている際に少し暗くなることでも識別できます。

引数

この関数は、引数を受け取りません。

戻り値

  • handle または nil:
    最上位にあるモーダルUIオブジェクトへのハンドル(存在する場合)を返します。

StagePopup 選択ポップアップに関する情報を、Dump() 関数で表示します。

Lua
return function()
    -- Open a Modal / Pop-up.
    Cmd('Menu "StagePopup"')
    -- Add a small wait.
    coroutine.yield(0.5)
    -- Get the handle for the modal / pop-up. 
    local modalHandle = GetTopModal()
    -- If there is a handle then dump all information else print en error feedback.
    if modalHandle ~= nil then
        Printf("=============== START OF DUMP ===============")
        modalHandle:Dump()
        Printf("================ END OF DUMP ================")
    else
        ErrPrintf("The Modal UI object could not be found.")
    end
    -- Close the modal / pop-up by pressing the Escape key.
    Keyboard(1,'press','Escape')
    Keyboard(1,'release','Escape')
end