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

Last change on this file since 155 was 137, checked in by smasson, 18 years ago

review of Colors and Calendar routines

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