xsharp.eu • VO menu editor - Page 2
Page 2 of 3

Re: VO menu editor

Posted: Fri Oct 20, 2023 9:16 am
by Chris
Hi Leonid,

Do you mean you're getting define names with numbers in them? That shouldn't be happening anymore. But indeed it's still problematic anyway for Cyrillic.

Re: VO menu editor

Posted: Fri Oct 20, 2023 9:37 am
by Chris
Guys,

Ah, now, after setting my system locale to Russian, I understand better what the problem is. The define names in the prg file are actually correct in build 2.17, same as the ones generated in VO (except for some very minor differences for a few menu items), but the .rc files still use the "old" define names. This is because the resource compiler cannot handle non-latin characters, so we had to use this trick.

But I think there's an easy fix for that, by using hex notation for the Cyrillic character numbers in the names in the resources, and also by cutting some unnecessary underscores, the total length of the strings will be cut down a lot and should not be a problem anymore, will look into this. Leonid, can you please confirm that the problem is only in the .rc files, and NOT in the .prg files?

Re: VO menu editor

Posted: Fri Oct 20, 2023 9:54 am
by leon-ts
Hi Chris,
For a visual demonstration, I recorded a short video:
https://1drv.ms/u/s!AlzZH96rHaSP6RhGid3 ... y?e=QNUlsL

After saving the changes, the problem is most noticeable on rc files. But in PRG there is also a subtle difference: in definition names, instead of having one underscore between words, there are two underscores between words.

Re: VO menu editor

Posted: Fri Oct 20, 2023 2:32 pm
by robert
Chris, Leonid,

The define names in the rc file do not have to be the same as the names in the PRG, as long as the values are the same.
Can't we simply use the first <n> ascii characters (e.g. IDM_RepViewMenu) and then simply add a sequence number to make them unique?
That would simplify things a lot.
The defines in the PRG seem to already be correct when we remove the extra underscore (or did I overlook something) ?

Robert

Re: VO menu editor

Posted: Fri Oct 20, 2023 3:43 pm
by Chris
Robert,

The only reason for putting the defines in the .rc files, is to make them humanly readable as in VO, but that's not need after all probably, so we can just directly put the values in the resource and do not emit defines (in the .rc) at all, will do that now. Regarding the .prg files, indeed in some circumstances there's an extra underscore compared to VO, will investigate when this happens and will adjust it.

Leonid, thanks for the video, it confirms my findings as well!

Re: VO menu editor

Posted: Fri Oct 20, 2023 5:00 pm
by Chris
Guys,

The problem should be fixed now in 2.18, the menu editor no longer emits defines at all in the .rc files (used the values directly, like VOXporter does), so it should always work fine.

Regarding the defines in the .prg file, on closer inspection from what I see it was already working well before (in 2.17), the defines are identical to that of VO. Leonid, if you give me a sample menu/menuitem that produces a different define name (with extra underscores?), I will fix that, too.

Edit: Ah, scratch that, I do see the prg define underscores problem. Back to the drawing board...

Re: VO menu editor

Posted: Fri Oct 20, 2023 6:14 pm
by leon-ts
Chris,
Thanks!

Here is an example project:
XSharpBetaTest_CyrillicMenu.zip
(23.86 KiB) Downloaded 137 times

Re: VO menu editor

Posted: Sat Oct 21, 2023 6:56 am
by Chris
Hi Leonid,

Thanks for the sample, this shows a different problem, that the menu editor does not respect the tags for LoadResString() in the captions, as the window editor does. Will fix that, too, but I don't think it can make it into 2.18. But we can always send you guys a quickfix dll afterwards.

Re: VO menu editor

Posted: Sat Oct 21, 2023 7:09 am
by Chris
Leonid,

The reason why LoadResString() does not work with your menu, is because the captions in the menu editor are surrounded by quotes (like "<'Выход',22235,GPLANG>"). Is that on purpose? VO does not see to handle this, either.
Maybe those quotes were added accidentally by VOXporter or your own porting tool maybe?

Re: VO menu editor

Posted: Sat Oct 21, 2023 7:24 am
by leon-ts
Hi Chris,
Apparently, in this part I just made a bad example. I manually made parts of this example from a real application. And as I reported earlier, in the real application I also edit the menu manually for now. So it's just my mistake (including in the real application).