Excuse me, does anyone knows whether this issue has been solved or not?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.![]()
As this is still open, it looks like it isn't -- but it should be easy to check by testing the code above. Have you done it and seen that it works now?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.![]()
... no it doesn't
I mean, in an application of mine I'm using wxBufferedPaintDC as method to paint custom controls.
The code works as expected for LTR languages.
But for languages where RTL is needed, all painting actions for custom controls don't draw them in the right way.
After a quick debug it seems something related to coordinates system, even though the coordinates values are correct.
Perhaps I'm wrong, but I don't take any special action in order to draw controls in case of RTL languages.
In other words, I would expect to draw controls without calculated differently their coordinates.
Am I wrong, or am I missing something ?
... anyway, I need to plan another debugging session in orther to be more precise
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.![]()
As the original patch doesn't show what's the output of the drawing when using wxGCDC,
I used this patch instead for testing (#26328 fixes the issue):
diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 5f32257c6b..44dc5c5cd6 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -63,6 +63,7 @@ public: // event handlers (these functions should _not_ be virtual) void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); + void OnPaint(wxPaintEvent& event); private: // any class wishing to process wxWidgets events must use this macro @@ -95,6 +96,7 @@ enum wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(Minimal_Quit, MyFrame::OnQuit) EVT_MENU(Minimal_About, MyFrame::OnAbout) + EVT_PAINT(MyFrame::OnPaint) wxEND_EVENT_TABLE() // Create a new application object: this macro will allow wxWidgets to create @@ -175,6 +177,7 @@ MyFrame::MyFrame(const wxString& title) CreateStatusBar(2); SetStatusText("Welcome to wxWidgets!"); #endif // wxUSE_STATUSBAR + SetLayoutDirection(wxLayout_RightToLeft); } @@ -201,3 +204,26 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxOK | wxICON_INFORMATION, this); } + +#include "wx/dcbuffer.h" +#include "wx/dcgraph.h" + +void MyFrame::OnPaint(wxPaintEvent& WXUNUSED(event)) +{ + wxBufferedPaintDC dc(this); +// wxPaintDC dc(this); + + dc.SetBackground(*wxWHITE_BRUSH); + dc.Clear(); + wxASSERT(dc.GetLayoutDirection() == wxLayout_RightToLeft ); + + if ( true /*use graphics context*/ ) + { + wxGCDC gdc(dc); + gdc.DrawText("ABCD", 0, 0); + } + else + { + dc.DrawText("ABCD", 0, 0); + } +}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.![]()