Re: widget_text, CW_FIELD [message #59274] |
Tue, 18 March 2008 01:19  |
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 #59300 is a reply to message #59297] |
Mon, 17 March 2008 08:23   |
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 #59417 is a reply to message #59274] |
Tue, 18 March 2008 07:20  |
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
|
|
|