Created
March 28, 2024 11:01
-
-
Save 958/5f581dbaa94e4e088bf6da1b5e529166 to your computer and use it in GitHub Desktop.
tablacus explorer popup tabgroup menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tabs = []; | |
const len = await GetLength(await te.Data.Tabgroups.Data); | |
for (let i = 0; i < len; i++) { | |
const name = await te.Data.Tabgroups.Data[i].Name; | |
tabs.push({ index: i, name: name}); | |
} | |
let hMenu = await api.CreatePopupMenu(); | |
for (let i = tabs.length; i--;) { | |
let uFlags = MF_STRING; | |
if ((await te.Data.Tabgroups.Click - 1) == i) { | |
uFlags |= MF_CHECKED; | |
} | |
await api.InsertMenu(hMenu, 0, MF_BYPOSITION | uFlags, i + 1, (i+1) + ". " + tabs[i].name); | |
} | |
const x = pt.x; | |
const y = pt.y; | |
const nVerb = await api.TrackPopupMenuEx(hMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD, x, y, ui_.hwnd, null, null); | |
api.DestroyMenu(hMenu); | |
if (nVerb > 0) { | |
Addons.Tabgroups.Change(nVerb); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment