Ignore:
Timestamp:
07/10/06 17:20:19 (18 years ago)
Author:
pinsard
Message:

some improvements and corrections in some .pro file according to
aspell and idldoc log file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Colors/xpal.pro

    r134 r136  
    11;+ 
    22; 
    3 ; @file_comments  
    4 ; like xpalette but shorter to write and ,moreover, 
     3; @file_comments 
     4; like xpalette but shorter to write and, moreover, 
    55; possess a hotkey save which (thanks to the newpalette routine) 
    66; allows to save the routine that we have just done. Comment: when we 
    7 ; press the predefined hotkey, it calls xlct instead of xloadct  
     7; press the predefined hotkey, it calls xlct instead of xloadct 
    88; No explicit inputs.  The current color table is used as a starting point. 
    99; 
    1010; @categories Color tables, widgets. 
    1111; 
    12 ; @keyword BLOCK Set this keyword to have XMANAGER block when this 
    13 ;               application is registered.  By default the Xmanager 
    14 ;               keyword NO_BLOCK is set to 1 to provide access to the 
    15 ;               command line if active command  line processing is available. 
    16 ;               Note that setting BLOCK for this application will cause 
    17 ;               all widget applications to block, not only this 
    18 ;               application.  For more information see the NO_BLOCK keyword 
    19 ;               to XMANAGER. 
    20 ; @keyword UPDATECALLBACK Set this keyword to a string containing the name of 
    21 ;               a user-supplied procedure that will be called when the color 
    22 ;               table is updated by XLOADCT.  The procedure may optionally 
    23 ;               accept a keyword called DATA, which will be automatically 
    24 ;               set to the value specified by the optional UPDATECBDATA 
    25 ;               keyword. 
    26 ; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be 
    27 ;               passed via the DATA keyword to the user-supplied procedure 
    28 ;               specified via the UPDATECALLBACK keyword, if any. If the 
    29 ;               UPDATECBDATA keyword is not set the value accepted by the 
    30 ;               DATA keyword to the procedure specified by UPDATECALLBACK 
    31 ;               will be undefined. 
    32 ; 
    33 ; @uses COLORS: Contains the current RGB color tables. 
    3412; @uses XP_COM: Private to this module. 
    3513; 
    36 ; @restrictions XPAL uses two colors from the current color table as 
    37 ;       drawing foreground and background colors. These are used 
    38 ;       for the RGB plots on the left, and the current index marker on 
    39 ;       the right. This means that if the user set these two colors 
    40 ;       to the same value, the XPAL display could become unreadable 
    41 ;       (like writing on black paper with black ink). XPAL minimizes 
    42 ;       this possibility by noting changes to the color map and always 
    43 ;       using the brightest available color for the foreground color 
    44 ;       and the darkest for the background. Thus, the only way 
    45 ;       to make XPAL's display unreadable is to set the entire color 
    46 ;       map to a single color, which is highly unlikely. The only side 
    47 ;       effect of this policy is that you may notice XPAL redrawing 
    48 ;       the entire display after you've modified the current color. 
    49 ;       This simply means that the change has made XPAL pick new 
    50 ;       drawing colors. 
    51 ; 
    52 ;       The new color tables are saved in the COLORS common and loaded 
    53 ;       to the display. 
    54 ; 
    55 ; @examples The XPAL widget has the following controls: 
     14; @restrictions 
     15; XPAL uses two colors from the current color table as 
     16; drawing foreground and background colors. These are used 
     17; for the RGB plots on the left, and the current index marker on 
     18; the right. This means that if the user set these two colors 
     19; to the same value, the XPAL display could become unreadable 
     20; (like writing on black paper with black ink). XPAL minimizes 
     21; this possibility by noting changes to the color map and always 
     22; using the brightest available color for the foreground color 
     23; and the darkest for the background. Thus, the only way 
     24; to make XPAL's display unreadable is to set the entire color 
     25; map to a single color, which is highly unlikely. The only side 
     26; effect of this policy is that you may notice XPAL redrawing 
     27; the entire display after you've modified the current color. 
     28; This simply means that the change has made XPAL pick new 
     29; drawing colors. 
     30; 
     31; The new color tables are saved in the COLORS common and loaded 
     32; to the display. 
     33; 
     34; @examples 
     35; The XPAL widget has the following controls: 
    5636; 
    5737;       Left:   Three plots showing the current Red, Green, and Blue vectors. 
     
    10686;                        3) The name of the file containing palettes. 
    10787;                        Comment: May follow instructions gave by the prompter. 
    108 ;                 
     88; 
    10989; 
    11090;       Three sliders (R, G, and B) that allow the user to modify the 
     
    125105;                          horizontally. 
    126106; 
    127 ; @history addaptation de xpalette pour ajouter un bouton save par 
    128 ;          Gima Nicolas (nglod@ipsl.jussieu.fr) et par Masson 
    129 ;          Sebastien (smlod@ipsl.jussieu.fr) 
     107; @history adaptation de xpalette pour ajouter un bouton save par 
     108;          Grima Nicolas (nglod\@ipsl.jussieu.fr) et par Masson 
     109;          Sebastien (smlod\@ipsl.jussieu.fr) 
    130110; 
    131111; $Id$ 
     
    134114; 
    135115;+ 
    136 ; @file_comments XP_NEW_COLORS: Choose the best foreground and background colors for the current 
    137 ;                color maps and set !P appropriately. Returns 1 if the colors changed, 
    138 ;                0 otherwise. 
    139 ; 
    140 ; @returns 1 or 0 
    141 ;-  
     116; @file_comments 
     117; XP_NEW_COLORS: Choose the best foreground and background colors for 
     118; the current color maps and set !P appropriately. 
     119; 
     120; @returns 
     121; 1 if the colors changed, 0 otherwise. 
     122;- 
    142123function XP_NEW_COLORS 
    143124; 
     
    162143end 
    163144 
     145;+ 
     146; @hidden 
     147;- 
    164148pro XP_ALERT_CALLER 
    165149; 
     
    187171end 
    188172;+ 
    189 ; @file_comments XP_XLCTCALLBACK:  For visuals with static colormaps, update the graphics 
    190 ;                after a change by XLOADCT. 
     173; @file_comments 
     174; XP_XLCTCALLBACK:  For visuals with static colormaps, update the graphics 
     175; after a change by XLOADCT. 
    191176;- 
    192177pro XP_XLCTCALLBACK 
     
    201186end 
    202187 
     188;+ 
     189; @hidden 
     190;- 
    203191pro XP_REDRAW 
    204192; 
     
    216204 
    217205;+ 
    218 ; @file_comments XP_REPLOT: Re-draw the RGB plots. Type has the following possible values. 
     206; @file_comments 
     207; XP_REPLOT: Re-draw the RGB plots. Type has the following possible values. 
    219208;       - 'D': Draw the data part of all three plots 
    220209;       - 'F': draw all three plots 
     
    222211;       - 'G': Draw the data part of the Green plot 
    223212;       - 'B': Draw the data part of the Blue plot 
    224 ;-  
     213;- 
    225214pro XP_REPLOT, color_index, type 
    226215; 
     
    240229  save_x_s = !x.s 
    241230  save_y_s = !y.s 
    242   save_x_type = !x.type  
    243   save_y_type = !y.type  
     231  save_x_type = !x.type 
     232  save_y_type = !y.type 
    244233 
    245234  !y.margin= [2, 2] 
     
    435424 
    436425      7: goto, do_copy 
    437       8: BEGIN  
     426      8: BEGIN 
    438427         COMMON basecommon,  bas212, bas222,  bas232 
    439428         base = WIDGET_BASE(/COLUMN, /FRAME) 
     
    476465  THEN BEGIN 
    477466    CASE uval OF 
    478      'ok' :BEGIN  
     467     'ok' :BEGIN 
    479468        WIDGET_CONTROL, bas212, GET_VALUE = palname 
    480469        WIDGET_CONTROL, bas222, GET_VALUE = over 
     
    541530;+ 
    542531; 
    543 ; @keyword group  
    544 ; 
    545 ; @keyword BLOCK Set this keyword to have XMANAGER block when this 
    546 ;               application is registered.  By default the Xmanager 
    547 ;               keyword NO_BLOCK is set to 1 to provide access to the 
    548 ;               command line if active command  line processing is available. 
    549 ;               Note that setting BLOCK for this application will cause 
    550 ;               all widget applications to block, not only this 
    551 ;               application.  For more information see the NO_BLOCK keyword 
    552 ;               to XMANAGER. 
    553 ; @keyword UPDATECALLBACK Set this keyword to a string containing the name of 
    554 ;               a user-supplied procedure that will be called when the color 
    555 ;               table is updated by XLOADCT.  The procedure may optionally 
    556 ;               accept a keyword called DATA, which will be automatically 
    557 ;               set to the value specified by the optional UPDATECBDATA 
    558 ;               keyword. 
    559 ; @keyword UPDATECBDATA Set this keyword to a value of any type. It will be 
    560 ;               passed via the DATA keyword to the user-supplied procedure 
    561 ;               specified via the UPDATECALLBACK keyword, if any. If the 
    562 ;               UPDATECBDATA keyword is not set the value accepted by the 
    563 ;               DATA keyword to the procedure specified by UPDATECALLBACK 
    564 ;               will be undefined. 
    565 ; 
    566 ;- 
    567  
    568  
    569  
     532; @keyword group 
     533; 
     534; @keyword BLOCK 
     535; Set this keyword to have XMANAGER block when this 
     536; application is registered.  By default the Xmanager 
     537; keyword NO_BLOCK is set to 1 to provide access to the 
     538; command line if active command line processing is available. 
     539; Note that setting BLOCK for this application will cause 
     540; all widget applications to block, not only this 
     541; application.  For more information see the NO_BLOCK keyword 
     542; to XMANAGER. 
     543; 
     544; @keyword UPDATECALLBACK 
     545; Set this keyword to a string containing the name of 
     546; a user-supplied procedure that will be called when the color 
     547; table is updated by XLOADCT.  The procedure may optionally 
     548; accept a keyword called DATA, which will be automatically 
     549; set to the value specified by the optional UPDATECBDATA 
     550; keyword. 
     551; 
     552; @keyword UPDATECBDATA 
     553; Set this keyword to a value of any type. It will be 
     554; passed via the DATA keyword to the user-supplied procedure 
     555; specified via the UPDATECALLBACK keyword, if any. If the 
     556; UPDATECBDATA keyword is not set the value accepted by the 
     557; DATA keyword to the procedure specified by UPDATECALLBACK 
     558; will be undefined. 
     559; 
     560;- 
    570561pro XPAL, group=group, BLOCK=block, UPDATECALLBACK=updt_cb_name, $ 
    571562        UPDATECBDATA=updt_cb_data 
     
    584575 
    585576  xpw = { xp_widgets, base:0L, $ 
    586         colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L} 
     577  colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L} 
    587578 
    588579  state = {old_p:!p, $                     ; Original value of !P 
    589            mark_idx:0, $                   ; Current mark index 
    590            cur_idx:0, $                    ; Current index 
    591            cur_color_win:0, $              ; Current Color draw window index 
    592            plot_win:0, $                   ; RGB plot draw window index 
    593            updt_callback: updt_callback, $ ; user-defined callback (optional) 
    594            p_updt_cb_data:p_updt_cb_data}  ; data for callback (optional) 
     580   mark_idx:0, $                   ; Current mark index 
     581   cur_idx:0, $                    ; Current index 
     582   cur_color_win:0, $              ; Current Color draw window index 
     583   plot_win:0, $                   ; RGB plot draw window index 
     584   updt_callback: updt_callback, $ ; user-defined callback (optional) 
     585   p_updt_cb_data:p_updt_cb_data}  ; data for callback (optional) 
    595586 
    596587  if (XREGISTERED('XPAL')) then return      ; Only one copy at a time 
     
    610601  save_win = !d.window          ;Previous window 
    611602 
    612   IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors 
    613         TVLCT, r_orig, g_orig, b_orig, /GET 
    614         r_curr = r_orig 
    615         b_curr = b_orig 
    616         g_curr = g_orig 
    617         ENDIF 
     603  IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors 
     604   TVLCT, r_orig, g_orig, b_orig, /GET 
     605   r_curr = r_orig 
     606   b_curr = b_orig 
     607   g_curr = g_orig 
     608  ENDIF 
    618609 
    619610  ; Create widgets 
     
    631622 
    632623  c1 = WIDGET_BASE(xpw.base, /COLUMN, space=20) 
    633     status = WIDGET_BASE(c1, /COLUMN, /FRAME) 
    634       ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE) 
    635       xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $ 
    636                                xsize=20, /STRING) 
    637       xpw.mark_label = CW_FIELD(status, title='Mark Index:    ', value='0', $ 
    638                                 xsize=20, /STRING) 
    639       c1_1 = widget_base(status, /ROW) 
    640         junk = WIDGET_LABEL(c1_1, value="Current Color: ") 
    641           cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame) 
    642     names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $ 
    643                 'Switch Mark', 'Copy Current', 'Interpolate', 'save'] 
    644     xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME) 
    645     xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG) 
    646  
    647     junk = WIDGET_BASE(xpw.base)        ; Responds to YOFFSET 
     624  status = WIDGET_BASE(c1, /COLUMN, /FRAME) 
     625  ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE) 
     626  xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $ 
     627  xsize=20, /STRING) 
     628  xpw.mark_label = CW_FIELD(status, title='Mark Index:    ', value='0', $ 
     629  xsize=20, /STRING) 
     630  c1_1 = widget_base(status, /ROW) 
     631  junk = WIDGET_LABEL(c1_1, value="Current Color: ") 
     632  cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame) 
     633  names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $ 
     634  'Switch Mark', 'Copy Current', 'Interpolate', 'save'] 
     635  xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME) 
     636  xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG) 
     637 
     638  junk = WIDGET_BASE(xpw.base)        ; Responds to YOFFSET 
    648639    if (version.style='Motif') then junk2=30 else junk2 = 50 
    649640    xpw.colorsel = CW_COLORSEL(junk, yoffset=junk2) 
    650  
    651641 
    652642  state.cur_idx = 0 
     
    658648 
    659649  WIDGET_CONTROL, ncw, $ 
    660         set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL) 
     650 set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL) 
    661651  WIDGET_CONTROL, get_value=tmp, cur_color 
    662652  state.cur_color_win = tmp 
     
    672662 
    673663  XMANAGER, 'Xpal', xpw.base, event_handler='XP_EVENT', group=group, $ 
    674         NO_BLOCK=(NOT(FLOAT(block))) 
    675 end 
    676  
     664  NO_BLOCK=(NOT(FLOAT(block))) 
     665end 
     666 
Note: See TracChangeset for help on using the changeset viewer.