Menu

Hidden menu items

Help
2011-12-09
2013-03-18
  • nenad cikic

    nenad cikic - 2011-12-09

    I have habit to declare hidden menu items in the main frame. Then in the code i declare global long data nd assign the feq number

    hiddenFeq=?hiddenMenuItem
    Then from other thread i send with POST to the hidden menu accepted event, so that i can process some code in the main frame.
    This is working in c2j. Just one thing is not working. The menu item is not effectivelly hidden.

    For example from main frame definition:
                             MENU('<154>đčć<158,138>ĐČĆ<142>'),USE(?test),HIDE
                               ITEM('Update globalni param'),USE(?Updateglobalniparam),HIDE
                             END

    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-12-10

    I'll take a look later on the weekend. Brief look at the code, I would expect HIDE to behave as expected.  My initial expectation is that maybe it is a limitation of Java Swing, you cannot hide menu item components. But I have not looked close enough yet.

    Interesting hack, using a ?control and posting ACCEPT to it.

    c2j will allow you to post events for non existent fields.  e.g. the following code snippet behaves the way you would expect. If this is of help:

            program
    window window('test'),at(10,10,100,100)
            button('Press me'),use(?b1),at(1,1,50,10)
    .
            code
            open(window)
            accept
                    if accepted()=?b1
                            post(event:Accepted,100)
                    .
                    if accepted()=100
                            message('Got an event for non existant field!')
                    .
            .
            close(window)
    
     
  • Andrew Barnham

    Andrew Barnham - 2011-12-10

    Menu items not responding to disable/hide etc was a one line oversight in runtime code. Committed a fix.

     
  • nenad cikic

    nenad cikic - 2011-12-10

    Ok, thanks
    Nenad

     
  • nenad cikic

    nenad cikic - 2011-12-12

    Works now.
    Thanks
    Nenad

     

Log in to post a comment.

Auth0 Logo