IDLgrText [message #35744] |
Thu, 10 July 2003 01:25 |
Nando Iavarone
Messages: 48 Registered: December 1998
|
Member |
|
|
Hi All!
After two years I'm again developing using IDL :)
I'd like to have a message bar on the top/bottom of the screen accepting
messages to be presented to the user in different colors according to a
message severity.
I'm trying to implement it via object graphic (IDLgrText) because it permits
high flexibility, but I'm new with this stuff.
In the following there is an example of the core code.
;string definition to be displayed
stringa = systime() + $
' ' + $
'INFORMATION ' + $
'Example of informational message: XXX
123456789012345678901234567890 1234567890' + $
' ' + 'MSG_ID'
font = OBJ_NEW('IDLgrFont','Courier', SIZE=10, THICK=1)
theString = OBJ_NEW('IDLgrText', stringa, $
COLOR = [0,0,0], HIDE = 0, FILL_COLOR = [255,0,0], FILL_BACK = 1, $
FONT = font)
;define the object hierarchy and display
theModel = OBJ_NEW('IDLgrModel')
theModel->Add, theString
theView = OBJ_NEW('IDLgrView', HIDE=0, COLOR=[0,0,255])
theView->Add, theModel
theWindow = OBJ_NEW('IDLgrWindow', RETAIN=2,$
DIMENSION = [1000, 50])
theWindow->Draw, theView
theString->getproperty, xrange=xrange, yrange=yrange
theString->setproperty, $
xcoord_conv=[-xrange[0]/(xrange[1]-xrange[0]), 1/(xrange[1]-xrange[0])],
$
ycoord_conv=[-yrange[0]/(yrange[1]-yrange[0]), 1/(yrange[1]-yrange[0])],
$
vertical = 1
theWindow->Draw, theView
The problem is that I can't obtain the text available in whole graphic
window, having the message clipped.
Any suggestion?
I'm sure I'm missing with a very simple detail to make it working.
Thank you!
PS: A few years ago I remember d. fanning as one of the most contributor to
this newsgroup. Doesn't he here anymore?
|
|
|