1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Menus - providing help

Discussion in 'Development' started by Crittar, Sep 26, 2002.

  1. Crittar

    Crittar New Member

    Progress 9.1c CHUI under Unix.

    I have a program with a menu structure within it something like:

    Code (progress):
    1.  
    2. DEFINE MENU main-menu   MENUBAR        
    3.    MENU-ITEM nxt     LABEL 'Next'      
    4.    MENU-ITEM prev    LABEL 'Previous'  
    5.    MENU-ITEM frst    LABEL 'First'      
    6.    MENU-ITEM lst     LABEL 'Last'
    7.  
    8.    .
    9.    .
    10.    .
    11.  
    12.   MENU-ITEM another LABEL 'Another'.
    13.  
    What I would like to be able to do is provide some help to the user when any menu option is highlighted.

    I have tried ON ENTRY OF MENU-ITEM nxt (etc) but this seems to have no effect at all.

    Does anyone out there know how I could achieve this please?

    :confused: :confused: :confused:
     
  2.  
  3. Crittar

    Crittar New Member

    I have had no replies to this thread - is there anyone out there who knows how to accomplish this or am I fighting a losing battle?

    :brick:
     
  4. bendaluz2

    bendaluz2 New Member

    I dont think there are any progress ways to do it. The only way I can think of is by capturing the windows messages for the highlight moving around on the menu in response to the mouse moving.
     
  5. Crittar

    Crittar New Member

    Bendaluz,

    Thank you for that - unfortunately I'm in CHui under UNIX - capturing the mouse is easier said than done - lol.

    :blue: :confused: :dead:
     
  6. bendaluz2

    bendaluz2 New Member

    Hehe, that might cause you a problem

    :)

    Your only option then, would be to do the menus manually with frames, not using the Progress menus. Its probably not worth all the effort, depends how important the help is perceived to be I guess.
     
  7. bendaluz2

    bendaluz2 New Member

    Just had a brainwave (maybe)

    Try this:

    at the top of your program

    <code>
    ON "CURSOR-UP":U ANYWHERE
    DO:
    &nbsp;&nbsp;IF SELF:TYPE = "MENU-ITEM":U THEN
    &nbsp;&nbsp;DO:
    &nbsp;&nbsp;&nbsp;&nbsp;CASE SELF:NAME:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHEN "Nxt":U
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STATUS INPUT "Select Next thingy":U.
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OTHERWISE
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STATUS DEFAULT.
    &nbsp;&nbsp;&nbsp;&nbsp;END CASE.
    &nbsp;&nbsp;END.
    END.
    </code>

    and the same for CURSOR-DOWN (and any other keys you use to navigate the menus)
     
  8. Crittar

    Crittar New Member

    Bendaluz,

    Many thanks for the brainwave - but sadly, it doesn't work.

    Looks like I will just have to manage without help in this particular instance.

    Unless anyone else out there has any suggestions...?
     
  9. bendaluz2

    bendaluz2 New Member

    Damn, thats a shame. Any chance you could paste your frame definition with the menus, and i'll have a play with it here
     
  10. Crittar

    Crittar New Member

    Thanks for the offer Bendaluz, but it's reached the stage now where I have tried just about everything and time has run out for it. The help was a 'nice to have' but not an essential.

    Once again, thanks for your input.

    :)
     
  11. Serj HAMMER

    Serj HAMMER Junior Racer

    MENU-DROP event

    Guten morging, Crittar.
    Did You tried to use MENU-DROP event on "menu-folders"?
    It fired only once (when menu opened), but it is more, that nothing.
     
  12. Crittar

    Crittar New Member

    Serj,

    Can you provide an example please?

    Does this technique apply to CHUI.
     
  13. Serj HAMMER

    Serj HAMMER Junior Racer

    MENU-DROP example

    Ok, example:
    <PRE>
    DEFINE SUB-MENU SubFolder
    MENU-ITEM SubItem1 LABEL "Ferrari-Marlboro"
    MENU-ITEM SubItem2 LABEL "West-McLaren"
    MENU-ITEM SubItem3 LABEL "MildSeven-Renault"
    MENU-ITEM SubItem4 LABEL "BensonAndHedges-Jordan"
    MENU-ITEM SubItem5 LABEL "LuckyStrike-BAR".

    DEFINE MENU TopMenu MENUBAR
    SUB-MENU SubFolder LABEL "Formula-1"
    MENU-ITEM MenuExit LABEL "Exit".

    ON MENU-DROP OF MENU SubFolder DO:
    MESSAGE "Choose any F1 team to Your experience!"
    VIEW-AS ALERT-BOX INFORMATION BUTTON OK
    TITLE "Menu help".
    /* realy at this place I update my "status string"
    (it placed in different frame) with information
    about current programm functions */
    END.

    CURRENT-WINDOW:MENUBAR = MENU TopMenu:HANDLE.
    WAIT-FOR CHOOSE OF MENU-ITEM MenuExit OR
    CLOSE OF CURRENT-WINDOW.
    CURRENT-WINDOW:MENUBAR = ?.
    </PRE>
    This example work in:

    <TT>PROGRESS Procedure Editor
    Version 9.1D0100
    POSSE Version 2.0
    Copyright (c) 1984-2002 Progress Software Corp.
    All rights reserved</TT>

    It is Progress9 in text mode on Linux.
     
  14. Serj HAMMER

    Serj HAMMER Junior Racer

    P.S. MENU-DROP

    I don't know, why this trigger fired twice. First time when choosing menu folder and the second time - when sub menu drawn.
     
  15. Crittar

    Crittar New Member

    Serj,

    That seems to work fine, thank you. As you say the trigger seems to fire twice but I'm sure I can find a way round that.

    Your help is much appreciated.

    :)
     
  16. bendaluz2

    bendaluz2 New Member

    I thought you wanted the message to change as you move over the options?
     
  17. Crittar

    Crittar New Member

    Bendaluz,

    That would be the ideal solution - but as Progress seems determined not to let me do that, I have to accept what I can get.

    At least this way something can be displayed.

    If someone can come up with a solution which allows me to display some text when the user moves over the menu option that would be even better.
     
  18. Crittar

    Crittar New Member

    Serj,

    I tried your solution and whilst it is ideal for those menu items where there is a sub menu (the 'help text' can be displayed before the user selects an option), it doesn't help for those menu items where there is no sub-menu. :(

    What I need ideally is a means of displaying help text when an option is highlighted.

    If any-one out there has a solution I would love to see it. For the moment I have had to implement without putting help text in for the menu options.

    Once again, thank you for the input, I can at least use that technique if I have a program where all menu items have sub-menus. :)
     
  19. Serj HAMMER

    Serj HAMMER Junior Racer

    HelpInfo on MENU-ITEM

    Buon giorno, signore Crittar.

    It is not very well, but I think that providing help on every menu-item in PROGRESS now phisicaly impossible.
    - At first MENU-ITEM has no events, except CHOICE. It also had VALUE-CHANGED, but it is for TOGGLE-BOX only and not can be use for help.
    - At next SUB-MENU has only MENU-DROP event, that we using.
    - At last MENU is the same as SUB-MENU and has no more assistance.

    At total we have a "black-box", named "MENU-FOLDER" full of some of items. What is processing inside - riddle. We see it only when trigger fired or program exit.
    C'est la vie...

    But I am sure, that PROGRESS add new events to the menu, like CURSOR-OVER and CURSOR-OUT. I wait when it do it and we can make the big and great step to the future.
     
  20. bendaluz2

    bendaluz2 New Member

    What about creating the menus yourself manually using frames instead of the Progress menu facilities. This would allow you as much flexibility as you wanted, though may be awkward to implement if you have many levels of menu.

    Just a thought anyway, hope it helps
     
  21. Crittar

    Crittar New Member

    Nice thought Bendaluz - unfortunately the thing which prompted this was an instruction to change to the Progress menu facilities to match a package we have. The original version would have been no problem to add help to. That's life.

    I guess it's time to 'put this one to bed' - unless PSC change the rules then the menus will have to function without help.

    :rolleyes:
     

Share This Page