Index: trunk/SRC/Colors/xpal.pro
===================================================================
--- trunk/SRC/Colors/xpal.pro	(revision 134)
+++ trunk/SRC/Colors/xpal.pro	(revision 136)
@@ -1,57 +1,37 @@
 ;+
 ;
-; @file_comments 
-; like xpalette but shorter to write and ,moreover,
+; @file_comments
+; like xpalette but shorter to write and, moreover,
 ; possess a hotkey save which (thanks to the newpalette routine)
 ; allows to save the routine that we have just done. Comment: when we
-; press the predefined hotkey, it calls xlct instead of xloadct 
+; press the predefined hotkey, it calls xlct instead of xloadct
 ; No explicit inputs.  The current color table is used as a starting point.
 ;
 ; @categories Color tables, widgets.
 ;
-; @keyword BLOCK Set this keyword to have XMANAGER block when this
-;		application is registered.  By default the Xmanager
-;               keyword NO_BLOCK is set to 1 to provide access to the
-;               command line if active command 	line processing is available.
-;               Note that setting BLOCK for this application will cause
-;		all widget applications to block, not only this
-;		application.  For more information see the NO_BLOCK keyword
-;		to XMANAGER.
-; @keyword UPDATECALLBACK Set this keyword to a string containing the name of
-;               a user-supplied procedure that will be called when the color
-;               table is updated by XLOADCT.  The procedure may optionally
-;               accept a keyword called DATA, which will be automatically
-;               set to the value specified by the optional UPDATECBDATA
-;               keyword.
-; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be
-;               passed via the DATA keyword to the user-supplied procedure
-;               specified via the UPDATECALLBACK keyword, if any. If the
-;               UPDATECBDATA keyword is not set the value accepted by the
-;               DATA keyword to the procedure specified by UPDATECALLBACK
-;               will be undefined.
-;
-; @uses COLORS: Contains the current RGB color tables.
 ; @uses XP_COM: Private to this module.
 ;
-; @restrictions XPAL uses two colors from the current color table as
-;       drawing foreground and background colors. These are used
-;       for the RGB plots on the left, and the current index marker on
-;       the right. This means that if the user set these two colors
-;       to the same value, the XPAL display could become unreadable
-;       (like writing on black paper with black ink). XPAL minimizes
-;       this possibility by noting changes to the color map and always
-;       using the brightest available color for the foreground color
-;       and the darkest for the background. Thus, the only way
-;       to make XPAL's display unreadable is to set the entire color
-;       map to a single color, which is highly unlikely. The only side
-;       effect of this policy is that you may notice XPAL redrawing
-;       the entire display after you've modified the current color.
-;       This simply means that the change has made XPAL pick new
-;       drawing colors.
-;
-;       The new color tables are saved in the COLORS common and loaded
-;       to the display.
-;
-; @examples The XPAL widget has the following controls:
+; @restrictions
+; XPAL uses two colors from the current color table as
+; drawing foreground and background colors. These are used
+; for the RGB plots on the left, and the current index marker on
+; the right. This means that if the user set these two colors
+; to the same value, the XPAL display could become unreadable
+; (like writing on black paper with black ink). XPAL minimizes
+; this possibility by noting changes to the color map and always
+; using the brightest available color for the foreground color
+; and the darkest for the background. Thus, the only way
+; to make XPAL's display unreadable is to set the entire color
+; map to a single color, which is highly unlikely. The only side
+; effect of this policy is that you may notice XPAL redrawing
+; the entire display after you've modified the current color.
+; This simply means that the change has made XPAL pick new
+; drawing colors.
+;
+; The new color tables are saved in the COLORS common and loaded
+; to the display.
+;
+; @examples
+; The XPAL widget has the following controls:
 ;
 ;       Left:   Three plots showing the current Red, Green, and Blue vectors.
@@ -106,5 +86,5 @@
 ;                        3) The name of the file containing palettes.
 ;                        Comment: May follow instructions gave by the prompter.
-;                
+;
 ;
 ;       Three sliders (R, G, and B) that allow the user to modify the
@@ -125,7 +105,7 @@
 ;                          horizontally.
 ;
-; @history addaptation de xpalette pour ajouter un bouton save par
-;          Gima Nicolas (nglod@ipsl.jussieu.fr) et par Masson
-;          Sebastien (smlod@ipsl.jussieu.fr)
+; @history adaptation de xpalette pour ajouter un bouton save par
+;          Grima Nicolas (nglod\@ipsl.jussieu.fr) et par Masson
+;          Sebastien (smlod\@ipsl.jussieu.fr)
 ;
 ; $Id$
