VO menu editor

This forum is meant for questions and discussions about the X# language and tools
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO menu editor

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO menu editor

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Re: VO menu editor

Post 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.
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: VO menu editor

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO menu editor

Post 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!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO menu editor

Post 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...
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Re: VO menu editor

Post by leon-ts »

Chris,
Thanks!

Here is an example project:
XSharpBetaTest_CyrillicMenu.zip
(23.86 KiB) Downloaded 210 times
Best regards,
Leonid
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO menu editor

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO menu editor

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Re: VO menu editor

Post 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).
Best regards,
Leonid
Post Reply