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

35
LINES

< > BotCompany Repo | #1015133 // flatInfoBox_topRightCorner - show flat info message in top-right corner

JavaX fragment (include)

please include function flatInfoBox.

static int flatInfoBox_topRightCorner_x = 50;
static int flatInfoBox_topRightCorner_y = 5;

static JWindow flatInfoBox_topRightCorner(S text) {
  ret flatInfoBox_topRightCorner(text, flatInfoBox_defaultTime);
}

static JWindow flatInfoBox_topRightCorner(final S text, final double seconds) {
  print(text);
  ret flatInfoBox_topRightCorner_noprint(text, seconds);
}

static JWindow flatInfoBox_topRightCorner_noprint(S text) {
  ret flatInfoBox_topRightCorner_noprint(text, flatInfoBox_defaultTime);
}

static JWindow flatInfoBox_topRightCorner_noprint(final S text, final double seconds) {
  logQuotedWithDate(infoBoxesLogFile(), text); 
  if (isHeadless()) null;
  ret (JWindow) swingAndWait(func {
    JWindow window = makeWindow(flatInfoBox_makePanel(text));
    window.pack();
    window.setBounds(screenWidth()-window.getWidth()-flatInfoBox_topRightCorner_x, flatInfoBox_topRightCorner_y, window.getWidth(), window.getHeight());
    if (flatInfoBox_alwaysOnTop)
      window.setAlwaysOnTop(true);
    window.setVisible(true);
    disposeWindowAfter(iround(seconds*1000), window);
    ret window;
  });

  /*ret moveToTopRightCorner(flatInfoBox_topRightCorner_x, flatInfoBox_topRightCorner_y,
    packWindow(flatInfoBox_noprint(text, flatInfoBox_defaultTime)));*/
}

Author comment

Began life as a copy of #1014595

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: #1015133
Snippet name: flatInfoBox_topRightCorner - show flat info message in top-right corner
Eternal ID of this version: #1015133/12
Text MD5: 67bcd0a5000c9fbca1f17e5a40cbf309
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-27 09:45:51
Source code size: 1342 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 393 / 407
Version history: 11 change(s)
Referenced in: [show references]