;+ ; ; @file_comments ; ; @categories ; ; @param TOPID ; ; @param SELECTED ; ; @returns ; ; @uses ; ; @restrictions ; ; @examples ; ; @history ; ; @version ; $Id$ ; ; @todo seb ; ;- PRO rh_alldomains, topid, selected ; compile_opt idl2, strictarrsubs ; widget_control, topid, get_uvalue=top_uvalue widget_control, topid, update=0 ; selectedline=(*top_uvalue[1, findline(top_uvalue, 'linetype')])[selected] ; ; we get the size of the dimension id of this section ; dimvar = *top_uvalue[1, findline(top_uvalue, 'dimvar')] typedim = *top_uvalue[1, findline(top_uvalue, 'typedim')] dimlist = *top_uvalue[1, findline(top_uvalue, 'dimlist')] sizedim = *top_uvalue[1, findline(top_uvalue, 'sizedim')] ; ; buttons to select type of line : odd, even or odd-even ; linechoicebase=widget_info(topid,find_by_uname = 'linechoicebase') id = widget_info(linechoicebase,find_by_uname = 'linechoice') IF id NE 0 THEN widget_control, id, /destroy choice = '' if (where(selectedline EQ 'odd'))[0] NE -1 then choice = [choice, 'odd'] if (where(selectedline EQ 'even'))[0] NE -1 then choice = [choice, 'even'] if (where(selectedline EQ 'odd-even'))[0] NE -1 then choice = [choice, 'odd-even'] choice = choice[1:n_elements(choice)-1] nothing = cw_bgroup(linechoicebase,choice, /row,/exclusive, /return_name, uname = 'linechoice', uvalue = {name:'linechoice'}) widget_control, nothing, set_value = 0 sensitive = bytarr(3) sensitive[where(['odd', 'even', 'odd-even'] eq choice[0])] = 1 ; ; odd points domain ; basedomainodd=widget_info(topid,find_by_uname = 'basedomainodd') id = widget_info(basedomainodd,find_by_uname = 'title') IF id NE 0 THEN widget_control, id, /destroy oddsecchoice = where(selectedline EQ 'odd') if oddsecchoice[0] NE -1 then BEGIN oddsecchoice = selected[oddsecchoice] nothing=widget_label(basedomainodd, value = 'Domain of the odd points', uname = 'title') IF n_elements(oddsecchoice) GT 1 THEN BEGIN selecteddim = dimvar[*, oddsecchoice] sorteddim = selecteddim FOR i = 0, n_elements(oddsecchoice)-1 DO $ sorteddim[*, i] = selecteddim[sortdim(typedim[selecteddim[*, i]]), i] zdim = sorteddim[2, *] sizedims = sizedim[zdim] sortedzdim = sort(sizedims) sizedims = sizedims[sortedzdim] oddsecchoice = oddsecchoice[sortedzdim] nothing=widget_droplist(basedomainodd,title = 'number of levels', value = strtrim(sizedims, 2), uvalue = {name:'oddsecchoice'}, uname='oddsecchoice') ENDIF domainpart, top_uvalue, basedomainodd, oddsecchoice[0] widget_control, basedomainodd, set_uvalue = oddsecchoice ENDIF ELSE BEGIN nothing=widget_label(basedomainodd, value = ' ', uname = 'title') domainpart, top_uvalue, basedomainodd, /destroy widget_control, basedomainodd, set_uvalue = -1 ENDELSE widget_control, basedomainodd, sensitive = sensitive[0] ; ; even points domain ; basedomaineven=widget_info(topid,find_by_uname = 'basedomaineven') id = widget_info(basedomaineven,find_by_uname = 'title') IF id NE 0 THEN widget_control, id, /destroy evensecchoice = where(selectedline EQ 'even') if evensecchoice[0] NE -1 then BEGIN evensecchoice = selected[evensecchoice] nothing=widget_label(basedomaineven, value = 'Domain of the even points', uname = 'title') IF n_elements(evensecchoice) GT 1 THEN BEGIN selecteddim = dimvar[*, evensecchoice] sorteddim = selecteddim FOR i = 0, n_elements(evensecchoice)-1 DO $ sorteddim[*, i] = selecteddim[sortdim(typedim[selecteddim[*, i]]), i] zdim = sorteddim[2, *] sizedims = sizedim[zdim] sortedzdim = sort(sizedims) sizedims = sizedims[sortedzdim] evensecchoice = evensecchoice[sortedzdim] nothing=widget_droplist(basedomaineven,title = 'number of levels', value = strtrim(sizedims, 2), uvalue = {name:'evensecchoice'}, uname='evensecchoice') ENDIF domainpart, top_uvalue, basedomaineven, evensecchoice[0] widget_control, basedomaineven, set_uvalue = evensecchoice ENDIF ELSE BEGIN domainpart, top_uvalue, basedomaineven, /destroy nothing=widget_label(basedomaineven, value = ' ', uname = 'title') widget_control, basedomaineven, set_uvalue = -1 ENDELSE widget_control, basedomaineven, sensitive = sensitive[1] ; ; odd-even points domain ; basedomainoddeven=widget_info(topid,find_by_uname = 'basedomainodd-even') id = widget_info(basedomainoddeven,find_by_uname = 'title') IF id NE 0 THEN widget_control, id, /destroy oddevensecchoice = where(selectedline EQ 'odd-even') if oddevensecchoice[0] NE -1 then BEGIN oddevensecchoice = selected[oddevensecchoice] nothing=widget_label(basedomainoddeven, value = 'Domain of the odd-even points', uname = 'title') IF n_elements(oddevensecchoice) GT 1 THEN BEGIN selecteddim = dimvar[*, oddevensecchoice] sorteddim = selecteddim FOR i = 0, n_elements(oddevensecchoice)-1 DO $ sorteddim[*, i] = selecteddim[sortdim(typedim[selecteddim[*, i]]), i] zdim = sorteddim[2, *] sizedims = sizedim[zdim] sortedzdim = sort(sizedims) sizedims = sizedims[sortedzdim] oddevensecchoice = oddevensecchoice[sortedzdim] nothing=widget_droplist(basedomainoddeven,title = 'number of levels', value = strtrim(sizedims, 2), uvalue = {name:'odd-evensecchoice'}, uname='odd-evensecchoice') ENDIF domainpart, top_uvalue, basedomainoddeven, oddevensecchoice[0] widget_control, basedomainoddeven, set_uvalue = oddevensecchoice ENDIF ELSE BEGIN domainpart, top_uvalue, basedomainoddeven, /destroy nothing=widget_label(basedomainoddeven, value = ' ', uname = 'title') widget_control, basedomainoddeven, set_uvalue = -1 ENDELSE widget_control, basedomainoddeven, sensitive = sensitive[2] ; case (where(sensitive EQ 1))[0] of 0:*top_uvalue[1, findline(top_uvalue, 'selected')] = oddsecchoice[0] 1:*top_uvalue[1, findline(top_uvalue, 'selected')] = evensecchoice[0] 2:*top_uvalue[1, findline(top_uvalue, 'selected')] = oddevensecchoice[0] endcase ; widget_control, topid, update=1 return end