×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    41

    Any way to know when the menu is open

    I have an application that depending on the state of the form, I add and remove commands. It is an EggTimer, so when the timer expires, I remove commands like stop and pause.

    The problem is that if the user has the menu open when I do this, an exception is generated.

    I'm not sure how to handle this as I find no way to know when the menu is open and I think the exception occurs when I remove the commands on the open menu.

    Has anyone run into this problem, and do you have any suggestions, like a way to force the menu closed or something?

    SpaceCowboy

  2. #2
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    Unfortunatly, there is no event or callback function to notify when user open the menu, but the Displayable.isShown() may help in this issue.

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    41
    Nice suggestion, kisember, but unfortunately, it doesn't seem to work. Having the normal command menu up is not enough for the system to consider the form hidden. I tried the following code,

    void addCommand( Command c ) {
    if ( m_timer_form.isShown() ) {
    m_timer_form.addCommand( c );
    System.out.println( "Add: menu down" );
    }
    else {
    m_added_commands.addElement( c );
    System.out.println( "Add: menu up" );
    }
    }

    but could never get into the else statement....=(

    Surely someone has dealt with this. It's not too big a bug, but I hate it that the bug is in there.

    SpaceCowboy

  4. #4
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    What is the targeted phone?
    Most phone use full screen list for commands, I thought, when this happen isShown() returns false. Maybe i'm wrong.
    If you target S60, that's a horse of another color, because the command list covers a part of screen and isShown() return true, I guess. Any workaround???
    On S60 there are some bug related to Commands...

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Perhaps you can make your own menu?

    Instead of adding two commands (which results in an "Options" command to open a menu) create one command (labelled "Options") that switches the display to a List screen, contain the options you want.

    It's a lot more work to achieve something that should be easy... but it should give you more control - now you will know when the menu is opened.

    Graham.

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    41
    I'm using the Nokia 3650, whose menu only covers the bottom half of the screen when open.

    At this point, if i want to fix the bug, it looks like I would have to implement my own menu via a list screen. Sucks.

    SpaceCowboy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×