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

28
LINES

< > BotCompany Repo | #1027023 - Fullscreen Image

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 843K of libraries. Click here for Pure Java version (6794L/36K).

1  
!7
2  
3  
cmodule FullscreenImage > DynImageSurface {
4  
  switchable bool noScroll; // workaround for weird unnecessary scrollbars (TODO: find out why that happens)
5  
  switchable bool zoomToScreen = true;
6  
  transient ImageSurface fullScreenIS;
7  
  
8  
  start {
9  
    if (!hasImage()) setImage(whiteImage(100, 100));
10  
  }
11  
  
12  
  visual
13  
    withCenteredButtons(super, "Show fullscreen", rThread showFullscreen);
14  
    
15  
  void showFullscreen enter {
16  
    if (!hasImage()) ret;
17  
    if (fullScreenIS != null) activateFrame(fullScreenIS);
18  
    fullScreenIS = noScroll
19  
      ? showFullScreenImageSurface_noScroll(getImage())
20  
      : showFullScreenImageSurface(getImage());
21  
    if (zoomToScreen) fullScreenIS.zoomToWindow();
22  
    onFrameClose(fullScreenIS, r { fullScreenIS = null; });
23  
  }
24  
  
25  
  void exitFullscreen enter {
26  
    disposeFrame(fullScreenIS);
27  
  }
28  
}

download  show line numbers  debug dex   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pzhvpgtvlbxg, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027023
Snippet name: Fullscreen Image
Eternal ID of this version: #1027023/5
Text MD5: 8921966c5e01b74c088b60abe8c08e5f
Transpilation MD5: 83548910b82b7cb0373ac536cd26b8f6
Author: stefan
Category: javax / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-10 18:41:32
Source code size: 856 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 35 / 444
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1027023 & http://1027023.tinybrain.de