/* $Id: theme_mngr.aml,v 1.1 1995/04/06 00:43:03 markz released $ /*------------------------------------------------------------------------- /* Environmental Systems Research Institute /*------------------------------------------------------------------------- /* Program: THEME_MNGR.AML /* Purpose: Tool for manageing the list of current themes in a view. New /* themes can be added or existing themes can be querried, edited, /* deleted, or drawn in the selected order. /* /*------------------------------------------------------------------------- /* Usage: THEME_MNGR /* Usage: THEME_MNGR INIT {position} /* /* Arguments: routine - name of the routine to be called. /* position - menu position if the init routine is called /* /* Globals: .view$theme_list - List of themes in the current view /* .view$draw_list - Themes to be drawn for the current view /* .view$identifier - view name /* .view$active_theme - index number of the currently active theme /* .viewtmp$new_edits - Indicates whether the view has been edited /* .view$prjflag - Indicates mapproject environment active. /*------------------------------------------------------------------------- /* Calls: /*------------------------------------------------------------------------- /* Notes: The theme and draw lists contain two values for each theme /* (i.e., the list is in -PAIRS format). The first is the string /* containing the theme's name, the second is a unique integer /* value indicating essentially what array element it belongs to. /* e.g., 'major roads' 1 'hydro' 2 /* The [TOKEN] function is used to manage these lists. /*------------------------------------------------------------------------- /* Input: /* Output: /*------------------------------------------------------------------------- /* History: bernie szukalski 08/09/92 o.c. (as theme.aml and view.aml) /* bernie szukalski 09/02/92 standardized routines. /* Matt McGrath - 10/28/92 - Rewrite to implement scrolling lists /* of themes /* Matt McGrath - 07/14/93 - Use TOKEN function to manage lists /* Clayton Crawford - 12/15/93 - add scale of view /* John Calkins - 03/11/94 - added support to overpost detection /* John Calkins - 04/27/94 - documented HIDDEN TRICKS /*========================================================================= /* &args routine position arglist:rest /* &if [null %routine%] &then &set routine = init /* &call %routine% &return /*-------------- &routine INIT /*-------------- /* Display menu showing list of themes /* /* Clear any variables that may have been set &dv .theme_mngr$* /* /* Display view name in the menu &set .theme_mngr$viewname = [translate %.view$identifier%] /* /* Initialize the list of themes &set .theme_mngr$themelist = %.view$theme_list% &set .theme_mngr$drawlist = %.view$draw_list% /* Initialize menu icon and scroll list selections &if not [null %.view$active_theme%] &then &do &set .theme_mngr$icon = [value .theme%.view$active_theme%->class].icon &set string_pos ~ [token %.theme_mngr$themelist% -find %.view$active_theme%] - 1 &set .theme_mngr$cur_theme ~ [unquote [extract %string_pos% %.theme_mngr$themelist%]] &end &if ^ [null %.theme_mngr$drawlist%] &then /* SDBsn11705 &set .theme_mngr$cur_drawtheme [extract 1 %.theme_mngr$drawlist%] /* Check that the variable containing theme categories is set. This is /* used for creating new themes. &if [null [value .arctools$theme_categories]] &then &return .arctools$theme_categories not set /* /* Display the menu &if [null %position%] &then &set position = &ul &thread at$pulldown &ll /* /* Issue thread delete self if thread depth = 2 and input is tty &if [show &thread &depth] = 2 and [extract 1 [show &thread &stack]] = tty &then &set launch = &thread &delete &self &else &set launch /* &if not [show &thread &exists view$theme_mngr] &then &thread &create view$theme_mngr ~ &menu theme_mngr ~ &position [UNquote %position%] ~ &stripe 'Theme Manager' ~ &pinaction '&run theme_mngr cancel' /* %launch% /* &return /*------------------- &routine ACTIVE_THEME /*------------------- /* Make the currently selected theme the active one &if [null %.theme_mngr$cur_theme%] &then &return /* &set .view$active_theme = %.theme_mngr$cur_theme_val% &set .theme_mngr$icon = [value .theme%.view$active_theme%->class].icon &run tools close_unsupported_tools &thread &synchronize &others /* &return /*---------------------- &routine ADD_TO_DRAWLIST /*---------------------- /* Add a theme to the draw list /* &if [null %.theme_mngr$cur_theme%] &then &do &set .theme_mngr$msg = No themes to draw /*&run msinform init 'No themes to draw' &return &end /* &set updatelist = .FALSE. /* If the draw list is empty, add the theme &if [null %.theme_mngr$drawlist%] &then &set updatelist = .TRUE. /* &else ~ /* Check that the theme is not already in the draw list /* There is a unique integer value associated with each theme &if [token %.theme_mngr$drawlist% -find %.theme_mngr$cur_theme_val%] lt 1 ~ &then &set updatelist = .TRUE. &else &set .theme_mngr$msg = ~ [quote %.theme_mngr$cur_theme%] is already in the draw list &if %updatelist% &then &do &set .theme_mngr$cur_drawtheme = %.theme_mngr$cur_theme% &set .theme_mngr$cur_drawtheme_val = %.theme_mngr$cur_theme_val% &set .theme_mngr$drawlist = %.theme_mngr$drawlist% ~ [quote %.theme_mngr$cur_drawtheme%] %.theme_mngr$cur_drawtheme_val% &set .view$draw_list = %.theme_mngr$drawlist% &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited &end /* if /* &return /*--------------------------- &routine REMOVE_FROM_DRAWLIST /*--------------------------- /* Remove a theme from the draw list /* &if [null %.theme_mngr$cur_drawtheme%] &then &do &set .theme_mngr$msg = No themes in draw list /*&run msinform init 'No themes in draw list' &return &end /* /* Get the position of the theme value in the list &set val_pos = ~ [token %.theme_mngr$drawlist% -find %.theme_mngr$cur_drawtheme_val%] &set string_pos = %val_pos% - 1 &set .theme_mngr$drawlist = [token %.theme_mngr$drawlist% -delete %val_pos%] &set .theme_mngr$drawlist = [token %.theme_mngr$drawlist% -delete %string_pos%] &if [null %.theme_mngr$drawlist%] &then &set .theme_mngr$drawlist /* &set .view$draw_list = %.theme_mngr$drawlist% &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited &if [null %.theme_mngr$drawlist%] &then &do &set .theme_mngr$cur_drawtheme &set .theme_mngr$cur_drawtheme_val &end /* if /* &return /*-------------- &routine MOVE_UP /*-------------- /* Move a theme up one level in the draw list /* &if [null %.theme_mngr$cur_drawtheme%] &then &do &set .theme_mngr$msg = No themes in draw list &return &end /* /* Get the position of the theme in the list &set val_pos = ~ [token %.theme_mngr$drawlist% -find %.theme_mngr$cur_drawtheme_val%] &set string_pos = %val_pos% - 1 &if %val_pos% = 2 &then &do /* Can't go up any more &set .theme_mngr$msg = ~ Can't move [translate %.theme_mngr$cur_drawtheme%] up any more &return &end /* /* Else, continue &set newval_pos = %val_pos% - 2 &set newstring_pos = %string_pos% - 2 /* Switch first value &set .theme_mngr$drawlist = ~ [token %.theme_mngr$drawlist% -switch %newval_pos% %val_pos%] /* Switch second value &set .theme_mngr$drawlist = ~ [token %.theme_mngr$drawlist% -switch %newstring_pos% %string_pos%] /* &set .theme_mngr$cur_drawtheme = ~ [unquote [extract %newstring_pos% %.theme_mngr$drawlist%]] &set .theme_mngr$cur_drawtheme_val = ~ [extract %newval_pos% %.theme_mngr$drawlist%] /* &set .view$draw_list = %.theme_mngr$drawlist% &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited /* &return /*---------------- &routine MOVE_DOWN /*---------------- /* Move a theme down one level in the draw list /* &if [null %.theme_mngr$cur_drawtheme%] &then &do &set .theme_mngr$msg = No themes in draw list &return &end /* /* Get the position of the theme in the list &set val_pos = ~ [token %.theme_mngr$drawlist% -find %.theme_mngr$cur_drawtheme_val%] &set string_pos = %val_pos% - 1 &set nextpos = %val_pos% + 1 &if [token %.theme_mngr$drawlist% -count] lt %nextpos% &then &do /*Can't go down anymore in the list &set .theme_mngr$msg = ~ Can't move [translate %.theme_mngr$cur_drawtheme%] down any more &return &end /* /* Else, continue &set newval_pos = %val_pos% + 2 &set newstring_pos = %string_pos% + 2 /* Switch first value &set .theme_mngr$drawlist = ~ [token %.theme_mngr$drawlist% -switch %newval_pos% %val_pos%] /* Switch second value &set .theme_mngr$drawlist = ~ [token %.theme_mngr$drawlist% -switch %newstring_pos% %string_pos%] /* &set .theme_mngr$cur_drawtheme = ~ [unquote [extract %newstring_pos% %.theme_mngr$drawlist%]] &set .theme_mngr$cur_drawtheme_val = ~ [extract %newval_pos% %.theme_mngr$drawlist%] /* &set .view$draw_list = %.theme_mngr$drawlist% &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited /* &return /*-------------- &routine DRAW /*-------------- /* Draw the themes in the draw list &if [before [show DISPLAY] ,] eq 0 &then &return /* /* Leave this section like this. The mapview tool from the map layout /* system uses this routine to draw views in the map. If the view to /* be drawn is not currently active, then the drawlist variable does not /* exist, so check for its existence &set .theme_mngr$drawlist = %.view$draw_list% &if [null [value .theme_mngr$drawlist]] &then &do /*&run msinform init 'No themes in draw list' &set .theme_mngr$msg = No themes in draw list &return &end /* /*** HIDDEN TRICK - (not documented) *************************************** /* /* This is an undocumented feature that allows application programmers to /* tie into the drawing capabilities of the view environment. /* This assumes that .custom$predraw is set to an aml name or draw command. &if not [null [value .custom$predraw]] &then %.custom$predraw% /*************************************************************************** /* /* /* First, do stuff for drawing 3D surfaces &call 2d_3d_draw /* /* don't try to drape themes if observer is below surface &if %.view$class% = 3D &then &if %.view$cant_drape% &then &return /* /* First, clear the screen &call clear /* &if not [null %.view$draw_list%] &then &do i = 2 &to [token %.view$draw_list% -count] &by 2 &set index = [extract %i% %.view$draw_list%] &if [quote [unquote [extract 1 ~ [value .theme%index%->identifier]]]] eq '?' &then &type WARNING: Invalid theme. [value .theme%index%->identifier] &else &do &set driver [value .theme%index%->driver] &run %driver% import .theme%index%-> &run %driver% draw &run %driver% free /* del vars &end /* else &end /* do /* reset mapscale because screen/page may have been resized &set tmpfrmt [show &format] /* format because displayed in input field on &format 0 /* theme manager menu &set .view$mapscale [format '%1%' [show mapscale]] &format %tmpfrmt% /*** HIDDEN TRICK - (not documented) *************************************** /* /* This is an undocumented feature that allows application programmers to /* tie into the drawing capabilities of the view environment. /* This assumes that .custom$postdraw is set to an aml name or draw command. &if not [null [value .custom$postdraw]] &then %.custom$postdraw% /*************************************************************************** &return /*------------------- &routine DRAWSELECTED /*------------------- /* Draw the selected theme in the draw list &if [null %.theme_mngr$drawlist%] &then &do /*&run msinform init 'No themes in draw list' &set .theme_mngr$msg = No themes in draw list &return &end &if [null %.theme_mngr$cur_drawtheme%] &then &return /* /* Pass selected theme to drawcommands routine &set index = %.theme_mngr$cur_drawtheme_val% &if [quote [extract 1 [value .theme%index%->identifier]]] eq '?' &then &return WARNING: Invalid theme. [value .theme%index%->identifier] &else &do &set position = INDEX &set arglist = %index% &call drawcommands &end &return /*------------------- &routine DRAWCOMMANDS /*------------------- /* Draw a single specified theme. /* This routine looks in the position and arglist variable for the following: /* - If position = INDEX, then arglist contains the index value of the theme /* to draw. /* - If position = IDENTIFIER, then arglist contains a string holding the /* identifier of the theme to draw. /* /* As a result, this routine cann be called (with the appropriate arguments) /* from outside the theme manager to draw any theme in the open view. /* &if [before [show display] ,] eq 0 &then &return &if [null [value position]] &then &return /* /* First, do stuff for drawing 3D surfaces &call 2d_3d_draw /* /* Don't try to drape themes if observer is below surface &if %.view$class% = 3D &then &if %.view$cant_drape% &then &return /* /* Set index based on arglist and position vars &if [upcase %position%] = INDEX &then &set index = [unquote %arglist%] &else &if [upcase %position%] = IDENTIFIER &then &do &set fullid = [quote [unquote %arglist%]] /* use identifier to find index value &set string_pos = [token %.theme_mngr$themelist% -find %fullid%] &set index = [extract [calc %string_pos% + 1] %.theme_mngr$themelist%] &end &else &do &type Error: invalid keyword argument &return &end /* /* Draw the theme &do &set driver [value .theme%index%->driver] &run %driver% import .theme%index%-> draw &run %driver% free /* delete vars &end /* else /* &return /*------------------- &routine 2D_3D_CHOICE /*------------------- /* Disallow 3D when mapproject environment is active &if ( %.view$class% = 3D ) and %.view$prjflag% &then &do &set .view$class = 2D &set .theme_mngr$msg = 3D is non-functional with projections ON &return &end &if %.view$class% = 3D &then &do &if ^ [variable .senv$surface_name] &then &do &set .theme_mngr$msg No surface loaded in view... &set .view$class = 2D &set .view$sd = &return &end &else &if [extract 1 %.senv$surface_name%] eq '?' &then &do &set .view$class = 2D &set .view$sd = &run msinform init 'Current surface was not found. Check paths.'~ [quote %.senv$surface_name%] &return &end &set .view$sd = SURFACEDRAPE &end &else &set .view$sd = /* null &return /*----------------- &routine 2D_3D_DRAW /*----------------- /* Function: Establishes the correct environments for the next redraw /* based on the value of .view$class as set by VIEW.MENU: /* 2D - normal planimetric displays /* 3D - uses the APPLIED camera properties to drape an invisible /* locator mesh followed by draping each theme in the /* display list /* &select %.view$class% /* type of view for next redraw &when 2D &do &set .view$sd = /* draping deactivated &set .view$3d = .FALSE. /* public knowledge that display is 2D &end &when 3D &do &run surface update_surface &run camera %.cam$draw_routine% &if %.view$cant_drape% &then &do &set .view$3d = .FALSE. &return &end &else &set .view$3d = .TRUE. &set linsym [show linesymbol] LINESYMBOL 0 SURFACELIMITS [show maplimits] SURFACEDRAPE LOCATOR &if %linsym% <> 0 &then LINESYMBOL %linsym% &else LINESYMBOL [show symbolbreaks line first] &end &end &return /*-------------- &routine CLEAR /*-------------- /* Clear the screen /* SHADECOPY 1000 1010 &set origunits [show units] UNITS PAGE SHADETYPE COLOR SHADECOLOR 0 &set tempxmin [calc [extract 1 [show maplimits]] - .075] &set tempymin [calc [extract 2 [show maplimits]] - .075] &set tempxmax [calc [extract 3 [show maplimits]] + .075] &set tempymax [calc [extract 4 [show maplimits]] + .075] PATCH %tempxmin% %tempymin% %tempxmax% %tempymax% UNITS %origunits% SHADECOPY 1010 1000 /* Clear the overpost bitmap &if %.view$ovrpst_status% = ON &then OVERPOST CLEAR /*** HIDDEN TRICK - (not fully supported) ********************************** /* /* The following block of code can be uncommented to enable /* automatic redraws of pan/zoom windows. By always drawing graphics /* to a map composition, the pan/zoom windows will automatically redraw. /* The disadvantage is a small degradation in performance and potentially /* large map composition files (disk space). However, in some cases /* it is desirable to use the pan/zoom windows. This code is not /* integrated into any other location. As a result, using the /* PREVIEW buttons is not managed, nor is opening or closing views. /* Any time the DRAW or CLEAR buttons are executed will refresh the /* map composition. DRAW CHOICE does not clear the map composition. /* /* &if ^ [null [show map]] &then /* killmap xxmapcomp /* &if [exists xxmapcomp -dir] &then /* &s flag = [delete xxmapcomp -dir] /* map xxmapcomp /* /*************************************************************************** &return /*------------ &routine TOOLS /*------------ &if %.view$theme_count% ne 0 &then &run tools.aml init '&ul &display &ur' &else &run msinform init 'Unable to display theme tools.' ~ 'No themes have been defined.' &return /*----------------- &routine NEW_THEME /*----------------- /* Add a new theme &run newtheme init '&ul &thread view$theme_mngr &ll' /* &return /*------------------- &routine DELETE_THEME /*------------------- /* Drop the currently active theme from the current view... /* &if ^ [variable .view$identifier] &then &do &run msinform init 'Unable to drop theme. A view must be opened first.' &return &end /* &if [null %.theme_mngr$cur_theme%] &then &do &set .theme_mngr$msg = No themes to delete /*&run msinform init 'No themes to delete' &return &end /* &run msconfirm init .theme_mngr$continue ~ [quote Do you really want to drop theme [value .theme%.view$active_theme%->identifier]?] &if not %.theme_mngr$continue% &then &return /* /* Update drawlist &if not [null %.theme_mngr$drawlist%] &then &if [token %.theme_mngr$drawlist% -find %.theme_mngr$cur_theme_val%] gt 0 ~ &then &do &set .theme_mngr$cur_drawtheme = %.theme_mngr$cur_theme% &set .theme_mngr$cur_drawtheme_val = %.theme_mngr$cur_theme_val% &call remove_from_drawlist &end /* if /* /* Update themelist and icon &set val_pos = ~ [token %.theme_mngr$themelist% -find %.theme_mngr$cur_theme_val%] &set string_pos = %val_pos% - 1 &set .theme_mngr$themelist = ~ [token %.theme_mngr$themelist% -delete %val_pos%] &set .theme_mngr$themelist = ~ [token %.theme_mngr$themelist% -delete %string_pos%] &if [null %.theme_mngr$themelist%] &then &do &set .theme_mngr$themelist /* handle fact token delete last entry returns ' ' &set .theme_mngr$cur_theme &set .theme_mngr$cur_theme_val &set .theme_mngr$icon &end &else &do &set .theme_mngr$cur_theme = [unquote [extract 1 %.theme_mngr$themelist%]] &set .theme_mngr$cur_theme_val = [extract 2 %.theme_mngr$themelist%] &set .theme_mngr$icon [value .theme%.theme_mngr$cur_theme_val%->class].icon &end /* /* Delete lookup table if it exists &if not [null [value .theme%.view$active_theme%->lut]] &then &if [exists [value .theme%.view$active_theme%->lut] -INFO] &then &set mmc [delete [value .theme%.view$active_theme%->lut] -INFO] /* &dv .theme%.view$active_theme%->* &set .view$theme_list = %.theme_mngr$themelist% &set .view$draw_list = %.theme_mngr$drawlist% &set .view$active_theme = %.theme_mngr$cur_theme_val% &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited /* &return /*----------------- &routine EDIT_THEME /*----------------- /* Edit current theme parameters... /* &if [null %.theme_mngr$cur_theme%] &then &do &set .theme_mngr$msg = No themes to modify /*&run msinform init 'No themes to modify' &return &end &set index = %.view$active_theme% /* /* Keep track of the old identifier. If it has been changed, we must change /* the name in the theme list &set identifier = [value .theme%index%->identifier] /* &set driver [value .theme%index%->driver] &set menuposition = '&cl &screen &cl' &run %driver% import .theme%index%-> &run %driver% edit %menuposition% # &if %.arctools$cancel% &then &do &run %driver%.aml free &return /* return if edit was cancelled &end &else &run %driver% export .theme%index%-> /* &if [quote [value .theme%index%->identifier]] ne [quote %identifier%] &then /* The identifier has been changed &do /* Check that the new identifier doesn't match one in the current list &if [token %.theme_mngr$themelist% -find ~ [value .theme%index%->identifier]] gt 0 &then &do &until [token %.theme_mngr$themelist% -find ~ [quote [value .theme%index%->identifier]]] = 0 OR ~ [quote [value .theme%index%->identifier]] eq ~ [quote %identifier%] &set .theme_mngr$tmpname = [value .theme%index%->identifier] &run msresponse init .theme_mngr$tmpname ~ [quote Theme name [quote %.theme_mngr$tmpname%] already exists.]~ [quote Please specify a unique name.] &if not [null %.theme_mngr$tmpname%] &then &set .theme%index%->identifier = %.theme_mngr$tmpname% &end /* if do &set val_pos = ~ [token %.theme_mngr$themelist% -find %.theme_mngr$cur_theme_val%] &set string_pos = %val_pos% - 1 &set newid = [value .theme%index%->identifier] &set .theme_mngr$themelist = ~ [token %.theme_mngr$themelist% -replace %string_pos% [quote %newid%]] &set .theme_mngr$cur_theme %newid% /* /* Update draw list &if not [null %.theme_mngr$drawlist%] &then &do &set drawvalpos = [token %.theme_mngr$drawlist% -find %index%] &if %drawvalpos% <> 0 &then &do &set drawstringpos = %drawvalpos% - 1 &set .theme_mngr$drawlist = ~ [token %.theme_mngr$drawlist% -replace %drawstringpos% ~ [quote [value .theme%index%->identifier]]] &end &end /* if /* &set .view$theme_list = %.theme_mngr$themelist% /* must reset menu icon and .view$active_theme because renamed identifier may /* be duplicate and cause the first duplicate in the list to get selected &set .theme_mngr$icon [value .theme%.theme_mngr$cur_theme_val%->class].icon &set .view$active_theme = %.theme_mngr$cur_theme_val% &set .view$draw_list = %.theme_mngr$drawlist% &end /* if /* &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited &return /*---------------------- &routine DUPLICATE_THEME /*---------------------- /* Copy to ... /* &if [null %.theme_mngr$cur_theme%] &then &do &set .theme_mngr$msg = No themes to duplicate /*&run msinform init 'No themes to duplicate' &return &end /* &set curindex = %.theme_mngr$cur_theme_val% /* /* Get a new array index number for a new theme &set newindex = 0 /* This cycles through the array until it finds an available index number &do &until not [variable .theme%newindex%->class] &set newindex = %newindex% + 1 &end &set driver [value .theme%curindex%->driver] &run %driver% import .theme%curindex%-> &run %driver% export .theme%newindex%-> &run %driver% free &set curid = [value .theme%newindex%->identifier] /* Create a unique name for the copied object &set done = .FALSE. &set counter = 0 &do &while not %done% &set counter = %counter% + 1 &set newid = %curid%copy%counter% &if [token %.theme_mngr$themelist% -find %newid%] eq 0 &then &set done = .TRUE. &end &set .theme%newindex%->identifier = %newid% &set .theme_mngr$themelist = ~ %.theme_mngr$themelist% %newid% %newindex% &set .view$theme_list = %.theme_mngr$themelist% &set .view$active_theme %.theme_mngr$cur_theme_val% &set .viewtmp$new_edits = .TRUE. /* Indicate that the view has been edited &return /*---------------------- &routine CREATE_COVERAGE /*---------------------- &r create_cover init &return /*------------ &routine TABLE /*------------ /* Specify the items that are to be used for query operations /* &if [null %.theme_mngr$cur_theme%] &then &do &set .theme_mngr$msg = No themes to create item list for /*&run msinform init 'No themes to create item list for' &return &end &set index = %.view$active_theme% /* &select [translate [value .theme%index%->class]] &when POINT, LINE, POLY, NODE &set donothing &otherwise &do &run msinform init [quote Operation not valid on themes of class ~ [value .theme%index%->class]]~ [quote Valid classes are: POINT, LINE, POLY, NODE] &return &end &end &set cover = [value .theme%index%->data_source] &set type = [value .theme%index%->class] &run table_mngr init ~ %cover% %type% .theme_mngr$tmp_itemlist .theme%index%->itemlist &if %.arctools$cancel% &then &return &else &set .theme%index%->itemlist = %.theme_mngr$tmp_itemlist% &return /*------------------- &routine SET_MAPSCALE /*------------------- /* user entered map scale to use for drawing view /* &if [null %.view$mapscale%] &then &do &set .view$mapscale [show mapscale] &return &end MAPSCALE %.view$mapscale% &set .viewtmp$new_edits .TRUE. &call clear &call draw &return /*-------------- &routine CANCEL /*-------------- /* &run viewdriver exit /* viewdriver's exit calls theme_mngr exit &return /*----------- &routine HELP /*----------- &run disp_help theme_mngr &return /*-------------- &routine EXIT /*-------------- /* Cancel routine called by pull pin and 'Quit' button runs viewdriver's exit /* routine. Viewdriver calls this exit routine &if [show &thread &exists view$newtheme] &then &run newtheme exit &dv .theme_mngr$* &if [show &thread &exists view$theme_mngr] &then &thread &delete view$theme_mngr &return /*------------------- &routine BAILOUT /*------------------- &severity &error &ignore &severity &warning &ignore /*&call exit &return &warning An error has occurred in routine: %routine% (THEME_MNGR.AML)