comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Table Widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Table Widget [message #10823] Fri, 23 January 1998 00:00 Go to next message
DMottershead is currently offline  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 #10827 is a reply to message #10823] Thu, 22 January 1998 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
DMottershead (DMottershead@mhl.nsw.gov.au) writes
a fabulous tale about drawing object graphics. And
at the end he claims this:

> 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.

No! I find this *extremely* hard to believe from the code
David provided, which couldn't possibly produce this
effect. It's more likely that it is already Friday in
Australia and David has started throwing back those wonderful
VBs in the late afternoon sun while he tries to finish up
a nice program. :-)

I know that a 10 point font is a different size based on
the size of the output window, but this is usually what
you want. But I have never, ever seen a 10 point font that
was a different size depending on the range of the axis!

I realize this is a pain in the neck, David. But is there
a way to reduce this problem down to an example we could
run? I really would have to see this to believe it. :-)

What kind of machine are you running this on, anyway?

I'm going to go get a few beers in anticipation of having
something juicy to work on this evening. :-)

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/
Re: Table Widget [message #10946 is a reply to message #10823] Fri, 30 January 1998 00:00 Go to previous message
davidf is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: David Fanning's IDL Programming Techniques Book
Next Topic: BEGINNER ASKS FOR HELP!!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:57:31 PDT 2025

Total time taken to generate the page: 0.96868 seconds