Re: wxTextAttr

2008-03-23 Thread Mattia Barbon

Octavian Rasnita wrote:

Hi Mattia,

Thank you very much! This is good news.
I've seen that I can set the colors of the text, and the alignment, but 
I couldn't find how to set a certain font with some attributes (bold, 
italic, underline). Could you please give me a short example?


  Just use -SetFont( $font ) where $font is a font object with
the required attributes.


I've done:

my $style = Wx::TextAttr-new();
$style-Wx::TextAttr::SetTextColour(wxBLUE);
$style-Wx::TextAttr::SetBackgroundColour(wxGREEN);
$style-Wx::TextAttr::SetAlignment(wxTEXT_ALIGNMENT_CENTRE);


  You do not need to always use the full method name,
just using $style-SetAlignment(wxTEXT_ALIGNMENT_CENTRE)
will suffice; it is also more robust in case of class
hierarchy changes.

Also, do you have any idea if I can use superscripts and subscripts with 
the methods provided by the library?


  I do not event know if wxTextCtrl supports subscripts and superscripts
or not.

Regards,
Mattia



Re: wxTextAttr

2008-03-21 Thread Mattia Barbon

Octavian Rasnita wrote:

  Hi Octavian,

I want to create a readonly multiline rich text control that has the 
wxTE_PROCESS_ENTER style, so I've tried to use

Wx::TextCtrl with the wxTE_RICH2 style.

I need to make some format settings in the control, like the font, the 
color, background-color, boldness and other things like that and I 
thought I can use Wx::TextAttr, but unfortunately I've read that all the 
methods for setting options of this module are not available in WxPerl.


  I think this was true for older wxPerl versions (can't remember how
much old); I use Wx::TextAttr to change font color on a Wx::TextCtrl
created with wxTE_RICH2, so this should work.

Can I make Wx::RichTextCtrl to create readonly controls that can be used 
with the keyboard?
Or can I assign different formats to a Wx::TextCtrl using Wx::TextAttr 
or other methods?


  I do not have much experience with Wx::RichTextCtrl (besides writing
some code for the wxPerl demo), but you should be able to do what you
need using wxTextCtrl.

HTH
Mattia



Re: wxTextAttr

2008-03-21 Thread Octavian Rasnita

Hi Mattia,

Thank you very much! This is good news.
I've seen that I can set the colors of the text, and the alignment, but I 
couldn't find how to set a certain font with some attributes (bold, italic, 
underline). Could you please give me a short example?


I've done:

my $style = Wx::TextAttr-new();
$style-Wx::TextAttr::SetTextColour(wxBLUE);
$style-Wx::TextAttr::SetBackgroundColour(wxGREEN);
$style-Wx::TextAttr::SetAlignment(wxTEXT_ALIGNMENT_CENTRE);

Also, do you have any idea if I can use superscripts and subscripts with the 
methods provided by the library?


Thank you.

Octavian

- Original Message - 
From: Mattia Barbon [EMAIL PROTECTED]

To: Octavian Rasnita [EMAIL PROTECTED]
Cc: wxperl-users@perl.org
Sent: Friday, March 21, 2008 7:15 PM
Subject: Re: wxTextAttr



Octavian Rasnita wrote:

  Hi Octavian,

I want to create a readonly multiline rich text control that has the 
wxTE_PROCESS_ENTER style, so I've tried to use

Wx::TextCtrl with the wxTE_RICH2 style.

I need to make some format settings in the control, like the font, the 
color, background-color, boldness and other things like that and I 
thought I can use Wx::TextAttr, but unfortunately I've read that all the 
methods for setting options of this module are not available in WxPerl.


  I think this was true for older wxPerl versions (can't remember how
much old); I use Wx::TextAttr to change font color on a Wx::TextCtrl
created with wxTE_RICH2, so this should work.

Can I make Wx::RichTextCtrl to create readonly controls that can be used 
with the keyboard?
Or can I assign different formats to a Wx::TextCtrl using Wx::TextAttr or 
other methods?


  I do not have much experience with Wx::RichTextCtrl (besides writing
some code for the wxPerl demo), but you should be able to do what you
need using wxTextCtrl.

HTH
Mattia





wxTextAttr

2008-03-20 Thread Octavian Rasnita

Hi,

I want to create a readonly multiline rich text control that has the 
wxTE_PROCESS_ENTER style, so I've tried to use

Wx::TextCtrl with the wxTE_RICH2 style.

I need to make some format settings in the control, like the font, the 
color, background-color, boldness and other things like that and I thought I 
can use Wx::TextAttr, but unfortunately I've read that all the methods for 
setting options of this module are not available in WxPerl.


I've seen in the demo module that the Wx::RichText extension is used instead 
and I thought I could use it instead of Wx::TextCtrl.


Unfortunately I can't use a RichTextCtrl object with the keyboard, because 
if I use the arrow up or arrow down, instead of moving the cursor to the 
next or previous line, it moves to the previous or next control.
And I've also seen that the wxTE_READONLY style seems to not work with 
Wx::RichTextCtrl.


What is your advice in this regard?

It would be wonderful if I could assign a pre-created RTF string to the 
control, because I would be able to use more formats which are allowed by 
RTF specifications, since I might need to also use subscripts, superscripts, 
etc.
But even if it is possible to add and format text only by using different 
methods, please tell me how can I do what I want.


Can I make Wx::RichTextCtrl to create readonly controls that can be used 
with the keyboard?
Or can I assign different formats to a Wx::TextCtrl using Wx::TextAttr or 
other methods?


Sorry for so many questions, but I couldn't find documentation about these 
things anywhere.


Thank you.

Octavian