????????? #34 ?????? ?????? ???????? lswitcher-dev@2rosenthals.com

??: "Gregg Young" <lswitcher-dev@2rosenthals.com> ?????? ?????????
?????????????? ?????????
????: Re: Changing codepage in menus
????: Sat, 05 Sep 2020 20:15:36 -0600 (MDT)
????: "Alex Taylor" <alex@altsan.org>, "Rich Walsh" <rich@e-vertise.com>, "lSwitcher Developers Mailing List" <lswitcher-dev@2rosenthals.com>
?????: "Steven Levine" <steve53@earthlink.net>

Hi All

On Sat, 05 Sep 2020 16:18:44 -0400 (EDT) Alex Taylor wrote:
>
>On Fri, 04 Sep 2020 21:36:31 -0600 (MDT) Gregg Young wrote:
>
>> I have made changes to lswitcher that allow for Cyrillic text to be
>> displayed correctly on my codepage 850 system in the dialogues. I have
>> even gotten the language page to display all the language names in
>> their
>> native language using unicode.
>>
>> I have failed to find a way to get the menus to work. How do you set
>> the codepage for menus? This code uses WinCreateMenu. I tried adding
>> a resource template that set the codepage but that results in a trap
>> during menu creation. Any suggestions are welcome. Thanks
>
>TTBOMK the only way to change codepage rendering in standard PM control
>rendering is to change the message queue codepage (WinSetCp). You can
>really only do this on the application level (well, per message queue
>technically) and not all control types are really happy with this in any
>case.

I used this to get the dialogues working and that has been (mostly ) successful.
>
>AFAIK the only really viable approach is to render the text yourself at
>the GPI level, whereupon you have full control over the codepage used by
>the presentation space. Glancing at the PM reference, it looks like
>menus
>support ownerdraw mode, so you can probably make it work that way.
>
>Either use GpiSetCp on the presentation space, or set ulCodepage in the
>FATTRS structure, before drawing the text with GpiCharString[Pos][At].

I finally figured out (with Steven's help) how to set the CODEPAGE correctly in resource files (set it once and don't set it in the menu definition at the same time). You also need a CODEPAGE capable font and you need to do the prespara call correctly.

It requires that you stop and restart the program between language changes that also require a CODEPAGE change. Thanks for your help.

I plan on releasing a RC tomorrow  which demonstrates this. The menus in all languages show in that language with appropriate glyphs on a CODEPAGE 850 system. The dialogues do also with the Misc page showing each language in the combobox in its own language with proper glyphs (unicode). It still has a few ruff edges but I think has potential.

Gregg


???????????: ?????????, ????????, ?????????.
??????????
???????? ?????????????? ?????? ????????