fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1
  • 2

TOPIC:

conversion problem (VO2.6 to 2.8) 02 Nov 2020 11:39 #16474

  • Plummet's Avatar

  • Plummet


  • Posts: 2
  • Hi Jan,
    A quick reply here as have not had the time to look thru yr code.

    In all my (mdi)windows, dbf or text(mle), I pass the menucommand on up to the owner. It works fine for me (VO 2.8 ).

    METHOD MenuCommand(oMCE) CLASS BasicDBFWindow
    // pass it on
    SELF:Owner:MenuCommand(oMCE)

    HTH - sorry if it is irrelevant,
    Don

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

    Last edit: by Plummet.

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 11:50 #16475

  • Jan@share.be's Avatar


  • Topic Author


  • Posts: 24
  • Don

    Thanks, I'll play around with that idea

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 11:51 #16476

  • Jan@share.be's Avatar


  • Topic Author


  • Posts: 24
  • In my previous demo app, there was a small mistake
    I hereby upload the updated version
    Attachments:

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 14:31 #16478

  • Jan@share.be's Avatar


  • Topic Author


  • Posts: 24
  • Don

    Does this work on context menus as well?
    In my case: no menucommand is called.

    But, I'm using a dynamically build menu.
    When I use the menueditor, it all works fine.

    So I'm doing something wrong in building the menu, I suppose.

    Anyone with experience to build menu's? dynamically?

    thanks

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 14:31 #16477

  • Jan@share.be's Avatar


  • Topic Author


  • Posts: 24
  • Don

    Does this work on context menus as well?
    In my case: no menucommand is called.

    But, I'm using a dynamically build menu.
    When I use the menueditor, it all works fine.

    So I'm doing something wrong in building the menu, I suppose.

    Anyone with experience to build menu's? dynamically?

    thanks

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 16:06 #16482

  • Chris's Avatar

  • Chris


  • Posts: 2258
  • Hi Jan,

    I checked the code in the SDK, apparently the MenuCommand() callback gets called only if there's no method that is directly handling your menu command. In your case, there are appropriate methods that get called for all the menu options, so MenuCommand() never gets called. Even if it got called, it would be sent to the "designwin" window, which owns the menu, not on the "DSRWin" class, where I see you have it defined.

    But since you are already handling the menu commands, may I ask why you need the MenuCommand() functionality anyway? In case it is necessary for any reason to trap the menu commands before they are dispatched automatically, you can use the PreMenuCommand() callback like this:
    METHOD PreMenuCommand(oMenuCommandEvent) CLASS designwin
    ? oMenuCommandEvent:Name
    RETURN TRUE // or FALSE 

    If you return TRUE from the method, itmeans that you have handled the even yourself, so the associated method with the menu item will not be called. If you return FALSE, the event gets dispatched normally.
    XSharp Development Team
    chris(at)xsharp.eu

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 16:48 #16483

  • Jan@share.be's Avatar


  • Topic Author


  • Posts: 24
  • Chris

    thanks for all the effort you put in this.

    I'm trying to catch the items form the contextmenu that is attached to the DSRWin, and for which I defined all the methods as 'Dummy()'. So I would expect it to call menucommand, but it doesn't. I tried MenuSelect and PreMenuCommand as wel, I don't get any result.
    take a look at DSRWin:setmenu()

    I my demo, the context menu is build dynamically although all options are predefined. But I also need the same thing working when I build the menu from entries that are in de database (in casu: different machines they are using, and that changes over time).
    The only way to do that in my opinion is built the menu dynamically and determine in menucommand wich option has been chosen.

    This setup worked fine in VO2.6.

    thanks
    Jan

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 19:58 #16486

  • Chris's Avatar

  • Chris


  • Posts: 2258
  • Hi Jan,

    Oh, it's a Context Menu that you were asking for from the beginning? I think I remember I've had issues with those myself in the past and ended up using ShowAsPopup() manually, but do not remember the details. I will look into them and will get back to you. Of course also anyone else please do not hesitate to give your input!
    XSharp Development Team
    chris(at)xsharp.eu

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 20:43 #16487

  • Jan@share.be's Avatar


  • Topic Author


  • Posts: 24
  • Chris

    YES, this works.
    events are a bit weard, still figuring out the details.
    Not all callback events get the correct event.
    But I'll manage this way.

    Thank you very much!!!

    We'll have a beer next time we meet!! OK?

    see you

    Jan

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

    conversion problem (VO2.6 to 2.8) 02 Nov 2020 20:46 #16488

  • Chris's Avatar

  • Chris


  • Posts: 2258
  • Hi Jan,

    Oh, you used the ShowAsPopup() method? OK, nice, so I am not gonna look more closely why the ContextMenu way did not work, and yes I really appreciate the beer offer :)

    cheers!
    XSharp Development Team
    chris(at)xsharp.eu

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

    • Page:
    • 1
    • 2