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

Home » Public Forums » archive » Re: widget_text, CW_FIELD
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
Re: widget_text, CW_FIELD [message #59274] Tue, 18 March 2008 01:19 Go to next message
Rajiv.Paneerselvam is currently offline  Rajiv.Paneerselvam
Messages: 14
Registered: November 2005
Junior Member
On Mar 17, 4:23 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> On Mar 17, 8:26 am, steverajiv <Rajiv.Paneersel...@gmail.com> wrote:
>
>> Hi all,
>> I am developing a macro language text editor using IDL.
>> I have the following questions:
>> 1)Is there any way to add colors to the texts displayed using
>> 'widget_text' or 'CW_field' .? (using direct graphics)
>> 2)Can I use IDL Object Graphics (eg,'IDLgrText' ) to change text color
>> and display the colored text in the text space created by
>> 'widget_text'.
>
> You can't use the graphics systems with WIDGET_TEXT. I can think of
> two alternatives (not for the faint of heart):
>
> * create a WIDGET_DRAW instead of a WIDGET_TEXT and output your text
> into it. If this is the main editing window of your text editor, good
> luck. But for a label or single line somewhere it is not too bad.
> There are keywords to WIDGET_INFO to get the right background color,
> font, width of a given string in pixels, etc.
>
> * if on Unix, use Xdefaults.
>
> I don't see any reasonable "IDL only" solutions if you are trying to
> chromo-code the code in your macro language text editor. Maybe there's
> something you could use with WIDGET_ACTIVEX if you are on Windows?
>
> Mike
> --www.michaelgalloy.com
> Tech-X Corporation
> Software Developer II

Thank you all for your useful suggestions, more questions..(to
Mr.Mike)
1. How can I add texts to 'widget_draw'? Even if I can add texts to
widget_draw, Can I make the text space editable.
2. how can I use 'WIDGET_ACTIVEX' to chromo-code the editor?,can you
please explain this in detail?

regards,
Rajiv
Re: widget_text, CW_FIELD [message #59297 is a reply to message #59274] Mon, 17 March 2008 10:39 Go to previous messageGo to next message
Jim Pendleton, ITT Vi is currently offline  Jim Pendleton, ITT Vi
Messages: 13
Registered: August 2006
Junior Member
<mgalloy@gmail.com> wrote in message
news:c8314ac7-2fa9-4c47-a720-e0480a36d070@13g2000hsb.googleg roups.com...
On Mar 17, 8:26 am, steverajiv <Rajiv.Paneersel...@gmail.com> wrote:
>> Hi all,
>> I am developing a macro language text editor using IDL.
>> I have the following questions:
>> 1)Is there any way to add colors to the texts displayed using
>> 'widget_text' or 'CW_field' .? (using direct graphics)

> You can't use the graphics systems with WIDGET_TEXT. I can think of
> two alternatives (not for the faint of heart):...

> I don't see any reasonable "IDL only" solutions if you are trying to
> chromo-code the code in your macro language text editor. Maybe there's
> something you could use with WIDGET_ACTIVEX if you are on Windows?

Here's another unreasonable solution. Use a WIDGET_TABLE with a single
element. You can specify both a background color and a foreground color.

Jim P
ITT VIS PSG
Re: widget_text, CW_FIELD [message #59300 is a reply to message #59297] Mon, 17 March 2008 08:23 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Mar 17, 8:26 am, steverajiv <Rajiv.Paneersel...@gmail.com> wrote:
> Hi all,
> I am developing a macro language text editor using IDL.
>  I have the following questions:
> 1)Is there any way to add colors to the texts displayed using
> 'widget_text' or 'CW_field' .? (using direct graphics)
> 2)Can I use IDL Object Graphics (eg,'IDLgrText' ) to change text color
> and display the colored text in the text space created by
> 'widget_text'.

You can't use the graphics systems with WIDGET_TEXT. I can think of
two alternatives (not for the faint of heart):

* create a WIDGET_DRAW instead of a WIDGET_TEXT and output your text
into it. If this is the main editing window of your text editor, good
luck. But for a label or single line somewhere it is not too bad.
There are keywords to WIDGET_INFO to get the right background color,
font, width of a given string in pixels, etc.

* if on Unix, use Xdefaults.

I don't see any reasonable "IDL only" solutions if you are trying to
chromo-code the code in your macro language text editor. Maybe there's
something you could use with WIDGET_ACTIVEX if you are on Windows?

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
Re: widget_text, CW_FIELD [message #59303 is a reply to message #59300] Mon, 17 March 2008 07:48 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
steverajiv writes:

> I am developing a macro language text editor using IDL.
> I have the following questions:
> 1)Is there any way to add colors to the texts displayed using
> 'widget_text' or 'CW_field' .? (using direct graphics)

No.

> 2)Can I use IDL Object Graphics (eg,'IDLgrText' ) to change text color
> and display the colored text in the text space created by
> 'widget_text'.

No.

You can have any text color you like, as long as it is black.
Next question?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: widget_text, CW_FIELD [message #59417 is a reply to message #59274] Tue, 18 March 2008 07:20 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
steverajiv wrote:
> Thank you all for your useful suggestions, more questions..(to
> Mr.Mike)
> 1. How can I add texts to 'widget_draw'? Even if I can add texts to
> widget_draw, Can I make the text space editable.
> 2. how can I use 'WIDGET_ACTIVEX' to chromo-code the editor?,can you
> please explain this in detail?

1. Use xyouts or IDLgrText. Sure it can be editable. For an example of
this, add text to any iTools display. I'm not sure that that example
will teach you anything about doing it, but it does prove it is possible.

2. No, I don't use Windows. But if there is some COM object out there
that does what you want, you could add it to your IDL application (on
Windows).

Again, these solutions are not easy at all, especially if you are
talking about multi-line wrapping text like an editor window. A single
line might not be too bad, but making it editable will be a major pain.

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to draw streamline
Next Topic: GOES Follow-up Question

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

Current Time: Wed Oct 08 18:43:55 PDT 2025

Total time taken to generate the page: 0.00467 seconds