wxWidgets - wxStyledTextCtrl - Text alignment RTL

385 views Asked by At

wxStyledTextCtrl is very good, but not fully documented.. any one know how to align text in Right ?

// To create one
this->STYLED_TEXT = new wxStyledTextCtrl(PANEL, wxID_ANY, wxDefaultPosition, wxSize(500, 500));

// To set it RTL
STYLED_TEXT->SetLayoutDirection(wxLayout_RightToLeft);

The question.. how to align text in Right please ?

This didn't work!

this->STYLED_TEXT = new wxStyledTextCtrl(PANEL, wxID_ANY, wxDefaultPosition, wxSize(500, 500), wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxRIGHT);

Thank in advance

2

There are 2 answers

3
New Pagodi On BEST ANSWER

This can't be done. wxStyledTextCtrl is a wrapper for the Scintilla text editor. It's really meant for writing in source code languages and not natural human languages. As they state on their site:

Scintilla does not properly support right-to-left languages like Arabic and Hebrew. While text in these languages may appear correct, it is not possible to interact with this text as is normal with other editing components.

Maybe wxRichTextCtrl might work instead.

0
Saif On

Finlay, i fount that Scintilla support sample RTL by SetLayoutDirection (wxLayout_RightToLeft), but languages like Arabic/Japanese/Hebrew.. need BIDIRECTION DISPLAY to show characters correctly, and Scintilla doesn't have this feature right now.

So.. this feature is requested for development in future, but not proved right now LoL!.

https://sourceforge.net/p/scintilla/feature-requests/640/

https://groups.google.com/forum/#!topic/scintilla-interest/IfLfG3Zj_nY/discussion