@@ -134,10 +114,11 @@
 ;
 ;+
-; @file_comments XP_NEW_COLORS: Choose the best foreground and background colors for the current
-;                color maps and set !P appropriately. Returns 1 if the colors changed,
-;                0 otherwise.
-;
-; @returns 1 or 0
-;- 
+; @file_comments
+; XP_NEW_COLORS: Choose the best foreground and background colors for
+; the current color maps and set !P appropriately.
+;
+; @returns
+; 1 if the colors changed, 0 otherwise.
+;-
 function XP_NEW_COLORS
 ;
@@ -162,4 +143,7 @@
 end
 
+;+
+; @hidden
+;-
 pro XP_ALERT_CALLER
 ;
@@ -187,6 +171,7 @@
 end
 ;+
-; @file_comments XP_XLCTCALLBACK:  For visuals with static colormaps, update the graphics
-;                after a change by XLOADCT.
+; @file_comments
+; XP_XLCTCALLBACK:  For visuals with static colormaps, update the graphics
+; after a change by XLOADCT.
 ;-
 pro XP_XLCTCALLBACK
@@ -201,4 +186,7 @@
 end
 
+;+
+; @hidden
+;-
 pro XP_REDRAW
 ;
@@ -216,5 +204,6 @@
 
 ;+
-; @file_comments XP_REPLOT: Re-draw the RGB plots. Type has the following possible values.
+; @file_comments
+; XP_REPLOT: Re-draw the RGB plots. Type has the following possible values.
 ;       - 'D': Draw the data part of all three plots
 ;       - 'F': draw all three plots
@@ -222,5 +211,5 @@
 ;       - 'G': Draw the data part of the Green plot
 ;       - 'B': Draw the data part of the Blue plot
-;- 
+;-
 pro XP_REPLOT, color_index, type
 ;
@@ -240,6 +229,6 @@
   save_x_s = !x.s
   save_y_s = !y.s
-  save_x_type = !x.type 
-  save_y_type = !y.type 
+  save_x_type = !x.type
+  save_y_type = !y.type
 
   !y.margin= [2, 2]
@@ -435,5 +424,5 @@
 
       7: goto, do_copy
-      8: BEGIN 
+      8: BEGIN
          COMMON basecommon,  bas212, bas222,  bas232
          base = WIDGET_BASE(/COLUMN, /FRAME)
@@ -476,5 +465,5 @@
   THEN BEGIN
     CASE uval OF
-     'ok' :BEGIN 
+     'ok' :BEGIN
         WIDGET_CONTROL, bas212, GET_VALUE = palname
         WIDGET_CONTROL, bas222, GET_VALUE = over
@@ -541,31 +530,33 @@
 ;+
 ;
-; @keyword group 
-;
-; @keyword BLOCK Set this keyword to have XMANAGER block when this
-;		application is registered.  By default the Xmanager
-;               keyword NO_BLOCK is set to 1 to provide access to the
-;               command line if active command 	line processing is available.
-;               Note that setting BLOCK for this application will cause
-;		all widget applications to block, not only this
-;		application.  For more information see the NO_BLOCK keyword
-;		to XMANAGER.
-; @keyword UPDATECALLBACK Set this keyword to a string containing the name of
-;               a user-supplied procedure that will be called when the color
-;               table is updated by XLOADCT.  The procedure may optionally
-;               accept a keyword called DATA, which will be automatically
-;               set to the value specified by the optional UPDATECBDATA
-;               keyword.
-; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be
-;               passed via the DATA keyword to the user-supplied procedure
-;               specified via the UPDATECALLBACK keyword, if any. If the
-;               UPDATECBDATA keyword is not set the value accepted by the
-;               DATA keyword to the procedure specified by UPDATECALLBACK
-;               will be undefined.
-;
-;-
-
-
-
+; @keyword group
+;
+; @keyword BLOCK
+; Set this keyword to have XMANAGER block when this
+; application is registered.  By default the Xmanager
+; keyword NO_BLOCK is set to 1 to provide access to the
+; command line if active command line processing is available.
+; Note that setting BLOCK for this application will cause
+; all widget applications to block, not only this
+; application.  For more information see the NO_BLOCK keyword
+; to XMANAGER.
+;
+; @keyword UPDATECALLBACK
+; Set this keyword to a string containing the name of
+; a user-supplied procedure that will be called when the color
+; table is updated by XLOADCT.  The procedure may optionally
+; accept a keyword called DATA, which will be automatically
+; set to the value specified by the optional UPDATECBDATA
+; keyword.
+;
+; @keyword UPDATECBDATA
+; Set this keyword to a value of any type. It will be
+; passed via the DATA keyword to the user-supplied procedure
+; specified via the UPDATECALLBACK keyword, if any. If the
+; UPDATECBDATA keyword is not set the value accepted by the
+; DATA keyword to the procedure specified by UPDATECALLBACK
+; will be undefined.
+;
+;-
 pro XPAL, group=group, BLOCK=block, UPDATECALLBACK=updt_cb_name, $
         UPDATECBDATA=updt_cb_data
