SEUIXP icon in menu & converted X# menu using default ribbon

This forum is meant for questions and discussions about the X# language and tools
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

SEUIXP icon in menu & converted X# menu using default ribbon

Post by ic2 »

In the conversion Frank is working on we have VO style menu's in which we eventually use an SEUIXP toolbar with adapted ribbon.

I have 2 questions:

1 In the menu itself (in the left purple band), the toolbar icons are absent. They are visible in the original VO code and I know that it works in X# as there's a sample included which shows the icons in the menu too. What again determines the visibility of toolbar/ribbon icons in the menu?

2 In the VO menu editor, the (adapted) toolbar ribbon is used and you see the correct icon assigned in "Button Bmp". But in the converted X# version, it shows a default VO ribbon with hence incorrect buttons . The (SEUIXP) toolbar shows correctly so why does the XP menu editor show some default, unused, VO ribbon instead?

Dick
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SEUIXP icon in menu & converted X# menu using default ribbon

Post by Chris »

Hi Dick,

For (2), the problem is that in VO this information about ribbons in the menu editor is stored in a very peculiar way, which is very difficult to use also in X#. Instead, you will need to go to the general menu options (by selecting the main menu item in the Menu Editor) and set theproperty "Ribbon filename" to point to the actual bmp file you are using for the ribbon in the disk. Now, the correct buttons should be visible in the editor.

Additionally, you must specify the name of the Ribbon class, in the property just above the one mentioned above, the "Ribbon" one. This should be the same as the name used in VO. Maybe doing that fixes also problem (1) for you?

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

SEUIXP icon in menu & converted X# menu using default ribbon

Post by ic2 »

Hello Chris,

Ah, thanks a lot. Frank can test it Wednesday and we'll let you know. Probably it will indeed solve (1) indeed as (AFAIK) there is not specific setting to in- or exclude the icons in the menu.

Dick
FdeRaadt
Posts: 31
Joined: Wed Sep 01, 2021 12:49 pm
Location: Netherlands

SEUIXP icon in menu & converted X# menu using default ribbon

Post by FdeRaadt »

Hi Chris,

I've changed the Ribbon Filename to the related bitmap.
I've mirrored the same settings from VO.
Sadly the same wrong buttons are still visible in the menu editor.

I've noticed some inconsistencies in my code, so I will report back with more information later.

Frank
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SEUIXP icon in menu & converted X# menu using default ribbon

Post by Chris »

Hi Frank,

Hmm, I think I remember a related problem, in some apps (but not all), VO stores the bitmap indexes with an offset of 1, so maybe you are seeing the icon that's next to the correct one in the bitmap? What happens when you try to change the icon of a menu item, does the list of icons contain the correct ones? If not, then maybe there's some problem with the ribbon bitmap that you are using, can you send it to me (or post it here) to have a look?

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

SEUIXP icon in menu & converted X# menu using default ribbon

Post by ic2 »

Hello Chris,

I've been looking with Frank what happens and it's actually more than a bit confusing.

In the VO version of the program Frank is converting they have a small icon toolbar and the typical SEUIXP light purple band in the menu, showing icons from the assigned toolbar. In the converted XS method the menu's seem fully VO. However, despite starting with this code:

Code: Select all

