[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
I live to help wx-kind
I live to help wx-kind
Posts: 191
Joined: Mon Apr 24, 2017 4:23 am

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

Post by tomay3000 » Fri May 07, 2021 5:06 am

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: 5162
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 » Fri May 07, 2021 4:57 pm

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
I live to help wx-kind
I live to help wx-kind
Posts: 191
Joined: Mon Apr 24, 2017 4:23 am

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

Post by tomay3000 » Fri May 07, 2021 10:40 pm

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 1877 times
What it should be in RTL:
Popup Mirror.png
Popup Mirror.png (578 Bytes) Viewed 1877 times
except the text Of-course.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5162
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 » Fri May 07, 2021 10:49 pm

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
I live to help wx-kind
I live to help wx-kind
Posts: 191
Joined: Mon Apr 24, 2017 4:23 am

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

Post by tomay3000 » Fri May 07, 2021 11:42 pm

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: 5162
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 » Sat May 08, 2021 12:37 am

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

Thank you.

Post Reply