[wxMSW] How to set an RTL layout direction a PopUp wxMenu? Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

[wxMSW] How to set an RTL layout direction a PopUp wxMenu?

Post by tomay3000 »

Hello,
Is it possible to set an RTL layout direction a PopUp wxMenu before calling the PopupMenu() method.
It seems not working by calling SetLayoutDirection(wxLayout_RightToLeft);

TIA.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [wxMSW] How to set an RTL layout direction a PopUp wxMenu?

Post by ONEEYEMAN »

Hi,
Which locale is set on your system? And are you overriding it by calling wxLocale methods?
Also - do you have a translations file to get the text from?

Thank you.
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [wxMSW] How to set an RTL layout direction a PopUp wxMenu?

Post by tomay3000 »

The local in my system is English US, and I have overridden it by the following method:

Code: Select all

wxLocale local(wxLANGUAGE_ARABIC_ALGERIA, wxLOCALE_DONT_LOAD_DEFAULT);
What I meant is the popup menu should be mirrored in application level like in the attached screenshots:
Original Popup menu:
Popup.png
Popup.png (587 Bytes) Viewed 7351 times
What it should be in RTL:
Popup Mirror.png
Popup Mirror.png (578 Bytes) Viewed 7351 times
except the text Of-course.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [wxMSW] How to set an RTL layout direction a PopUp wxMenu?

Post by ONEEYEMAN »

Hi,
I presume you are on Windows and using 3.1.5?
Can you run the internat sample and see fi the menu is displaying correctly?

Thank you.
tomay3000
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Mon Apr 24, 2017 4:23 am

Re: [wxMSW] How to set an RTL layout direction a PopUp wxMenu?

Post by tomay3000 »

I just tested the internat sample.
All the menu-bar menus have the correct RTL layout except when a popup menu that is fired via PopupMenu() is stayed in an LTR layout.
It seems impossible even the native Right-click context-menu on an edit control in the "Test locale availability..." menu, you can try it yourself.
So, I guess the PopupMenu() will follow the system locale no matter what.

What do you think?

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [wxMSW] How to set an RTL layout direction a PopUp wxMenu?

Post by ONEEYEMAN »

Hi,
Yes, I think it will follow the system locale.

Thank you.
Post Reply