wxTextCtrl and wxTE_RICH Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
stefania
Knows some wx things
Knows some wx things
Posts: 26
Joined: Wed Jul 20, 2005 9:08 am

wxTextCtrl and wxTE_RICH

Post by stefania »

Hi!
I need to set wxTE_RICH flag after the wxTextCtrl has created, but does not work fine.

wxTextAttr *l_attr = new wxTextAttr;
l_attr->SetFlags( wxTE_RICH);
l_attr->SetAlignment( wxTEXT_ALIGNMENT_RIGHT);
c_ptrtext->SetDefaultStyle( *l_attr);

Is there a way to set this flak dinamiccaly?

Thanks
Stefania
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: wxTextCtrl and wxTE_RICH

Post by catalin »

No.
In wxTextCtrl docs, at the end of 'Styles' section there is a note about the styles that can be changed dynamically after control creation (only wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT for wxMSW).

You can probably create a new control, copy the contents and replace the old one.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxTextCtrl and wxTE_RICH

Post by doublemax »

From the wxTextCtrl documentation:
Note that alignment styles (wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT) can be changed dynamically after control creation on wxMSW and wxGTK. wxTE_READONLY, wxTE_PASSWORD and wrapping styles can be dynamically changed under wxGTK but not wxMSW. The other styles can be only set during control creation.
Also: This is a window style flag. *If* it worked, you'd have to use wxWindow::SetWindowStyleFlag() to set it.
Use the source, Luke!
stefania
Knows some wx things
Knows some wx things
Posts: 26
Joined: Wed Jul 20, 2005 9:08 am

Re: wxTextCtrl and wxTE_RICH

Post by stefania »

Thanks.

Stefania
Post Reply