pro SPD_UI_PROPAGATE_AXIS , state, apply_to_all_panels
compile_opt idl2, hidden
panelobjs = spd_ui_axis_options_getpanelobjs(state)
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
curraxissettings = spd_ui_axis_options_getaxis(state)
IF N_Elements(panelobjs) GT 0 && Obj_Valid(panelobjs[0]) THEN BEGIN
for i=0,n_elements(panelobjs)-1 do begin
if i ne state.axispanelselect then begin
temppanelobj = panelobjs[i]
case state.axisselect of
0: temppanelobj->getProperty,xaxis = newaxissettings
1: temppanelobj->getProperty,yaxis = newaxissettings
endcase
if apply_to_all_panels eq 0 then begin
currAxisSettings->getProperty,$
rangeOption=rangeOption,$
scaling=scaling,$
isTimeAxis=isTimeAxis,$
rangeMargin=rangeMargin,$
boundScaling=boundScaling,$
minBoundRange=minBoundRange, $
maxBoundRange=maxBoundRange, $
minFixedRange=minFixedRange, $
maxFixedRange=maxFixedRange
newAxisSettings->setProperty,$
rangeOption=rangeOption,$
scaling=scaling,$
isTimeAxis=isTimeAxis,$
rangeMargin=rangeMargin,$
boundScaling=boundScaling,$
minBoundRange=minBoundRange, $
maxBoundRange=maxBoundRange, $
minFixedRange=minFixedRange, $
maxFixedRange=maxFixedRange
endif
if apply_to_all_panels eq 1 then begin
currAxisSettings->getProperty,$
MajorTickEvery=majortickevery, $
MinorTickEvery=minortickevery, $
MajorTickUnits=majortickunits, $
MinorTickUnits=minortickunits, $
MajorTickAuto=majortickauto, $
MinorTickAuto=minortickauto, $
FirstTickAuto=firsttickauto, $
NumMajorTicks=nummajorticks, $
NumMinorTicks=numminorticks, $
FirstTickAt=firsttickat, $
FirstTickUnits=firsttickunits, $
TickStyle=tickstyle, $
BottomPlacement=bottomplacement, $
TopPlacement=topplacement, $
MajorLength=majorlength, $
MinorLength=minorlength, $
autoTicks=autoTicks, $
logminorticktype=logminorticktype
newAxisSettings->setProperty,$
MajorTickEvery=majortickevery, $
MinorTickEvery=minortickevery, $
MajorTickUnits=majortickunits, $
MinorTickUnits=minortickunits, $
MajorTickAuto=majortickauto, $
MinorTickAuto=minortickauto, $
FirstTickAuto=firsttickauto, $
NumMajorTicks=nummajorticks, $
NumMinorTicks=numminorticks, $
FirstTickAt=firsttickat, $
FirstTickUnits=firsttickunits, $
TickStyle=tickstyle, $
BottomPlacement=bottomplacement, $
TopPlacement=topplacement, $
MajorLength=majorlength, $
MinorLength=minorlength, $
autoTicks=autoTicks, $
logminorticktype=logminorticktype
endif
if apply_to_all_panels eq 2 then begin
currAxisSettings->getProperty,$
majorGrid=majorgrid, $
minorGrid=minorgrid
newAxisSettings->setProperty,$
majorGrid=(majorgrid->copy()), $
minorGrid=(minorgrid->copy())
currpanelobj->GetProperty, Settings=panelSettings
IF obj_valid(panelSettings) THEN panelSettings->GetProperty, framethick=framethick $
ELSE framethick=1
IF obj_valid(panelobjs[i]) THEN panelobjs[i]->GetProperty, Settings=newSettings
IF obj_valid(newSettings) THEN newSettings->SetProperty, framethick=framethick
endif
if apply_to_all_panels eq 3 then begin
currAxisSettings->getProperty,$
LineAtZero=lineatzero, $
showdate=showdate, $
DateString1=datestring1, $
DateString2=datestring2, $
DateFormat1=dateformat1, $
DateFormat2=dateformat2, $
AnnotateAxis=annotateaxis, $
PlaceAnnotation=placeannotation, $
AnnotateMajorTicks=annotatemajorticks, $
annotateEvery=annotateevery, $
annotateUnits=annotateunits, $
FirstAnnotation=firstannotation, $
FirstAnnotateUnits=firstannotateunits, $
annotateRangeMin=annotaterangemin, $
AnnotateRangeMax=annotaterangemax, $
AnnotateStyle=annotatestyle, $
annotateOrientation=annotateOrientation,$
annotateTextObject=annotateTextObject, $
annotateExponent=annotateExponent
newAxisSettings->setProperty,$
LineAtZero=lineatzero, $
showdate=showdate, $
DateString1=datestring1, $
DateString2=datestring2, $
DateFormat1=dateformat1, $
DateFormat2=dateformat2, $
AnnotateAxis=annotateaxis, $
PlaceAnnotation=placeannotation, $
AnnotateMajorTicks=annotatemajorticks, $
annotateEvery=annotateevery, $
annotateUnits=annotateunits, $
FirstAnnotation=firstannotation, $
FirstAnnotateUnits=firstannotateunits, $
annotateRangeMin=annotaterangemin, $
AnnotateRangeMax=annotaterangemax, $
AnnotateStyle=annotatestyle, $
annotateOrientation=annotateOrientation,$
annotateTextObject=(annotateTextObject->copy()),$
annotateExponent=annotateExponent
endif
if apply_to_all_panels eq 4 then begin
currAxisSettings->getProperty,$
titleObj=titleObj, $
subtitleObj=subtitleObj, $
placeTitle=placeTitle, $
titleorientation=titleorientation, $
titlemargin=titlemargin, $
lazytitles=lazytitles, $
showtitle=showtitle
newAxisSettings->getProperty, $
titleObj=oldtitleObj, $
subtitleObj=oldsubtitleObj
oldTitleStr = oldtitleObj->GetValue()
oldSubTitleStr = oldsubtitleObj->GetValue()
newTitle = titleObj->copy()
newSubTitle = subtitleObj->copy()
newTitle->setProperty, Value=oldTitleStr
newSubTitle->setProperty, Value=oldSubTitleStr
newAxisSettings->setProperty,$
titleObj=newTitle, $
subtitleObj=newSubTitle, $
placeTitle=placeTitle, $
titleorientation=titleorientation, $
titlemargin=titlemargin, $
lazytitles=lazytitles, $
showtitle=showtitle
endif
if apply_to_all_panels eq 5 then begin
currAxisSettings->getProperty,$
Orientation=orientation, $
Margin=margin, $
showLabels=showLabels, $
labels=labels, $
stackLabels=stackLabels, $
lazylabels=lazylabels, $
blackLabels=blackLabels, $
placeLabel=placeLabel
newAxisSettings->getProperty, labels=newlabels
if obj_valid(labels) && obj_isa(labels,'IDL_Container') && $
obj_valid(newlabels) && obj_isa(newlabels,'IDL_Container') then begin
labellist = labels->get(/all)
newlabellist = newlabels->get(/all)
if obj_valid(labellist[0]) && obj_valid(newlabellist[0]) then begin
for j=0, n_elements(newlabellist)-1 do begin
if j gt n_elements(labellist)-1 then break
if obj_valid(labellist[j]) then begin
labellist[j]->getProperty, font=lfont, format=lformat, color=lcolor, $
size=lsize, thickness=lthickness, show=lshow
newlabellist[j]->setProperty, font=lfont, format=lformat, color=lcolor, $
size=lsize, thickness=lthickness, show=lshow
endif
endfor
endif
endif else begin
endelse
newAxisSettings->setProperty,$
Orientation=orientation, $
Margin=margin, $
showLabels=showLabels, $
stackLabels=stackLabels, $
lazylabels=lazylabels, $
blackLabels=blackLabels, $
placeLabel=placeLabel
if ~blacklabels && showlabels && (state.axisselect eq 1) then temppanelobj->SyncLinesToLabels
endif
endif
endfor
ENDIF
end
pro spd_ui_update_axis_from_draw,drawObject,panels
compile_opt idl2,hidden
if obj_valid(panels) && panels->count() gt 0 then begin
panel_list = panels->get(/all)
for i = 0,n_elements(panel_list)-1 do begin
panel_list[i]->getProperty,xaxis=xaxis,yaxis=yaxis
info = drawObject->getPanelInfo(i)
if ~is_struct(info) then continue
xrange = info.xrange
if info.xscale eq 1 then begin
xrange = 10D^xrange
endif else if info.xscale eq 2 then begin
xrange = exp(xrange)
endif
xaxis->setProperty,$
minFixedRange=xrange[0],$
maxFixedRange=xrange[1]
xaxis->getProperty, autoticks=aestheticticks, majortickauto=majortickauto, $
majortickunits=majortickunits, istimeaxis=istime
if ~aestheticticks || ~majortickauto then begin
xaxis->setProperty,$
numMajorTicks=info.xmajorNum,$
numMinorTicks=info.xminorNum
endif
if majortickauto then begin
xmajorsize = ~istime ? info.xmajorsize : $
spd_ui_axis_options_convert_units(info.xmajorsize,majortickunits,/fromseconds)
xaxis->setProperty, majortickevery = xmajorsize
endif
yrange = info.yrange
if info.yscale eq 1 then begin
yrange = 10D^yrange
endif else if info.yscale eq 2 then begin
yrange = exp(yrange)
endif
yaxis->setProperty,$
minFixedRange=yrange[0],$
maxFixedRange=yrange[1]
yaxis->getProperty, autoticks=aestheticticks, majortickauto=majortickauto, $
majortickunits=majortickunits, istimeaxis=istime
if ~aestheticticks || ~majortickauto then begin
yaxis->setProperty,$
numMajorTicks=info.ymajorNum,$
numMinorTicks=info.yminorNum
endif
if majortickauto then begin
ymajorsize = ~istime ? info.ymajorsize : $
spd_ui_axis_options_convert_units(info.ymajorsize,majortickunits,/fromseconds)
yaxis->setProperty,majortickevery = ymajorsize
endif
endfor
endif
end
function spd_ui_axis_options_convert_units,value,units,fromseconds=fromseconds
compile_opt idl2, hidden
if units eq 0 then begin
conversion_factor = 1D
endif else if units eq 1 then begin
conversion_factor = 60D
endif else if units eq 2 then begin
conversion_factor = 60D*60D
endif else if units eq 3 then begin
conversion_factor = 60D*60D*24D
endif
if keyword_set(fromseconds) then begin
return,value/conversion_factor
endif else begin
return,value*conversion_factor
endelse
end
pro spd_ui_axis_options_init_color, state
compile_opt idl2, hidden
id = widget_info(state.tlb, find_by_uname='labelcolorwin')
widget_control, id, get_value=labelcolorwin
currlabelobj = spd_ui_axis_options_getcurrentlabel(state)
currlabelobj->getproperty, color=color
scene=obj_new('IDLGRSCENE', color=color)
labelcolorwin->setProperty,graphics_tree=scene
labelcolorwin->draw, scene
end
pro spd_ui_axis_update_units,state
compile_opt idl2, hidden
tlb=state.tlb
axissettings = spd_ui_axis_options_getaxis(state)
units = axisSettings->getUnits()
axissettings->GetProperty, majortickunits = majortickunits
if majorTickUnits ge n_elements(units) then begin
majorTickUnits = 0
axissettings->setProperty, majortickunits = majortickunits
endif
id = widget_info(tlb, find_by_uname = 'majortickunits')
widget_control, id, set_value = units
widget_control, id, set_combobox_select = majortickunits
axissettings->GetProperty, annotateunits=annotateunits
if annotateUnits ge n_elements(units) then begin
annotateUnits = 0
axissettings->setProperty, annotateUnits = annotateUnits
endif
id = widget_info(state.tlb, find_by_uname='annotateunits')
widget_control, id, set_value = units
widget_control, id, set_combobox_select=annotateunits
end
pro SPD_UI_INIT_AXIS_WINDOW ,tlb, state=state
compile_opt idl2, hidden
statedef = ~(~size(state,/type))
if ~statedef then begin
Widget_Control, tlb, Get_UValue=state, /No_Copy
endif else begin
tlb = state.tlb
endelse
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
axissettings = spd_ui_axis_options_getaxis(state)
tabid = widget_info(state.tlb, find_by_uname='tabs')
widget_control, tabid, update=0
panelObjs = spd_ui_axis_options_getpanelobjs(state)
if obj_valid(panelObjs[0]) then panelsExist = 1 else panelsExist = 0
IF Obj_Valid(axissettings) THEN BEGIN
axissettings->GetProperty, istimeaxis=istime
ENDIF ELSE BEGIN
axissettings=Obj_New("SPD_UI_AXIS_SETTINGS")
axissettings->GetProperty, istimeaxis=istime
ENDELSE
id = widget_info(tlb, find_by_uname = 'rangepaneldroplist')
widget_control, id, set_combobox_select = state.axispanelselect
FOR i=0,N_Elements(state.rangeOptions)-1 DO Widget_Control, state.rangeOptions[i], sensitive=(1 && panelsExist)
FOR i=0,N_Elements(state.scalingOptions)-1 DO Widget_Control, state.scalingOptions[i], sensitive = (1 && panelsExist)
axissettings->GetProperty,rangeoption=rangeoption
WIDGET_CONTROL, state.rangeoptions[rangeoption eq 2], /Set_Button
axissettings->GetProperty,scaling=scaling
WIDGET_CONTROL, state.scalingoptions[scaling], /Set_Button
styleValues = axisSettings->GetAnnotationFormats()
id = widget_info(state.tlb, find_by_uname='annotatestyle')
widget_control, id, set_value = styleValues
for j=0, n_elements(state.atype)-1 do widget_control, state.atype[j], sensitive=(1 && panelsExist)
axissettings->GetProperty, annotateExponent=annotateExponent
widget_control, state.atype[annotateExponent], set_button=1
minincrement = widget_info(state.tlb, find_by_uname='minincrement')
maxincrement = widget_info(state.tlb, find_by_uname='maxincrement')
widget_control, minIncrement, /destroy
widget_control, maxIncrement, /destroy
if scaling eq 0 then minvalue = !values.d_nan else minvalue = 0
minbase = widget_info(state.tlb, find_by_uname='minbase')
maxbase = widget_info(state.tlb, find_by_uname='maxbase')
minIncrement=spd_ui_spinner(minBase, Increment=1, text_box_size=24, $
uval='MINFIXEDRANGE', uname='minincrement', $
precision=13,min_value=minvalue)
maxIncrement=spd_ui_spinner(maxBase, Increment=1, text_box_size=24, $
uval='MAXFIXEDRANGE', uname='maxincrement', $
precision=13,min_value=minvalue)
id = widget_info(state.tlb, find_by_uname = 'rmincrement')
axissettings->GetProperty, rangemargin = rangemargin
widget_control, id, set_value = 100*rangemargin
id = widget_info(state.tlb, find_by_uname = 'boundscaling')
axissettings->GetProperty, boundscaling = boundscaling
widget_control, id, set_button = boundscaling
id = widget_info(state.tlb, find_by_uname = 'minboundrange')
axissettings->GetProperty, minboundrange = minboundrange
widget_control, id, set_value=minboundrange
id = widget_info(state.tlb, find_by_uname = 'maxboundrange')
axissettings->GetProperty, maxboundrange = maxboundrange
widget_control, id, set_value=maxboundrange
case rangeoption of
2: begin
id = widget_info(state.tlb, find_by_uname = 'aobase')
widget_control, id, sensitive = 0
id = widget_info(state.tlb, find_by_uname = 'fobase')
widget_control, id, sensitive = (1 && panelsExist)
id = widget_info(state.tlb, find_by_uname = 'minincrement')
axissettings->GetProperty, minfixedrange = minfixedrange
widget_control, id, set_value = minfixedrange
id = widget_info(state.tlb, find_by_uname = 'maxincrement')
axissettings->GetProperty, maxfixedrange = maxfixedrange
widget_control, id, set_value = maxfixedrange
end
else: begin
id = widget_info(state.tlb, find_by_uname = 'aobase')
widget_control, id, sensitive = (1 && panelsExist)
id = widget_info(state.tlb, find_by_uname = 'fobase')
widget_control, id, sensitive = 0
id = widget_info(state.tlb,find_by_uname = 'boundbase')
widget_control,id,sensitive=(boundscaling && panelsExist)
id = widget_info(state.tlb, find_by_uname = 'minincrement')
axissettings->GetProperty, minfixedrange = value
widget_control, id, set_value=value
id = widget_info(state.tlb, find_by_uname = 'maxincrement')
axissettings->GetProperty, maxfixedrange = value
widget_control, id, set_value=value
end
endcase
if istime then begin
minincrement = widget_info(state.tlb, find_by_uname='minincrement')
maxincrement = widget_info(state.tlb, find_by_uname='maxincrement')
widget_control, minIncrement, /destroy
widget_control, maxIncrement, /destroy
minbase = widget_info(state.tlb, find_by_uname='minbase')
maxbase = widget_info(state.tlb, find_by_uname='maxbase')
minIncrement=widget_text(minBase, /editable, uval='MINFIXEDRANGE', $
xsize=21, uname='minincrement',/all_events)
maxIncrement=widget_text(maxBase, /editable, uval='MAXFIXEDRANGE', $
xsize=21, uname='maxincrement',/all_events)
styleValues = axisSettings->GetAnnotationFormats()
id = widget_info(state.tlb, find_by_uname='annotatestyle')
widget_control, id, set_value = styleValues
for j=0, n_elements(state.atype)-1 do widget_control, state.atype[j], sensitive=0
id = widget_info(state.tlb, find_by_uname = 'minincrement')
axissettings->GetProperty, minfixedrange = minfixedrange
minfixedrangetime = formatDate(minfixedrange, '%date/%exacttime', 0)
widget_control, id, set_value=minfixedrangetime, sensitive=1
id = widget_info(state.tlb, find_by_uname = 'maxincrement')
axissettings->GetProperty, maxfixedrange = maxfixedrange
maxfixedrangetime = formatDate(maxfixedrange, '%date/%exacttime', 0)
widget_control, id, set_value=maxfixedrangetime, sensitive=1
endif
id = widget_info(tlb,find_by_uname = 'istime')
widget_control,id,set_button=istime, sensitive=panelsExist
axissettings->GetProperty, annotatestyle=annotatestyle
id = widget_info(state.tlb, find_by_uname='annotatestyle')
widget_control, id, set_combobox_select=annotatestyle, sensitive=panelsExist
widget_control, state.tlb,tlb_get_offset=off
widget_control, state.tlb, xoffset=off[0],yoffset=off[1]
widget_control, tabid, update=1
if state.axisselect eq 0 then begin
id = widget_info(state.tlb, find_by_uname='tabs')
if widget_info(id, /tab_current) eq 0 then begin
activeWindow = state.windowstorage->getactive()
activewindow->getproperty, locked=locked
if locked ne -1 && state.lockedMessageDisplayed eq 0 then begin
state.statusbar->update, $
'*Panels Are Locked: Changes to range are only displayed for the locked panel ("(L)" prefix).'
state.lockedMessageDisplayed=1
endif
endif
endif
id = widget_info(tlb, find_by_uname = 'bynumberbase')
widget_control, id, sensitive = panelsExist
id = widget_info(tlb, find_by_uname = 'byintervalbase')
widget_control, id, sensitive = panelsExist
axisSettings->GetProperty,autoticks=autoticks
id = widget_info(tlb,find_by_uname = 'niceticks')
widget_control,id,set_button=autoticks
id = widget_info(tlb, find_by_uname = 'tickpaneldroplist')
widget_control, id, set_combobox_select = state.axispanelselect
axissettings->GetProperty, majortickevery = majortickevery
id = widget_info(tlb, find_by_uname = 'majortickevery')
widget_control, id, set_value = majortickevery
spd_ui_axis_update_units,state
axissettings->GetProperty, nummajorticks = value
id = widget_info(tlb, find_by_uname = 'nummajorticks')
widget_control, id, set_value = value
axissettings->GetProperty, numminorticks = value
axissettings->GetProperty, majortickauto = majortickauto
bid = widget_info(tlb, find_by_uname = 'bynumber')
id = widget_info(tlb, find_by_uname = 'numberbase')
widget_control, bid, set_button = majortickauto
widget_control, id, sensitive = majortickauto
minortickbase = widget_info(state.tlb, find_by_uname='minortickbase')
if autoticks && majortickauto then widget_control, minorTickBase, sensitive=0 else widget_control, minorTickBase, sensitive=1
majortickbase = widget_info(state.tlb, find_by_uname='majortickbase')
if autoticks && majortickauto then widget_control, majorTickBase, sensitive=0 else widget_control, majorTickBase, sensitive=1
bid = widget_info(tlb, find_by_uname = 'byinterval')
id = widget_info(tlb, find_by_uname = 'intervalbase')
widget_control, bid, set_button = ~majortickauto
widget_control, id, sensitive = ~majortickauto
axissettings->GetProperty, numminorticks = value, autoticks=autoticks
if ~autoticks then begin
id = widget_info(tlb, find_by_uname = 'numminorticks')
widget_control, id, set_value = value
endif
if (state.axisselect eq 0) then begin
axisSettings->getproperty,minfixedrange=minrange_firsttickat,firsttickat=current_firsttickat
ts_firsttickat = time_struct(minrange_firsttickat)
default_firsttickat = time_double(num_to_str_pad(ts_firsttickat.year,4)+'-'+num_to_str_pad(ts_firsttickat.month,2)+'-'+num_to_str_pad(ts_firsttickat.date,2))
firsttickat = default_firsttickat > current_firsttickat
axisSettings->setProperty,firsttickat=firsttickat,/notouched
endif
axissettings->GetProperty, firsttickat = firsttickat
bid = widget_info(state.tlb, find_by_uname='firsttickatbase')
id = widget_info(tlb, find_by_uname = 'firsttickat')
if istime then begin
if widget_info(id,/type) ne 3 then begin
widget_control, id, /destroy
id = widget_text(bid, value=time_string(firsttickat), uname='firsttickat',/editable)
endif else widget_control, id, set_value = time_string(firsttickat)
endif else begin
if widget_info(id,/type) ne 0 then begin
widget_control, id, /destroy
id = spd_ui_spinner(bid, value=firsttickat, incr=1, uname='firsttickat', $
tooltip='Numerical location of first tick.', text_box=12)
endif else widget_control, id, set_value = firsttickat
endelse
axisSettings->getProperty,logMinorTickType=logMinorTickType
id = widget_info(tlb,find_by_uname='logminorticktype'+strtrim(logMinorTickType,2))
widget_control,id,/set_button
axisSettings->getProperty,scaling=scaling
id = widget_info(tlb,find_by_uname='logminorticktypebase')
if scaling eq 0 then begin
widget_control,id,sensitive=0
endif else begin
widget_control,id,sensitive=1
endelse
id = widget_info(tlb, find_by_uname = 'placeframebase')
widget_control, id, sensitive = panelsExist
id = widget_info(tlb, find_by_uname = 'lengthframebase')
widget_control, id, sensitive = panelsExist
axissettings->GetProperty, tickstyle = value
id = widget_info(tlb, find_by_uname = 'tickstyle')
widget_control, id, set_combobox_select=value, sensitive=panelsExist
axissettings->GetProperty, bottomplacement = value
id = widget_info(tlb, find_by_uname = 'bottomplace')
widget_control, id, set_button=value
axissettings->GetProperty, topplacement = value
id = widget_info(tlb, find_by_uname = 'topplace')
widget_control, id, set_button=value
axissettings->GetProperty, majorlength = value
id = widget_info(tlb, find_by_uname = 'majorlength')
widget_control, id, set_value=value
axissettings->GetProperty, minorlength = value
id = widget_info(tlb, find_by_uname = 'minorlength')
widget_control, id, set_value=value
id = widget_info(tlb, find_by_uname = 'gridpaneldroplist')
widget_control, id, set_combobox_select = state.axispanelselect
axissettings->GetProperty, majorgrid=majorgrid
if obj_valid(majorgrid) then begin
majorgrid->GetProperty,color=color
endif else begin
color = [0,0,0]
majorGrid = obj_new('SPD_UI_LINE_STYLE',color=color, show=0)
axissettings->SetProperty, majorgrid=majorgrid
endelse
majorcolorid = widget_info(state.tlb, find_by_uname='majorgridcolorwin')
Widget_Control, majorcolorid, Get_Value=majorgridcolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=color)
majorgridcolorWin->draw, scene
majorgrid->GetProperty, show=showmajor
id = widget_info(state.tlb, find_by_uname = 'majorbase')
widget_control, id, sensitive=showmajor
id = widget_info(state.tlb, find_by_uname = 'majorgrids')
widget_control, id, set_button=showmajor, sensitive=panelsExist
id = widget_info(state.tlb, find_by_uname = 'majorgridbtnlabel')
widget_control, id, sensitive = panelsExist
styleNames = majorgrid->getlinestyles()
majorgrid->GetProperty, id=styleid
id=widget_info(state.tlb, find_by_uname = 'majorgridstyle')
widget_control, id, set_combobox_select=styleid
majorgrid->GetProperty, thickness=thickness
id=widget_info(state.tlb, find_by_uname = 'majorgridthick')
widget_control, id, set_value = thickness
axissettings->GetProperty, minorgrid=minorgrid
if obj_valid(minorgrid) then begin
minorgrid->GetProperty,color=color
endif else begin
color = [0,0,0]
minorGrid = obj_new('spd_ui_line_style',color=color, show=0)
axissettings->SetProperty, minorgrid=minorgrid
endelse
minorcolorid = widget_info(state.tlb, find_by_uname='minorgridcolorwin')
Widget_Control, minorcolorid, Get_Value=minorgridcolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=color)
minorgridcolorWin->draw, scene
minorgrid->GetProperty, show=showminor
id = widget_info(state.tlb, find_by_uname = 'minorbase')
widget_control, id, sensitive=showminor
id = widget_info(state.tlb, find_by_uname = 'minorgrids')
widget_control, id, set_button=showminor, sensitive=panelsExist
id = widget_info(state.tlb, find_by_uname = 'minorgridbtnlabel')
widget_control, id, sensitive=panelsExist
styleNames = minorgrid->getlinestyles()
minorgrid->GetProperty, id=styleid
id=widget_info(state.tlb, find_by_uname = 'minorgridstyle')
widget_control, id, set_value=styleNames, set_combobox_select=styleid
minorgrid->GetProperty, thickness=thickness
id=widget_info(state.tlb, find_by_uname = 'minorgridthick')
widget_control, id, set_value = thickness
id = widget_info(tlb, find_by_uname = 'annopaneldroplist')
widget_control, id, set_combobox_select = state.axispanelselect
axissettings->GetProperty, lineatzero=lineatzero
id = widget_info(tlb, find_by_uname = 'lineatzero')
widget_control, id, set_button=lineatzero, sensitive = panelsExist
axissettings->GetProperty, showdate=showdate
id = widget_info(tlb, find_by_uname = 'showdate')
widget_control, id, set_button=showdate
if istime && ~state.axisselect then widget_control, id, sensitive=panelsExist else widget_control, id, sensitive=0
id = widget_info(state.tlb, find_by_uname='anodatebase')
if istime && ~state.axisselect then widget_control, id, sensitive=panelsExist&&showDate else widget_control, id, sensitive=0
axissettings->GetProperty, datestring1=datestring1
id = widget_info(tlb, find_by_uname = 'anodate1')
widget_control, id, set_value=datestring1
axissettings->GetProperty, datestring2=datestring2
id = widget_info(tlb, find_by_uname = 'anodate2')
widget_control, id, set_value=datestring2
axissettings->GetProperty, annotateaxis=annotateaxis
id = widget_info(state.tlb, find_by_uname='annotateaxis')
widget_control, id, set_button=annotateaxis, sensitive=panelsExist
id = widget_info(state.tlb, find_by_uname='annoaxisbase')
widget_control, id, sensitive=(annotateaxis && panelsExist)
axissettings->GetProperty, placeannotation=placeannotation
id = widget_info(tlb, find_by_uname = 'placeannotation')
widget_control, id, set_combobox_select=placeannotation
axissettings->GetProperty, annotatemajorticks=annotatemajorticks
id = widget_info(state.tlb, find_by_uname='annotatemajorticks')
widget_control, id, set_button=annotatemajorticks
id = widget_info(state.tlb, find_by_uname='annomajorbase')
widget_control, id, sensitive=(~annotatemajorticks && panelsExist)
axissettings->GetProperty, annotateevery=annotateevery
id = widget_info(state.tlb, find_by_uname='annotateevery')
widget_control, id, set_value=annotateevery
axissettings->GetProperty, firstannotation=firstannotation
id = widget_info(state.tlb, find_by_uname='firstannotation')
bid = widget_info(state.tlb, find_by_uname='firstannotationbase')
if istime then begin
if widget_info(id,/type) ne 3 then begin
widget_control, id, /destroy
id = widget_text(bid, value=time_string(firstannotation), uname='firstannotation',/editable)
endif else begin
widget_control, id, set_value = time_string(firstannotation)
endelse
endif else begin
if widget_info(id,/type) ne 0 then begin
widget_control,id,/destroy
id = spd_ui_spinner(bid, value=firstannotation, incr=1, uname='firstannotation', $
tooltip='Numerical location of first annotation.', text_box=12)
endif else begin
widget_control, id, set_value=firstannotation
endelse
endelse
axissettings->GetProperty, annotaterangemin=annotaterangemin
id = widget_info(state.tlb, find_by_uname='annotaterangemin')
widget_control, id, set_button=annotaterangemin, sensitive=panelsExist
axissettings->GetProperty, annotaterangemax=annotaterangemax
id = widget_info(state.tlb, find_by_uname='annotaterangemax')
widget_control, id, set_button=annotaterangemax, sensitive=panelsExist
axissettings->GetProperty, annotateorientation=annotateorientation
id = widget_info(state.tlb, find_by_uname='annohorizontal')
widget_control, id, set_button=~annotateorientation
id = widget_info(state.tlb, find_by_uname='annovertical')
widget_control, id, set_button=annotateorientation
axissettings->GetProperty, annotateTextObject=annotateTextObject
annotateTextObject->GetProperty, font=font
id = widget_info(state.tlb, find_by_uname='anofontlist')
widget_control, id, set_combobox_select=font
annotateTextObject->GetProperty, size=size
id = widget_info(state.tlb, find_by_uname='anofontsize')
widget_control, id, set_value=size
axissettings->GetProperty, annotatetextobject=annotatetextobject
if obj_valid(annotatetextobject) then begin
annotatetextobject->GetProperty,color=color
endif else begin
color = [0,0,0]
annotatetextobject = obj_new('spd_ui_text',color=color, show=0)
axissettings->SetProperty, annotatetextobject=annotatetextobject
endelse
anocolorid = widget_info(state.tlb, find_by_uname='anocolorwin')
Widget_Control, anocolorid, Get_Value=anocolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=color)
anocolorWin->draw, scene
id = widget_info(tlb, find_by_uname= 'anoslabel')
widget_control, id, sensitive=panelsExist
id = widget_info(tlb, find_by_uname = 'labelpaneldroplist')
widget_control, id, set_combobox_select = state.axispanelselect
IF state.axisselect EQ 1 THEN BEGIN
axisSettings->GetProperty, BLACKLABELS=blacklabels
id = widget_info(state.tlb, find_by_uname = 'blacklabels')
widget_control, id, set_button = blacklabels
ENDIF
id = widget_info(state.tlb, find_by_uname = 'labelstyleframebase')
widget_control, id, sensitive=panelsExist
axissettings->getproperty, lazylabels = lazylabels
id = widget_info(state.tlb, find_by_uname='lazylabels')
widget_control, id, set_button = lazylabels
axissettings->GetProperty, stacklabels = stacklabels
id = widget_info(state.tlb, find_by_uname = 'stacklabels')
widget_control, id, set_button = stacklabels
axissettings->GetProperty, showlabels = showlabels
id = widget_info(state.tlb, find_by_uname = 'showlabels')
widget_control, id, set_button = showlabels
id = widget_info(state.tlb, find_by_uname = 'labeldroplist')
axissettings->GetProperty, labels=labelsObj
showid = widget_info(state.tlb,find_by_uname = 'showlabel')
if obj_valid(labelsObj) then labels = labelsObj->get(/all) ELSE labels=Obj_New("SPD_UI_TEXT", Value=' ')
if obj_valid(labels[0]) then begin
nlabels = n_elements(labels)
labeltextlines = strarr(nlabels)
for i=0,nlabels-1 do begin
labels[i]->GetProperty, value=labeltext
labeltext = spd_ui_axis_options_create_label_name(i,labeltext)
labeltextlines[i]=labeltext
endfor
currlabelobj = labels[state.labelselect]
currlabelobj->getProperty, show=showlabel
widget_control, id, set_value=labeltextlines
widget_control, id, set_combobox_select=state.labelselect
IF showlabel THEN widget_control,showid,set_button=1 ELSE widget_control,showid,set_button=0
currlabelobj->GetProperty, font=font, format=format, size=size, color=color, value=value
IF showlabels THEN show=1 ELSE show=0
widget_control, showid, sensitive=show
id = widget_info(state.tlb, find_by_uname = 'labeldroplist')
widget_control, id, sensitive=show
endif else begin
state.labelselect = 0
labeltextlines=[' ']
widget_control, id, set_value=' '
widget_control,showid,sensitive=1
font=0
format=3
size=10
color=[0,0,0]
value=''
endelse
id = widget_info(tlb, find_by_uname='ltframebase')
widget_control, id, sensitive=panelsExist
id = widget_info(tlb, find_by_uname='labeltextedit')
widget_control, id, set_value=value
id = widget_info(state.tlb, find_by_uname='labelfont')
widget_control, id, set_combobox_select=font
id = widget_info(state.tlb, find_by_uname='labelformat')
widget_control, id, set_combobox_select=format
id = widget_info(state.tlb, find_by_uname='labelsize')
widget_control, id, set_value=size
labelcolorid = widget_info(state.tlb, find_by_uname='labelcolorwin')
Widget_Control, labelcolorid, Get_Value=labelcolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=color)
labelcolorWin->draw, scene
axissettings->GetProperty, placelabel=placelabel
id = widget_info(tlb, find_by_uname = 'placelabel')
widget_control, id, set_combobox_select=placelabel
axissettings->GetProperty, orientation=orientation
id = widget_info(state.tlb, find_by_uname='labelhorizontal')
widget_control, id, set_button=~orientation
id = widget_info(state.tlb, find_by_uname='labelvertical')
widget_control, id, set_button=orientation
axissettings->GetProperty, margin=margin
id = widget_info(state.tlb, find_by_uname='labelmargin')
widget_control, id, set_value=margin, sensitive = panelsExist
id = widget_info(state.tlb, find_by_uname='labelsync')
widget_control, id, sensitive = panelsExist
id = widget_info(state.tlb, find_by_uname='labelpalette')
widget_control, id, sensitive = panelsExist
spd_ui_axis_options_init_color, state
id = widget_info(tlb, find_by_uname = 'titlepaneldroplist')
widget_control, id, set_combobox_select = state.axispanelselect
id = widget_info(state.tlb, find_by_uname = 'titletextframebase')
widget_control, id, sensitive=panelsExist
id = widget_info(state.tlb, find_by_uname = 'titleplacementframebase')
widget_control, id, sensitive=panelsExist
axissettings->GetProperty, titleobj=titleobj, subtitleobj=subtitleobj
if obj_valid(titleobj) then begin
titleobj->GetProperty,color=color
endif else begin
color = [0,0,0]
titleobj = obj_new('spd_ui_text',color=color, show=0)
axissettings->SetProperty, titleobj=titleobj
endelse
titlecolorid = widget_info(state.tlb, find_by_uname='titlecolorwin')
Widget_Control, titlecolorid, Get_Value=titlecolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=color)
titlecolorWin->draw, scene
if obj_valid(subtitleobj) then begin
subtitleobj->GetProperty,color=color
endif else begin
color = [0,0,0]
titleobj = obj_new('spd_ui_text',color=color, show=0)
axissettings->SetProperty, subtitleobj=subtitleobj
endelse
subtitlecolorid = widget_info(state.tlb, find_by_uname='subtitlecolorwin')
Widget_Control, subtitlecolorid, Get_Value=subtitlecolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=color)
subtitlecolorWin->draw, scene
axissettings->GetProperty, placetitle=placetitle
id = widget_info(tlb, find_by_uname = 'placetitle')
widget_control, id, set_combobox_select=placetitle
axissettings->GetProperty, titleorientation=titleorientation
id = widget_info(state.tlb, find_by_uname='titlehorizontal')
widget_control, id, set_button=~titleorientation
id = widget_info(state.tlb, find_by_uname='titlevertical')
widget_control, id, set_button=titleorientation
titleobj->GetProperty, font=font
id = widget_info(state.tlb, find_by_uname='titlefont')
widget_control, id, set_combobox_select=font
titleobj->GetProperty, size=size
id = widget_info(state.tlb, find_by_uname='titlesize')
widget_control, id, set_value=size
titleobj->GetProperty, format=format
id = widget_info(state.tlb, find_by_uname='titleformat')
widget_control, id, set_combobox_select=format
subtitleobj->GetProperty, font=font
id = widget_info(state.tlb, find_by_uname='subtitlefont')
widget_control, id, set_combobox_select=font
subtitleobj->GetProperty, size=subsize
id = widget_info(state.tlb, find_by_uname='subtitlesize')
widget_control, id, set_value=subsize
subtitleobj->GetProperty, format=format
id = widget_info(state.tlb, find_by_uname='subtitleformat')
widget_control, id, set_combobox_select=format
titleobj->GetProperty, value=value
id = widget_info(state.tlb, find_by_uname='titletextedit')
widget_control, id, set_value=value
axissettings->GetProperty, subtitleobj=subtitleobj
subtitleobj->GetProperty, value=value
id = widget_info(state.tlb, find_by_uname='subtitletextedit')
widget_control, id, set_value=value
axissettings->GetProperty, titlemargin=titlemargin
id = widget_info(state.tlb, find_by_uname='titlemargin')
widget_control, id, set_value=titlemargin
axissettings->getproperty, lazytitles = lazytitles
id = widget_info(state.tlb, find_by_uname='lazytitles')
widget_control, id, set_button = lazytitles
if ~statedef then Widget_Control, tlb, Set_UValue=state, /No_Copy
END
FUNCTION spd_ui_axis_options_getaxis, state
compile_opt idl2,hidden
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
if ~Obj_Valid(currpanelobj) then currpanelobj=Obj_New("SPD_UI_PANEL", 1)
case state.axisselect of
0: currpanelobj->GetProperty,xaxis = axissettings
1: currpanelobj->GetProperty,yaxis = axissettings
endcase
if ~obj_valid(axissettings) then axissettings=obj_new('SPD_UI_AXIS_SETTINGS')
return, axissettings
END
function spd_ui_axis_options_getpanels, state
compile_opt idl2,hidden
activeWindow = state.windowStorage->GetActive()
activeWindow->GetProperty, Panels=panels
return, panels
end
function spd_ui_axis_options_getpanelobjs, state
compile_opt idl2, hidden
panels = spd_ui_axis_options_getpanels(state)
if obj_valid(panels) then begin
panelobjs = panels->get(/All)
endif else panelobjs = -1
return, panelobjs
end
function spd_ui_axis_options_getcurrentpanel, state
compile_opt idl2,hidden
panelObjs = spd_ui_axis_options_getpanelobjs(state)
if obj_valid(panelobjs[0]) then begin
currpanelobj = panelobjs[state.axispanelselect]
endif
if ~Obj_Valid(currpanelobj) then currpanelobj=Obj_New("SPD_UI_PANEL", 1)
return, currpanelobj
end
function spd_ui_axis_options_getcurrentlabel, state
compile_opt idl2, hidden
axissettings = spd_ui_axis_options_getaxis(state)
axissettings->getProperty, labels=labels
if obj_valid(labels) then begin
currlabelobj = labels->get(position = state.labelselect)
if ~obj_valid(currlabelobj) then begin
currlabelobj = Obj_new("SPD_UI_TEXT", Value=' ')
endif
endif else currlabelobj=Obj_New("SPD_UI_TEXT", Value=' ')
return, currlabelobj
end
pro spd_ui_axis_options_set_scaling,tlb,state,nopopups=nopopups
compile_opt idl2,hidden
axissettings = spd_ui_axis_options_getaxis(state)
linid = widget_info(tlb,find_by_uname='linear')
logid = widget_info(tlb,find_by_uname='log10')
if widget_info(linid,/button_set) then begin
axissettings->setProperty,scaling=0
endif else if widget_info(logid,/button_set) then begin
axissettings->setProperty,scaling=1
endif else begin
axissettings->setProperty,scaling=2
endelse
end
PRO spd_ui_axis_options_set_range, tlb, state,nopopups=nopopups
compile_opt idl2, hidden
panelObjs = spd_ui_axis_options_getpanelobjs(state)
if ~Obj_valid(panelObjs[0]) then return
axissettings = spd_ui_axis_options_getaxis(state)
axissettings->getproperty,scaling=scaling, istimeaxis=istimeaxis
ID = widget_info(tlb, find_by_uname='fixedrange')
if widget_info(ID, /button_set) then begin
axissettings->SetProperty,rangeoption=2
maxID = widget_info(tlb, find_by_uname='maxincrement')
minID = widget_info(tlb, find_by_uname='minincrement')
widget_control, minid, get_value=minv
widget_control, maxid, get_value=maxv
axisSettings->getProperty,minFixedRange=oldmin,maxFixedRange=oldmax
if istimeaxis then begin
oldmin = formatDate(oldmin, '%date/%exacttime', 0)
oldmax = formatDate(oldmax, '%date/%exacttime', 0)
endif
if istimeaxis then begin
minv = spd_ui_timefix(minv)
maxv = spd_ui_timefix(maxv)
if ~is_string(minv) || ~is_string(maxv) then begin
if ~is_string(minv) then begin
inv = 'min'
widget_control, minid, set_value=oldmin
minv = oldmin
endif
if ~is_string(maxv) then begin
inv = keyword_set(inv) ? inv + ' and max':'max'
widget_control,maxid, set_value=oldmax
maxv = oldmax
endif
spd_ui_message,'Invalid fixed '+inv+'; values reset. (Must be yyyy-mm-dd/hh:mm:ss)', $
sb=state.statusBar, hw=state.historywin, dialog=~keyword_set(nopopups)
endif
minv = time_double(minv)
maxv = time_double(maxv)
endif
if finite(minv,/nan) || finite(maxv,/nan) then begin
if finite(minv,/nan) then begin
invd = 'min'
widget_control, minid, set_value=oldmin
endif
if finite(maxv,/nan) then begin
invd = keyword_set(invd) ? ' and max':'max'
widget_control, maxid, set_value=oldmax
endif
spd_ui_message,'Invalid fixed '+invd+'; values reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
endif else begin
if minv ge maxv then begin
spd_ui_message,'Maximum range value must be greater than minimum; values reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
widget_control, minid, set_value=oldmin
widget_control, maxid, set_value=oldmax
endif else if scaling ne 0 && minv le 0 && ~istimeaxis then begin
spd_ui_message,'Range must be greater than zero for logarithmic scaling.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
newmin = (oldmin gt 0)? oldmin:1
newmax = (oldmax gt 0)? oldmax:10
widget_control, minid, set_value=newmin
widget_control, maxid, set_value=newmax
endif else begin
axisSettings->setproperty, minfixedrange=minv
axisSettings->setproperty, maxfixedrange=maxv
endelse
endelse
endif
id = widget_info(tlb, find_by_uname='autorange')
if widget_info(ID, /button_set) then begin
axissettings->SetProperty,rangeoption=0
rmarginid = widget_info(tlb,find_by_uname='rmincrement')
widget_control, rmarginid, get_value = rangemargin
if ~finite(rangemargin,/nan) then begin
if rangemargin lt 0 then begin
spd_ui_message,'Range Margin value must be greater than 0; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, rangemargin=rangemargin
Widget_Control, rmarginid, set_value = rangemargin*100
endif else begin
axissettings->SetProperty, rangemargin = rangemargin/100
endelse
endif else begin
spd_ui_message,'Invalid range margin; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, rangemargin=rangemargin
Widget_Control, rmarginid, set_value = rangemargin*100
endelse
boundID = widget_info(tlb, find_by_uname='boundscaling')
bound = widget_info(boundID, /button_set)
if bound then begin
minID = widget_info(tlb, find_by_uname='minboundrange')
widget_control, minID, get_value = minboundrange
maxID = widget_info(tlb, find_by_uname='maxboundrange')
widget_control, maxID, get_value = maxboundrange
if ~finite(minboundrange,/nan) && ~finite(maxboundrange,/nan) then begin
if minboundrange ge maxboundrange then begin
spd_ui_message,'Maximum bound scaling must be greater than minimum; values reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
Widget_Control, boundID, Set_Button=0
bound = 0
endif else if scaling ne 0 && maxboundrange le 0 then begin
spd_ui_message,'Negative bound scaling range for a log axis. Bound scaling not used.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
Widget_Control, boundID, Set_Button=0
bound = 0
endif else begin
if scaling ne 0 && minboundrange le 0 then begin
spd_ui_message,'Warning: Negative minimum autoscaling range boundary set for a log axis.', $
sb=state.statusbar, hw=state.historywin
endif
axissettings->setproperty, maxboundrange = maxboundrange, minboundrange = minboundrange
endelse
endif else begin
spd_ui_message,'Invalid bound range min/max, no changes made.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
widget_control, minID, set_value = 0
widget_control, maxID, set_value = 0
Widget_Control, boundID, Set_Button=0
bound=0
endelse
endif
axisSettings->getProperty,boundscaling=currentbound
if currentBound ne bound then begin
axissettings->SetProperty, boundscaling = bound
spd_ui_message,'Bound scaling turned ' + (bound ? 'on.':'off.'), hw=state.historywin
endif
endif
END
function spd_ui_axis_options_create_label_name, labelnumber, value
name = strtrim(string(labelnumber +1),2)
name += ': '+value[0]
if strlen(name) GT 35 then name=strmid(name, 0, 35)+'...'
return, name
end
PRO spd_ui_axis_options_set_labels, tlb, state,nopopups=nopopups
compile_opt idl2, hidden
axissettings = spd_ui_axis_options_getaxis(state)
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
if ~obj_valid(currpanelobj) then begin
state.historywin->update, 'Current panel object is invalid'
return
endif
id = widget_info(tlb, find_by_uname='labelfont')
widget_control, id, get_value =fontlist
font = widget_info(id, /combobox_gettext)
font = where(fontlist eq font)
id = widget_info(tlb, find_by_uname='labelformat')
widget_control, id, get_value =formatlist
format = widget_info(id, /combobox_gettext)
format = where(formatlist eq format)
id = widget_info(tlb, find_by_uname='labelsize')
widget_control, id, get_value =size
id = widget_info(tlb, find_by_uname='labelcolorwin')
widget_control, id, get_value =colorwin
colorwin->getProperty,graphics_tree=scene
scene->getProperty,color=color
id = widget_info(tlb, find_by_uname='labelmargin')
widget_control, id, get_value = marginsize
axissettings->getProperty, labels=labels
if obj_valid(labels) then begin
currlabelobj = labels->get(position = state.labelselect)
if obj_valid(currlabelObj) then begin
currlabelobj->SetProperty, font=font, format=format, color=color
if state.axisselect eq 1 then begin
axissettings->GetProperty, blacklabels=blacklabels, showlabels=showlabels
if ~blacklabels and showlabels then currpanelobj->SyncLinesToLabels
endif
if ~finite(size,/nan) then begin
if fix(size) lt 1 then begin
spd_ui_message,'Label Size must be greater than or equal to one; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
currlabelobj->GetProperty, size = prevsize
id = widget_info(tlb, find_by_uname='labelsize')
widget_control, id, set_value =prevsize
endif else currlabelobj->SetProperty, size = size
endif else begin
spd_ui_message,'Invalid label font size; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
currlabelobj->GetProperty, size = prevsize
id = widget_info(tlb, find_by_uname='labelsize')
widget_control, id, set_value =prevsize
endelse
if finite(marginsize, /nan) then begin
spd_ui_message,'Invalid label margin size; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, margin=prevmargin
id = widget_info(tlb, find_by_uname='labelmargin')
widget_control, id, set_value=prevmargin
endif
endif $
else state.historywin->update, 'Invalid label object'
endif else state.historywin->update, 'Invalid labels object'
END
pro spd_ui_axis_options_set_major_ticks,state,nopopups=nopopups
compile_opt idl2,hidden
tlb = state.tlb
axissettings = spd_ui_axis_options_getaxis(state)
showmessage = 1
id = widget_info(tlb,find_by_uname='bynumber')
bynumberset = widget_info(id,/button_set)
showmessage = bynumberset
id = widget_info(tlb, find_by_uname = 'nummajorticks')
widget_control,id,get_value=ticknum
spd_ui_spinner_get_max_value, id, majormax
if ~finite(ticknum,/nan) then begin
if tickNum gt majormax then begin
spd_ui_message,'Major Ticks number cannot be greater than ' + STRTRIM(string(majormax,format='(I)'),2) + '; value reset.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axisSettings->getProperty,numMajorTicks=ticknum
widget_control,id,set_value=ticknum
endif else if tickNum lt 0 then begin
spd_ui_message,'Major Ticks number cannot be less than 0; value reset.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axisSettings->getProperty,numMajorTicks=0
widget_control,id,set_value=ticknum
endif else begin
axissettings->SetProperty, nummajorticks = ticknum
endelse
endif else begin
spd_ui_message,'Invalid number of major ticks; value reset.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axisSettings->getProperty,numMajorTicks=ticknum
widget_control,id,set_value=ticknum
endelse
showmessage = ~bynumberset
id = widget_info(tlb, find_by_uname = 'majortickevery')
widget_control,id,get_value=majortickevery
if ~finite(majortickevery,/nan) then begin
if majortickevery le 0 then begin
spd_ui_message,'Major tick interval must be greater than zero; value reset.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axissettings->GetProperty,majorTickEvery=majorTickEvery,majorTickUnits=majorTickUnits
widget_control,id,set_value=majorTickEvery
id = widget_info(tlb, find_by_uname = 'majortickunits')
widget_control, id, set_combobox_select = majortickunits
endif else begin
axisSettings->setProperty,majorTickEvery=majorTickEvery
endelse
endif else begin
spd_ui_message,'Invalid major tick interval; value reset.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axissettings->GetProperty,majorTickEvery=majorTickEvery, majorTickUnits=majorTickUnits
widget_control,id,set_value=majorTickEvery
id = widget_info(tlb, find_by_uname = 'majortickunits')
widget_control, id, set_combobox_select = majortickunits
endelse
axisSettings->setProperty,majorTickUnits=spd_ui_get_combobox_select(tlb,'majortickunits')
id = widget_info(tlb,find_by_uname='bynumber')
axisSettings->setProperty,majorTickAuto=widget_info(id,/button_set)
end
pro spd_ui_axis_options_set_minor_ticks,state,nopopups=nopopups
compile_opt idl2,hidden
tlb = state.tlb
axissettings = spd_ui_axis_options_getaxis(state)
showmessage = 1
id = widget_info(tlb, find_by_uname = 'numminorticks')
showmessage = widget_info(id,/sensitive)
widget_control,id,get_value=ticknum
if ~finite(ticknum,/nan) then begin
if tickNum lt 0 then begin
spd_ui_message,'Minor Tick Number cannot be less than 0; value reset.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axisSettings->getProperty,numminorTicks=ticknum
widget_control,id,set_value=ticknum
endif else if tickNum gt 2ll^63-1 then begin
spd_ui_message,strtrim(tickNum,2) + ' is waaaaaay too many minor ticks. Try something smaller.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axisSettings->getProperty,numminorTicks=ticknum
widget_control,id,set_value=ticknum
endif else begin
axissettings->SetProperty, numminorticks = ticknum
endelse
endif else begin
spd_ui_message,'Invalid number of minor ticks, no changes made.', $
sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
axisSettings->getProperty, numminorticks = ticknum
widget_control, id, set_value = ticknum
endelse
for i = 0,3 do begin
id = widget_info(tlb,find_by_uname='logminorticktype'+strtrim(i,2))
if widget_info(id,/button_set) then begin
axisSettings->setProperty,logminorticktype=i
endif
endfor
axisSettings->setProperty,minorTickAuto=1
end
pro spd_ui_axis_options_set_first_ticks,state,nopopups=nopopups
compile_opt idl2,hidden
tlb = state.tlb
axissettings = spd_ui_axis_options_getaxis(state)
axissettings->GetProperty, istimeaxis=istime, maxfixedrange=maxfixedrange
id = widget_info(tlb, find_by_uname = 'firsttickat')
widget_control,id,get_value=firsttickat
f = 'Align ticks at'
showmessage = 1
bid = widget_info(tlb,find_by_uname='bynumber')
bynumberset = widget_info(bid,/button_set)
showmessage=~bynumberset
if istime then begin
if ~is_string(spd_ui_timefix(firsttickat)) then begin
spd_ui_message,f+': Invalid entry; value reset. (Must be yyyy-mm-dd/hh:mm:ss)', $
sb=state.statusbar, hw=state.historywin, /dontshow, $
dialog=(showmessage && ~keyword_set(nopopups))
axissettings->GetProperty,firsttickat=firsttickat
widget_control,id,set_value=time_string(firsttickat)
endif else begin
axisSettings->setProperty,firsttickat=time_double(spd_ui_timefix(firsttickat))
endelse
endif else if finite(firsttickat) then begin
axisSettings->setProperty,firsttickat=firsttickat
endif else begin
spd_ui_message,'Invalid "'+f+'"; no changes made.', $
sb=state.statusbar, hw=state.historywin, /dontshow, $
dialog=(showmessage && ~keyword_set(nopopups))
endelse
end
pro spd_ui_axis_options_set_ticks,tlb,state,nopopups=nopopups
compile_opt idl2,hidden
panelObjs = spd_ui_axis_options_getpanelobjs(state)
if ~Obj_valid(panelObjs[0]) then return
axissettings = spd_ui_axis_options_getaxis(state)
spd_ui_axis_options_set_major_ticks,state,nopopups=nopopups
spd_ui_axis_options_set_minor_ticks,state,nopopups=nopopups
spd_ui_axis_options_set_first_ticks,state,nopopups=nopopups
id = widget_info(tlb,find_by_uname='niceticks')
axissettings->setproperty, autoticks = widget_info(id,/button_set)
axissettings->setProperty,tickStyle=spd_ui_get_combobox_select(tlb,'tickstyle')
id = widget_info(tlb, find_by_uname = 'bottomplace')
axissettings->SetProperty, bottomplacement = widget_info(id,/button_set)
id = widget_info(tlb, find_by_uname = 'topplace')
axissettings->SetProperty, topplacement = widget_info(id,/button_set)
id = widget_info(tlb, find_by_uname = 'majorlength')
widget_control, id, get_value=value
spd_ui_spinner_get_max_value, id, majormax
if ~finite(value,/nan) then begin
if value gt majormax then begin
spd_ui_message,'Major tick length must be less than or equal to ' + STRTRIM(string(majormax,format='(I)'),2) + '; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axisSettings->getProperty, majorlength = prevvalue
if prevvalue gt majormax then prevvalue = majormax
widget_control, id, set_value=STRTRIM(string(prevvalue,format='(I)'),2)
endif else if value lt 0. then begin
spd_ui_message,'Major tick length must be greater than or equal to 0; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axisSettings->getProperty, majorlength = prevvalue
if prevvalue lt 0 then prevvalue = 0
widget_control, id, set_value=prevvalue
endif else begin
axisSettings->setProperty, majorlength = value
endelse
endif else begin
spd_ui_message,'Invalid major tick length; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axisSettings->getProperty, majorlength = prevvalue
widget_control, id, set_value=prevvalue
endelse
id = widget_info(tlb, find_by_uname = 'minorlength')
widget_control, id, get_value=value
spd_ui_spinner_get_max_value, id, majormax
if ~finite(value,/nan) then begin
if value gt majormax then begin
spd_ui_message,'Minor tick length must be less than or equal to ' + STRTRIM(string(majormax,format='(I)'),2) + '; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axisSettings->getProperty, minorlength = prevvalue
if prevvalue gt majormax then prevvalue = majormax
widget_control, id, set_value=prevvalue
endif else if value lt 0. then begin
spd_ui_message,'Minor tick length must be greater than or equal to 0; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axisSettings->getProperty, minorlength = prevvalue
if prevvalue lt 0 then prevvalue = 0
widget_control, id, set_value=prevvalue
endif else begin
axisSettings->setProperty, minorlength = value
endelse
endif else begin
spd_ui_message,'Invalid minor tick length; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axisSettings->getProperty, minorlength = prevvalue
widget_control, id, set_value=prevvalue
endelse
end
pro spd_ui_axis_options_set_annotations,tlb,state,nopopups=nopopups
compile_opt idl2, hidden
panelobjs = spd_ui_axis_options_getpanelobjs(state)
if ~Obj_valid(panelObjs[0]) then return
axissettings = spd_ui_axis_options_getaxis(state)
id = widget_info(state.tlb, find_by_uname='anofontsize')
widget_control, id, get_value=anofontsize
if anofontsize lt 1 then begin
spd_ui_message,'Annotation font size must be greater than or equal to one; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, annotatetextobject = annotatetextobject
annotatetextobject->GetProperty, size = prevanofontsize
widget_control, id, set_value=prevanofontsize
endif else if finite(anofontsize, /nan) then begin
spd_ui_message,'Invalid annotation font size; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, annotatetextobject = annotatetextobject
annotatetextobject->GetProperty, size = prevanofontsize
widget_control, id, set_value=prevanofontsize
endif else begin
axissettings->GetProperty, annotatetextobject = annotatetextobject
annotatetextobject->SetProperty, size = anofontsize
endelse
id = widget_info(state.tlb, find_by_uname='annotateevery')
widget_control, id, get_value=aneveryvalue
if aneveryvalue le 0 then begin
spd_ui_message,'Annotate every value must be greater than zero; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, annotateevery = prevaneveryvalue
widget_control, id, set_value=prevaneveryvalue
endif else if finite(aneveryvalue, /nan) then begin
spd_ui_message,'Invalid annotate every value; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, annotateevery = prevaneveryvalue
widget_control, id, set_value=prevaneveryvalue
endif
firstannotationid = widget_info(tlb,find_by_uname='firstannotation')
widget_control,firstannotationid,get_value=firstannotation
axissettings->GetProperty, istimeaxis=istime, maxfixedrange=maxfixedrange
axissettings->GetProperty, annotatemajorticks=annotatemajorticks
axissettings->GetProperty, annotateaxis=annotateaxis
f = 'Align Annotations at'
if istime then begin
firstannotation = spd_ui_timefix(firstannotation)
if ~is_string(firstannotation) then begin
spd_ui_message,f+': Invalid entry; value reset. (Must be yyyy-mm-dd/hh:mm:ss)', $
sb=state.statusbar, hw=state.historywin, /dontshow, dialog=~keyword_set(nopopups)
axissettings->GetProperty,firstannotation=firstannotation
widget_control,firstannotationid,set_value=time_string(firstannotation)
endif else if annotateaxis and ~annotatemajorticks and (time_double(firstannotation) gt maxfixedrange) then begin
spd_ui_message,f+': Invalid entry, value cannot be greater than range.', $
sb=state.statusbar, hw=state.historywin, /dontshow, dialog=~keyword_set(nopopups)
axissettings->GetProperty,firstannotation=firstannotation
widget_control,firstannotationid,set_value=time_string(firstannotation)
endif else begin
axisSettings->setProperty,firstannotation=time_double(firstannotation)
endelse
endif else if finite(firstannotation) then begin
if annotateaxis and ~annotatemajorticks and (firstannotation gt maxfixedrange) then begin
spd_ui_message,f+': Invalid entry, value cannot be greater than range.', $
sb=state.statusbar, hw=state.historywin, /dontshow, dialog=~keyword_set(nopopups)
endif else begin
axisSettings->setProperty,firstannotation=firstannotation
endelse
endif else begin
spd_ui_message,'Invalid "'+f+'" value; value reset.', $
sb=state.statusbar, hw=state.historywin, /dontshow, dialog=~keyword_set(nopopups)
axisSettings->getProperty,firstannotation=prevfirstannotation
widget_control,firstannotationid,set_value=prevfirstannotation
endelse
end
pro spd_ui_axis_options_set_grids, tlb, state,nopopups=nopopups
compile_opt idl2, hidden
panelObjs = spd_ui_axis_options_getpanelobjs(state)
if ~Obj_valid(panelObjs[0]) then return
axissettings = spd_ui_axis_options_getaxis(state)
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
currpanelobj->GetProperty, settings=panelsettings
showmessage = 1
axissettings->GetProperty, majorgrid=majorgrid
majorgrid->GetProperty, show=showmessage
id = widget_info(tlb, find_by_uname = 'majorgridthick')
widget_control, id, get_value=majorgridthick
if majorgridthick lt 1. or majorgridthick gt 10 or ~finite(majorgridthick) then begin
messageString = finite(majorgridthick) ? 'Major grid thickness must be between 1 and 10; value reset.': $
'Invalid major grid thickness; value reset.'
spd_ui_message, messageString, sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
majorgrid->GetProperty, thickness=prevmajorthick
widget_control, id, set_value=prevmajorthick
endif else begin
majorgrid->SetProperty, thickness=majorgridthick
endelse
id = widget_info(tlb, find_by_uname = 'minorgridthick')
widget_control, id, get_value=minorgridthick
showmessage = 1
axissettings->GetProperty, minorgrid=minorgrid
minorgrid->GetProperty, show=showmessage
if minorgridthick lt 1. or minorgridthick gt 10 or ~finite(minorgridthick) then begin
messageString = finite(minorgridthick) ? 'Minor grid thickness must be between 1 and 10; value reset.': $
'Invalid minor grid thickness; value reset.'
spd_ui_message, messageString, sb=state.statusbar, hw=state.historywin, $
dialog=(showmessage && ~keyword_set(nopopups))
minorgrid->GetProperty, thickness=prevminorthick
widget_control, id, set_value=prevminorthick
endif else begin
minorgrid->SetProperty, thickness=minorgridthick
endelse
end
pro spd_ui_axis_options_set_title, tlb, state,nopopups=nopopups
compile_opt idl2, hidden
axissettings = spd_ui_axis_options_getaxis(state)
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
if ~obj_valid(currpanelobj) then begin
state.historywin->update, 'Current panel object is invalid'
return
endif
id = widget_info(tlb, find_by_uname='titletextedit')
widget_control, id, get_value = title
id = widget_info(tlb, find_by_uname='titlefont')
widget_control, id, get_value =fontlist
font = widget_info(id, /combobox_gettext)
font = where(fontlist eq font)
id = widget_info(tlb, find_by_uname='titleformat')
widget_control, id, get_value =formatlist
format = widget_info(id, /combobox_gettext)
format = where(formatlist eq format)
axissettings->getProperty, titleobj=titleobj, subtitleobj=subtitleobj
titleobj->SetProperty, value=title, font=font, format=format
id = widget_info(tlb, find_by_uname='subtitletextedit')
widget_control, id, get_value = subtitle
id = widget_info(tlb, find_by_uname='subtitlefont')
widget_control, id, get_value =fontlist
font = widget_info(id, /combobox_gettext)
font = where(fontlist eq font)
id = widget_info(tlb, find_by_uname='subtitleformat')
widget_control, id, get_value =formatlist
format = widget_info(id, /combobox_gettext)
format = where(formatlist eq format)
subtitleobj->SetProperty, value=subtitle, font=font, format=format
id = widget_info(tlb, find_by_uname='titlesize')
widget_control, id, get_value =size
id = widget_info(tlb, find_by_uname='subtitlesize')
widget_control, id, get_value =subsize
id = widget_info(tlb, find_by_uname='titlemargin')
widget_control, id, get_value = marginsize
if ~finite(size,/nan) then begin
if fix(size) le 0 then begin
spd_ui_message,'Title font size must be greater than zero; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
titleobj->GetProperty, size = prevsize
id = widget_info(tlb, find_by_uname='titlesize')
widget_control, id, set_value =prevsize
endif else begin
titleobj->SetProperty, size = size
endelse
endif else begin
spd_ui_message,'Invalid title font size; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
titleobj->GetProperty, size = prevsize
id = widget_info(tlb, find_by_uname='titlesize')
widget_control, id, set_value =prevsize
endelse
if ~finite(subsize,/nan) then begin
if fix(subsize) le 0 then begin
spd_ui_message,'Subtitle font size must be greater than zero; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
subtitleobj->GetProperty, size = prevsize
id = widget_info(tlb, find_by_uname='subtitlesize')
widget_control, id, set_value =prevsize
endif else begin
subtitleobj->SetProperty, size = subsize
endelse
endif else begin
spd_ui_message,'Invalid subtitle font size; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
subtitleobj->GetProperty, size = prevsize
id = widget_info(tlb, find_by_uname='subtitlesize')
widget_control, id, set_value =prevsize
endelse
if finite(marginsize, /nan) then begin
spd_ui_message,'Invalid title margin size; value reset.', $
sb=state.statusbar, hw=state.historywin, dialog=~keyword_set(nopopups)
axissettings->GetProperty, titlemargin=prevmargin
id = widget_info(tlb, find_by_uname='titlemargin')
widget_control, id, set_value=prevmargin
endif else axissettings->setProperty, titlemargin=marginsize
end
PRO spd_ui_axis_options_setvalues, tlb, state,nopopups=nopopups
compile_opt idl2, hidden
spd_ui_axis_options_set_scaling, tlb, state,nopopups=nopopups
spd_ui_axis_options_set_range, tlb, state,nopopups=nopopups
spd_ui_axis_options_set_ticks, tlb,state,nopopups=nopopups
spd_ui_axis_options_set_labels, tlb, state,nopopups=nopopups
spd_ui_axis_options_set_annotations,tlb,state,nopopups=nopopups
spd_ui_axis_options_set_grids, tlb, state,nopopups=nopopups
spd_ui_axis_options_set_title, tlb, state, nopopups=nopopups
return
END
pro spd_ui_axis_options_update_scaling, state, axissettings, linear=linear, log10=log10, natural_log=natural_log
compile_opt idl2, hidden
if ~undefined(linear) then begin
scaling = 0
def_range = [0,0] * !values.d_nan
msg = 'Linear'
endif
if ~undefined(log10) then begin
scaling = 1
def_range = [0,0]
msg = 'Log 10'
endif
if ~undefined(natural_log) then begin
scaling = 2
def_range = [0,0]
msg = 'Natural Log'
endif
axissettings->SetProperty,scaling=scaling
is_time = widget_info(state.tlb,find_by_uname='istime')
if ~widget_info(is_time,/button_set) then begin
spd_ui_spinner_set_min_value, widget_info(state.tlb, find_by_uname = 'minincrement'), def_range[0]
spd_ui_spinner_set_min_value, widget_info(state.tlb, find_by_uname = 'maxincrement'), def_range[1]
endif
id = widget_info(state.tlb,find_by_uname='logminorticktypebase')
widget_control, id, sensitive = (scaling gt 0)
spd_ui_axis_update_units,state
state.historywin->Update, msg+' scaling selected'
end
PRO spd_ui_axis_options_update_labels, tlb, axissettings, currlabelobj, labelcolorwindow
compile_opt idl2, hidden
axissettings->GetProperty, orientation=orientation, margin = margin
if obj_valid(currlabelobj) && (n_elements(currlabelobj) gt 0) then begin
currlabelobj->GetProperty, font=font, format=format, size=size, color=color, value=value, show=show
id = widget_info(tlb, find_by_uname='labeltextedit')
widget_control, id, set_value=value
id = widget_info(tlb, find_by_uname='labelfont')
widget_control, id, set_combobox_select=font
id = widget_info(tlb, find_by_uname='labelformat')
widget_control, id, set_combobox_select=format
id = widget_info(tlb, find_by_uname='labelsize')
widget_control, id, set_value=size
id = widget_info(tlb, find_by_uname='showlabel')
widget_control, id, set_button=show
endif
Widget_Control, labelcolorWindow, Get_Value=labelcolorWin
labelcolorwin->getproperty, graphics_tree=scene
if obj_valid(scene) then begin
scene->remove,/all
scene->setproperty, color=reform(color)
endif else begin
scene=obj_new('IDLGRSCENE', color=reform(color))
labelcolorwin->setproperty, graphics_tree=scene
endelse
labelcolorWin->draw, scene
id = widget_info(tlb, find_by_uname='labelhorizontal')
widget_control, id, set_button=~orientation
id = widget_info(tlb, find_by_uname='labelvertical')
widget_control, id, set_button=orientation
id = widget_info(tlb, find_by_uname='labelmargin')
widget_control, id, set_value=margin
END
PRO spd_ui_axis_options_event, event
Compile_Opt idl2,hidden
Widget_Control, event.TOP, Get_UValue=state, /No_Copy
err_xxx = 0
Catch, err_xxx
IF (err_xxx NE 0) THEN BEGIN
Catch, /Cancel
Help, /Last_Message, Output = err_msg
spd_ui_sbar_hwin_update, state, err_msg, /error, err_msgbox_title='Error in Axis Options'
Widget_Control, event.TOP, Set_UValue=state, /No_Copy
widget_control, event.top,/destroy
RETURN
ENDIF
currpanelobj = spd_ui_axis_options_getcurrentpanel(state)
IF (Tag_Names(event, /Structure_Name) EQ 'WIDGET_KILL_REQUEST') THEN BEGIN
state.statusbar->Update, 'Widget kill request received...'
state.historyWin->Update, 'Widget kill request received...'
(state.windowStorage->getActive())->reset
state.statusbar->Update, 'Panels reset.'
state.historyWin->Update, 'Panels reset.'
state.drawObject->update, state.windowStorage, state.loadedData
state.drawObject->draw
state.scrollbar->update
state.statusbar->Update, 'Active window refreshed.'
state.historyWin->Update, 'Active window refreshed.'
state.statusbar->Update, 'Closing Axis Options widget...
state.historyWin->Update, 'Closing Axis Options widget...
dprint, dlevel=4, 'Closing Axis Options widget...
state.tlb_statusbar->Update, 'Axis Options closed'
dprint, dlevel=4, 'widget killed'
Widget_Control, event.TOP, Set_UValue=state, /No_Copy
Widget_Control, event.top, /Destroy
RETURN
ENDIF
IF (Tag_Names(event, /Structure_Name) EQ 'WIDGET_TAB') THEN BEGIN
Widget_Control, state.panelDroplists[event.tab], set_combobox_select = state.axispanelselect
Widget_Control, event.TOP, Set_UValue=state, /No_Copy
RETURN
EndIF
axissettings = spd_ui_axis_options_getaxis(state)
Widget_Control, event.id, Get_UValue=uval
IF Size(uval, /Type) NE 0 THEN BEGIN
state.historyWin->Update,'SPD_UI_AXIS_OPTIONS: User value: '+uval, /dontshow
CASE uval OF
'APPLYTOALL': BEGIN
spd_ui_axis_options_setvalues, state.tlb, state
tabid = widget_info(state.tlb, find_by_uname='tabs',/TAB_CURRENT)
tid = widget_info(tabid, /TAB_CURRENT)
spd_ui_propagate_axis,state,tid
state.drawObject->update, state.windowStorage, state.loadedData, error=draw_error, errmsg=errmsg
if draw_error ne 0 then begin
if keyword_set(errmsg) then begin
if in_set('TYPE', tag_names(errmsg)) then begin
if strupcase(errmsg.type) eq 'ERROR' then begin
if in_set('VALUE', tag_names(errmsg)) then begin
ok = dialog_message('Error: '+errmsg.value+' Changes reset.',/center)
endif
endif
endif
endif
(state.windowStorage->getActive())->reset
spd_ui_init_axis_window, state = state
state.drawObject->update, state.windowStorage, state.loadedData
currentwin=state.windowStorage->getActive()
currentwin->getProperty, panels=panels
spd_ui_update_axis_from_draw,state.drawObject,panels
state.historyWin->Update, 'Draw object update error, changes reset.'
endif else begin
currentwin=state.windowStorage->getActive()
currentwin->getProperty, panels=panels
spd_ui_update_axis_from_draw,state.drawObject,panels
state.statusBar->update,'Changes applied to all Panels.'
state.historyWin->update,'Changes applied to all Panels.'
endelse
spd_ui_init_axis_window, state = state
state.drawObject->draw
state.historyWin->Update, 'Active window refreshed.'
end
'APPLY': BEGIN
spd_ui_axis_options_setvalues, state.tlb, state
state.drawObject->update, state.windowStorage, state.loadedData, error=draw_error, errmsg=errmsg
if draw_error ne 0 then begin
if keyword_set(errmsg) then begin
if in_set('TYPE', tag_names(errmsg)) then begin
if strupcase(errmsg.type) eq 'ERROR' then begin
if in_set('VALUE', tag_names(errmsg)) then begin
ok = dialog_message('Error: '+errmsg.value+' Changes reset.',/center)
endif
endif
endif
endif
(state.windowStorage->getActive())->reset
spd_ui_init_axis_window, state = state
state.drawObject->update, state.windowStorage, state.loadedData
currentwin=state.windowStorage->getActive()
currentwin->getProperty, panels=panels
spd_ui_update_axis_from_draw,state.drawObject,panels
state.historyWin->Update, 'Draw object update error, changes reset.'
endif else begin
currentwin=state.windowStorage->getActive()
currentwin->getProperty, panels=panels
spd_ui_update_axis_from_draw,state.drawObject,panels
spd_ui_message,'Changes applied.', hw=state.historywin
endelse
spd_ui_init_axis_window, state = state
state.drawObject->draw
state.scrollbar->update
state.historyWin->Update, 'Active window refreshed.'
END
'CANC': Begin
(state.windowStorage->getActive())->reset
state.statusbar->Update, 'Panels reset.'
state.historyWin->Update, 'Panels reset.'
state.drawObject->update, state.windowStorage, state.loadedData
state.drawObject->draw
state.scrollbar->update
state.statusbar->Update, 'Active window refreshed.'
state.historyWin->Update, 'Active window refreshed.'
state.statusbar->Update, 'Closing Axis Options widget...
state.historyWin->Update, 'Closing Axis Options widget...
dprint, dlevel=4, 'Closing Axis Options widget...
state.tlb_statusbar->Update, 'Axis Options canceled'
Widget_Control, event.TOP, Set_UValue=state, /No_Copy
Widget_Control, event.top, /Destroy
RETURN
END
'OK': BEGIN
spd_ui_axis_options_setvalues, state.tlb, state
state.drawObject->update, state.windowStorage, state.loadedData, error=draw_error, errmsg=errmsg
if draw_error ne 0 then begin
if keyword_set(errmsg) then begin
if in_set('TYPE', tag_names(errmsg)) then begin
if strupcase(errmsg.type) eq 'ERROR' then begin
if in_set('VALUE', tag_names(errmsg)) then begin
ok = dialog_message('Error: '+errmsg.value+' Changes reset.',/center)
endif
endif
endif
endif
(state.windowStorage->getActive())->reset
spd_ui_init_axis_window, state = state
state.drawObject->update, state.windowStorage, state.loadedData
panels = spd_ui_axis_options_getpanels(state)
spd_ui_update_axis_from_draw,state.drawObject,panels
state.historyWin->Update, 'Draw object update error, changes reset.'
endif else begin
panels = spd_ui_axis_options_getpanels(state)
spd_ui_update_axis_from_draw,state.drawObject,panels
endelse
state.drawObject->draw
state.scrollbar->update
state.statusbar->Update, 'Active window refreshed.'
state.historyWin->Update, 'Active window refreshed.'
dprint, dlevel=4, 'Active window refreshed.'
state.statusbar->Update, 'Closing Axis Options widget...'
state.historyWin->Update, 'Closing Axis Options widget...'
dprint, dlevel=4, 'Closing Axis Options widget...'
state.tlb_statusbar->update, 'Axis Options closed'
Widget_Control, event.TOP, Set_UValue=state, /No_Copy
Widget_Control, event.top, /Destroy
RETURN
END
'TEMP':begin
spd_ui_axis_options_setvalues, state.tlb, state
panelObjs = spd_ui_axis_options_getpanelobjs(state)
if Obj_valid(panelObjs[0]) then begin
for i=0, n_elements(panelobjs)-1 do panelobjs[i]->setTouched
endif
if obj_valid(panelObjs[state.axispanelselect]) then begin
if state.axisselect eq 0 then begin
state.template->setProperty,x_axis=axissettings->copy()
axis_string = 'X'
endif else begin
state.template->setProperty,y_axis=axissettings->copy()
axis_string = 'Y'
endelse
state.statusbar->update,'Saved Current '+axis_string+'-Axis Settings to Template'
state.historywin->update,'Saved Current '+axis_string+'-Axis Settigns to Template'
endif else begin
state.statusbar->update,'Cannot save template. Needs a valid panel to save axis template.'
state.historywin->update,'Cannot save template. Needs a valid panel to save axis template.'
endelse
spd_ui_init_axis_window, state = state
end
'PANELDROPLIST' : begin
spd_ui_axis_options_setvalues, state.tlb, state,/nopopups
state.axispanelselect = event.index
state.labelselect=0
spd_ui_init_axis_window , state = state
state.historywin->Update, 'Panel selected'
end
'AAUTO': if event.select eq 1 then begin
axissettings->setproperty, AnnotateExponent=0
state.historywin->update,'Auto-Notation selected'
end
'ADBL': if event.select eq 1 then begin
axissettings->setproperty, AnnotateExponent=1
state.historywin->update,'Decimal Notation selected'
end
'AEXP': if event.select eq 1 then begin
axissettings->setproperty, AnnotateExponent=2
state.historywin->update,'Scientific Notation selected'
end
'HEXNOT': if event.select eq 1 then begin
axissettings->setproperty, AnnotateExponent=4
state.historywin->update,'Hexadecimal Notation selected'
end
'LINEATZERO': BEGIN
axissettings->SetProperty, lineatzero=event.select
state.historywin->update,'Draw Line at Zero toggled'
END
'SHOWDATE': BEGIN
axissettings->SetProperty, showdate=event.select
id = widget_info(state.tlb, find_by_uname='anodatebase')
if event.select then begin
widget_control, id, /sensitive
endif else begin
widget_control, id, sensitive=0
endelse
state.historywin->update,'Show Date toggled'
END
'ANODATE1': BEGIN
widget_control, event.id, get_value=value
axissettings->SetProperty, datestring1=value
state.historywin->update,'Annotate First toggled'
END
'ANODATE2': BEGIN
widget_control, event.id, get_value=value
axissettings->SetProperty, datestring2=value
state.historywin->update,'Annotate Last toggled'
END
'ANODATEPREVIEW': BEGIN
axissettings->GetProperty, dateString1=datestring1, dateString2=datestring2
panelObjs = spd_ui_axis_options_getpanelobjs(state)
IF ~in_set(Obj_Valid(panelObjs),'0') THEN BEGIN
info = state.drawObject->GetPanelInfo(state.axispanelselect)
line1 = formatdate(info.xrange[0], datestring1, info.xscale)
line2 = formatdate(info.xrange[0], datestring2, info.xscale)
preview = line1 + ssl_newline() + line2
id = widget_info(state.tlb, find_by_uname='anodatepreviewtext')
widget_control, id, set_value=preview
state.historywin->update,'Annotate Preview selected'
ENDIF
END
'ANNOTATEAXIS': BEGIN
axissettings->SetProperty, annotateaxis=event.select
id = widget_info(state.tlb, find_by_uname='annoaxisbase')
if event.select then begin
widget_control, id, /sensitive
endif else begin
widget_control, id, sensitive=0
endelse
state.historywin->update,'Annotate Along Axis toggled'
END
'PLACEANNOTATION':BEGIN
axissettings->SetProperty, placeannotation=event.index
state.historyWin->Update, 'Annotation placement updated to "'+event.str+'".'
END
'ANNOTATEMAJORTICKS': BEGIN
axissettings->SetProperty, annotatemajorticks=event.select
id = widget_info(state.tlb, find_by_uname='annomajorbase')
if event.select then begin
widget_control, id, sensitive=0
endif else begin
widget_control, id, /sensitive
endelse
state.historywin->update,'Annotate Major Ticks toggled'
END
'ANNOTATEEVERY':BEGIN
if event.valid then begin
if event.value le 0 then begin
state.statusBar->Update, 'Annotate Every must be greater than zero.'
endif else begin
axissettings->SetProperty, annotateevery = event.value
state.historywin->Update, 'Annotate every value changed.'
endelse
endif else if finite(event.value,/nan) then begin
state.statusBar->Update, 'Invalid annotate every value, please re-enter.'
endif else state.statusBar->Update, 'Annotate every value must be greater than zero.'
END
'ANNOTATEUNITS':BEGIN
axissettings->GetProperty, $
annotateevery = annotateevery, $
annotateUnits = annotateUnits
annotateEvery = spd_ui_axis_options_convert_units(annotateEvery,annotateUnits)
annotateEvery = spd_ui_axis_options_convert_units(annotateEvery,event.index,/fromSeconds)
axissettings->SetProperty, annotateunits=event.index,annotateEvery=annotateEvery
spd_ui_init_axis_window , state = state
state.historyWin->Update, 'Annotation units updated to "'+axissettings->GetUnit(event.index)+'".'
END
'FIRSTANNOTATION':BEGIN
if finite(event.value,/nan) then state.statusBar->Update, 'Invalid ''Align annotation at'' value, please re-enter.'
END
'ANNOTATESTYLE': BEGIN
axissettings->SetProperty, annotatestyle=event.index
state.historyWin->Update, 'Annotation style updated to "'+axissettings->GetAnnotationFormat(event.index)+'".'
END
'ANNOTATERANGEMIN':BEGIN
axissettings->SetProperty, annotaterangemin = event.select
END
'ANNOTATERANGEMAX':BEGIN
axissettings->SetProperty, annotaterangemax = event.select
END
'ANNOHORIZONTAL': BEGIN
axissettings->SetProperty, annotateorientation=~event.select
state.historywin->Update, 'Horizontal Orientation selected'
END
'ANNOVERTICAL':BEGIN
axissettings->SetProperty, annotateorientation=event.select
state.historywin->Update, 'Vertical Orientation selected'
END
'ANOFONTLIST': BEGIN
axissettings->GetProperty, annotatetextobject = annotatetextobject
annotatetextobject->SetProperty, font=event.index
state.historyWin->Update, 'Annotation font updated to "'+annotatetextobject->GetFont(index=event.index)+'".'
END
'ANOFONTSIZE': BEGIN
if event.valid then begin
if event.value lt 1. then begin
state.statusbar->update, 'Font size should be greater than or equal to one.'
endif
endif else if finite(event.value, /nan) then begin
state.statusBar->Update, 'Invalid annotation font size, please re-enter.'
endif else state.statusBar->Update, 'Annotation font size should be greater than or equal to one, please re-enter.'
END
'ANNOTATIONPALETTE': BEGIN
axissettings->GetProperty,annotatetextobject=annotatetextobject
annotatetextobject->GetProperty,color=currentcolor
color = PickColor(!P.Color, Group_Leader=state.tlb, Cancel=cancelled, $
currentcolor=currentcolor)
if cancelled then color=currentcolor
if obj_valid(annotatetextobject) then annotatetextobject->SetProperty,color=color else begin
annotatetextobject = obj_new('spd_ui_text')
annotatetextobject->SetProperty,color=color
axissettings->SetProperty,annotatetextobject=annotatetextobject
endelse
anocolorid = widget_info(state.tlb, find_by_uname='anocolorwin')
Widget_Control, anocolorid, Get_Value=anocolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=reform(color))
anocolorWin->draw, scene
state.historywin->Update, 'Minor Grids Color selected'
END
'MAJORGRIDPALETTE': begin
axissettings->GetProperty,majorgrid=majorgrid
IF ~Obj_Valid(majorgrid) THEN majorgrid=Obj_New("SPD_UI_LINE_STYLE")
majorgrid->GetProperty,color=currentcolor
color = PickColor(!P.Color, Group_Leader=state.tlb, Cancel=cancelled, $
currentcolor=currentcolor)
if cancelled then color=currentcolor
if obj_valid(majorgrid) then majorgrid->SetProperty,color=color else begin
majorgrid = obj_new('SPD_UI_LINE_STYLE')
majorgrid->SetProperty,color=color
axissettings->SetProperty,majorgrid=majorgrid
endelse
majorcolorid = widget_info(state.tlb, find_by_uname='majorgridcolorwin')
Widget_Control, majorcolorid, Get_Value=majorgridcolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=reform(color))
majorgridcolorWin->draw, scene
state.historywin->Update, 'Lazy Labels selected'
end
'MAJORGRIDS': BEGIN
axissettings->GetProperty, majorgrid=majorgrid
IF ~Obj_Valid(majorgrid) THEN majorgrid=Obj_New("SPD_UI_LINE_STYLE")
majorgrid->SetProperty, show=event.select
if event.select then begin
id = widget_info(state.tlb, find_by_uname = 'majorbase')
widget_control, id, /sensitive
endif else begin
id = widget_info(state.tlb, find_by_uname = 'majorbase')
widget_control, id, sensitive=0
endelse
state.historywin->Update, 'Major Grids toggled'
END
'MAJORGRIDSTYLE': BEGIN
axissettings->GetProperty, majorgrid=majorgrid
IF ~Obj_Valid(majorgrid) THEN majorgrid=Obj_New("SPD_UI_LINE_STYLE")
styleNames = majorgrid->getlinestyles()
majorgrid->SetProperty, Id=event.index, Name=styleNames[event.index]
state.historyWin->Update, 'Major grid line style updated to "'+majorgrid->GetLineStyleName(linestyleid=event.index)+'".'
END
'MAJORGRIDTHICK': BEGIN
END
'MINORGRIDPALETTE': begin
axissettings->GetProperty,minorgrid=minorgrid
IF ~Obj_Valid(minorgrid) THEN minorgrid=Obj_New("SPD_UI_LINE_STYLE")
minorgrid->GetProperty,color=currentcolor
color = PickColor(!P.Color, Group_Leader=state.tlb, Cancel=cancelled, $
currentcolor=currentcolor)
if cancelled then color=currentcolor
if obj_valid(minorgrid) then minorgrid->SetProperty,color=color else begin
minorgrid = obj_new('spd_ui_line_style')
minorgrid->SetProperty,color=color
axissettings->SetProperty,minorgrid=minorgrid
endelse
minorcolorid = widget_info(state.tlb, find_by_uname='minorgridcolorwin')
Widget_Control, minorcolorid, Get_Value=minorgridcolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=reform(color))
minorgridcolorWin->draw, scene
state.historywin->Update, 'Minor Grids Color selected'
end
'MINORGRIDS': BEGIN
axissettings->GetProperty, minorgrid=minorgrid
IF ~Obj_Valid(minorgrid) THEN minorgrid=Obj_New("SPD_UI_LINE_STYLE")
minorgrid->SetProperty, show=event.select
if event.select then begin
id = widget_info(state.tlb, find_by_uname = 'minorbase')
widget_control, id, /sensitive
endif else begin
id = widget_info(state.tlb, find_by_uname = 'minorbase')
widget_control, id, sensitive=0
endelse
state.historywin->Update, 'Minor Grids toggled'
END
'MINORGRIDSTYLE': BEGIN
axissettings->GetProperty, minorgrid=minorgrid
IF ~Obj_Valid(minorgrid) THEN minorgrid=Obj_New("SPD_UI_LINE_STYLE")
styleNames = minorgrid->getlinestyles()
minorgrid->SetProperty, Id=event.index, Name=styleNames[event.index]
state.historyWin->Update, 'Minor grid line style updated to "'+minorgrid->GetLineStyleName(linestyleid=event.index)+'".'
END
'MINORGRIDTHICK': BEGIN
END
'BLACKLABELS': BEGIN
axissettings->SetProperty, BlackLabels=event.select
id = widget_info(state.tlb, find_by_uname='labelpalette')
if event.select eq 1 then widget_control, id, sensitive=0 $
else widget_control, id, sensitive=1
END
'STACKLABELS': begin
axissettings->SetProperty, stacklabels=event.select
state.historywin->Update, 'Stack Labels toggled'
end
'LAZYLABELS': begin
axissettings->setproperty, lazylabels=event.select
state.historywin->Update, 'Lazy Labels toggled'
end
'SHOWLABELS': BEGIN
axissettings->SetProperty, showlabels=event.select
id = widget_info(state.tlb, find_by_uname = 'showlabel')
widget_control, id, sensitive=event.select
id = widget_info(state.tlb, find_by_uname = 'labeldroplist')
widget_control, id, sensitive=event.select
state.historywin->Update, 'Show Labels toggled'
END
'SHOWLABEL': BEGIN
axissettings->getProperty, labels=labels
if obj_valid(labels) then begin
currlabelobj = labels->get(position = state.labelselect)
if obj_valid(currLabelobj) then begin
currLabelObj->setProperty,show=event.select
endif
endif
labelcolorid = widget_info(state.tlb, find_by_uname='labelcolorwin')
spd_ui_axis_options_update_labels, state.tlb, axissettings, currlabelobj, labelcolorid
state.historywin->Update, 'Show Label toggled'
END
'LABELDROPLIST': BEGIN
spd_ui_axis_options_set_labels, state.tlb, state
currlabelObj = spd_ui_axis_options_getcurrentlabel(state)
if event.index eq -1 then begin
currlabelobj->SetProperty, value=event.str
endif else begin
state.labelselect = event.index
currlabelObj = spd_ui_axis_options_getcurrentlabel(state)
endelse
labelcolorid = widget_info(state.tlb, find_by_uname='labelcolorwin')
spd_ui_axis_options_update_labels, state.tlb, axissettings, currlabelobj, labelcolorid
state.historywin->Update, 'Label selected'
END
'LABELTEXTEDIT': BEGIN
widget_control, event.id, get_value = value
if stregex(value[0], '^ *$', /boolean) then begin
show = 0
endif else begin
show = 1
endelse
name = spd_ui_axis_options_create_label_name(state.labelselect,value[0])
id = widget_info(state.tlb, find_by_uname='labeldroplist')
widget_control, id, get_value = labels
labels[state.labelselect] = name
widget_control, id, set_value = labels
widget_control, id, set_combobox_select=state.labelselect
if show eq 0 then value[0] = ''
axissettings->getProperty, labels=labels
if obj_valid(labels) then begin
currlabelobj=labels->get(position = state.labelselect)
IF ~Obj_Valid(currlabelobj) THEN currlabelobj=Obj_New("SPD_UI_TEXT", Value=' ')
endif else currlabelobj = obj_new("SPD_UI_TEXT", Value=' ')
currLabelObj->setProperty, show=show, value=value[0]
id = widget_info(state.tlb, find_by_uname='showlabel')
widget_control, id, set_button=show
state.historywin->Update, 'Label Text edited'
END
'ADDLABEL': BEGIN
axissettings->GetProperty, labels=labelsObj
if obj_valid(labelsObj) then begin
labelsObj->add,obj_new('spd_ui_text',value='New Text Label',font=0,format=3, $
size=10,color=[0,0,0])
endif else begin
labelsObj = obj_new('IDL_Container')
labelsObj->add,obj_new('spd_ui_text',value='New Text Label',font=0,format=3, $
size=10,color=[0,0,0])
endelse
axissettings->SetProperty, labels=labelsObj
state.labelselect = labelsObj->Count() - 1
currlabelobj = labelsObj->get(position = state.labelselect)
spd_ui_init_axis_window , state = state
state.historywin->Update, 'Label Text added'
END
'LABELFONT': begin
state.historywin->Update, 'Label Font selected'
end
'LABELFORMAT': begin
state.historywin->Update, 'Label Font Format selected'
end
'LABELSIZE': BEGIN
if event.valid then begin
if event.value lt 1. then begin
state.statusbar->update, 'Font size should be greater than or equal to one.'
endif
endif else if finite(event.value, /nan) then begin
state.statusBar->Update, 'Invalid label font size, please re-enter.'
endif else state.statusBar->Update, 'Label font size should be greater than or equal to one, please re-enter.'
END
'LABELPALETTE': BEGIN
axissettings->getProperty, labels=labels
if obj_valid(labels) then begin
currlabelobj=labels->get(position = state.labelselect)
IF obj_Valid(currlabelobj) THEN currlabelobj->GetProperty,color=currentcolor $
ELSE currentcolor=[0,0,0]
endif else currentcolor=[0,0,0]
color = PickColor(!P.Color, Group_Leader=state.tlb, Cancel=cancelled, $
currentcolor=currentcolor)
if cancelled then color=currentcolor
if obj_valid(currlabelobj) then currlabelobj->setProperty, color=color
labelcolorid = widget_info(state.tlb, find_by_uname='labelcolorwin')
Widget_Control, labelcolorid, Get_Value=labelcolorWin
labelcolorwin->getproperty, graphics_tree=scene
if obj_valid(scene) then begin
scene->remove,/all
scene->setproperty, color=reform(color)
endif else begin
scene=obj_new('IDLGRSCENE', color=reform(color))
labelcolorwin->setproperty, graphics_tree=scene
endelse
labelcolorWin->draw, scene
state.historywin->Update, 'Label Font Color selected'
END
'LABELHORIZONTAL': BEGIN
axissettings->SetProperty, orientation=~event.select
state.historywin->Update, 'Horizontal Label Orientation selected'
END
'LABELVERTICAL': BEGIN
axissettings->SetProperty, orientation=event.select
state.historywin->Update, 'Vertical Label Orientation selected'
END
'PLACELABEL':BEGIN
axissettings->SetProperty, placelabel=event.index
state.historyWin->Update, 'Label placement updated to "'+event.str+'".'
END
'LABELMARGIN': BEGIN
if event.valid then begin
axissettings->getProperty, margin=oldvalue
mvalue = double(event.value)
if (mvalue gt 10000) or (mvalue lt -10000) then begin
state.historywin->Update, 'Invalid label margin, please re-enter.'
endif else begin
axissettings->SetProperty, margin=mvalue
state.historywin->Update, 'Label margin changed.'
endelse
endif else state.statusBar->Update, 'Invalid label margin, please re-enter.'
END
'LABELSYNC': BEGIN
spd_ui_axis_options_set_labels, state.tlb, state
axissettings->GetProperty,labels=labels
if obj_valid(labels[0]) then begin
labelobjects = labels->get(/all)
labelobjects[state.labelselect]->GetProperty, font=font, format=format, size=size, show=show
for i=0, n_elements(labelobjects)-1 do begin
if i eq state.labelselect then continue
labelobjects[i]->SetProperty, font=font, format=format, size=size, show=show
endfor
state.historywin->update, 'Labels synchronized on panel.'
endif else begin
state.statusBar->update, 'No valid labels to sync on current panel.'
endelse
END
'FORMATHELPBUTTON': BEGIN
gethelppath,path
xdisplayfile,path+'spd_ui_format_axis_labels.txt' , group=state.tlb, /modal, done_button='Done', title='HELP: Formatting Axis Labels'
END
'AUTORANGE': begin
id = widget_info(state.tlb, find_by_uname = 'aobase')
widget_control, id, sensitive = 1
boundid = widget_info(state.tlb, find_by_uname = 'boundscaling')
bound = widget_info(boundid, /button_set)
id = widget_info(state.tlb, find_by_uname='boundbase')
widget_control,id,sensitive=bound
id = widget_info(state.tlb, find_by_uname = 'fobase')
widget_control, id, sensitive = 0
state.historywin->Update, 'Auto Range selected'
end
'FIXEDRANGE': begin
id = widget_info(state.tlb, find_by_uname = 'aobase')
widget_control, id, sensitive = 0
id = widget_info(state.tlb, find_by_uname = 'fobase')
widget_control, id, sensitive = 1
axissettings->getproperty,scaling=scaling, istimeaxis=istimeaxis
linid = widget_info(state.tlb,find_by_uname='linear')
if widget_info(linid,/button_set) then linscale = 1 else linscale = 0
if ~istimeaxis then begin
if linscale eq 0 then minvalue = 0 else minvalue = !values.d_nan
spd_ui_spinner_set_min_value, widget_info(state.tlb, find_by_uname = 'minincrement'), minvalue
spd_ui_spinner_set_min_value, widget_info(state.tlb, find_by_uname = 'maxincrement'),minvalue
endif
state.historywin->Update, 'Fixed Min/Max selected'
end
'BOUNDSCALING': begin
id = widget_info(event.top, find_by_uname='boundbase')
widget_control,id,sensitive=event.select
state.historywin->Update, 'Bound Autoscaling toggled'
end
'ISTIME': BEGIN
spd_ui_axis_options_setvalues, state.tlb, state,/nopopups
istime = Widget_Info(event.id, /Button_Set)
axisSettings->getProperty,$
istimeaxis=istimeold,$
annotateUnits=annotateUnits,$
firstAnnotateUnits=firstAnnotateUnits,$
majorTickUnits=majorTickUnits,$
minorTickUnits=minorTickUnits,$
firstTickUnits=firstTickUnits,$
annotateEvery=annotateEvery,$
firstAnnotation=firstAnnotation,$
majorTickEvery=majorTickEvery,$
minorTickEvery=minorTickEvery,$
firsttickAt=firstTickAt
if istime eq 1 && istimeold eq 0 then begin
annotateEvery = spd_ui_axis_options_convert_units(annotateEvery,annotateUnits,/fromseconds)
firstAnnotation = spd_ui_axis_options_convert_units(firstAnnotation,firstAnnotateUnits,/fromseconds)
majorTickEvery = spd_ui_axis_options_convert_units(majorTickEvery,majorTickUnits,/fromseconds)
minorTickEvery = spd_ui_axis_options_convert_units(minorTickEvery,minorTickUnits,/fromseconds)
firstTickAt = spd_ui_axis_options_convert_units(firstTickAt,firstTickUnits,/fromseconds)
endif else begin
annotateEvery = spd_ui_axis_options_convert_units(annotateEvery,annotateUnits)
firstAnnotation = spd_ui_axis_options_convert_units(firstAnnotation,firstAnnotateUnits)
majorTickEvery = spd_ui_axis_options_convert_units(majorTickEvery,majorTickUnits)
minorTickEvery = spd_ui_axis_options_convert_units(minorTickEvery,minorTickUnits)
firstTickAt = spd_ui_axis_options_convert_units(firstTickAt,firstTickUnits)
endelse
axissettings->SetProperty,$
istimeaxis=istime,$
annotateEvery=annotateEvery,$
firstAnnotation=firstAnnotation,$
majorTickEvery=majorTickEvery,$
minorTickEvery=minorTickEvery,$
firsttickAt=firstTickAt
spd_ui_init_axis_window,event.top,state=state
END
'LINEAR': spd_ui_axis_options_update_scaling, state, axissettings, /linear
'LOG10': spd_ui_axis_options_update_scaling, state, axissettings, /log10
'NATURALLOG': spd_ui_axis_options_update_scaling, state, axissettings, /natural_log
'EQUALXYSCALING': begin
axissettings->SetProperty, equalxyscaling = widget_info(event.id, /button_set)
state.historywin->Update, 'Eual X Y Axis Scaling toggled'
end
'MAJORTICKUNITS': BEGIN
axissettings->getProperty, majortickunits=majorunits, istimeaxis=istime
if istime then begin
id = widget_info(state.tlb,find_by_uname='majortickevery')
widget_control,id,get_value=majorTickEvery
majorTickEvery = spd_ui_axis_options_convert_units(majorTickEvery,majorUnits)
majorTickEvery = spd_ui_axis_options_convert_units(majorTickEvery,event.index,/fromSeconds)
widget_control,id,set_value=majorTickEvery
endif
axissettings->setProperty, majortickunits=event.index
state.historyWin->Update, 'Major tick units updated to "'+axissettings->GetUnit(event.index)+'".'
END
'BYNUMBER': begin
bid = widget_info(state.tlb, find_by_uname='byinterval')
id = widget_info(state.tlb, find_by_uname='intervalbase')
widget_control, bid, set_button=0
widget_control, id, sens=0
id = widget_info(state.tlb, find_by_uname='numberbase')
widget_control, id, sens=1
id = widget_info(state.tlb, find_by_uname='niceticks')
minortickbase = widget_info(state.tlb, find_by_uname='minortickbase')
If widget_info(id, /button_set) then widget_control, minorTickBase, sens=0 else widget_control, minorTickBase, sens=1
state.historywin->Update, 'Major Ticks by Number selected'
end
'NICETICKS': begin
id = widget_info(state.tlb, find_by_uname='niceticks')
minortickbase = widget_info(state.tlb, find_by_uname='minortickbase')
If widget_info(id, /button_set) then widget_control, minorTickBase, sens=0 else widget_control, minorTickBase, sens=1
majortickbase = widget_info(state.tlb, find_by_uname='majortickbase')
If widget_info(id, /button_set) then widget_control, majorTickBase, sens=0 else widget_control, majorTickBase, sens=1
state.historywin->Update, 'Aesthetic Ticks toggled'
end
'BYINTERVAL': begin
bid = widget_info(state.tlb, find_by_uname='bynumber')
id = widget_info(state.tlb, find_by_uname='numberbase')
widget_control, bid, set_button=0
widget_control, id, sens=0
id = widget_info(state.tlb, find_by_uname='intervalbase')
widget_control, id, sens=1
minortickbase = widget_info(state.tlb, find_by_uname='minortickbase')
widget_control,minorTickBase,sensitive=1
state.historywin->Update, 'Major Ticks by Interval selected'
end
'TITLEPALETTE': BEGIN
axissettings->getProperty, titleobj=titleobj
if obj_valid(titleobj) then titleobj->GetProperty,color=currentcolor else currentcolor = [0,0,0]
color = PickColor(!P.Color, Group_Leader=state.tlb, Cancel=cancelled, $
currentcolor=currentcolor)
if cancelled then color=currentcolor
if obj_valid(titleobj) then titleobj->SetProperty,color=color else begin
titleobj = obj_new('spd_ui_text')
titleobj->SetProperty,color=color
axissettings->SetProperty,titleobj=titleobj
endelse
titlecolorid = widget_info(state.tlb, find_by_uname='titlecolorwin')
Widget_Control, titlecolorid, Get_Value=titlecolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=reform(color))
titlecolorWin->draw, scene
state.historywin->Update, 'Title Color selected'
END
'SUBTITLEPALETTE': BEGIN
axissettings->getProperty, subtitleobj=subtitleobj
if obj_valid(subtitleobj) then subtitleobj->GetProperty,color=currentcolor else currentcolor = [0,0,0]
color = PickColor(!P.Color, Group_Leader=state.tlb, Cancel=cancelled, $
currentcolor=currentcolor)
if cancelled then color=currentcolor
if obj_valid(subtitleobj) then subtitleobj->SetProperty,color=color else begin
subtitleobj = obj_new('spd_ui_text')
subtitleobj->SetProperty,color=color
axissettings->SetProperty,subtitleobj=subtitleobj
endelse
subtitlecolorid = widget_info(state.tlb, find_by_uname='subtitlecolorwin')
Widget_Control, subtitlecolorid, Get_Value=subtitlecolorWin
if obj_valid(scene) then scene->remove,/all
scene=obj_new('IDLGRSCENE', color=reform(color))
subtitlecolorWin->draw, scene
state.historywin->Update, 'Subtitle Color selected'
END
'LAZYTITLES': begin
axissettings->setproperty, lazytitles=event.select
state.historywin->Update, 'Lazy Titles toggled'
end
'TITLEHORIZONTAL': BEGIN
axissettings->SetProperty, titleorientation=~event.select
state.historywin->Update, 'Horizontal Title Orientation selected'
END
'TITLEVERTICAL': BEGIN
axissettings->SetProperty, titleorientation=event.select
state.historywin->Update, 'Vertical Title Orientation selected'
END
'PLACETITLE':BEGIN
axissettings->SetProperty, placetitle=event.index
state.historyWin->Update, 'Title placement updated to "'+event.str+'".'
END
'TITLEMARGIN': BEGIN
if event.valid then begin
state.historywin->Update, 'Title margin changed.'
endif else state.statusBar->Update, 'Invalid title margin, please re-enter.'
END
'TITLEFONT': begin
state.historywin->Update, 'Title Font selected'
end
'TITLEFORMAT': begin
state.historywin->Update, 'Title Font Format selected'
end
'SUBTITLEFONT': begin
state.historywin->Update, 'Subtitle Font selected'
end
'SUBTITLEFORMAT': begin
state.historywin->Update, 'Subtitle Font Format selected'
end
'TITLESIZE': BEGIN
if ~event.valid then begin
if finite(event.value,/nan) then begin
state.statusBar->Update, 'Invalid font size, please re-enter.'
endif else begin
state.statusBar->Update, 'Minimum font size is 1.'
endelse
endif
state.historywin->Update, 'Title Font Size changed'
END
'SUBTITLESIZE': BEGIN
if ~event.valid then begin
if finite(event.value,/nan) then begin
state.statusBar->Update, 'Invalid font size, please re-enter.'
endif else begin
state.statusBar->Update, 'Minimum font size is 1.'
endelse
endif
state.historywin->Update, 'Subtitle Font Size changed'
END
'TITLETEXTEDIT': begin
state.historywin->Update, 'Title updated'
end
'SUBTITLETEXTEDIT':begin
state.historywin->Update, 'Subtitle updated'
end
ELSE:
ENDCASE
ENDIF
Widget_Control, event.TOP, Set_UValue=state, /No_Copy
RETURN
END
PRO spd_ui_axis_options, gui_id, windowStorage, loadedData, drawObject, historyWin, $
windowTitle, axisselect, scrollbar, template,$
panel_select=panel_select, tlb_statusbar
compile_opt idl2
err_x=0
catch, err_x
if err_x ne 0 then begin
catch, /cancel
help, /Last_Message, Output=err_msg
for j = 0, N_Elements(err_msg)-1 do historywin->update,err_msg[j]
ok = error_message('An unknown error occured starting Axis Options.', /noname, $
/center, title='Error in Axis Options')
widget_control, tlb, /destroy
spd_gui_error, gui_id, historywin
return
endif
tlb_statusBar->update,'Axis Options opened'
tlb = Widget_Base(/Col, Title=windowTitle, Group_Leader=gui_id, /Modal, /Floating,/tlb_kill_request_events, tab_mode=1)
tabBase = Widget_Tab(tlb, Location=location, uname = 'tabs')
buttonBase = Widget_Base(tlb, /Row, /align_center)
statusBase = Widget_Base(tlb, /Row, /align_center)
rangeBase = Widget_Base(tabBase, Title='Range', /Col)
ticksBase = Widget_Base(tabBase, Title='Ticks', /Col)
gridBase = Widget_Base(tabBase, Title='Grid', /Col)
annotationBase = Widget_Base(tabBase, Title='Annotations', /Col)
titleBase = widget_base(tabBase,Title='Title',/col)
labelsBase = Widget_Base(tabBase, Title='Labels', /Col)
panelBase = Widget_Base(rangeBase, /Row)
rangeBase = Widget_Base(rangeBase, /Row)
range1Base = Widget_Base(rangeBase, /Col)
rlabelBase = Widget_Base(range1Base, /Col)
roptionsBase = Widget_Base(range1Base, /Col, Frame=3)
slabelBase = Widget_Base(range1Base, /Col)
soptionsBase = Widget_Base(range1Base, /Col, Frame=3)
flabelBase = Widget_Base(range1Base, /Col)
foptionsBase = Widget_Base(range1Base, /Col, Frame=3, uname='fobase')
timeXYBase = Widget_Base(range1Base, /Col, /NonExclusive, YPad=2)
lockMSGbase = widget_base(range1Base, /row, ypad=1)
range2Base = Widget_Base(rangeBase, /Col)
alabelBase = Widget_Base(range2Base, /Col, uname='alabelbase')
aoptionsBase = Widget_Base(range2Base, /Col, Frame=3, YPad=6, uname='aobase')
tpanelBase = Widget_Base(ticksBase, ypad=15, /Row)
ticksMainBase = Widget_Base(ticksBase, /Col)
ticksTopBase = Widget_Base(ticksMainBase, /row, ypad=5, /align_left)
ticksMiddleBase = widget_base(ticksMainBase, /col, ypad=1)
ticksBottomBase = Widget_Base(ticksMainBase, /Row,/align_left)
plcmntBase = Widget_Base(ticksBottomBase, /Col, /Align_Left, ypad=5)
lengthBase = Widget_Base(ticksBottomBase, /Col, /Align_Left, xpad=3, ypad=5)
ticksButtonBase = Widget_Base(ticksMainBase, /Row, /Align_Center, YPad=10, /nonexclusive)
gpBase = Widget_Base(gridBase, /Col)
grid1Base = Widget_Base(gridBase, /Col, XPad=4)
majorBase = Widget_Base(grid1Base, /Col, YPad=1, xpad=20)
mgLabelBase = Widget_Base(majorBase, /Row)
majFrameBase = Widget_Base(majorBase, /Col, Frame=3, XPad=15, YPad=1, /align_center, uname='majorbase')
mdLabelBase = Widget_Base(majFrameBase, /Row)
dirPullBase = Widget_Base(majFrameBase, /Col, YPad=1)
minorBase = Widget_Base(grid1Base, /Col, YPad=1, XPad=20)
mgiLabelBase = Widget_Base(minorBase, /Row, YPad=1)
minFrameBase = Widget_Base(minorBase, /Col, Frame=3, YPad=1, XPad=15, /align_center, uname='minorbase')
mdiLabelBase = Widget_Base(minFrameBase, /Row)
diriPullBase = Widget_Base(minFrameBase, /Col, YPad=1)
gcBase = Widget_Base(grid1Base, /Col)
gaBase = Widget_Base(gridBase, /Col, /Align_Center, YPad=1, /nonexclusive)
anoPanelBase = Widget_Base(annotationBase, /Row)
anoMainBase = Widget_Base(annotationBase, /Col)
anoTopBase = Widget_Base(anoMainBase, /row, space=0, ypad=0)
anoTopCol1Base = Widget_Base(anoTopBase, space=0, ypad=0, /Col)
anoTopCol2Base = Widget_Base(anoTopBase, space=0, ypad=0, /Col)
anoMiddleBase = Widget_Base(anoMainBase, /Col, ypad=0, space=0)
anoButtonBase = Widget_Base(anoMainBase, /Row, /Align_Center, /nonexclusive)
titlePanelBase = Widget_Base(titleBase, /Row)
titleMainBase = Widget_Base(titleBase, /Col)
titleTextBase = Widget_Base(titleMainBase, /Col, YPad=1, space=10)
titleButtonBase = Widget_Base(titleMainBase, /Row, /Align_Center, /nonexclusive)
lpanelBase = Widget_Base(labelsBase, /col, YPad=3)
labelMainBase = Widget_Base(labelsBase, /Col)
labelTextBase = Widget_Base(labelMainBase, /Col, YPad=1)
stackBase = Widget_Base(labelMainBase, /nonexclusive, /row)
labelButtonBase = Widget_Base(labelMainBase, /Row, /Align_Center, YPad=3, /nonexclusive)
activeWindow = windowStorage->GetActive()
IF ~Obj_Valid(activeWindow) THEN BEGIN
panelNames=['No Panels']
windowlocked = -1
ENDIF ELSE BEGIN
activeWindow->GetProperty, Panels=panels,locked=windowlocked
IF ~Obj_Valid(panels) THEN BEGIN
panelNames=['No Panels']
ENDIF ELSE BEGIN
panelObjs = panels->Get(/all)
IF Is_Num(panelObjs) THEN BEGIN
panelNames=['No Panels']
ENDIF ELSE BEGIN
FOR i=0, N_Elements(panelObjs)-1 DO BEGIN
activeWindow->getproperty, locked = locked
lockPrefix = i eq locked ? '(L) ':''
name = lockPrefix + panelObjs[i]->constructPanelName()
IF i EQ 0 THEN panelNames=[name] ELSE panelNames=[panelNames, name]
ENDFOR
ENDELSE
ENDELSE
IF Is_Num(panelNames) THEN panelNames=['No Panels']
IF N_Elements(panelNames) EQ 1 && panelNames EQ '' THEN panelNames=['No Panels']
ENDELSE
activeWindow->save
axispanelselect = 0
if obj_valid(panelobjs[0]) then begin
if n_elements(panel_select) gt 0 && panel_select ge 0 && panel_select lt n_elements(panelObjs) then begin
axispanelselect = panel_select
endif else begin
if windowlocked ne -1 then begin
axispanelselect = windowlocked
endif
endelse
case axisselect of
0: panelobjs[axispanelselect]->GetProperty,xaxis=axissettings
1: panelobjs[axispanelselect]->GetProperty,yaxis=axissettings
endcase
IF ~Obj_Valid(axissettings) THEN axissettings = obj_new('spd_ui_axis_settings')
endif else axissettings = obj_new('spd_ui_axis_settings')
axisSettings->GetProperty, $
Scaling=scaleIndex, $
RangeOption=rangeIndex, $
IsTimeAxis=isTimeAxis, $
EqualXYScaling=equalXYScaling, $
MinFixedRange=minFixedRange, $
MaxFixedRange=maxFixedRange, $
RangeMargin=rangeMargin, $
BoundScaling=boundScaling, $
MinBoundRange=minBoundRange, $
MaxBoundRange=maxBoundRange, $
MajorTickEvery=majorTickEvery, $
MajorTickUnits=majorTickUnits, $
MajorTickAuto=majorTickAuto, $
MinorTickEvery=minorTickEvery, $
MinorTickUnits=minorTickUnits, $
MinorTickAuto=minorTickAuto, $
NumMajorTicks=numMajorTicks, $
NumMinorTicks=numMinorTicks, $
FirstTickAt=firstTickAt, $
FirstTickUnits=firstickUnits, $
AnnotateExponent=AnnotateExponent
rpdlabel = Widget_label(panelbase, value = 'Panel: ', /align_center)
rangepanelDroplist = Widget_combobox(panelBase, Value=panelNames, XSize=200, uval='PANELDROPLIST', uname='rangepaneldroplist')
roptionsLabel = Widget_Label(rlabelBase, Value='Range Options:', /Align_Left)
rbuttonsBase = Widget_Base(roptionsBase, /Col, /Exclusive)
sensitive = ~istimeaxis
autoRangeButton = Widget_Button(rbuttonsBase, Value='Auto Range', Sensitive=sensitive, UValue='AUTORANGE',uname='autorange')
fixedRangeButton = Widget_Button(rbuttonsBase, Value='Fixed Range', Sensitive=sensitive, UValue='FIXEDRANGE',uname='fixedrange')
rangeOptions = [autoRangeButton, fixedRangeButton]
soptionsLabel = Widget_Label(slabelBase, Value='Scaling:', /Align_Left)
sbuttonsBase = Widget_Base(soptionsBase, /Col, /Exclusive)
scalingOptions = Make_Array(3, /long)
scalingOptions[0] = Widget_Button(sbuttonsBase, Value='Linear', Sensitive=sensitive, uval = 'LINEAR', uname='linear')
scalingOptions[1] = Widget_Button(sbuttonsBase, Value='Log 10', Sensitive=sensitive, uval = 'LOG10',uname='log10')
scalingOptions[2] = Widget_Button(sbuttonsBase, Value='Natural Log', Sensitive=sensitive, uval = 'NATURALLOG',uname='logn')
WIDGET_CONTROL, scalingOptions[scaleIndex], /Set_Button
isTimeButton = Widget_Button(timeXYBase, Value='Time Axis', UValue='ISTIME',uname='istime', tooltip='If checked, SPEDAS will generate date and time based annotations for this axis.')
lockMSG = widget_label(lockmsgbase, value='', uvalue = 'lockmsg')
IF isTimeAxis EQ 1 THEN Widget_Control, isTimeButton, /Set_Button
IF rangeIndex EQ 2 THEN sensitive=1 ELSE sensitive=0
foptionsLabel = Widget_Label(flabelBase, Value='Fixed Range:', /Align_Left)
minBase = Widget_Base(foptionsBase, /Row, /align_right, uname='minbase')
maxBase = Widget_Base(foptionsBase, /Row, /align_right, uname='maxbase')
minIncLabel=widget_label(minbase, Value='Min: ')
maxIncLabel=widget_label(maxbase, Value='Max: ')
if istimeaxis then begin
minIncrement=widget_text(minBase, Sensitive=sensitive, /editable, uval='MINFIXEDRANGE', uname='minincrement',/all_events)
maxIncrement=widget_text(maxBase, Sensitive=sensitive, /editable, uval='MAXFIXEDRANGE', uname='maxincrement',/all_events)
endif else begin
minIncrement=spd_ui_spinner(minBase, Increment=1, Sensitive=sensitive, Value=minFixedRange, text_box_size=12, $
uval='MINFIXEDRANGE', uname='minincrement')
maxIncrement=spd_ui_spinner(maxBase, Increment=1, Sensitive=sensitive, Value=maxFixedRange, text_box_size=12, $
uval='MAXFIXEDRANGE', uname='maxincrement')
endelse
aoptionsLabel = Widget_Label(alabelBase, Value='Auto Range:', /Align_Left)
rmBase = Widget_Base(aoptionsBase, /Row)
IF rangeIndex EQ 0 THEN sensitive=1 ELSE sensitive=0
rmLabel=Widget_Label(rmBase, value='Range Margin (%): ', xsize=120, /align_left, uname='rmlabel')
rmIncrement=spd_ui_spinner(rmBase,increment=1, Value=200*rangeMargin, uval = 'RANGEMARGIN', $
uname='rmincrement', min_value = 0)
autoBase = Widget_Base(aoptionsBase, /NonExclusive)
autoButton = Widget_Button(autoBase, value = ' Bound autoscaling range', $
tooltip='Automatically scales the range within user defined boundaries', uname='boundscaling', uval='BOUNDSCALING')
IF boundScaling THEN BEGIN
Widget_Control, autoButton, /Set_Button
sensitive=1
ENDIF else sensitive = 0
boundbase = widget_base(aoptionsBase,uname='boundbase',/col)
minaBase = Widget_Base(boundbase, /Row)
minaLabel=Widget_Label(minaBase, value='Minimum: ', /align_left, uname='minlabel', xsize=96)
minaIncrement=spd_ui_spinner(minaBase, Increment=1, Value=minBoundRange, $
text_box_size=12, uval = 'MINBOUNDRANGE', uname='minboundrange')
maxaBase = Widget_Base(boundbase, /Row)
maxaLabel=Widget_Label(maxaBase, value='Maximum: ', /align_left, xsize=96, uname='maxlabel')
mmaxaIncrement=spd_ui_spinner(maxaBase, Increment=1, Value=maxBoundRange, $
text_box_size=12, uval = 'MAXBOUNDRANGE', uname='maxboundrange')
minmaxLabel = Widget_Label(boundbase, Value='(Not applied if min/max are equal)')
tpanellabel = widget_label(tpanelbase, value = 'Panel: ', /align_left)
tpanelDroplist = Widget_combobox(tpanelBase, Value=panelNames, XSize=200, $
uval='PANELDROPLIST', uname='tickpaneldroplist')
tickUnitValues = axisSettings->GetUnits()
tickStyleValues = axisSettings->GetStyles()
bynumberBase = widget_base(ticksTopBase, /col, uname='bynumberbase')
byintervalBase = widget_base(ticksTopBase, /col, uname='byintervalbase')
iLabelBase = widget_base(byintervalBase, /row, /exclusive)
byinterval = widget_button(ilabelbase, value='Major Ticks By Interval', uvalue='BYINTERVAL', $
uname='byinterval')
intervalbase = widget_base(byintervalBase, /col, /base_align_left, uname='intervalbase', $
frame=1, space=6, ypad=6, xpad=4)
tickEvery = spd_ui_spinner(intervalBase, label='Major Tick Every: ', getXLabelSize=xlsize, $
text_box_size=12, uname='majortickevery', incr=1, $
tooltip='Inverval in Units between major tick marks', min_value=0)
geo_tmp = widget_info(tickevery,/geo)
tickUnitsBase = widget_base(intervalBase, /row, xpad=0, ypad=0, space=1)
unitslabel = widget_label(tickUnitsBase, value='Units', xsize=xlsize)
unitslist = widget_combobox(tickUnitsBase, value=tickUnitValues, uval='MAJORTICKUNITS', $
uname='majortickunits', xsize=geo_tmp.scr_xsize - xlsize - 2)
firsttickBase = widget_base(intervalBase, /row, xpad=0, space=0,uname='firsttickatbase')
firstticklabel = widget_label(firsttickBase, value='Align ticks at: ', xsize=xlsize+3)
if istimeaxis then begin
firsttick = widget_text(firsttickBase, value=time_string(firsttickat), uname='firsttickat',/editable)
endif else begin
firsttick = spd_ui_spinner(firsttickBase, value=firsttickat, incr=1, uname='firsttickat', $
tooltip='Numerical location of first tick.', text_box=12)
endelse
numLabelBase = widgeT_base(bynumberBase, /Col, /exclusive)
bynumber = widget_button(numlabelBase, value='Major Ticks By Number', uvalue='BYNUMBER', $
uname='bynumber')
numberbase = widget_base(bynumberBase, /col, /base_align_left, uname='numberbase', $
frame=1, space=6, ypad=6, xpad=4)
niceticksbase = widget_base(numberbase, /row, /nonexclusive, uname='niceticksbase')
niceticks = widget_button(niceticksbase, value='Automatic Ticks', uvalue='NICETICKS', uname='niceticks', $
tooltip='Places ticks at easily read values.')
majorTickBase = widget_base(numberBase,uname='majortickbase',sens=0)
MajorTicknum = spd_ui_spinner(majorTickBase, value=nummajorticks, getXlabelSize=xlsize, $
uname='nummajorticks', uvalue='NUMMAJORTICKS', label='Major Ticks (hint): ', incr=1, min_value=0, max_value=100,tooltip='Number of ticks may be approximate.')
widget_control, numberbase, scr_ysize=( widget_info(intervalbase, /geo) ).scr_ysize
widget_control, unitslist, Set_combobox_Select=majorTickUnits
widget_control, bynumber, set_button=1
widget_control, numberbase, sens=1
widget_control, byinterval, set_button=0
widget_control, intervalbase, sens=0
minorTickBase = widget_base(ticksMiddleBase, /row, sens=0, uname='minortickbase')
MinorTicknum = spd_ui_spinner(minorTickBase, value=numminorticks, getXlabelSize=xlsize, $
uname='numminorticks', label='# of Minor Ticks: ', incr=1, min_value=0, max_value=100)
minorLogTickTypeBase = widget_base(ticksMiddleBase,/col,/frame,/base_align_center)
minorLogTickTypeLabelBase = widget_base(minorLogTickTypeBase,/base_align_center,/row)
minorLogTickTypeLabel = widget_label(minorLogTickTypeLabelBase,value="Log Minor Tick Type:", /align_center)
minorLogTickTypeButtonBase = widget_base(minorLogTickTypeBase,/exclusive,/row,uname='logminorticktypebase')
minorLogTickType0 = widget_button(minorLogTickTypeButtonBase,value='Full Interval', $
uname='logminorticktype0', tooltip='Minor ticks linearly divide each major tick interval.')
minorLogTickType1 = widget_button(minorLogTickTypeButtonBase,value='First Magnitude', $
tooltip='For major tick spacing > 1 order of magnitude, minor ticks linearly divide first order of magnitude in each major tick interval.',uname='logminorticktype1')
minorLogTickType2 = widget_button(minorLogTickTypeButtonBase,value='Last Magnitude',$
tooltip='For major tick spacing > 1 order of magnitude, minor ticks linearly divide last order of magnitude in each major tick interval.',uname='logminorticktype2')
minorLogTickType3 = widget_button(minorLogTickTypeButtonBase,value='Even Spacing',$
tooltip='Minor ticks logarithmically divide each major tickinterval.',uname='logminorticktype3')
tickstyleBase = Widget_Base(ticksMiddleBase, /row, ypad=3)
tslabel = widget_label(tickstylebase, value = 'Draw Ticks: ', xsize=xlsize+1)
tickStyleDroplist = Widget_combobox(tickstyleBase, Value=tickStyleValues, uval='TICKSTYLE',uname='tickstyle')
placementLabel = Widget_Label(plcmntBase, Value = 'Placement', /Align_Left)
placeFrameBase = Widget_Base(plcmntBase, /Col, /NonExclusive, Frame=3, YPad=11, XPad=10,uname='placeframebase')
case axisselect of
0:BEGIN
botbutval = 'Bottom '
topbutval = 'Top '
END
1:BEGIN
botbutval = 'Left '
topbutval = 'Right '
END
endcase
bottomButton = Widget_Button(placeFrameBase, Value=botbutval, uval='BOTTOMPLACE', $
uname='bottomplace')
topButton = Widget_Button(placeFrameBase, Value=topbutval, uval='TOPPLACE', $
uname='topplace')
WIDGET_CONTROL, bottomButton, /Set_Button
WIDGET_CONTROL, topButton, /Set_Button
lengthLabel = Widget_Label(lengthBase, Value = 'Length', /Align_Left)
lengthFrameBase = Widget_Base(lengthBase, /Col, Frame=3, uname='lengthframebase')
lmajorBase = Widget_Base(lengthFrameBase, /Row, YPad=3)
lmajorIncrement = spd_ui_spinner(lmajorBase, label = 'Major : ',Increment=1, uval='MAJORLENGTH', $
uname='majorlength', min_value = 0, max_value = 10000)
lmajorLabel= Widget_Label(lmajorBase, Value=' pts')
lminorBase = Widget_Base(lengthFrameBase, /Row, YPad=3)
lminorIncrement = spd_ui_spinner(lminorBase, label = 'Minor : ',Increment=1, uval='MINORLENGTH', $
uname='minorlength', min_value = 0, max_value = 10000)
lminorLabel = Widget_Label(lminorBase, Value=' pts')
gppanelbase = widget_base(gpbase, /row)
gplabel = widget_label(gppanelbase, value='Panel: ')
gpDroplist = Widget_combobox(gppanelBase, Value=panelNames, XSize=200, uval='PANELDROPLIST', uname='gridpaneldroplist')
gmajorLabel = Widget_Label(mglabelBase, Value='Major Grids: ', /Align_left, uname='majorgridbtnlabel')
gmajorbuttonbase = Widget_Base(mglabelBase, /NonExclusive)
gmajorbutton = Widget_Button(gmajorbuttonbase, value=' ', uval='MAJORGRIDS', uname='majorgrids')
currentBase = Widget_Base(dirPullBase, /Row, XPad=1)
paletteBase = Widget_Base(dirPullBase, /Row, XPad=1)
colorLabel = Widget_Label(paletteBase, Value='Color: ', /align_left, xsize=100, uname='majorcolorlabel')
getresourcepath,rpath
palettebmp = read_bmp(rpath + 'color.bmp', /rgb)
spd_ui_match_background, tlb, palettebmp
majorgridpaletteButton = Widget_Button(paletteBase, Value=palettebmp, /Bitmap, $
UValue='MAJORGRIDPALETTE', uname='majorgridpalette', $
Tooltip='Choose color from Palette')
spaceLabel = Widget_Label(paletteBase, Value=' ')
majorgridcolorWindow = WIDGET_DRAW(paletteBase,graphics_level=2,renderer=1, $
retain=1, XSize=50, YSize=20, units=0, frame=1, /expose_events, uname='majorgridcolorwin')
cmajorBase = Widget_Base(dirpullBase, /Row)
cmajorlabel=widget_label(cmajorBase, value='Thickness: ', /align_left, uname='majorgridlabel', xsize=100)
cmajorIncrement = spd_ui_spinner(cmajorBase, Increment=1, Value=1,xsize=120, $
uval='MAJORGRIDTHICK', uname='majorgridthick', min_value=1, max_value=10)
smajorbase = widget_base(dirpullbase, /row)
smajorlabel = widget_label(smajorbase, value='Style: ', xsize=100, /align_left, uname='majorstylelabel')
lineObj=Obj_New("SPD_UI_LINE_STYLE")
lineStyles=lineObj->GetLineStyles()
Obj_Destroy, lineObj
smajorDroplist = Widget_combobox(smajorbase, XSize=157, $
uval='MAJORGRIDSTYLE', uname='majorgridstyle', $
Value=lineStyles)
gimajorLabel = Widget_Label(mgilabelBase, Value = 'Minor Grids: ', /Align_Left, uname='minorgridbtnlabel')
gminorbuttonbase = Widget_Base(mgilabelBase, /NonExclusive)
gminorbutton = Widget_Button(gminorbuttonbase, value=' ', uval='MINORGRIDS', uname='minorgrids')
cminorBase = Widget_Base(diripullBase, /Row, XPad=1)
paletteiBase = Widget_Base(diripullBase, /Row, XPad=1)
coloriLabel = Widget_Label(paletteiBase, Value='Color: ' ,/align_left, uname='minorclabolorel', xsize=100)
minorgridpaletteButton = Widget_Button(paletteiBase, Value=palettebmp, /Bitmap, $
UValue='MINORGRIDPALETTE', uname='minorgridpalette', $
Tooltip='Choose color from Palette')
spaceLabel = Widget_Label(paletteiBase, Value=' ')
minorgridcolorWindow = WIDGET_DRAW(paletteiBase,graphics_level=2,renderer=1, $
retain=1, XSize=50, YSize=20, units=0, frame=1, /expose_events, uname='minorgridcolorwin')
cminorBase = Widget_Base(diripullBase, /Row)
cmajorlabel=widget_label(cminorBase, value='Thickness: ', /align_left, uname='minorgridlabel', xsize=100)
cminorIncrement = spd_ui_spinner(cminorBase,Increment=1, Value=1, $
uval='MINORGRIDTHICK', uname='minorgridthick',min_value=1, max_value=10)
sminorbase = widget_base(diripullbase, /row)
sminorlabel=widget_label(sminorBase, value='Style: ', /align_left, uname='minorstylelabel', xsize=100)
sminorDroplist = Widget_combobox(sminorbase, XSize=160, $
uval='MINORGRIDSTYLE', uname='minorgridstyle', $
Value=lineStyles)
anoPlabel = widget_label(anopanelbase, value = 'Panel: ')
anoPanelDroplist = Widget_combobox(anopanelBase, Value=panelNames, XSize=200, uval='PANELDROPLIST', uname='annopaneldroplist')
IF isTimeAxis EQ 1 THEN sensitive=1 ELSE sensitive=0
anoDrawBase = Widget_Base(anoTopCol1Base, /col, /NonExclusive)
anoDrawButton = Widget_Button(anoDrawBase, Value='Draw Line at Zero (1 for log)', uval='LINEATZERO', $
uname='lineatzero')
anoftButton = Widget_Button(anoDrawBase, Value='Annotate Range Min', uval='ANNOTATERANGEMIN', $
uname='annotaterangemin')
WIDGET_CONTROL, anoftButton, /Set_Button
ano2ftButton = Widget_Button(anoDrawBase, Value='Annotate Range Max', uval='ANNOTATERANGEMAX', $
uname='annotaterangemax')
WIDGET_CONTROL, ano2ftButton, /Set_Button
anoShowButton = Widget_Button(anoDrawBase, Value='Show Date', Sensitive=sensitive, $
uval='SHOWDATE', uname='showdate')
WIDGET_CONTROL, anoShowButton, /Set_Button
anoShowDateBase = Widget_Base(anoMiddleBase, /Row, /NonExclusive)
anoDateBase = Widget_Base(anoMiddleBase, /Row, frame=1, uname='anodatebase')
anoDateTextBases = Widget_Base(anoDateBase, /col)
anoDateFormat1Base = Widget_Base(anoDateTextBases, /row)
anoDateFormat2Base = Widget_Base(anoDateTextBases, /row)
anoDatePreviewTextBase = Widget_Base(anoDateBase, /col)
anoDateFormat1Label = Widget_Label(anoDateFormat1Base, Value='Line 1: ')
anoDateFormat1 = Widget_Text(anoDateFormat1Base, /editable, uval='ANODATE1', uname='anodate1', /All_Events)
anoDateFormat2Label = Widget_Label(anoDateFormat2Base, Value='Line 2: ')
anoDateFormat2 = Widget_Text(anoDateFormat2Base, /editable, uval='ANODATE2', uname='anodate2', /All_Events)
anoDatePreviewText = Widget_Text(anoDatePreviewTextBase, ysize=2, xsize=32, /wrap, uname='anodatepreviewtext')
anoDatePreviewButt = Widget_Button(anoDatePreviewTextBase, value='Preview', uval='ANODATEPREVIEW')
anoAxisBase = Widget_Base(anoMiddleBase, /Row, /NonExclusive)
anoAxisButton = Widget_Button(anoAxisBase, Value='Annotate Along Axis:', uval='ANNOTATEAXIS', $
uname='annotateaxis')
WIDGET_CONTROL, anoAxisButton, /Set_Button
anoFrameBase = Widget_Base(anoMiddleBase, /Col, Frame=5, XPad=5, uname='annoaxisbase')
anofpBase = Widget_Base(anoFrameBase, /row)
case axisselect of
0: annoplacement = ['Bottom','Top']
1: annoplacement = ['Left','Right']
endcase
anoMajorBase = Widget_Base(anofpBase, /Row, /NonExclusive)
anoMajorButton = Widget_Button(anoMajorBase, Value='Annotate Major Ticks', uval='ANNOTATEMAJORTICKS', $
uname='annotatemajorticks')
anoplabel = widget_label(anofpbase, value='Place Annotation on: ', /align_left, xsize=125)
anoPlaceDroplist = Widget_combobox(anofpBase, Value=annoplacement, uval='PLACEANNOTATION', uname='placeannotation')
WIDGET_CONTROL, anoMajorButton, /Set_Button
anomFrameBase = Widget_Base(anoFrameBase, /Col, XPad=4, uname='annomajorbase')
anoEveryBase = Widget_Base(anomFrameBase, /Row)
anoEveryLabel = Widget_Label(anoEveryBase, Value='Annotate Every: ', /align_left, xsize=101)
anoEveryText = spd_ui_spinner(anoEveryBase, Value=majortickevery, increment=1,$
text_box_size=12, uval='ANNOTATEEVERY', uname='annotateevery',min_value=0)
spaceLabel = Widget_Label(anoEveryBase, Value = ' ')
IF isTimeAxis EQ 1 THEN Sensitive=1 ELSE Sensitive=0
anoEveryDroplist = Widget_combobox(anoEveryBase, Value=tickUnitValues, xsize=120, uval='ANNOTATEUNITS', uname='annotateunits')
anoFirstBase = Widget_Base(anomFrameBase, /Row,uname='firstannotationbase')
anoFirstLabel = Widget_Label(anoFirstBase, Value='Align Annotations At: ' ,/align_left)
if istimeaxis then begin
anoFirstText = widget_text(anoFirstBase, value=time_string(0), uname='firstannotation',/editable,uval='FIRSTANNOTATION')
endif else begin
anoFirstText = spd_ui_spinner(anoFirstBase, value=0, incr=1, uname='firstannotation', $
tooltip='Numerical location of first annotation.', text_box=12,uval='FIRSTANNOTATION')
endelse
anoBase = Widget_Base(anoFrameBase, /row)
styleValues = axisSettings->GetAnnotationFormats()
anoSBase = widget_base(anoTopCol2Base, /row, space = 0)
avalue = istimeaxis ? 'Annotation Format: ':'Annotation Precision: '
anoSLabel = widget_label(anosbase, value = avalue, uname='anoslabel')
anoStyleDroplist = Widget_combobox(anosbase, Value = styleValues, uval='ANNOTATESTYLE', uname='annotatestyle')
anoSOBase = widget_base(anoTopCol2Base, column=1, /exclusive, ypad=0, space=0)
default = widget_button(anoSOBase, value = 'Auto-Notation', uvalue='AAUTO', uname='aauto', sensitive=~istimeaxis)
dbl = widget_button(anoSOBase, value = 'Decimal Notation', uvalue='ADBL', uname='adbl', sensitive=~istimeaxis)
expo = widget_button(anoSOBase, value = 'Scientific Notation', uvalue='AEXP', uname = 'aexp', sensitive=~istimeaxis)
hexno = widget_button(anoSOBase, value = 'Hexadecimal Notation', uvalue='HEXNOT', uname = 'hexnot', sensitive=~istimeaxis)
atype = [default, dbl, expo, hexno, hexno]
widget_control, atype[annotateExponent], /set_button
orientBase = Widget_Base(anoFrameBase, /row)
orientationLabel = Widget_Label(orientBase, Value=' Orientation: ', /Align_Left, xsize=125,sensitive=1)
orientButtonBase = Widget_Base(orientBase, /Exclusive, /row)
landscapeButton = Widget_Button(orientButtonBase, Value='Horizontal ', UValue='ANNOHORIZONTAL', $
uname='annohorizontal')
landscapeButton = Widget_Button(orientButtonBase, Value='Vertical ', UValue='ANNOVERTICAL', $
uname='annovertical')
anoStyleBase = Widget_Base(anoFrameBase, /row)
anoFontBase = Widget_Base(anoStyleBase, /col)
textObj = Obj_New("SPD_UI_TEXT")
fontNames = textObj->GetFonts()
anoFontLabel = Widget_Label(anoFontBase, value='Font', /align_left)
anoStyleDroplist = Widget_combobox(anoFontbase, value=fontNames, uval='ANOFONTLIST', uname='anofontlist')
anoIncBase = Widget_Base(anoStyleBase, /col)
anoIncLabel = Widget_Label(anoIncBase, value='Size (pts)', /align_left)
fontTitleIncrement = spd_ui_spinner(anoIncBase, Increment=1, uval='ANOFONTSIZE', $
uname='anofontsize', min_value=1)
anoColorBase = Widget_Base(anoStyleBase, /col)
colorLabel = Widget_Label(anoColorbase, value='Color', /align_center)
annotationpaletteButton = Widget_Button(anoColorBase, Value=palettebmp, /Bitmap, $
UVal='ANNOTATIONPALETTE', uname='annotationpalette', $
Tooltip='Choose color from Palette')
anoCurrentBase = Widget_Base(anoStyleBase, /col)
anoCurrentLabel = Widget_Label(anocurrentbase, value='Current Color')
anoColorWindow = WIDGET_DRAW(anoCurrentBase, graphics_level=2, renderer=1, retain=1, XSize=50, $
YSize=20, units=0, frame=1, /expose_events, uname='anocolorwin')
titlepdBase = widget_base(titlepanelbase, /row)
titlePLabel=Widget_Label(titlepdBase, value='Panel: ')
titlepanelDroplist = Widget_combobox(titlepdBase, Value=panelNames, XSize=150, uval='PANELDROPLIST', uname='titlepaneldroplist')
titletextcolbase = widget_base(titletextBase, col=2, space=350)
titletextframeLabel = Widget_Label(titletextcolbase, Value='Text: ', /Align_Left)
titlehelpbutton = widget_button(titletextcolbase, value='Format Help', uname='formathelpbutton', uvalue='FORMATHELPBUTTON')
titletextFrameBase = Widget_Base(titletextBase, /col, Frame=3,XPad=1, uname='titletextframebase')
titlecolBase = widget_base(titletextframebase,/col)
titleeditBase = widget_base(titlecolbase,/row, ypad=1,/base_align_center)
titleeditbasecol1 = widget_base(titleeditBase, /col, /base_align_left)
titleeditbasecol2 = widget_base(titleeditbase, /col, /base_align_left)
titletextlabel = widget_label(titleeditbasecol1, value='Title:', xsize=60, /align_left)
titletextfield = widget_text(titleeditBasecol2, value = '', /editable, /all_events, xsize=55, ysize=1, $
uval='TITLETEXTEDIT', uname='titletextedit')
titlerow1base = widget_base(titlecolbase,/row, xpad=40,/base_align_center)
titlelabel1base = widget_base(titlerow1base,/col,/base_align_left, space=20, ypad=6)
titlefield1base = widget_base(titlerow1base,/col,/base_align_left, space=12)
titlelabel2base = widget_base(titlerow1base,/col,/base_align_left, space=20, ypad=6)
titlefield2base = widget_base(titlerow1base,/col,/base_align_left, space=6)
tlabel = Widget_Label(titlelabel1Base, value = 'Font:')
lpofontDroplist = Widget_combobox(titlefield1Base, XSize=125, Value=fontnames, uval='TITLEFONT', uname='titlefont')
tlabel = Widget_Label(titlelabel1Base, value = 'Format:')
formattypes=textObj->getformats()
titleFormatDroplist = Widget_combobox(titlefield1Base, XSize=125, Value=formattypes, uval='TITLEFORMAT', uname='titleformat')
tlabel= Widget_Label(titlelabel2Base, value='Size (points): ', /align_left)
fontIncrement = spd_ui_spinner(titlefield2Base, Increment=1, Value=12, uval='TITLESIZE', uname='titlesize', min_value=1)
tlabel= Widget_Label(titlelabel2Base, value='Color: ', /align_left)
titlecolorBase = Widget_Base(titlefield2Base, /row, xpad=0, /base_align_center)
titlepaletteButton = Widget_Button(titlecolorBase, Value=palettebmp, /Bitmap, UValue='TITLEPALETTE', uname='titlepalette', $
Tooltip='Choose color from Palette')
titleColorWindow = WIDGET_DRAW(titlecolorBase, graphics_level=2, renderer=1, retain=1, XSize=50, YSize=20, units=0, frame=1, $
uname = 'titlecolorwin', /expose_events)
subtitleeditBase = widget_base(titlecolbase,/row, ypad=1,/base_align_center)
subtitleeditbasecol1 = widget_base(subtitleeditBase, /col, /base_align_left)
subtitleeditbasecol2 = widget_base(subtitleeditbase, /col, /base_align_left)
subtitletextlabel = widget_label(subtitleeditbasecol1, value='Subtitle:',xsize=60,/align_left)
subtitletextfield = widget_text(subtitleeditbasecol2, value='',/editable, /all_events, xsize=55, ysize=1,$
uval='SUBTITLETEXTEDIT',uname='subtitletextedit')
subtitlerow1base = widget_base(titlecolbase,/row, xpad=40,/base_align_center)
subtitlelabel1base = widget_base(subtitlerow1base,/col,/base_align_left, space=20, ypad=6)
subtitlefield1base = widget_base(subtitlerow1base,/col,/base_align_left, space=12)
subtitlelabel2base = widget_base(subtitlerow1base,/col,/base_align_left, space=20, ypad=6)
subtitlefield2base = widget_base(subtitlerow1base,/col,/base_align_left, space=6)
subtlabel = Widget_Label(subtitlelabel1Base, value = 'Font:')
sublpofontDroplist = Widget_combobox(subtitlefield1Base, XSize=125, Value=fontnames, uval='SUBTITLEFONT', uname='subtitlefont')
subtlabel = Widget_Label(subtitlelabel1Base, value = 'Format:')
formattypes=textObj->getformats()
subtitleFormatDroplist = Widget_combobox(subtitlefield1Base, XSize=125, Value=formattypes, uval='SUBTITLEFORMAT', uname='subtitleformat')
subtlabel= Widget_Label(subtitlelabel2Base, value='Size (points): ', /align_left)
subfontIncrement = spd_ui_spinner(subtitlefield2Base, Increment=1, Value=12, uval='SUBTITLESIZE', uname='subtitlesize', min_value=1)
subtlabel= Widget_Label(subtitlelabel2Base, value='Color: ', /align_left)
subtitlecolorBase = Widget_Base(subtitlefield2Base, /row, xpad=0, /base_align_center)
subtitlepaletteButton = Widget_Button(subtitlecolorBase, Value=palettebmp, /Bitmap, UValue='SUBTITLEPALETTE', uname='subtitlepalette', $
Tooltip='Choose color from Palette')
subtitleColorWindow = WIDGET_DRAW(subtitlecolorBase, graphics_level=2, renderer=1, retain=1, XSize=50, YSize=20, units=0, frame=1, $
uname = 'subtitlecolorwin', /expose_events)
titleplacementframeLabel = Widget_Label(titletextBase, Value='Style & Placement: ', /Align_Left)
titleplacementFrameBase = Widget_Base(titletextBase, /col, Frame=3,XPad=1, uname='titleplacementframebase')
case axisselect of
0: titleplacement = ['Bottom','Top ']
1: titleplacement = ['Left ','Right ']
endcase
titleplacebase0 = widget_base(titleplacementframebase,/row, /base_align_center)
titlelazybase = widget_base(titleplaceBase0, /row, /nonexclusive,/align_left)
titlelazyButton = widget_button(titlelazybase, value='Lazy Titles', uval='LAZYTITLES', $
uname='lazytitles', tooltip='Underscores will be converted to new lines')
titleplaceBase = widget_base(titleplacementframebase,/row,/base_align_center)
titlepBase = Widget_Base(titleplaceBase, /row)
titleplacelabel = widget_label(titlepbase, value='Place Title on: ')
titlePlaceDroplist = Widget_combobox(titlepBase, Value=titleplacement, uval='PLACETITLE', uname='placetitle')
titlemarginBase = Widget_Base(titleplacebase, /Row, xpad=20)
titlemarginIncrement=spd_ui_spinner(titlemarginBase, label = 'Margin: ',Increment=1, uval='TITLEMARGIN', uname='titlemargin')
titlemarginLabel = Widget_Label(titlemarginBase, Value=' pts ')
titleplace2Base = widget_base(titleplacementframebase,/row)
titlep2Base = Widget_Base(titleplace2Base, /row)
titleplacelabel = widget_label(titlep2base, value='Orientation: ')
titleButBase = Widget_Base(titlep2Base , /row, /Exclusive,xpad=12,space=50)
titleHorizButton = Widget_Button(titleButBase, Value='Horizontal', uval='TITLEHORIZONTAL', uname='titlehorizontal')
titleVertButton = Widget_Button(titleButBase, Value='Vertical', uval='TITLEVERTICAL', uname='titlevertical')
Widget_Control, titleVertButton, /Set_Button
lpdBase = widget_base(lpanelbase, /row)
panelLabel=Widget_Label(lpdBase, value='Panel: ')
lpanelDroplist = Widget_combobox(lpdBase, Value=panelNames, XSize=150, uval='PANELDROPLIST', uname='labelpaneldroplist')
ltextLabel = Widget_Label(labeltextBase, Value='Text: ', /Align_Left)
ltFrameBase = Widget_Base(labeltextBase, /col, Frame=3,XPad=1, uname='ltframebase')
lt1TextBase = Widget_Base(ltFrameBase, /row, xpad=3)
col1Base = Widget_Base(lt1TextBase, /col, /base_align_Center, ypad=5)
labelSelectBase = widget_base(col1base, /row, xpad=0, /align_left, space=3)
ltexteditlabel = widget_label(labelSelectBase,value='Select Label: ')
lt1Text = Widget_Combobox(labelSelectBase,Value = ' ', XSize=260, uval='LABELDROPLIST', uname='labeldroplist')
ltexteditBase = widget_base(col1base, /row, xpad=0, /align_left, space=3)
ltexteditlabel = widget_label(ltexteditBase,value='Edit/Add Label:')
ltextedit = widget_text(ltexteditBase, value = '', /editable, /all_events, xsize=40, ysize=1, $
uval='LABELTEXTEDIT', uname='labeltextedit')
col2Base = Widget_Base(lt1TextBase, /col)
col2Base2 = Widget_Base(col2Base, /col, /nonexclusive, ypad=5)
showSingleLabelCheck = widget_button(col2Base2,value='Show Label',UVALUE='SHOWLABEL',uname='showlabel')
ltexthelpbutton = widget_button(col2Base, value='Format Help', uname='formathelpbutton', uvalue='FORMATHELPBUTTON')
ltFrameAttrBase = widget_base(ltFrameBase,/row)
lpcol1Base = Widget_Base(ltFrameAttrBase, /row)
lpcol2Base = Widget_Base(ltFrameAttrBase, /row)
lpcol1aBase = Widget_Base(lpcol1Base, /col, space=17)
lpcol1bBase = Widget_Base(lpcol1Base, /col, space=5)
lpcol2aBase = Widget_Base(lpcol2Base, /col, space=17)
lpcol2bBase = Widget_Base(lpcol2Base, /col, space=5)
lpstyleLabel = Widget_Label(labelTextBase, Value='Style & Placement:', /Align_Left)
styleFrameBase= Widget_Base(labelTextBase, /col, Frame=3, YPad=2, XPad=2, uname='labelstyleframebase')
stylepBase = Widget_Base(styleFrameBase, /row)
case axisselect of
0: labelplacement = ['Bottom','Top']
1: labelplacement = ['Left','Right']
endcase
labelplabel = widget_label(stylepbase, value='Place Label on: ', /align_left, xsize=90)
titlePlaceDroplist = Widget_combobox(stylepBase, Value=labelplacement, uval='PLACELABEL', uname='placelabel')
showLabelButtonBase = widget_base(styleFrameBase,/row,/nonexclusive,/align_left)
stackButton = Widget_Button(showLabelButtonBase, Value='Stack Labels', uval='STACKLABELS', uname='stacklabels')
lazyButton = widget_button(showlabelButtonBase, value='Lazy Labels', uval='LAZYLABELS', $
uname='lazylabels', tooltip='Underscores will be converted to new lines')
showLabelButton = Widget_Button(showLabelButtonBase, Value='Show Labels', uval='SHOWLABELS', uname='showlabels')
stackButtonBase= widget_base(styleFrameBase,/row,/nonexclusive)
IF axisselect EQ 1 THEN blackButton = Widget_Button(stackButtonBase, Value='Set All Labels Black', UValue='BLACKLABELS', uname='blacklabels')
Widget_Control, showlabelButton, /Set_Button
lpGlobalBase = Widget_Base(styleFrameBase, /row)
lpoBase = Widget_Base(lpGlobalBase, /col)
lpoLabel = Widget_Label(lpoBase , Value='Orientation: ', /align_left)
lpoButBase = Widget_Base(lpoBase , /col, /Exclusive, Frame=3, xpad=18)
lpovHorizButton = Widget_Button(lpoButBase, Value='Horizontal', uval='LABELHORIZONTAL', uname='labelhorizontal')
lpoVertButton = Widget_Button(lpoButBase, Value='Vertical', uval='LABELVERTICAL', uname='labelvertical')
Widget_Control, lpovHorizButton, /Set_Button
lpoIncrBase = Widget_Base(lpGlobalBase, /Row, YPad=2,/align_center)
lpoIncrIncrement=spd_ui_spinner(lpoIncrBase, label = 'Margin: ',Increment=1, uval='LABELMARGIN', uname='labelmargin')
lpoIncrLabel = Widget_Label(lpoIncrBase, Value=' pts ')
tlabel = Widget_Label(lpcol1aBase, value = 'Font:', /align_left)
lpofontDroplist = Widget_combobox(lpcol1bBase, XSize=125, Value=fontnames, uval='LABELFONT', uname='labelfont')
tlabel = Widget_Label(lpcol1aBase, value = 'Format:', /align_left)
formattypes=textObj->getformats()
Obj_Destroy, textObj
lpoFormatDroplist = Widget_combobox(lpcol1bBase, XSize=125, Value=formattypes, uval='LABELFORMAT', uname='labelformat')
labelsync = widget_button(lpcol1bBase, value='Sync Panel Labels', uval='LABELSYNC', uname='labelsync', tooltip='Propagate text settings to the other labels on this panel')
tlabel= Widget_Label(lpcol2aBase, value='Size (points): ', /align_left)
fontIncrement = spd_ui_spinner(lpcol2bBase, Increment=1, Value=12, uval='LABELSIZE', uname='labelsize', min_value=1)
cb1Base = Widget_Base(lpcol2bBase, /row, space=3, /base_align_center)
tlabel= Widget_Label(lpcol2aBase, value='Color: ', /align_left)
labelpaletteButton = Widget_Button(cb1Base, Value=palettebmp, /Bitmap, UValue='LABELPALETTE', uname='labelpalette', $
Tooltip='Choose color from Palette')
labelColorWindow = WIDGET_DRAW(cb1Base, graphics_level=2, renderer=1, retain=1, XSize=50, YSize=20, units=0, frame=1, $
uname = 'labelcolorwin', /expose_events)
okButton = Widget_Button(buttonBase, Value='OK', XSize=75, uval='OK')
applyButton = Widget_Button(buttonBase, Value='Apply', UValue='APPLY',Tooltip='Apply all settings from all tabs to current panel.', XSize=75)
applyToAllButton = Widget_Button(buttonBase, Value='Apply to All Panels', Uvalue='APPLYTOALL', sens=1, $
Tooltip='Apply settings from the current tab to all panels',XSize=125)
cancelButton = Widget_Button(buttonBase, Value='Cancel', UValue='CANC', XSize=75)
templateButton = Widget_Button(buttonBase, Value='Save as Default', UValue='TEMP',xsize=125,tooltip="Save current settings as default template")
panelDroplists=[rangepanelDroplist, tpanelDroplist, gpDroplist, anopanelDroplist, titlepanelDroplist, lpanelDroplist]
statusBar = Obj_New('SPD_UI_MESSAGE_BAR', statusBase, XSize=80, YSize=1)
state = {tlb:tlb, gui_id:gui_id, rangeOptions:rangeOptions,scalingOptions:scalingOptions,$
labelselect:0, atype:atype, axispanelselect:axispanelselect, axisselect:axisselect,$
windowStorage:windowStorage, loadedData:loadedData, drawObject:drawObject, historyWin:historyWin,$
statusBar:statusBar, panelDroplists:panelDroplists, scrollbar:scrollbar, template:template, tlb_statusbar:tlb_statusbar,$
lockedMessageDisplayed:0,last_change:''}
Widget_Control, tlb, Set_UValue=state, /No_Copy
centerTLB, tlb
Widget_Control, tlb, /realize
statusBar->Draw
spd_ui_update_axis_from_draw,drawObject,panels
spd_ui_init_axis_window, tlb
if !d.NAME eq 'X' then begin
widget_control, tlb, xoffset=0, yoffset=0
endif
XManager, 'spd_ui_axis_options', tlb, /No_Block
RETURN
END