Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1007754 // standardTitlePopupMenu

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (7072L/41K).

static void standardTitlePopupMenu(final JFrame frame) {
  // standard right-click behavior on titles
  if (!isSubstanceLAF()) ret;
  titlePopupMenu(frame, voidfunc(JPopupMenu menu) {
    bool alwaysOnTop = frame.isAlwaysOnTop();
    ifndef standardTitlePopupMenu_noProgramFunctions
      menu.add(jmenuItem("Restart Program", r restart));
      menu.add(jmenuItem("Duplicate Program", r duplicateThisProgram));
    endifndef
    menu.add(jmenuItem("Show Console", r showConsole));
    menu.add(jCheckBoxMenuItem("Always On Top", alwaysOnTop, r { toggleAlwaysOnTop(frame) }));
    /*ifndef standardTitlePopupMenu_noShootWindow
      { menu.add(jMenuItem("Shoot Window", r { shootWindowGUI_external(frame, 500) })); }
    endifndef*/
    //addMenuItem(menu, "Bigger fonts", r swingBiggerFonts);
    //addMenuItem(menu, "Smaller fonts", r swingSmallerFonts);
  });
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007754
Snippet name: standardTitlePopupMenu
Eternal ID of this version: #1007754/13
Text MD5: 49c7e7a8b6ccfd2548814bda4cd67157
Transpilation MD5: 0529edc60511651418dceb9f4e87677c
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-04 20:39:49
Source code size: 881 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 571 / 657
Version history: 12 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)