oToolbar	:= BasicToolBar{}  // This inherits from SEToolbarXP
oWindow:=StandardShellWindow{SELF,SELF:Init_Menu(oToolbar),oToolbar}														ShowOnPosition(oWindow,"#MAINWINDOW")   
the methods PreCreate & PostCreate of BasicToolBar are never called. These are called in my programs. We checked in the debugger, on my VO program the PreCreate of BasicToolbar is called directly on the second line above and for their (VO or X#) program it is not, despite being present. So my first puzzle is: why does it work in VO for their program?

And my question would be: what do I need to do to actually have the icons assigned to the menu as it is apparently not enough (in X#) to instantiate a toolbar inheriting from the SEToolbarXP?

When I look into the X# VO style menu editor it will display the default ribbon even though Frank has assigned the adapted toolbar. The end result works, in a sense. If Franks selects icon 5 of the default toolbar in the editor, it will display icon 5 of the correct toolbar.

So we are not sure if:

1 The X# menu editor works with a non default toolbar and if so, how?
2 If there is probably a weird mix of default VO style menu & toolbar code and SEUIXP use? ANd if that causes the problem
3 And mainly, what needs to be done to assure SEUIXP is used to both assign icons to the toolbar and the menu.

I know it should work (as it does for the samples) but I really do not know how; also it is a decade or more ago since I wrote this.

If anyone knows the solution, that would be great.

Dick & Frank
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SEUIXP icon in menu & converted X# menu using default ribbon

Post by Chris »

Hi Dick,

Yes, the menu editor in X# works by default with a standard ribbon (the same that VO uses), but this is overrideable with the option to specify the toolbar ribbon manually. I do not know why this does not work in your case, possibly the bitmap you use is not compatible or something along those lines, so for this reason I asked to send it to me to have a look.

About why the tool works differently in VO and X#, again I have absolutely no idea without seeing the code. I am not familiar with it at all (never used it in my VO apps unfortunately), so I cannot make a guess, either. Maybe something in the X# version of the tool is not (yet) working as expected. So if you'd like, please send me the VO version of the app, or another small test app (as an aef) showing how you are using the tool in VO and so I can port it to X# and see the difference at runtime and debug why it behaves differently.

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

SEUIXP icon in menu & converted X# menu using default ribbon

Post by ic2 »

Hello Chris,

Thanks for the quick reply. I'll let Frank mail you the toolbar. I saw that, clicking in the menu name in the menu editor, he filled in the Ribbon and Ribbon Filename properties and still gets the default ribbon. But the icons from that ribbon are used...

Maybe if someone using SEUIXP can remind me what could cause it to (not) call the mentioned method, we could solve the whole issue.

Dick
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SEUIXP icon in menu & converted X# menu using default ribbon

Post by Chris »

Hi Dick,

If I understood correctly, you said that the icons from that ribbon are used in the application when run, but not in the menu editor at design time, is that right? If yes, I'd need that bitmap to give it a test (with the menu editor) also here. Better also send me an X# app that is using this bitmap but it does not work inside the menu editor.

About the other problem, if you are using the exact same code in both VO and X#, then it should work, and if it doesn't, it's probably a bug in the X# version. But we really need a sample reproducing the problem in order to investigate it and fix it if needed.

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

SEUIXP icon in menu & converted X# menu using default ribbon

Post by ic2 »

Hello Chris,

Concerning the 2nd question, we have done the following:

1 Started to debug our program and the SEUIXP MDI sample
2 Both instantiate the BasicToolBar more or less like this: SELF:ToolBar := oTB := BasicToolBar{}, we use oToolbar:=BasiCToolBar[} as in the picture, both are from class BasicToolbar.
3 When we open the window with details, there seem to be multiple XSharp exceptions. There is 1 in the sample program too, but for example the first one in the picture, the ClientArea, is VO BoundingBox instead in the SEUIXP sample program
SEUIXPXS.PNG
SEUIXPXS.PNG (27.41 KiB) Viewed 767 times
4 Then the sample program goes to the CONSTRUCTOR of SEToolbarXP and SetStyle (which we also see in our program) but then the next steps aren't visible as our program uses the DLL (yes, we use the same dll as reference as in the sampel program); the sample program goes to Create->Precreate->PostCreate which apparently our program does not because the purple left band with icons is absent while it works in X#.

So it isn't something which doesn't work in X#, as the sample program does, but it does not work in our converted VO code (it works in VO too).

I am not sure how to proceed to solve this.Maybe someone seeing these errors (the BasicToolBar object is NOT nil although not working) has an idea?

Dick & Frank
Post Reply