source: trunk/SRC/Colors/xpal.pro @ 231

Last change on this file since 231 was 231, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 21.2 KB
Line 
1; XP_NEW_COLORS: Choose the best foreground and background colors for
2; the current color maps and set !P appropriately.
3;+
4;
5; @returns
6; 1 if the colors changed, 0 otherwise.
7; @hidden
8;-
9;
10function xp_new_colors
11;
12  compile_opt idl2, strictarrsubs
13;
14  common xp_com, xpw, state
15
16  res = 0
17  junk = CT_LUMINANCE(dark=dark_col, bright=bright_col)
18
19  if (bright_col ne !p.color) then begin
20    !p.color = bright_col
21    res = 1
22  endif
23
24  if (dark_col ne !p.background) then begin
25    !p.background = dark_col
26    res = 1
27  endif
28
29  return, res
30end
31
32;+
33; @hidden
34;-
35pro xp_alert_caller
36;
37  compile_opt idl2, strictarrsubs
38;
39
40  common xp_com, xpw, state
41
42  ErrorStatus = 0
43  CATCH, ErrorStatus
44  if (ErrorStatus NE 0) then begin
45    CATCH, /CANCEL
46    v = DIALOG_MESSAGE(['Unexpected error in XPAL:', $
47                        '!ERR_STRING = ' + !ERR_STRING], $
48                        /ERROR)
49    return
50  endif
51  if (STRLEN(state.updt_callback) gt 0) then begin
52    if (PTR_VALID(state.p_updt_cb_data)) then begin
53      CALL_PROCEDURE, state.updt_callback, DATA=*(state.p_updt_cb_data)
54    endif else begin
55      CALL_PROCEDURE, state.updt_callback
56    endelse
57  endif
58end
59; XP_XLCTCALLBACK:  For visuals with static colormaps, update the graphics
60; after a change by XLOADCT.
61;+
62; @hidden
63;-
64pro xp_xlctcallback
65;
66  compile_opt idl2, strictarrsubs
67;
68  if ((COLORMAP_APPLICABLE(redrawRequired) GT 0) and $
69        (redrawRequired GT 0)) then begin
70    XP_REDRAW
71  endif
72
73end
74
75;+
76; @hidden
77;-
78pro xp_redraw
79;
80  compile_opt idl2, strictarrsubs
81;
82
83  common xp_com, xpw, state
84
85  junk = XP_NEW_COLORS()
86  WIDGET_CONTROL, xpw.colorsel, set_value=-1
87  XP_REPLOT, !p.color, 'F'        ; Update the plots of RGB
88  ; Let the caller of XPAL know that the color table was modified
89  XP_ALERT_CALLER
90end
91
92; XP_REPLOT: Re-draw the RGB plots. Type has the following possible values.
93;       - 'D': Draw the data part of all three plots
94;       - 'F': draw all three plots
95;       - 'R': Draw the data part of the Red plot
96;       - 'G': Draw the data part of the Green plot
97;       - 'B': Draw the data part of the Blue plot
98;+
99; @param color_index
100; ???
101; @param type
102; ???
103;
104; @hidden
105;-
106pro xp_replot, color_index, type
107;
108  compile_opt idl2, strictarrsubs
109;
110
111  common xp_com, xpw, state
112  common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
113  common pscale, r_x_s, r_y_s, g_x_s, g_y_s, b_x_s, b_y_s
114
115  ; Update the plots of RGB
116  save_win = !D.WINDOW
117  wset, state.plot_win
118  save_p_region = !p.region
119  save_x_margin = !x.margin
120  save_y_margin = !y.margin
121  save_x_s = !x.s
122  save_y_s = !y.s
123  save_x_type = !x.type
124  save_y_type = !y.type
125
126  !y.margin= [2, 2]
127  !x.margin= [6, 2]
128
129  if (type eq 'F') then begin
130    !p.region = [0,.6667, 1, 1]
131    plot,xstyle=2, ystyle=3, yrange=[0, 260], r_curr, title='Red'
132    r_x_s = !x.s
133    r_y_s = !y.s
134
135    !p.region = [0,.333, 1, .6667]
136    plot,/noerase, xstyle=2,ystyle=3, yrange=[0, 260], g_curr, title='Green'
137    g_x_s = !x.s
138    g_y_s = !y.s
139
140    !p.region = [0,0, 1, .333]
141    plot,/noerase, xstyle=2,ystyle=3, yrange=[0, 260], b_curr, title='Blue'
142
143    b_x_s = !x.s
144    b_y_s = !y.s
145  endif else begin
146    if ((type eq 'D') or (type eq 'R')) then begin
147      !p.region = [0,.6667, 1, 1]
148      !x.s = r_x_s
149      !y.s = r_y_s
150      oplot, r_curr, color=color_index
151    endif
152    if ((type eq 'D') or (type eq 'G')) then begin
153      !p.region = [0,.333, 1, .6667]
154      !x.s = g_x_s
155      !y.s = g_y_s
156      oplot, g_curr, color=color_index
157    endif
158    if ((type eq 'D') or (type eq 'B')) then begin
159      !p.region = [0,0, 1, .333]
160      !x.s = b_x_s
161      !y.s = b_y_s
162      oplot, b_curr, color=color_index
163    endif
164  endelse
165
166  empty
167  WSET, save_win
168  !p.region = save_p_region
169  !x.margin = save_x_margin
170  !y.margin = save_y_margin
171  !x.s = save_x_s
172  !y.s = save_y_s
173  !x.type = save_x_type
174  !y.type = save_y_type
175
176end
177
178
179
180; XP_CHANGE_COLOR:  Change current color. Type has the following possible values.
181;       - 'R': Change the R part of the current color
182;       - 'G': ...
183;       - 'B': ...
184;+
185;
186; @param type
187; ???
188; @param value
189; ???
190;
191; @hidden
192;-
193pro xp_change_color, type, value
194;
195  compile_opt idl2, strictarrsubs
196;
197  common xp_com, xpw, state
198  common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
199
200
201  cur_idx = state.cur_idx
202
203  XP_REPLOT, !p.background, type
204
205  if (type eq 'R') then r_curr[cur_idx] = value;
206  if (type eq 'G') then g_curr[cur_idx] = value;
207  if (type eq 'B') then b_curr[cur_idx] = value;
208
209  tvlct, r_curr[cur_idx], g_curr[cur_idx], b_curr[cur_idx], cur_idx
210
211  if (XP_NEW_COLORS()) then begin
212    ; Highlight the current position using the marker
213    WIDGET_CONTROL, xpw.colorsel, set_value=-1  ; Re-initialize
214    XP_REPLOT, !p.color, 'F'
215  endif else begin
216    XP_REPLOT, !p.color, type
217  endelse
218
219  ; For visuals with static colormaps, update the graphics
220  ; of the current color.
221  if ((COLORMAP_APPLICABLE(redrawRequired) GT 0) and $
222        (redrawRequired GT 0)) then begin
223    ; Mark new square
224    tmp = !D.WINDOW
225    wset, state.cur_color_win
226    erase, color=state.cur_idx
227    wset, tmp
228  endif
229
230  ; Let the caller of XPAL know that the color table was modified
231  xp_alert_caller
232
233end
234;+
235; @param event
236; ???
237; @hidden
238;-
239pro xp_button_event, event
240;
241  compile_opt idl2, strictarrsubs
242;
243
244   common xp_com, xpw, state
245   common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
246
247                                ; NOTE: The value of these tags depend on the order of the buttons
248                                ;     in the base.
249   case (event.value) of
250
251                                ; DONE
252      0: begin
253         empty
254         r_orig = r_curr & g_orig = g_curr & b_orig = b_curr ;new orig color tbl
255         WIDGET_CONTROL, /DESTROY, event.top
256         !p = state.old_p
257      end
258
259                                ; PREDEFINED
260      1: xlct, /silent, group=xpw.base, UPDATECALLBACK='XP_XLCTCALLBACK'
261
262                                ; HELP
263      2: XDisplayFile, FILEPATH("xpal.txt", subdir=['help', 'widget']), $
264       TITLE = "Xpal Help", GROUP = event.top, WIDTH = 55, HEIGHT = 16
265
266                                ; REDRAW
267      3: XP_REDRAW
268
269                                ; SET MARK
270      4: begin
271         state.mark_idx = state.cur_idx
272         WIDGET_CONTROL, xpw.mark_label, $
273          set_value=strcompress(state.mark_idx, /REMOVE)
274      end
275
276                                ; SWITCH MARK
277      5 : if (state.mark_idx ne state.cur_idx) then begin
278         tmp = state.mark_idx
279         state.mark_idx = state.cur_idx
280         state.cur_idx = tmp
281         WIDGET_CONTROL, xpw.colorsel, set_value=tmp
282         WIDGET_CONTROL, xpw.idx_label, $
283          set_value=strcompress(state.cur_idx, /REMOVE)
284         WIDGET_CONTROL, xpw.mark_label, $
285          set_value=strcompress(state.mark_idx, /REMOVE)
286      endif
287
288                                ; COPY CURRENT
289      6 : begin
290         do_copy:
291         cur_idx = state.cur_idx
292         if (state.mark_idx le cur_idx) then begin
293            s = state.mark_idx
294            e = cur_idx
295         endif else begin
296            s = cur_idx
297            e = state.mark_idx
298         endelse
299         n = e-s+1
300         XP_REPLOT, !p.background, 'D'
301         if (event.value eq 6) then begin
302            r_curr[s:e] = r_curr[cur_idx]
303            g_curr[s:e] = g_curr[cur_idx]
304            b_curr[s:e] = b_curr[cur_idx]
305         endif else begin       ; Interpolate
306            scale = findgen(n)/float(n-1)
307            r_curr[s:e] = r_curr[s] + (fix(r_curr[e]) - fix(r_curr[s])) * scale
308            g_curr[s:e] = g_curr[s] + (fix(g_curr[e]) - fix(g_curr[s])) * scale
309            b_curr[s:e] = b_curr[s] + (fix(b_curr[e]) - fix(b_curr[s])) * scale
310         endelse
311         tvlct, r_curr[s:e], g_curr[s:e], b_curr[s:e], s
312         if (XP_NEW_COLORS()) then begin
313            WIDGET_CONTROL, xpw.colorsel, SET_VALUE=-1
314            XP_REPLOT, !p.color, 'F'
315         endif else begin
316            XP_REPLOT, !p.color, 'D'
317         endelse
318                                ; Let the caller of XPAL know that the color table was modified
319         xp_alert_caller
320      end
321
322      7: goto, do_copy
323      8: BEGIN
324         COMMON basecommon,  bas212, bas222,  bas232
325         base = WIDGET_BASE(/COLUMN, /FRAME)
326         bas1 = WIDGET_LABEL(base, value = 'Save')
327         bas2 = WIDGET_BASE(base, /COLUMN)
328         bas21 = WIDGET_BASE(bas2, /COLUMN)
329         bas211 = WIDGET_LABEL(bas21, value = 'Palette Name : ')
330         bas212 = WIDGET_TEXT(bas21, value = 'Noname', /editable)
331         bas22 = WIDGET_BASE(bas2, /COLUMN)
332         bas221 = WIDGET_LABEL(bas22, value = ' Overwrite palette number : ')
333         bas222 = WIDGET_TEXT(bas22, value = '', /editable)
334         bas23 = WIDGET_BASE(bas2, /COLUMN)
335         bas231 = WIDGET_LABEL(bas23, value = 'file name : ')
336         bas232 = WIDGET_TEXT(bas23, value = 'palette.tbl', /editable)
337         bas3 = WIDGET_BASE(base, /ROW)
338         ok = WIDGET_BUTTON(bas3, value = 'OK',$
339                            /ALIGN_LEFT, /FRAME, UVALUE = 'ok')
340         cancel = WIDGET_BUTTON(bas3, value = 'CANCEL',$
341                                /ALIGN_RIGHT, /FRAME, UVALUE = 'cancel')
342         WIDGET_CONTROL, base, /REALIZE
343;         WIDGET_CONTROL, base, SET_UVALUE = drawID
344         XMANAGER,  'xp_button_event',  base
345
346
347
348      END
349      else:
350   endcase
351
352end
353
354;+
355; @hidden
356; @param ev
357; ???
358;-
359PRO xp_button_event_event, ev
360;
361  compile_opt idl2, strictarrsubs
362;
363COMMON basecommon,  bas212, bas222,  bas232
364  WIDGET_CONTROL, ev.id,  GET_UVALUE = uval
365  IF(TAG_NAMES(ev,  /STRUCTURE_NAME) EQ 'WIDGET_BUTTON')$
366  THEN BEGIN
367    CASE uval OF
368     'ok' :BEGIN
369        WIDGET_CONTROL, bas212, GET_VALUE = palname
370        WIDGET_CONTROL, bas222, GET_VALUE = over
371        WIDGET_CONTROL, bas232, GET_VALUE = fichname
372        if over[0] EQ '' then over = 255 ELSE over = long(over)
373         newpalette,palname[0], OVER = over[0], file = fichname[0]
374         WIDGET_CONTROL,  ev.top,  /DESTROY
375        END
376     'cancel': WIDGET_CONTROL,  ev.top,  /DESTROY
377    ENDCASE
378  ENDIF
379
380END
381
382
383
384
385;+
386; @param event
387; ???
388; @hidden
389;-
390
391pro xp_event, event
392;
393  compile_opt idl2, strictarrsubs
394;
395
396   common xp_com, xpw, state
397   common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
398
399   case (event.id) of
400
401      xpw.button_base: XP_BUTTON_EVENT, event
402
403      xpw.rgb_base: begin
404         cur_idx = state.cur_idx
405         if (event.r ne r_curr[cur_idx]) then XP_CHANGE_COLOR, "R", event.r
406         if (event.g ne g_curr[cur_idx]) then XP_CHANGE_COLOR, "G", event.g
407         if (event.b ne b_curr[cur_idx]) then XP_CHANGE_COLOR, "B", event.b
408      end
409
410      xpw.colorsel: begin
411         cur_idx = state.cur_idx
412         new_pos = event.value ne cur_idx
413                                ; Update the RBG sliders
414         if (event.value ne cur_idx) then begin
415            state.cur_idx = (cur_idx = event.value)
416            WIDGET_CONTROL, xpw.idx_label,  $
417             set_value=strcompress(cur_idx, /REMOVE_ALL)
418                                ; Mark new square
419            tmp = !D.WINDOW
420            wset, state.cur_color_win
421            erase, color=cur_idx
422            wset, tmp
423
424            WIDGET_CONTROL, xpw.rgb_base, $
425             set_value=[r_curr[cur_idx], g_curr[cur_idx], b_curr[cur_idx]]
426         endif
427      end
428
429      else:
430   endcase
431
432 END
433
434;+
435;
436; @file_comments
437; like xpalette but shorter to write and, moreover,
438; possess a hotkey save which (thanks to the newpalette routine)
439; allows to save the routine that we have just done. Comment: when we
440; press the predefined hotkey, it calls xlct instead of xloadct
441; No explicit inputs.  The current color table is used as a starting point.
442;
443; @categories
444; Color, Widget
445;
446; @uses XP_COM: Private to this module.
447;
448; @restrictions
449; XPAL uses two colors from the current color table as
450; drawing foreground and background colors. These are used
451; for the RGB plots on the left, and the current index marker on
452; the right. This means that if the user set these two colors
453; to the same value, the XPAL display could become unreadable
454; (like writing on black paper with black ink). XPAL minimizes
455; this possibility by noting changes to the color map and always
456; using the brightest available color for the foreground color
457; and the darkest for the background. Thus, the only way
458; to make XPAL's display unreadable is to set the entire color
459; map to a single color, which is highly unlikely. The only side
460; effect of this policy is that you may notice XPAL redrawing
461; the entire display after you've modified the current color.
462; This simply means that the change has made XPAL pick new
463; drawing colors.
464;
465; The new color tables are saved in the COLORS common and loaded
466; to the display.
467;
468; @examples
469; The XPAL widget has the following controls:
470;
471;       Left:   Three plots showing the current Red, Green, and Blue vectors.
472;
473;       Center: A status region containing:
474;               1) The total number of colors.
475;               2) The current color. XPAL allows changing
476;                  one color at a time. This color is known as
477;                  the "current color" and is indicated in the
478;                  color spectrum display with a special marker.
479;               3) The current mark index. The mark is used to
480;                  remember a color index. It is established by
481;                  pressing the "Set Mark Button" while the current
482;                  color index is the desired mark index.
483;               4) The current color. The special marker used in
484;                  color spectrum display prevents the user from seeing
485;                  the color of the current index, but it is visible
486;                  here.
487;
488;               A panel of control buttons, which do the following when
489;               pressed:
490;
491;                 Done: Exits XPAL.
492;
493;           Predefined: Starts XLOADCT to allow selection of one of the
494;                       predefined color tables.
495;
496;                 Help: Supplies help information similar to this header.
497;
498;               Redraw: Completely redraws the display using the current
499;                       state of the color map.
500;
501;             Set Mark: Set the value of the mark index to the
502;                       current index.
503;
504;          Switch Mark: Exchange the mark and the current index.
505;
506;         Copy Current: Every color lying between the current
507;                       index and the mark index (inclusive) is given
508;                       the current color.
509;
510;          Interpolate: The colors lying between the current
511;                       index and the mark index are interpolated linearly
512;                       to lie between the colors of two endpoints.
513;                 save: Allows to save  the palette which is currently
514;                       on the screen. When we press this hotkey, there is a
515;                       widget who appear and ask:
516;                        1) the name of the palette we want to save.
517;                        2) The number of the palette we may want to erase
518;                        by the new palette. If there is not any number
519;                        specified, the new palette is add to elders.
520;                        3) The name of the file containing palettes.
521;                        Comment: May follow instructions gave by the prompter.
522;
523;
524;       Three sliders (R, G, and B) that allow the user to modify the
525;       current color.
526;
527;       Right:  A display which shows the current color map as a series of
528;               squares. Color index 0 is at the upper left. The color index
529;               increases monotonically by rows going left to right and top
530;               to bottom.  The current color index is indicated by a special
531;               marker symbol. There are 4 ways to change the current color:
532;                       1) Press any mouse button while the mouse
533;                          pointer is over the color map display.
534;                       2) Use the "By Index" slider to move to
535;                          the desired color index.
536;                       3) Use the "Row" Slider to move the marker
537;                          vertically.
538;                       4) Use the "Column" Slider to move the marker
539;                          horizontally.
540;
541; @keyword GROUP
542; The widget ID of the widget that calls xpal. When  this ID is
543; specified, a death of the caller results in a death of xpal
544;
545; @keyword BLOCK {default=1}
546; Set this keyword to have XMANAGER block when this
547; application is registered.  By default the Xmanager
548; keyword NO_BLOCK is set to 1 to provide access to the
549; command line if active command line processing is available.
550; Note that setting BLOCK for this application will cause
551; all widget applications to block, not only this
552; application.  For more information see the NO_BLOCK keyword
553; to XMANAGER.
554;
555; @keyword UPDATECALLBACK
556; Set this keyword to a string containing the name of
557; a user-supplied procedure that will be called when the color
558; table is updated by XLOADCT.  The procedure may optionally
559; accept a keyword called DATA, which will be automatically
560; set to the value specified by the optional UPDATECBDATA
561; keyword.
562;
563; @keyword UPDATECBDATA
564; Set this keyword to a value of any type. It will be
565; passed via the DATA keyword to the user-supplied procedure
566; specified via the UPDATECALLBACK keyword, if any. If the
567; UPDATECBDATA keyword is not set the value accepted by the
568; DATA keyword to the procedure specified by UPDATECALLBACK
569; will be undefined.
570;
571; @history
572; Adaptation of xpalette to add a save button by
573;          Grima Nicolas (nglod\@ipsl.jussieu.fr) and by Masson
574;          Sebastien (smlod\@ipsl.jussieu.fr)
575;
576; @version
577; $Id$
578;
579;-
580pro xpal, GROUP=group, BLOCK=block, UPDATECALLBACK=updt_cb_name, $
581        UPDATECBDATA=updt_cb_data
582;
583  compile_opt idl2, strictarrsubs
584;
585
586
587  common xp_com, xpw, state
588  common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
589
590  IF N_ELEMENTS(updt_cb_name) EQ 0 THEN updt_callback="" $
591                                 ELSE updt_callback=updt_cb_name
592  IF N_ELEMENTS(updt_cb_data) GT 0 THEN p_updt_cb_data=PTR_NEW(updt_cb_data) $
593                                 ELSE p_updt_cb_data=PTR_NEW()
594
595  xpw = { xp_widgets, base:0L, $
596  colorsel:0L, mark_label:0L, idx_label:0L, button_base:0L, rgb_base:0L}
597
598  state = {old_p:!p, $                     ; Original value of !P
599   mark_idx:0, $                   ; Current mark index
600   cur_idx:0, $                    ; Current index
601   cur_color_win:0, $              ; Current Color draw window index
602   plot_win:0, $                   ; RGB plot draw window index
603   updt_callback: updt_callback, $ ; user-defined callback (optional)
604   p_updt_cb_data:p_updt_cb_data}  ; data for callback (optional)
605
606  if (XREGISTERED('XPAL')) then return      ; Only one copy at a time
607
608  IF N_ELEMENTS(block) EQ 0 THEN block=0
609
610  on_error,2              ;Return to caller if an error occurs
611
612  nc = !d.table_size            ;# of colors avail
613  if nc eq 0 then message, "Device has static color tables.  Can't modify."
614  if (nc eq 2) then message, 'Unable to work with monochrome system.'
615
616  state.old_p = !p              ;Save !p
617  !p.noclip = 1                 ;No clipping
618  !p.color = nc -1              ;Foreground color
619  !p.font = 0                   ;Hdw font
620  save_win = !d.window          ;Previous window
621
622  IF N_ELEMENTS(r_orig) LE 0 THEN BEGIN ;If no common, use current colors
623   TVLCT, r_orig, g_orig, b_orig, /GET
624   r_curr = r_orig
625   b_curr = b_orig
626   g_curr = g_orig
627  ENDIF
628
629  ; Create widgets
630  xpw.base=WIDGET_BASE(title='Xpal', /ROW, space=30)
631  ; This is a little tricky. Setting the managed attribute indicates
632  ; our intention to put this app under the control of XMANAGER, and
633  ; prevents our draw widgets from becoming candidates for becoming
634  ; the default window on WSET, -1. XMANAGER sets this, but doing it here
635  ; prevents our own WSETs at startup from having that problem.
636  WIDGET_CONTROL, /MANAGED, xpw.base
637
638  version = WIDGET_INFO(/VERSION)
639  if (version.style='Motif') then junk=510 else junk = 580
640  plot_frame = WIDGET_DRAW(xpw.base, xsize=200, ysize=junk)
641
642  c1 = WIDGET_BASE(xpw.base, /COLUMN, space=20)
643  status = WIDGET_BASE(c1, /COLUMN, /FRAME)
644  ncw = WIDGET_LABEL(WIDGET_BASE(status), /DYNAMIC_RESIZE)
645  xpw.idx_label = CW_FIELD(status, title='Current Index: ', value='0', $
646  xsize=20, /STRING)
647  xpw.mark_label = CW_FIELD(status, title='Mark Index:    ', value='0', $
648  xsize=20, /STRING)
649  c1_1 = widget_base(status, /ROW)
650  junk = WIDGET_LABEL(c1_1, value="Current Color: ")
651  cur_color = WIDGET_DRAW(c1_1, xsize = 125, ysize=50, /frame)
652  names = [ 'Done', 'Predefined', 'Help', 'Redraw', 'Set Mark', $
653  'Switch Mark', 'Copy Current', 'Interpolate', 'save']
654  xpw.button_base = CW_BGROUP(c1, names, COLUMN=3, /FRAME)
655  xpw.rgb_base = CW_RGBSLIDER(c1, /FRAME, /DRAG)
656
657  junk = WIDGET_BASE(xpw.base)        ; Responds to YOFFSET
658    if (version.style='Motif') then junk2=30 else junk2 = 50
659    xpw.colorsel = CW_COLORSEL(junk, yoffset=junk2)
660
661  state.cur_idx = 0
662  state.mark_idx = 0
663
664  ; Position RGB slider appropriately
665  WIDGET_CONTROL, xpw.rgb_base, SET_VALUE=[r_curr[0], g_curr[0], b_curr[0]]
666  WIDGET_CONTROL, /REALIZE, xpw.base
667
668  WIDGET_CONTROL, ncw, $
669 set_value='Number Of Colors: ' + strcompress(!d.n_colors, /REMOVE_ALL)
670  WIDGET_CONTROL, get_value=tmp, cur_color
671  state.cur_color_win = tmp
672  WIDGET_CONTROL, get_value=tmp, plot_frame
673  state.plot_win = tmp
674
675
676  ; Update the plots of RGB
677  junk = XP_NEW_COLORS()
678  XP_REPLOT, !p.color, 'F'
679
680  WSET, save_win
681
682  XMANAGER, 'Xpal', xpw.base, event_handler='XP_EVENT', group=group, $
683  NO_BLOCK=(NOT(FLOAT(block)))
684end
685
Note: See TracBrowser for help on using the repository browser.