Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

SEUIXP icon in menu & converted X# menu using default ribbon 09 May 2022 15:31 #22387

  • ic2
  • ic2's Avatar
  • Topic Author


  • Posts: 1609
  • 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

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 09 May 2022 15:53 #22388

    • Chris
    • Chris's Avatar


  • Posts: 3851
  • 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?

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 09 May 2022 18:45 #22398

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1609
  • 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

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 12 May 2022 17:15 #22432

    • FdeRaadt
    • FdeRaadt's Avatar


  • Posts: 31
  • 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

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 12 May 2022 17:33 #22433

    • Chris
    • Chris's Avatar


  • Posts: 3851
  • 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?

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 13 May 2022 17:14 #22454

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1609
  • 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:
    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

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 13 May 2022 18:01 #22455

    • Chris
    • Chris's Avatar


  • Posts: 3851
  • 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.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    SEUIXP icon in menu & converted X# menu using default ribbon 13 May 2022 18:37 #22456

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1609
  • 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

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 13 May 2022 20:22 #22459

    • Chris
    • Chris's Avatar


  • Posts: 3851
  • 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.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 18 May 2022 15:45 #22528

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1609
  • 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



    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
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by ic2.

    SEUIXP icon in menu & converted X# menu using default ribbon 18 May 2022 16:35 #22529

    • Chris
    • Chris's Avatar


  • Posts: 3851
  • Guys,

    The X# ported version of the SEUIXP tools is very new, so it is quite possible that there is indeed some problem in it. But we can do absolutely nothing without having a repro sample. So please send to me or Robert either your ported app, or another sample showing the problem, and we'll look into it ASAP. Just please make sure you include in the zip everything is needed to compile and run it.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    SEUIXP icon in menu & converted X# menu using default ribbon 26 May 2022 12:00 #22623

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1609
  • Here's an update for those who come across this post later.

    As so often, Chris proved how valuable he is for X#. First we sent a "lean" version of the converted app which didn't show the menu as it should (just grey instead of white + purple band + icons). Still it was difficult to find what set it apart from the original VO version. Chris found that after I assembled a real basic VO program with a working SEUIXP menu + VO-XPorted X# program where it did not work.

    It looks like the SEUIXP has external methods to the VOGUI classes which is not possible in DotNet. In short, this seems to fix it:

    - Change your StandardShellWindow to inherit from SETopAppWindow,
    instead of ShellWindow
    - If you get compiler errors in 3 methods because of this change, just
    remove those lines that report errors
    - In the constructor of StandardShellWindow, add the line SELF:ToolBar
    := oToolbar

    Now the PostCreate() method of your BasicToolBar is being called, and
    this is where you need to specify your icons in the menu items, with the
    _oConfig:AddButton(...) lines.

    Dick

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1