%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % EXPRESS v1.0 % % Date: October 18, 1989 % Author: % David G. Zawada % EAIS-VIS % Argonne National Laboratory % zawada@athens.ees.anl.gov % % Technical Advisors: % Peter A. Korp % EAIS-VIS % Argonne National Laboratory % korp@athens.ees.anl.gov % % David C. Mak % EAIS-VIS % Argonne National Laboratory % mak@athens.ees.anl.gov % % % Accompanying files: % -> ScrollDataItem.ps % -> me.ras % % EXPRESS is a quick launch facility which displays % a list of user-specified applications in a menu with % a touch of the designated HotKey. % % IMPORTANT !!! % Before running EXPRESS, the environment variable % EXPRESS_HOME must be set to the path specifying the % location of the files me.ras and ScrollDataItem.ps. % To run EXPRESS, simply type 'psh express.ps'. However, % I strongly recommend that you add an item to your NeWS % rootmenu to perform this task. A line, similar to the % following, in your user.ps file will acheive this goal: % % 0 (Activate Express) % { (psh "path to express"/express.ps) forkunix } % /insertitem rootmenu send % % Now, EXPRESS can be launched from a menu selection, % which I prefer since my typing skills are minimal. % Also, EXPRESS is only a mouse click away. % % After launching EXPRESS for the first time, the 'RIGHT' % key is set as the HotKey and the EXPRESS menu contains % the following items: % % Terminal <- Sun psterm window % Cancel <- no action % About Express <- EXPRESS credits % Configure Express <- Allows customization % Disable Express <- Deactivates EXPRESS % % These items are hardcoded and cannot be changed by % EXPRESS itself. The Configure option, however, displays % a control panel which allows for the customization of % the applications accessible through EXPRESS, the fonts % used by EXPRESS, and the HotKey which launches EXPRESS. % Currently, only the F-, L-, and R-function keys, as % well as the LEFT and RIGHT keys, may be designated as % the HotKey. Also, only the Sun3 keyboard layout is % supported at present. % % A neat feature of EXPRESS is that it can be configured % to execute virtually any piece of NeWS/PostScript code. % Suppose there is a file called win.ps which opens a % NeWS window. You can tell EXPRESS how to launch this % program by accessing the Application Customizer and % entering "psh win.ps" in the Application to add field % and setting the Application type CycleItem to NeWS. % EXPRESS will simply fork off the process "psh win.ps". %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% systemdict /ScrollDataItem known not % Make sure SDI is available { (EXPRESS_HOME) getenv (/ScrollDataItem.ps) append run } if version (1.1) eq { keyboardtype 3 eq % enable the Left key -- Why does NeWS disable it? { systemdict /keyboard_positions get /FunctionLeft [ 120 systemdict /UI_private get /keyStation get exec /function ] put } if } if systemdict /ExpressDict 100 dict put % put all the Express code in its own dictionary ExpressDict begin /createfile? false def % does the defaults file (.expressapps) need to be created? /expressfile null def /NumDefaultMenuEntries 7 def /HotKey /FunctionRight def /writefile % - > - write out the current EXPRESS settings { pause % Just Being Nice /expressfile ($HOME/.expressapps) (w) file store expressfile ([\n) writestring ExpressMenu /MenuKeys get 0 1 2 index length NumDefaultMenuEntries 1 add sub { expressfile 2 index 3 -1 roll get (\() exch append (\)\n) append writestring } for expressfile (]\n\n) writestring pause % Just Being Nice expressfile ([\n) writestring ExpressMenu /MenuActions get 0 1 2 index length NumDefaultMenuEntries 1 add sub { expressfile 2 index 3 -1 roll get (\() exch append (\)\n) append writestring } for expressfile (]\n) writestring [ ButFnt MenFnt SDIFnt TIFnt ] { (\() exch convertfont (\)\n) append append expressfile exch writestring } forall expressfile (\() HotKey 100 string cvs (\)\n) append append writestring expressfile closefile } def /getfntname % font => string containing fontname and pt_size { 200 string cvs (font\() search pop pop pop (\)) search pop 3 1 roll pop pop ( ) append } def /convertfont % (font&size) => (font size) put space betwn font and size { getfntname dup 0 1 index length 3 sub getinterval ( ) 3 -1 roll dup length 3 sub 3 getinterval append append } def /verifyfile % filename => boolean does filename exist? { { (r) file } errored { pop pop false } { closefile true } ifelse } def ($HOME/.expressapps) verifyfile % if defaults file exists, read it in { ExpressDict begin ($HOME/.expressapps) run /HotKey exch cvn store /TIFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /SDIFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /MenFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /ButFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /UserMenuActions exch def /UserMenuKeys exch def end % ExpressDict } { % otherwise, set default fonts and ... ExpressDict begin /ButFnt /Times-Bold findfont 14 scalefont def /MenFnt /Helvetica-Bold findfont 12 scalefont def /SDIFnt /Helvetica-Bold findfont 14 scalefont def /TIFnt /Screen-Bold findfont 14 scalefont def end % ExpressDict /createfile? true store % ... indicate default file needs to be created } ifelse gsave % get screen dimensions framebuffer setcanvas clippath pathbbox /ScreenHeight exch def /ScreenWidth exch def pop pop grestore /calc_wincoords % w h => x y w h coords that will center window on screen { 1 index 1 index ScreenHeight exch sub 2 div 4 1 roll ScreenWidth exch sub 2 div 4 1 roll } def %%%%%%%%%%%%%%%%%%%%%% %% About EXPRESS stuff %%%%%%%%%%%%%%%%%%%%%% /aboutEM null def /aboutcan framebuffer newcanvas def aboutcan /Transparent false put aboutcan /Retained true put aboutcan /Mapped false put 0 0 463 313 rectpath aboutcan reshapecanvas /about_express % display EXPRESS credits { ExpressDict begin gsave aboutcan setcanvas 300 dup movecanvas aboutcan canvastotop aboutcan /Mapped true put gsave % scale and load in my picture !!! (kind of Mac-ish, huh?) 463 313 scale pause (EXPRESS_HOME) getenv (/me.ras) append readcanvas imagecanvas grestore newpath 128 8 329 20 rectpath 0 0 0 rgbcolor 1 1 1 rgbcolor ColorDisplay? { pop pop 0 0 1 rgbcolor ColorDict /MediumSpringGreen get } if setcolor fill setcolor newpath 2 128 8 329 20 rectframe eofill /Symbol findfont 14 scalefont setfont 131 14 moveto (\323) show /Helvetica-Bold findfont 12 scalefont setfont 142 14 moveto ( Argonne National Lab by Dave Zawada -- Version 1.0) show /aboutEM % display credits until Left Mouse Button pressed [ PointButton { aboutcan /Mapped false put aboutEM killprocess } /DownTransition aboutcan eventmgrinterest ] forkeventmgr store grestore end % ExpressDict } def %% End About EXPRESS %%%%%%%%%%%%%%%%%%%%%%%%% %% EXPRESS Control Panel %%%%%%%%%%%%%%%%%%%%%%%%% /cpButtonSize 0 def % size of buttons to use -- depends on ButFnt /cpButtonX 10 def /cpitemsEM null def /appsChanges? false def % Changes made to application list? /fntChanges? false def % Changes made to font list? /hkChanges? false def % Change made to HotKey? /cp framebuffer /new SunViewWindow send def { 300 dup 200 400 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ColorDisplay? { ColorDict /LightBlue get fillcanvas } if cpitems paintitems } def /FrameFont /Helvetica-Bold findfont 14 scalefont def /FrameLabel (EXPRESS Control Panel) def /flipiconic {} def /stretchcorner {} def } cp send /cpcan cp /ClientCanvas get def %-------------------- %--- button notifies %-------------------- /abut_notify { /unmap cp send configapps } def % Display Application Customizer /fbut_notify { /unmap cp send configfnt } def % Display Font Customizer /hkbut_notify { /unmap cp send confighk } def % Display HotKey Customizer /sbut_notify { % Save any changes and write them out to the defaults file ExpressDict begin hkChanges? { HotKey unbindkey /HotKey (Function) hkitems /msg get /ItemObject get append cvn store HotKey 20 string cvs (Function) search pop pop pop dup /printstring hkitems /msg get send cvn /CurntHK exch store setHotKey hkcan_notify /hkChanges? false store } if fntChanges? { /ButFnt tmpButFnt store /MenFnt tmpMenFnt store % Bizarre, but must create a NEW menu to reflect the font change { /MenuFont MenFnt store /SaveMenuKeys MenuKeys store /SaveMenuActions MenuActions store } ExpressMenu send /ExpressMenu SaveMenuKeys SaveMenuActions /new ExpressDefaultMenu send store adjustmenu /SDIFnt tmpSDIFnt store /TIFnt tmpTIFnt store update_configwin update_hkwin update_cp } if writefile /unmap cp send cpitemsEM null ne { cpitemsEM killprocess /cpitemsEM null store } if end % ExpressDict } def /cbut_notify % - > - cancel ALL changes { can_notify cancel_notify hkcan_notify /unmap cp send cpitemsEM null ne { cpitemsEM killprocess /cpitemsEM null store } if } def /cpitems 5 dict dup begin /abut (Change Installed Applications) /abut_notify cpcan 0 0 /new ButtonItem send dup /ItemFrame 2 put dup /ItemLabelFont ButFnt put 0 0 /move 3 index send def /cpButtonSize abut /ItemWidth get store /fbut (Change Fonts) /fbut_notify cpcan cpButtonSize 0 /new ButtonItem send dup /ItemFrame 2 put dup /ItemLabelFont ButFnt put 0 0 /move 3 index send def /hkbut(Change HotKey) /hkbut_notify cpcan cpButtonSize 0 /new ButtonItem send dup /ItemFrame 2 put dup /ItemLabelFont ButFnt put 0 0 /move 3 index send def /sbut(Save) /sbut_notify cpcan 0 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ButFnt def /ItemFillColor 1 0 0 rgbcolor def end 0 0 /move 3 index send def /cbut(Cancel) /cbut_notify cpcan 0 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ButFnt def /ItemFillColor 1 1 0 rgbcolor def end 0 0 /move 3 index send def end % cpitems def /poscpitems % - > - Postion cpitems based on the max button size in cpitems { cpitems begin cpButtonX dup /move sbut send cpButtonX cpButtonSize add cbut /ItemWidth get sub 10 /move cbut send cbut /ItemHeight get cpButtonX dup 1.5 mul 2 index add /move hkbut send cpButtonX dup 2 mul 2 index 2 mul add /move fbut send cpButtonX dup 2.5 mul 3 -1 roll 3 mul add /move abut send end % cpitems } def { cpButtonX 2.5 mul cpButtonSize add cpButtonX 3.5 mul cpitems /cbut get /ItemHeight get 4 mul BorderTop BorderBottom add add add calc_wincoords reshape } cp send poscpitems %% End Control Panel %%%%%%%%%%%%%%%% %% Font Adjuster %%%%%%%%%%%%%%%% /FontChange? false def /tmpButFnt ButFnt def /tmpMenFnt MenFnt def /tmpSDIFnt SDIFnt def /tmpTIFnt TIFnt def /Fonts [ % the fonts to choose from [ (Boston) dup cvn findfont 14 scalefont ] [ (Courier) dup cvn findfont 14 scalefont ] [ (Courier-Bold) dup cvn findfont 14 scalefont ] [ (Courier-BoldOblique) dup cvn findfont 14 scalefont ] [ (Courier-Oblique) dup cvn findfont 14 scalefont ] [ (Helvetica) dup cvn findfont 14 scalefont ] [ (Helvetica-Bold) dup cvn findfont 14 scalefont ] [ (Helvetica-BoldOblique) dup cvn findfont 14 scalefont ] [ (Helvetica-Oblique) dup cvn findfont 14 scalefont ] [ (Screen) dup cvn findfont 14 scalefont ] [ (Screen-Bold) dup cvn findfont 14 scalefont ] [ (Times-Bold) dup cvn findfont 14 scalefont ] [ (Times-BoldItalic) dup cvn findfont 14 scalefont ] [ (Times-Italic) dup cvn findfont 14 scalefont ] [ (Times-Roman) dup cvn findfont 14 scalefont ] ] def /PtSizes [ [(12)] [(14)] [(18)] [(24)] ] def % font point sizes /fwitemsEM null def /fwin framebuffer /new SunViewWindow send def { 200 300 810 240 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ColorDisplay? { ColorDict /LightBlue get fillcanvas } if fwinitems paintitems } def /FrameFont /Helvetica-BoldOblique findfont 14 scalefont def /FrameLabel (EXPRESS Font Customizer for ) (USER) getenv append def /flipiconic {} def /stretchcorner {} def } fwin send /fwcan fwin /ClientCanvas get def /configfnt % - > - configure and display the Font Customizer window { ExpressDict begin /fwitemsEM fwinitems forkitems store fwinitems begin (%) [ tmpButFnt getfntname ] /printf mb send (%) [ tmpMenFnt getfntname ] /printf mm send (%) [ tmpSDIFnt getfntname ] /printf msdi send (%) [ tmpTIFnt getfntname ] /printf mti send end % fwinitems { totop map } fwin send end % ExpressDict } def %-------------------- %--- button notifies %-------------------- /getfontselection % - => font boolean converts string returned by SDI into a font object { fwinitems begin fntSDI /ItemValue get dup null ne { Fonts exch get 0 get cvn findfont PtSizes ptsz /ItemValue get 1 get get 0 get cvi scalefont true } { pop false } ifelse end % fwinitems } def % The following four notify procs update there respective msg items % to reflect font changes. /sti_notify { getfontselection { dup ExpressDict /tmpTIFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /mti get send ExpressDict /fntChanges? true put } if } def /ssdi_notify { getfontselection { dup ExpressDict /tmpSDIFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /msdi get send ExpressDict /fntChanges? true put } if } def /sm_notify { getfontselection { dup ExpressDict /tmpMenFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /mm get send ExpressDict /fntChanges? true put } if } def /sb_notify { getfontselection { dup ExpressDict /tmpButFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /mb get send ExpressDict /fntChanges? true put } if } def /savfnt_notify % Don't do anything { ExpressDict begin /unmap fwin send fwitemsEM null ne { fwitemsEM killprocess /fwitemsEM null store } if { totop map } cp send end % ExpressDict } def /cancel_notify % Restore previous font settings { ExpressDict begin /fntChanges? false store /tmpButFnt ButFnt store /tmpMenFnt MenFnt store /tmpSDIFnt SDIFnt store /tmpTIFnt TIFnt store /unmap fwin send fwitemsEM null ne { fwitemsEM killprocess /fwitemsEM null store } if { totop map } cp send end % ExpressDict } def % The following update routines will rescale all of the various configure % windows to account for changes made to the fonts to be utilized in % control items. /update_cp { cpitems begin [ abut sbut cbut ] { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } exch send } forall /cpButtonSize abut /ItemWidth get store [ fbut hkbut ] { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 cpButtonSize 0 reshape } exch send } forall end % cpitems { cpButtonX 2.5 mul cpButtonSize add cpButtonX 3.5 mul cpitems /cbut get /ItemHeight get 4 mul BorderTop BorderBottom add add add calc_wincoords reshape } cp send poscpitems } def /update_configwin { items begin /cfTISize gsave TIFnt setfont (Reference in Menu as: ) stringbbox grestore pop 3 1 roll pop pop 2 mul store /cfSDISize gsave SDIFnt setfont ( Installed Applications ) stringbbox grestore pop 3 1 roll pop pop store { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } cancel_but send /cfButtonSize cancel_but /ItemWidth get store [ add_but del_but done_but ] { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 cfButtonSize 0 reshape } exch send } forall { /ItemFont SDIFnt def /ItemLabelFont SDIFnt def } appsSDI send [ apptoadd appref ] { { /ItemFont TIFnt def /ItemLabelFont TIFnt def /LabelX 0 def /LabelY 0 def /ObjectX 0 def /ObjectY 0 def 0 0 cfTISize 0 reshape TI_resetarray } exch send } forall { /ItemFont TIFnt def /ItemLabelFont TIFnt def /LabelX 0 def /LabelY 0 def /ObjectX 0 def /ObjectY 0 def 0 0 0 0 reshape } filetype send end % items { 30 cfSDISize cfButtonSize cfTISize add add add 30 cfSDISize BorderTop BorderBottom add add add calc_wincoords reshape } configwin send poscfitems } def /update_hkwin { hkitems begin /msg (The current Hot Key is ) ( ) /Right {} hkcan 0 0 /new MessageItem send ColorDisplay? { dup /ItemFillColor ColorDict /LightBlue get put } if dup /ItemFont TIFnt put dup /ItemLabelFont TIFnt put 0 0 /move 3 index send store { /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } dup save_but send can_but send { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } Right send /hkButtonSize Right /ItemWidth get store { /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 hkButtonSize dup reshape } 0 index Left send Right send fkeys { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 hkButtonSize dup reshape } exch cvn cvx exec send } forall end % hkitems { hkButtonSize dup 15 mul exch 6 mul BorderTop BorderBottom add add calc_wincoords reshape } hkwin send poshkitems } def %----------------------- %--- end button notifies %----------------------- /fwinitems 12 dict dup begin /fntSDI fwcan {} /new ScrollDataItem send def { /AllowMultipleSelect? false def /ShowItemSeperators false def /HScrollbar? false def ColorDisplay? { /BufferColor ColorDict /Aquamarine get def /ItemTextColor 0 0 1 rgbcolor def } if /ItemLabel (FONTS) def /ItemLabelFont /Helvetica-Bold findfont 13 scalefont def /ItemLabelColor 0 0 0 rgbcolor def /ItemHighLightColor 0 0 0 rgbcolor def Fonts setdata 10 dup 200 dup reshape } fntSDI send /ptsz ( Point Size ) PtSizes /Bottom {} fwcan 0 0 /new ArrayItem send 225 100 /move 3 index send def /savebut (SAVE) /savfnt_notify fwcan 80 0 /new ButtonItem send dup /ItemRadius 0 put 225 50 /move 3 index send def /canbut (CANCEL) /cancel_notify fwcan 80 0 /new ButtonItem send dup /ItemRadius 0 put 225 10 /move 3 index send def /sb (Set Button Font) /sb_notify fwcan 165 0 /new ButtonItem send 315 160 /move 3 index send def /sm (Set Menu Font) /sm_notify fwcan 165 0 /new ButtonItem send 315 110 /move 3 index send def /ssdi (Set ScrollDataItem Font) /ssdi_notify fwcan 165 0 /new ButtonItem send 315 60 /move 3 index send def /sti (Set TextItem Font) /sti_notify fwcan 165 0 /new ButtonItem send 315 10 /move 3 index send def /mb (Button Font is ) ButFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 165 /move 3 index send def /mm (Menu Font is ) MenFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 115 /move 3 index send def /msdi (ScrollDataItem Font is ) SDIFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 65 /move 3 index send def /mti (TextItem Font is ) TIFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 15 /move 3 index send def end def fwinitems { 0 index /ItemFrame 2 put ColorDisplay? { /ItemFillColor ColorDict /LightBlue get put } { pop } ifelse } forall %%% End Font Adjuster %%%%%%%%%%%%%%%%%%%%% %% Set Hot Keys Stuff %%%%%%%%%%%%%%%%%%%%% /HKColor ColorDisplay? { 0 1 1 rgbcolor } { 0.7 0.7 0.7 rgbcolor } ifelse def /HKColorerase 1 1 1 rgbcolor def /CurntHK HotKey 20 string cvs (Function) search pop pop pop cvn def /hkButtonSize 0 def /ButtonX 0 def /ButtonY 0 def /fkeys % The possible HotKey choices [ (L1) (L2) (L3) (L4) (L5) (L6) (L7) (L8) (L9) (L10) (F1) (F2) (F3) (F4) (F5) (F6) (F7) (F8) (F9) (R1) (R2) (R3) (R4) (R5) (R6) (R7) (R8) (R9) (R10) (R11) (R12) (R13) (R14) (R15) ] def /hkitemsEM null def /hkwin framebuffer /new SunViewWindow send def { 200 300 600 320 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ColorDisplay? { ColorDict /LightBlue get fillcanvas } if ExpressDict /hkitems get paintitems } def /FrameFont /Helvetica-BoldOblique findfont 14 scalefont def /FrameLabel (Set the EXPRESS Hot Key for ) (USER) getenv append def /stretchcorner {} def /flipiconic {} def } hkwin send /hkcan hkwin /ClientCanvas get def /confighk % Display the current HotKey and map the HotKey Customizer window { pause ExpressDict begin /hkitemsEM hkitems forkitems store CurntHK 10 string cvs /printstring hkitems /msg get send { /ItemFillColor HKColor def paint } hkitems CurntHK get send { totop map } hkwin send end % ExpressDict } def %------------- %--- Item Notifies %----------------- /hks_notify { ExpressDict begin { /ItemFillColor HKColorerase def paint } hkitems CurntHK get send /CurntHK ItemLabel cvn store { /ItemFillColor HKColor def } hkitems CurntHK get send ItemLabel /printstring hkitems /msg get send end % ExpressDict } def /save_notify % Don't do anything { ExpressDict begin /hkChanges? true store /unmap hkwin send hkitemsEM null ne { hkitemsEM killprocess /hkitemsEM null store } if { totop map } cp send end % ExpressDict } def /hkcan_notify % Reset to previous HotKey { ExpressDict begin /hkChanges? false store /unmap hkwin send { /ItemFillColor HKColorerase def paint } hkitems CurntHK get send /CurntHK HotKey 20 string cvs (Function) search pop pop pop cvn store { /ItemFillColor HKColor def } hkitems CurntHK get send hkitemsEM null ne { hkitemsEM killprocess /hkitemsEM null store } if { totop map } cp send end % ExpressDict } def pause pause % Just Being Nice /hkitems 40 dict dup begin /Right (Right) /hks_notify hkcan 0 hkButtonSize /new ButtonItem send dup begin /ItemLabelFont ButFnt def /ItemFrame 1 def /ItemRadius 0 def /ClientUp { ItemValue { NotifyUser } if false SetButtonValue /ItemValue null store paint StopItem } def end 0 0 /move 3 index send def /hkButtonSize Right /ItemWidth get store { /LabelX 0 def /LabelY 0 def 0 0 hkButtonSize dup reshape } Right send /Left (Left) /hks_notify hkcan hkButtonSize dup /new ButtonItem send dup begin /ItemLabelFont ButFnt def /ItemFrame 1 def /ItemRadius 0 def /ClientUp { ItemValue { NotifyUser } if false SetButtonValue /ItemValue null store paint StopItem } def end 0 0 /move 3 index send def 0 1 fkeys length 1 sub { fkeys exch get dup cvn exch /hks_notify hkcan hkButtonSize dup /new ButtonItem send dup begin /ItemLabelFont ButFnt def /ItemFrame 1 def /ItemRadius 0 def /ClientUp { ItemValue { NotifyUser } if false SetButtonValue /ItemValue null store paint StopItem } def end 0 0 /move 3 index send def } for /msg (The current Hot Key is ) ( ) /Right {} hkcan 0 0 /new MessageItem send ColorDisplay? { dup /ItemFillColor ColorDict /LightBlue get put } if dup /ItemFont TIFnt put dup /ItemLabelFont TIFnt put 0 0 /move 3 index send def /save_but ( Save Change ) /save_notify hkcan 100 0 /new ButtonItem send dup begin /ItemFrame 1 def /ItemLabelFont ButFnt def /ItemFillColor 1 0 0 rgbcolor def end 0 0 /move 3 index send def /can_but ( Cancel ) /hkcan_notify hkcan 100 0 /new ButtonItem send dup begin /ItemFrame 1 def /ItemLabelFont ButFnt def /ItemFillColor 1 1 0 rgbcolor def end 0 0 /move 3 index send def end def pause /poshkitems { % Reposition the buttons /ButtonX 10 store /ButtonY hkButtonSize 4.5 mul store 0 2 9 { ButtonX ButtonY /move hkitems fkeys 5 index get cvn get send ButtonX hkButtonSize 1 sub add ButtonY /move hkitems fkeys 6 -1 roll 1 add get cvn get send /ButtonY ButtonY hkButtonSize 1 sub sub store } for pause /ButtonX 20 hkButtonSize 2 mul add store /ButtonY hkButtonSize 4.5 mul store 10 1 18 { ButtonX ButtonY /move hkitems fkeys 6 -1 roll get cvn get send /ButtonX ButtonX hkButtonSize 1 sub add store } for pause /ButtonX 25 hkButtonSize 11 mul add store /ButtonY hkButtonSize 4.5 mul store 19 3 33 { ButtonX ButtonY /move hkitems fkeys 5 index get cvn get send ButtonX hkButtonSize 1 sub add ButtonY /move hkitems fkeys 5 index 1 add get cvn get send ButtonX hkButtonSize 1 sub 2 mul add ButtonY /move hkitems fkeys 6 -1 roll 2 add get cvn get send /ButtonY ButtonY hkButtonSize 1 sub sub store } for hkitems begin hkButtonSize dup 3 mul exch 0.6 mul /move Left send hkButtonSize dup 10 mul exch 0.6 mul /move Right send { hkButtonSize dup 3.5 mul exch 3.5 mul move } msg send { hkButtonSize dup 2 mul ItemWidth 2 div add exch 2 mul move } save_but send { hkButtonSize dup 10 mul ItemWidth 2 div sub exch 2 mul move } can_but send end % hkitems } def { hkButtonSize dup 15 mul exch 6 mul BorderTop BorderBottom add add calc_wincoords reshape } hkwin send poshkitems /setHotKey % - > - Activate the desired HotKey { HotKey { ExpressDict begin ExpressMenu /MenuCanvas get null ne cp /FrameCanvas get /Mapped get configwin /FrameCanvas get /Mapped get fwin /FrameCanvas get /Mapped get hkwin /FrameCanvas get /Mapped get aboutcan /Mapped get or or or or or not { /showat ExpressMenu send } if end % ExpressDict } bindkey } def %% End Hot Keys %%%%%%%%%%%%%%%%%%%% %% Configure Express %%%%%%%%%%%%%%%%%%%% /cfButtonSize 0 def /cfTISize gsave TIFnt setfont (Reference in Menu as: ) stringbbox grestore pop 3 1 roll pop pop 2.5 mul def /cfSDISize gsave SDIFnt setfont ( Installed Applications ) stringbbox grestore pop 3 1 roll pop pop def /FileType ( forkunix) def /SaveSDIData [] def /SaveMenuItems null def /SaveMenuKeys null def /SaveMenuActions null def /itemsEM null def /configwin framebuffer /new SunViewWindow send def { 250 400 500 220 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ExpressDict begin ColorDisplay? { ColorDict /LightBlue get fillcanvas } if items paintitems 0 setgray TIFnt setfont 10 cfSDISize cfButtonSize 2 mul add add items /cancel_but get /ItemHeight get 3.2 mul moveto (Application type is) show end % ExpressDict } def /FrameFont /Helvetica-BoldOblique findfont 14 scalefont def /FrameLabel (EXPRESS Application Customizer for ) (USER) getenv append def /flipiconic {} def /stretchcorner {} def } configwin send /cwcan configwin /ClientCanvas get def /configapps % Clear the TextItems and map the Application Customizer window { ExpressDict begin /itemsEM items forkitems store { TI_resetarray items /apptoadd get send TI_resetarray items /appref get send totop map } configwin send end % ExpressDict } def %----------------- %--- Item Notifies %----------------- /fil_notify { ExpressDict /FileType ItemValue 0 eq { ( forkunix) } { ( fork_sunview1_tty) } ifelse put } def /TI_resetarray { { gsave ItemCanvas setcanvas restorefocus /LINEKILL ItemText send /ItemPaintedValue () def /ItemValue () def removefocus paint grestore } } def /add_notify { ExpressDict begin /appsChanges? true store items begin apptoadd /ItemValue get () append appref /ItemValue get dup () eq { pop dup (\() 1 index append (\)) append FileType append cvx } { () append dup (\() 4 -1 roll append (\)) append FileType append cvx } ifelse 0 3 1 roll /insertitem ExpressMenu send 0 /additem appsSDI send TI_resetarray apptoadd send TI_resetarray appref send end % items end % ExpressDict } def /del_notify { ExpressDict begin /appsChanges? true store items begin appsSDI /ItemValue get dup null ne { 0 index /deleteitem appsSDI send /deleteitem ExpressMenu send } { pop } ifelse end % items end % ExpressDict } def /can_notify % Restore previous SDI values { ExpressDict begin /appsChanges? false store /unmap configwin send SaveSDIData /setdata items /appsSDI get send { /MenuItems SaveMenuItems def /MenuKeys SaveMenuKeys def /MenuActions SaveMenuActions def /MenuWidth null def } ExpressMenu send itemsEM null ne { itemsEM killprocess /itemsEM null store } if { totop map } cp send end % ExpressDict } def /db_notify % Don't do anything { ExpressDict begin /unmap configwin send itemsEM null ne { itemsEM killprocess } if { totop map } cp send end % ExpressDict } def /items 8 dict dup begin /cancel_but ( Cancel ) ExpressDict /can_notify get cwcan 0 0 /new ButtonItem send dup begin /ItemFrame 2 def ColorDisplay? { /ItemFillColor 1 1 0 rgbcolor def } if /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /cfButtonSize cancel_but /ItemWidth get store /add_but ( Add ) ExpressDict /add_notify get cwcan cfButtonSize 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /del_but ( Delete ) ExpressDict /del_notify get cwcan cfButtonSize 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /done_but ( Done ) ExpressDict /db_notify get cwcan cfButtonSize 0 /new ButtonItem send dup begin /ItemFrame 2 def ColorDisplay? { /ItemFillColor 1 0 0 rgbcolor def } if /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /appsSDI cwcan {} /new ScrollDataItem send def { /AllowMultipleSelect? false def /ShowItemSeperators false def /HScrollbar? false def ColorDisplay? { /BufferColor ColorDict /Aquamarine get def /ItemTextColor 0 0 1 rgbcolor def } if /ItemLabel ( Installed Applications ) def /ItemLabelFont ExpressDict /SDIFnt get def /ItemFont ExpressDict /SDIFnt get def /ItemLabelColor 0 0 0 rgbcolor def /ItemHighLightColor 0 0 0 rgbcolor def } appsSDI send /apptoadd (Application to add: ) () /Right {} cwcan cfTISize 0 /new TextItem send dup /ItemFont ExpressDict /TIFnt get put dup /ItemLabelFont ExpressDict /TIFnt get put 0 0 /move 3 index send def /appref (Reference in Menu as: ) () /Right {} cwcan cfTISize 0 /new TextItem send dup /ItemFont ExpressDict /TIFnt get put dup /ItemLabelFont ExpressDict /TIFnt get put 0 0 /move 3 index send def /filetype /cycle [ (NeWS) (SunView) ] /Right /fil_notify cwcan 0 0 /new CycleItem send dup begin /LabelY 0 def /ItemFont ExpressDict /TIFnt get def ColorDisplay? { /ItemFillColor ColorDict /LightBlue get def } if end 0 0 /move 3 index send def end def pause /poscfitems { ExpressDict begin items begin { 10 dup cfSDISize dup reshape 450 SizeAllData reshapebuffer ShowObjectData } appsSDI send 10 cfSDISize cfButtonSize 2 div add add { 0 index 10 move ItemHeight 1.5 mul 5 add } done_but send { 1 index exch move ItemHeight 3 mul } del_but send 1 index exch /move add_but send cfButtonSize 1.5 mul add 10 /move cancel_but send ColorDisplay? { [ apptoadd appref ] { begin /ItemFillColor ColorDict /LightBlue get def ItemText begin /TextFill ItemFillColor store end end } forall } if 10 cfSDISize cfButtonSize 2 div add add dup cancel_but /ItemHeight get 4 mul /move appref send cancel_but /ItemHeight get 4 mul appref /ItemHeight get 10 add add /move apptoadd send 10 cfSDISize cfButtonSize 2.1 mul add add gsave TIFnt setfont (Application type is) stringbbox grestore pop 3 1 roll pop pop add cancel_but /ItemHeight get 3 mul /move filetype send end % items end % ExpressDict } def { 30 cfSDISize cfButtonSize cfTISize add add add 30 cfSDISize BorderTop BorderBottom add add add calc_wincoords reshape } configwin send poscfitems %% End Configure Apps %%%%%%%%%%%%%%%%%%%%% %% Express Menu Stuff %%%%%%%%%%%%%%%%%%%%% /ExpressDefaultMenu LitePullRightMenu def /configure % Save current SDI and ExpressMenu settings and { % display the EXPRESS Configuration Control Panel pause ExpressDict begin /SaveSDIData /getdata items /appsSDI get send store /SaveMenuItems ExpressMenu /MenuItems get store /SaveMenuKeys ExpressMenu /MenuKeys get store /SaveMenuActions ExpressMenu /MenuActions get store /cpitemsEM cpitems forkitems store { totop map } cp send end % ExpressDict } def /ExpressMenu % Create default EXPRESS menu [ (Terminal) { (psterm -t sun -f) forkunix } (~~~~~~~~~~~~~) {} (Cancel) {} (~~~~~~~~~~~~~) {} (About Express) ExpressDict /about_express get (Configure Express) ExpressDict /configure get (Disable Express) { ExpressDict begin itemsEM null ne { itemsEM killprocess } if hkitemsEM null ne { hkitemsEM killprocess } if end % ExpressDict ExpressDict { ExpressDict exch undef } forall systemdict /ExpressDict undef HotKey unbindkey keyboardtype 3 eq % deactivate Left key { systemdict /keyboard_positions get /LeftMeta [ 120 systemdict /UI_private get /keyStation get exec /shift_key ] put } if } ] /new ExpressDefaultMenu send def pause % Just Being Nice /adjustmenu % - > - Customize the look of ExpressMenu { { ColorDisplay? { /MenuBorderColor ColorDict /MediumBlue get def /MenuFillColor ColorDict /LightBlue get def /MenuTextColor ColorDict /Blue get def } if /MenuFont ExpressDict /MenFnt get def /Frame 3 def /reshape { MenuGSave framebuffer setcanvas 10 0 Border ArrayWidth ArrayHeight rrectpath MenuCanvas reshapecanvas /rtarr /rtarr_m MenuCanvas setstandardcursor grestore } def /PaintBox % [color] value => - { dup null ne { MenuItems exch get begin X Y W H end rectpath dup type /colortype ne { MenuTextColor } if setcolor stroke } { pop } ifelse } def /PaintMenuValue { MenuGSave MenuFillColor PaintedValue PaintBox MenuTextColor MenuValue PaintBox /PaintedValue MenuValue store grestore } def /PaintMenuFrame { MenuFillColor fillcanvas Frame 0 ne { MenuBorderColor setcolor Frame 10 0 Border ArrayWidth ArrayHeight rrectframe eofill } if } def } ExpressMenu send } def %% End Menu Stuff pause adjustmenu createfile? % create the defaults file (.expressapps) if it doesn't exist { writefile [] [] } { % otherwise, load in the stored applications pause 0 1 UserMenuKeys length 1 sub { dup UserMenuKeys exch get dup { ObjectData length additem } items /appsSDI get send UserMenuActions 2 index get cvx /insertitem ExpressMenu send } for } ifelse setHotKey % activate the HotKey end % ExpressDict