Table Widget [message #10823] |
Fri, 23 January 1998 00:00  |
DMottershead
Messages: 17 Registered: January 1998
|
Junior Member |
|
|
Also, with regards to this table widget I have a draw widget defined
below the table widget. When a user selects a column of data this data
is displayed in the draw widget. My problem is that when the axes change
to plot different data ranges, the axis labels change size as well. The
code to plot the data is shown below:-
pro CTD_Table_Widget_Events, event
; This event handler handles draw widget expose events.
WIDGET_CONTROL, event.top, GET_UVALUE = ptr
; Draw the graphic.
result = widget_info(event.id,/table_select)
a=result(0)
b=result(1)
c=result(2)
d=result(3)
data = (*ptr).plotdata(a:c, b:d)
; set the plot data
(*ptr).plot.thisPlot->SetProperty, datay = data
(*ptr).plot.thisPlot->GetProperty, XRange=xrange, YRange=yrange
; Set up the scaling so that the axes for the plot and the
; plot data extends from 0->1 in the X and Y directions.
xs = Normalize(xrange)
ys = Normalize(yrange)
; Scale the plot data into 0->1.
(*ptr).plot.thisPlot->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys
(*ptr).plot.xAxis1->SetProperty, Ticklen = 0.01
(*ptr).plot.xAxis1->SetProperty, minor = 4
(*ptr).plot.xAxis1->SetProperty, range = xrange
(*ptr).plot.xAxis1->SetProperty, XCoord_Conv = xs
(*ptr).plot.xAxis1->SetProperty, tickdir = 1
;(*ptr).plot.yAxis1->SetProperty, Location = [xs[0],ys[0]]
(*ptr).plot.xAxis1->SetProperty, Location = [0,0]
(*ptr).plot.yAxis1->SetProperty, Ticklen = 0.01
(*ptr).plot.yAxis1->SetProperty, minor = 4
(*ptr).plot.yAxis1->SetProperty, range = yrange
(*ptr).plot.yAxis1->SetProperty, YCoord_Conv = ys
(*ptr).plot.yAxis1->SetProperty, tickdir = 1
;(*ptr).plot.yAxis1->SetProperty, Location = [xs[0],ys[0]]
(*ptr).plot.yAxis1->SetProperty, Location = [0,0]
xaxistext = Obj_New('IDLgrText', font = (*ptr).plot.helvetica6pt)
yaxistext = Obj_New('IDLgrText', font = (*ptr).plot.helvetica6pt)
xAxisText->SetProperty, Font=(*ptr).plot.helvetica6pt
yAxisText->SetProperty, Font=(*ptr).plot.helvetica6pt
(*ptr).obj.omodel->add, xaxistext
(*ptr).obj.omodel->add, yaxistext
; render the graphics to the window
(*ptr).obj.owindow -> Draw, (*ptr).obj.oview
return
end
Say for example I have a y axis labelled from 0 to 10 the first pass.
Next pass I have values from 0 - 20. The labels will halve their size in
both x and y direction.
--
Regards
David
************************************************************ *******
David Mottershead Phone: +61 2 9949 0234
Manly Hydraulics Laboratory Fax: +61 2 9948 6185
110b King St, Manly Vale, 2093 email: dmottershead@mhl.nsw.gov.au
SYDNEY, AUSTRALIA WWW: http://www.mhl.nsw.gov.au
************************************************************ *******
|
|
|
|
Re: Table Widget [message #10946 is a reply to message #10823] |
Fri, 30 January 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
David Mottershead (DMottershead@mhl.nsw.gov.au) wrote a fantastical
story lately that began like this:
> Also, with regards to this table widget I have a draw widget defined
> below the table widget. When a user selects a column of data this data
> is displayed in the draw widget. My problem is that when the axes change
> to plot different data ranges, the axis labels change size as well. The
> code to plot the data is shown below:
David was quite correct about this. (I had to see it with my
own eyes, frankly.) It is clearly a bug and has been entered
as such in the RSI database.
For the time being, David, I think I would suggest direct
graphics for this application. It might even be faster. :-)
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|