Utility report (MAG...
 

Utility report (MAGIC NUI Workstation only) for displaying all available NPR Icons  

  RSS

Brian Schmit
(@schmit)
Eminent Member
Joined: 2 months ago
Posts: 44
25/03/2019 5:58 pm  

Users can attached "Icons" from the NPR.ICON dictionary to "Desktop" style menus for the NUI Workstation. 

These are the steps for creating a report that displays all of the bitmaps (from NPR.BMP) that are connected to icons:

1) Create a report with Report DPM NPR.ICON with the following Report Title:

 "_%NPR.ICON.zcus.report.M.review("")_"

You will need to replace 'report' with the name of your report.

2) File and translate your report.

3) Create a macro called 'review' with the following code:

IF{/DONE;
   1^/DONE^/Z.SCHED.LOG^/R.FRAGMENT,
   @Not(@.gui) @W.err("This report should be run from the NUI Workstation only!");
   @SETUP,
   @GET.TEMP.LIST,
   @DISPLAY,
   @CLEAN.UP},
END;

DISPLAY
""^CNT^NUM^DONE,
DO{+(/TEMP[CNT],filename)^CNT&@Not(DONE) @DISPLAY.ICON}

DISPLAY.ICON
@Mouse.pointer(@Z.mouse.ptr.hour.glass),
IF{@Add(1,NUM)\15=0 84;NUM\15-1*6}^COL,
NUM-1/15*3^ROW,
TITLE_"\"_filename^FILE,
@Pos(ROW,COL)^#,
@Button.create(11,10,5,100,50,0,FILE)^/ICON.HANDLE[CNT],
CNT^/HANDLE.MAP[/ICON.HANDLE[CNT]],
@Button.tooltip(/ICON.HANDLE[CNT],"Please click here for info on bitmap "_filename),
IF{NUM=105!@Not(+/TEMP[CNT]) @Mouse.pointer(@Z.mouse.ptr.std.arrow),
                             @REMOVE.BUTTONS}

REMOVE.BUTTONS
%Z.init.build.folders("T")^TBF,
@Pos(23,20)^#,
@Button.create(11,10,5,100,50,0,TBF_"\"_"left arrow.bmp")^PREV,
@Button.tooltip(PREV,"Previous set of bitmaps"),
@Pos(23,40)^#,
@Button.create(11,10,5,100,50,0,TBF_"\"_"exit.bmp")^EXIT,
@Button.tooltip(EXIT,"Exit"),
@Pos(23,60)^#,
@Button.create(11,10,5,100,50,0,TBF_"\"_"right arrow.bmp")^NEXT,
@Button.tooltip(NEXT,"Next set of bitmaps"),
IF{@Not(+/TEMP[CNT]) @Button.disable(NEXT)},
IF{@Not(-/TEMP[CNT-104]) @Button.disable(PREV)},
DO{#R[0,0,0,X]^X,#Y^y,
   IF{y=@Z.mouse.click @Button.query("")^MOUSE,
                       IF{MOUSE=PREV "Previous";
                          MOUSE=EXIT "Exit";
                          MOUSE=NEXT "Next";
                          @OTHER.BUTTONS};
      (y=@Z.exit)!(y=@Z.esc.key) "Exit";
      y=@Z.down.shift&+/TEMP[CNT] "Next";
      y=@Z.page.down&+/TEMP[CNT] "Next";
      y=@Z.down&+/TEMP[CNT] "Next";
      y=@Z.right.10.chars&+/TEMP[CNT] "Next";
      y=@Z.next.section&+/TEMP[CNT] "Next";
      y=@Z.next.field&+/TEMP[CNT] "Next";
      y=@Z.up.shift&-/TEMP[CNT-104] "Previous";
      y=@Z.page.up&-/TEMP[CNT-104] "Previous";
      y=@Z.up&-/TEMP[CNT-104] "Previous";
      y=@Z.left.10.chars&-/TEMP[CNT-104] "Previous";
      y=@Z.previous.section&-/TEMP[CNT-104] "Previous";
      y=@Z.previous.field&-/TEMP[CNT-104] "Previous"}^CH_.=.},
""^X,
DO{+(/ICON.HANDLE[X],HANDLE)^X @Button.expunge(HANDLE),
                               ""^/ICON.HANDLE[X]},
@Button.expunge(PREV),
@Button.expunge(EXIT),
@Button.expunge(NEXT),
@Pos(0,0,"")S^#,
IF{CH="Exit"^DONE;CH="Previous" @Sub(NUM+105,CNT)},
""^NUM^CH^HANDLE

OTHER.BUTTONS
IF{@Not(/HANDLE.MAP[MOUSE]^CLICK);
   /TEMP[CLICK]^filename,
   "Bitmap "_filename_" last updated on "_%Z.date.clin.to.out(@NPR.BMP.last.updat*)^/WIN.TITLE,
   "Bitmap "_filename_" is used with the following icons:"^/.WO[-/.WO[""]+1],
   ""^mnemonic,
   DO{@Next(mnemonic,type.x) mnemonic^/.WO[-/.WO[""]+1]},
   %Z.wm.macro(1,0,0)},
""

GET.TEMP.LIST
ZZ%K(/TEMP),
"DESKTOP"^use,
""^filename,
DO{@Next(filename,type.x) filename^/TEMP[-/TEMP[""]+1]}

SETUP
@Cursor.off("")^#,
@Window.centered(27,92,1)^#,
%Z.init.build.folders("B")^TITLE,
@Dos.ws.header("Bitmaps from folder "_TITLE)

CLEAN.UP
ZZ%K(/TEMP,/ICON.HANDLE,/HANDLE.MAP),
@Window.close("")^#,
@Cursor.on("")^#

4) File and translate your macro.

When you run the report you will get a window with a display of all of the available 'Desktop' style icons.


Quote
Gary Armfield
(@armfield)
CEO Admin
Joined: 2 months ago
Posts: 3
25/03/2019 6:44 pm  

This forum software has a bug that doesn't allow the word NPR.BMP.last.update to be placed in the editor.  So, after copying the above code replace "NPR.BMP.last.updat*" with "NPR.BMP.last.update";  basically, replace the '*' with a lower case 'e'.


ReplyQuote
Share:
  
Working

Please Login or Register