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

34
LINES

< > BotCompany Repo | #1033657 // DMPopOutHandler [does it work?]

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

Libraryless. Click here for Pure Java version (15517L/92K).

1  
asclass DMPopOutHandler {
2  
  transient DynModule module;
3  
  transient JButton popDownButton;
4  
  
5  
  abstract void addControl(JComponent c);
6  
  
7  
  void start {
8  
    module = dm_current_mandatory();
9  
    dm_vmBus_onMessages_q(ll("modulePoppedOut", "modulePoppedIn"), (m, myFrame) -> {
10  
      if (dm_isMe(m))
11  
        adjustUIForPoppedOutWindow();
12  
    });
13  
  }
14  
  
15  
  void adjustUIForPoppedOutWindow swing {
16  
    if (popDownButton == null) {
17  
      Window window = cast getWindow(dm_vis());
18  
19  
      var popBackInButton = findButton(window, "Pop Back In");
20  
      var parent = getParent(popBackInButton);
21  
      print(+parent);
22  
      
23  
      removeFromParent(parent); // hide controls
24  
      
25  
      popDownButton = jPopDownButton_noText(
26  
        "Pop Back In", r { dm_popInModule(module) },
27  
        jCheckBoxMenuItem("Always On Top",
28  
          isAlwaysOnTop(window),
29  
          r { temp module.enter(); dm_toggleAlwaysOnTop(); }),
30  
      );
31  
      addControl(popDownButton);      
32  
    }
33  
  }
34  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033657
Snippet name: DMPopOutHandler [does it work?]
Eternal ID of this version: #1033657/4
Text MD5: 922e868e4aa4c7471975bed4b6aa9f31
Transpilation MD5: 42a8bcad3f0c01eee6d37fa12e053ee4
Author: stefan
Category: javax / screen recognition
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-12-26 15:58:56
Source code size: 999 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 66 / 151
Version history: 3 change(s)
Referenced in: [show references]