@@ -584,13 +575,13 @@
 
   xpw = { xp_widgets, base:0L, $
-	colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L}
+  colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L}
 
   state = {old_p:!p, $                     ; Original value of !P
-	   mark_idx:0, $                   ; Current mark index
-	   cur_idx:0, $                    ; Current index
-	   cur_color_win:0, $              ; Current Color draw window index
-	   plot_win:0, $                   ; RGB plot draw window index
-	   updt_callback: updt_callback, $ ; user-defined callback (optional)
-	   p_updt_cb_data:p_updt_cb_data}  ; data for callback (optional)
+   mark_idx:0, $                   ; Current mark index
+   cur_idx:0, $                    ; Current index
+   cur_color_win:0, $              ; Current Color draw window index
+   plot_win:0, $                   ; RGB plot draw window index
+   updt_callback: updt_callback, $ ; user-defined callback (optional)
+   p_updt_cb_data:p_updt_cb_data}  ; data for callback (optional)
 
   if (XREGISTERED('XPAL')) then return      ; Only one copy at a time
@@ -610,10 +601,10 @@
   save_win = !d.window          ;Previous window
 
-  IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN	;If no common, use current colors
-	TVLCT, r_orig, g_orig, b_orig, /GET
-	r_curr = r_orig
-	b_curr = b_orig
-	g_curr = g_orig
-	ENDIF
+  IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors
+   TVLCT, r_orig, g_orig, b_orig, /GET
+   r_curr = r_orig
+   b_curr = b_orig
+   g_curr = g_orig
+  ENDIF
 
   ; Create widgets
@@ -631,22 +622,21 @@
 
   c1 = WIDGET_BASE(xpw.base, /COLUMN, space=20)
-    status = WIDGET_BASE(c1, /COLUMN, /FRAME)
-      ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE)
-      xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $
-			       xsize=20, /STRING)
-      xpw.mark_label = CW_FIELD(status, title='Mark Index:    ', value='0', $
-				xsize=20, /STRING)
-      c1_1 = widget_base(status, /ROW)
-	junk = WIDGET_LABEL(c1_1, value="Current Color: ")
-	  cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame)
-    names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $
-		'Switch Mark', 'Copy Current', 'Interpolate', 'save']
-    xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME)
-    xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG)
-
-    junk = WIDGET_BASE(xpw.base)        ; Responds to YOFFSET
+  status = WIDGET_BASE(c1, /COLUMN, /FRAME)
+  ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE)
+  xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $
+  xsize=20, /STRING)
+  xpw.mark_label = CW_FIELD(status, title='Mark Index:    ', value='0', $
+  xsize=20, /STRING)
+  c1_1 = widget_base(status, /ROW)
+  junk = WIDGET_LABEL(c1_1, value="Current Color: ")
+  cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame)
+  names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $
+  'Switch Mark', 'Copy Current', 'Interpolate', 'save']
+  xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME)
+  xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG)
+
+  junk = WIDGET_BASE(xpw.base)        ; Responds to YOFFSET
     if (version.style='Motif') then junk2=30 else junk2 = 50
     xpw.colorsel = CW_COLORSEL(junk, yoffset=junk2)
-
 
   state.cur_idx = 0
@@ -658,5 +648,5 @@
 
   WIDGET_CONTROL, ncw, $
-	set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL)
+ set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL)
   WIDGET_CONTROL, get_value=tmp, cur_color
   state.cur_color_win = tmp
@@ -672,5 +662,5 @@
 
   XMANAGER, 'Xpal', xpw.base, event_handler='XP_EVENT', group=group, $
-	NO_BLOCK=(NOT(FLOAT(block)))
-end
-
+  NO_BLOCK=(NOT(FLOAT(block)))
+end
+
