-+-+-+-+-+-+-+-+ START OF PART 51 -+-+-+-+-+-+-+-+ X(\252name\272)i(must)e(be)g(set)g(up)g(for)f(the)h(topology)e(drawer)i(to)f X(work.)23 b(Assuming)0 1644 y(these)12 b(hashtables)f(have)h(been)g(created) Vg X(the)f(following)e(code)j(may)g(be)g(used)f(to)g(create)h(and)g(display)e(a) Vi X(topology)d(diagram)j(of)0 1694 y(the)f(lamp)h(structure)e(network.)72 X1864 y Fi(/*)18 b(WS)h(is)f(the)h(workstation)h(identifier)f(*/)72 X1914 y(/*)f(TOPID)h(is)g(the)f(topology)i(identifier)f(*/)72 X2013 y(ptk_createtopology\(TO)q(PID,)i(ptk_stringtoint\("st)q(ructur)q(eid", V) Xg("lamp"\),)f(&err\);)72 2063 y(ptk_posttopology\(WS,)h(TOPID,)f(0.0\);)0 X2956 y Fq(13th)i(May)m(,)12 b(1992)636 b(44)839 b(2.01)p eop X%%Page: 45 46 Xbop 0 348 a Fj(Chapter)24 b(8)0 585 y Fs(The)29 b(PHIGS)g(Menus)h(Library)0 X834 y Fq(The)17 b(PHIGS)g(choice)h(input)d(device)i(provides)f(a)h(means)h X(for)f(creating)f(menus)i(within)d(an)i(application.)30 b(However)n(,)19 Xb(the)0 884 y(appearance)14 b(of)e(the)g(menus)h(is)f(dependent)g(on)g(the)g X(PHIGS)g(implementation)f(and)i(menu)f(items)h(are)g(often)e(restricted)h(to V) Xg(be)0 934 y(text)e(strings.)k(This)c(tool)f(provides)g(a)i(means)g(of)f X(creating)g(menus)h(implemented)f(using)f(PHIGS)i(structures)e(and)i(full)e X(support)0 984 y(is)i(given)g(for)g(menu)g(selection,)h(menu)f(editing)f(and V) Xh(menu)h(display)m(.)0 1062 y(The)g(module)f(provides)f(functions)g(for:)64 X1181 y Fl(\267)21 b Fq(Creating)10 b(`60box')g(menus,)j(whose)e(items)h(may) Vf X(be)h(textual)e(or)h(instances)h(of)f(structure)g(networks.)64 X1264 y Fl(\267)21 b Fq(Creating)10 b(menus)i(whose)f(items)h(are)g(arbitrary V) Xe(PHIGS)i(structures.)64 1346 y Fl(\267)21 b Fq(Creating)10 Xb(special)i(menus)g(called)f(`60rotators'.)64 1429 y Fl(\267)21 Xb Fq(Selecting)11 b(menu)g(items)h(using)e(locator)n(,)h(pick)g(or)g(string) Vf X(input)g(devices.)64 1511 y Fl(\267)21 b Fq(Comtrolling)8 b(the)j(visibility V) Xd(and)k(priority)d(of)i(menus.)0 1630 y(There)h(are)g(three)g(dif)o(ferent)e X(types)h(of)g(PHIGS)h(menus:)j(`60Box)10 b(Menus',)i(`60User)f(Menus')h(and) Vf X(`60Rotators')f(`5B8)o(`5D.)0 1798 y Fr(8.1)59 b(Box)17 b(menus)0 X1919 y Fq(Box)11 b(Menu)h(items)h(may)f(be)h(a)f(text)g(string)e(or)i(a)h X(structure)e(network,)h(and)g(the)g(menu)h(items)f(are)h(arranged)f X(according)g(to)f(the)0 1969 y(`60menu)f(path'.)15 b(This)10 Xb(is)f(de\256ned)i(in)e(the)h(same)h(way)g(as)f(the)g(PHIGS)g(text)f(path,)i X(and)f(may)g(be)h(UP)-5 b(,)10 b(DOWN,)h(LEFT)g(or)f(RIGHT)m(.)0 X2019 y(Figure)g(8.1)g(shows)g(four)g(Box)f(Menus)h(created)i(with)d(dif)o X(ferent)g(paths.)15 b(The)c(cross)g(indicates)f(the)g(top-left)e(corner)j(of V) Xe(the)i(\256rst)0 2069 y(menu)h(item.)0 2237 y Fr(8.2)59 b(User)16 Xb(menus)0 2359 y Fq(In)d(a)i(User)f(Menu,)h(each)g(item)e(is)h(de\256ned)g X(by)g(a)g(structure)f(identi\256er)n(.)22 b(The)14 b(size,)i(position)11 Xb(and)j(attributes)e(of)i(each)h(menu)0 2408 y(item)c(are)h(under)f(complete V) Xh(control)e(of)h(the)g(application.)0 2577 y Fr(8.3)59 b(Rotators)0 X2698 y Fq(A)12 b(special)g(form)g(of)f(user)h(menu)g(called)g(a)g(rotator)f X(is)g(also)h(provided)f(in)g(this)g(module.)16 b(Rotators)11 Xb(are)h(menus)h(which)e(consist)0 2748 y(of)g(a)h(number)f(of)g(arrows)g X(arranged)h(according)f(to)g(the)g(dimension)f(as)i(shown)f(in)g(Figure)g X(8.2.)912 2956 y(45)p eop X%%Page: 46 47 Xbop 0 -137 a Fq(PHIGS)11 b(T)m(oolkit)f(User)i(Manual)1235 Xb(PTK/100)470 190 y X 14619087 13052758 4604723 5920358 37890293 35522150 startTexFig X470 190 a X%%BeginDocument: mpath.ps Xsave /DEC_VAXGFX_save exch def Xgsave /pixel_matrix 72 300 div dup scale matrix currentmatrix def grestore X72 300 div dup scale X118 118 translate X/DEC_VAXGFX_dict 60 dict def DEC_VAXGFX_dict begin X10 dict dup begin /FontType 3 def /FontMatrix `5B 1.0 60.0 div X dup 0 exch 0 exch 0 0 `5D def X/Encoding 256 array def /FontBBox `5B0 0 60 60 `5Ddef 0 1 255 `7BEncoding ex Vch /.notdef X put `7D for XEncoding dup (1) 0 get /cross put dup (2) 0 get /d45 put dup X (3) 0 get /d135 put dup (4) 0 get /horiz put Xdup (5) 0 get /vert put dup (6) 0 get /d45w put dup (7) 0 get X /d135w put dup (8) 0 get /horizw put (9) 0 get /vertw put X/Metrics 10 dict def Metrics begin /.notdef 0 def /cross 60 def X /d45 60 def /d135 60 def X/horiz 60 def /vert 60 def /d45w 60 def /d135w 60 def /horizw X 60 def /vertw 60 def end X/BBox 10 dict def BBox begin /.notdef `5B0 0 0 0 `5D def /cross `5B0 0 59 59 V `5D def /d45 `5B0 0 59 59 `5D def X/d135 `5B0 0 59 59 `5D def /horiz `5B0 0 60 60 `5D def /vert `5B0 0 60 X 60 `5D def X/d45w `5B0 0 59 59 `5D def /d135w `5B0 0 59 59 `5D def X/horizw `5B0 0 60 60 `5D def /vertw `5B0 0 60 60 `5D def end X/CharacterDefs 10 dict def CharacterDefs begin /.notdef `7B`7D def X/horiz `7B0 15 59 `7Bdup newpath 0 exch moveto 60 exch lineto stroke X `7D for `7D def X/horizw `7B0 30 59 `7Bdup newpath 0 exch moveto 60 exch lineto stroke X `7D for `7D def X/vert `7B0 15 59 `7Bdup newpath 0 moveto 60 lineto stroke `7D for `7D def X/vertw `7B0 30 59 `7Bdup newpath 0 moveto 60 lineto stroke `7D for X `7D def X/d45 `7B15 15 59 `7Bdup newpath 0 exch moveto dup 59 exch sub 59 X lineto stroke Xdup 0 moveto 59 exch 59 exch sub lineto stroke `7D for newpath X 0 0 moveto 59 59 lineto stroke `7D def X/d135 `7B15 15 59 `7Bdup newpath 59 exch moveto dup 59 lineto stroke Xdup 59 exch sub 0 moveto 0 exch 59 exch sub lineto stroke `7D for X newpath 0 59 moveto 59 0 lineto stroke `7D def X/d45w `7B30 30 59 `7Bdup newpath 0 exch moveto dup 59 exch sub 59 X lineto stroke Xdup 0 moveto 59 exch 59 exch sub lineto stroke `7D for newpath 0 0 moveto 59 V 59 X lineto stroke `7D def X/d135w `7B 30 30 59 `7Bdup newpath 59 exch moveto dup 59 lineto stroke Xdup 59 exch sub 0 moveto 0 exch 59 exch sub lineto stroke `7D for X newpath 0 59 moveto 59 0 lineto stroke `7D def X/cross `7B 20 20 59 `7Bdup newpath 0 exch moveto dup 59 exch sub X 59 lineto stroke Xdup 0 moveto 59 exch 59 exch sub lineto stroke `7D for newpath X 0 0 moveto 59 59 lineto stroke X20 20 59 `7Bdup newpath 59 exch moveto dup 59 lineto stroke dup X 59 exch sub 0 moveto 0 exch 59 exch sub lineto stroke `7D for Xnewpath 0 59 moveto 59 0 lineto stroke `7D def end X/BuildChar `7B0 begin /char exch def /fontdict exch def /charname X fontdict /Encoding get char get def Xfontdict begin Metrics charname get 0 BBox charname get aload X pop setcachedevice `5B`5D 0 setdash 1 setlinewidth XCharacterDefs charname get exec end end `7D def /BuildChar load X 0 3 dict put Xend /DEC_VAXGFX_Hatchstyles exch definefont pop X/Currenthatch 1 string def X10 dict dup begin /FontType 3 def /FontMatrix `5B.001 0 0 .001 0 0 `5D def / VEncoding 256 array X def X/FontBBox `5B-500 -500 500 500`5D def 0 1 255 `7B Encoding exch /.notdef X put `7D for XEncoding dup 48 /dot put dup 49 /plus put dup 50 /star put dup X 51 /circle put dup 52 /cross put dup 53 /triangleup put Xdup 54 /square put dup 55 /diamond put dup 56 /triangledown put X dup 57 /bowtie put dup 58 /hourglass put Xdup 59 /solidtriangledown put dup 60 /solidtriangleup put dup X 61 /solidsquare put dup 62 /soliddiamond put Xdup 63 /solidcircle put dup 64 /solidhourglass put 65 /solidbowtie put X/Metrics 19 dict def Metrics begin /.notdef 0 def /dot 0 def X /plus 0 def /star 0 def X/circle 0 def /cross 0 def /triangleup 0 def /square 0 def /diamond X 0 def /triangledown 0 def X/bowtie 0 def /hourglass 0 def /solidtriangleup 0 def /solidtriangledown 0 d Vef /solidsquare 0 def X/soliddiamond 0 def /solidcircle 0 def /solidhourglass 0 def X /solidbowtie 0 def end X/BBox 19 dict def BBox begin /.notdef `5B0 0 0 0 `5D def /dot `5B-20 X -20 20 20 `5D def X/plus `5B-500 -500 500 500 `5D def /star `5B-500 -500 500 500 `5D def /circl Ve `5B-500 -500 500 500 `5D def /cross X `5B-500 -500 500 500 `5D def X/triangleup `5B-500 -433 500 433`5D def /square `5B-500 -500 500 500`5D X def /diamond `5B-500 -500 500 500`5D def X/triangledown `5B-500 -433 500 433`5D def /solidtriangleup `5B-500 X -433 500 433`5D def /solidtriangledown `5B-500 -433 500 433`5D def X/solidsquare `5B-500 -500 500 500`5D def /soliddiamond `5B-500 -500 X 500 500`5D def /solidcircle `5B-500 -500 500 500`5D def X/hourglass `5B-500 -500 500 500`5D def /solidhourglass `5B-500 -500 X 500 500`5D def /bowtie `5B-500 -500 500 500`5D def X/solidbowtie `5B-500 -500 500 500`5D def end X/CharacterDefs 19 dict def CharacterDefs begin /.notdef `7B`7D def X/dot `7B newpath 0 0 moveto 0 0 rlineto pixel_matrix setmatrix X 2 setlinewidth 1 setlinecap stroke `7D def X/plus `7B newpath 0 500 moveto 0 -500 lineto 500 0 moveto -500 0 lineto Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/star `7B newpath 0 500 moveto 0 -500 lineto 500 0 moveto -500 X 0 lineto 350 350 moveto -350 -350 lineto 350 -350 moveto X-350 350 lineto pixel_matrix setmatrix 1 setlinewidth stroke `7D def X/circle `7B newpath 0 0 500 0 360 arc closepath pixel_matrix setmatrix X 1 setlinewidth stroke `7D def X/solidcircle `7B newpath 0 0 500 0 360 arc closepath fill`7D def X/cross `7B newpath 500 500 moveto -500 -500 lineto 500 -500 moveto X -500 500 lineto Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/square `7B newpath -500 -500 moveto 500 -500 lineto 500 500 lineto X -500 500 lineto closepath Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/solidsquare `7B newpath -500 -500 moveto 500 -500 lineto 500 500 lineto -50 V0 500 lineto closepath fill`7D def X/diamond `7B newpath 0 -500 moveto 500 0 lineto 0 500 lineto -500 X 0 lineto closepath Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/soliddiamond `7B newpath 0 -500 moveto 500 0 lineto 0 500 lineto X -500 0 lineto closepath fill `7Ddef X/triangleup `7B newpath -500 -433 moveto 500 -433 lineto 0 433 X lineto closepath pixel_matrix setmatrix 1 setlinewidth stroke X `7Ddef X/solidtriangleup `7B newpath -500 -433 moveto 500 -433 lineto 0 X 433 lineto closepath fill `7Ddef X/triangledown `7B newpath -500 433 moveto 500 433 lineto 0 -433 lineto X closepath Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/solidtriangledown `7B newpath -500 433 moveto 500 433 lineto 0 X -433 lineto closepath fill `7D def X/hourglass `7B newpath 500 500 moveto -500 500 lineto 500 -500 lineto -500 - V500 lineto closepath Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/bowtie `7B newpath 500 500 moveto 500 -500 lineto -500 500 lineto X -500 -500 lineto closepath Xpixel_matrix setmatrix 1 setlinewidth stroke `7D def X/solidhourglass `7B newpath 500 500 moveto -500 500 lineto 500 -500 X lineto -500 -500 lineto closepath fill `7D def X/solidbowtie `7B newpath 500 500 moveto 500 -500 lineto -500 500 X lineto -500 -500 lineto closepath fill `7D def end X/BuildChar `7B 0 begin /char exch def /fontdict exch def /charname fontdict V /Encoding get char get def Xfontdict begin Metrics charname get 0 BBox charname get aload X pop setcachedevice CharacterDefs charname get exec Xend end `7D def /BuildChar load 0 3 dict put Xend /DEC_VAXGFX_Markers exch definefont pop Xsystemdict /setpacking known `7B/savepacking currentpacking def X true setpacking `7Dif X/m `7Bmoveto`7D bind def X/nmr `7B newpath gsave translate rotate 0 0 moveto `7D bind def X/sfnt `7B findfont exch scalefont setfont `7D bind def X/mfnt `7B findfont exch makefont setfont `7D bind def X/dh `7Bmark exch `7BCurrenthatch cvs pop eoclip newpath Xpixel_matrix setmatrix /DEC_VAXGFX_Hatchstyles findfont 60 scalefont X setfont clippath pathbbox newpath X4 2 roll 60 div floor exch 60 div floor exch 60 mul /y0 exch def dup /x1 exc Vh def X60 mul /x0 exch def x0 y0 moveto 60 div ceiling 60 mul exch 60 X div ceiling x1 sub cvi /nc exch def Xy0 exch 60 exch `7Bnc `7BCurrenthatch show `7Drepeat x0 exch moveto X `7Dfor `7D Xstopped pop cleartomark grestore `7Dbind def X/pl `7B moveto `7B rlineto `7D repeat stroke `7D bind def X /l `7B lineto `7D bind def /ls `7B lineto stroke `7D bind def /mls `7B X moveto rlineto stroke `7D bind def`20 X/n `7B newpath `7D bind def X/pth `7B`7Brlineto`7D repeat`7D bind def X/cry `7B /y0 exch def /x0 exch def /e1 (Cell array reached end-of-file) def V /t1 x0 7 add 8 div cvi string def Xx0 y0 1 `5B x0 0 0 y0 neg 0 y0 `5D `7B currentfile t1 readhexstring X not `7B e1 print `7D if `7D image `7D bind def X/vshow `7B /s1 exch def /y1 exch def /x1 exch def s1 0 1 getinterval X /t1 exch def t1 stringwidth 2 div exch 2 div exch rmoveto Xs1 `7B t1 exch 0 exch put gsave t1 stringwidth -2 div exch -2 div X exch rmoveto t1 show grestore Xx1 y1 rmoveto `7D forall newpath `7D bind def X/dpt `7Bmark 7 1 roll `7Beoclip /ph exch def /pw exch def newpath X moveto /t1 exch def rotate X/s1 90 t1 sub sin def `5B 1 0 t1 sin t1 cos div s1 mul s1 0 0 `5D concat cur Vrentpoint X /py exch def /px exch def Xclippath pathbbox newpath /y1 exch def /x1 exch def /y0 exch X def /x0 exch def X/x0 x0 px sub pw div floor pw mul px add def /y0 y0 py sub ph X div floor ph mul py add def X/nc x1 x0 sub pw div ceiling cvi def /nr y1 y0 sub ph div ceiling X cvi def X/x1 x0 pw nc mul add def /y1 y0 ph nr mul add def Xx0 y0 translate x1 x0 sub y1 y0 sub scale /x0 nc pcl mul def X /y0 nr prw mul def X/nc nc 1 sub def /nr prw 1 sub def /x1 0 def /y1 0 def x0 y0 8 `5B x0 0 0 y0 V neg 0 y0 `5D X`7Bpry y1 get x1 nc lt `7B/x1 x1 1 add def `7D`7B/x1 0 def y1 nr lt `7B/y1 X y1 1 add def `7D`7B/y1 0 def `7Difelse `7Difelse `7Dimage X`7Dstopped pop cleartomark grestore `7Dbind def X/rpt `7B /prw exch def /pcl exch def dup /s2 exch pcl mul 8 div X ceiling cvi string def /pry prw array def X8 eq `7B /f1 `7B pry nr get 0 s2 putinterval `7D def `7D `7B /f1 `7B /s1 X pry nr get def 0 1 pcl 1 sub X`7B /nc exch def s1 nc s2 nc 8 idiv get 1 7 nc 8 mod sub bitshift X and 0 eq `7B 0 `7D `7B 255 `7D ifelse put `7D for `7D def `7D ifelse X0 1 prw 1 sub `7B /nr exch def pry nr pcl string put currentfile s2 readhexs Vtring Xnot `7B (rpt reached end-of-file) print `7D if pop f1 `7D for `7D bind X def X/scl `7B /ccol exch def gray ccol get setgray `7D bind def X/sclrp `7B /t1 exch def gray exch t1 exch put t1 ccol eq `7B /ccol -1 def t1 V scl `7D if `7D bind def X/sm `7B /DEC_VAXGFX_Markers findfont exch scalefont /mf exch def X `7D def X/dm `7B mf setfont /mc exch def moveto mc show `7B rmoveto mc show X `7D repeat newpath `7D def X/om `7B mf setfont moveto show newpath `7D def Xsystemdict /setpacking known `7Bsavepacking setpacking `7Dif X/gray 2 array def X/ccol -1 def X1 0 sclrp X0 1 sclrp X1 scl X/dfl `7B eofill `7D def X1 setlinewidth Xsave /psl exch def Xsave /psl exch def Xinitclip 0 0 m 2314 0 l 2314 2314 l 0 2314 l clip n X0.000000 1 sclrp X231 1388 m X0 -208 X-440 0 X-11 -12 X463 0 X0 232 X5 pth Xdfl X231 1388 m X-440 0 +-+-+-+-+-+-+-+- END OF PART 51 +-+-+-+-+-+-+-+-