Adding a Key Translation to an XmOptionList - Motif

This is a discussion on Adding a Key Translation to an XmOptionList - Motif ; If I traverse to an XmOptionList I can press to open the option list's pulldown menu. How can I specify that Ctrl-downarrow should do the same thing? I've tried the following: *XmRowColumn.Translations: #override \n\ Ctrl osfDown : MenuBtnDown()\n\ Ctrl Down ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Adding a Key Translation to an XmOptionList

  1. Adding a Key Translation to an XmOptionList


    If I traverse to an XmOptionList I can press to open the option
    list's pulldown menu. How can I specify that Ctrl-downarrow should do the
    same thing?

    I've tried the following:

    *XmRowColumn.Translations: #override \n\
    CtrlosfDown : MenuBtnDown()\n\
    CtrlDown : MenuBtnDown()\n

    but this did not help.

    Any suggestions would be greatly appreciated.

    --
    Jake Colman
    Sr. Applications Developer
    Principia Partners LLC
    Harborside Financial Center
    1001 Plaza Two
    Jersey City, NJ 07311
    (201) 209-2467
    www.principiapartners.com

  2. Re: Adding a Key Translation to an XmOptionList



    Jake Colman wrote:
    >
    > If I traverse to an XmOptionList I can press to open the option
    > list's pulldown menu. How can I specify that Ctrl-downarrow should do the
    > same thing?
    >
    > I've tried the following:
    >
    > *XmRowColumn.Translations: #override \n\
    > CtrlosfDown : MenuBtnDown()\n\
    > CtrlDown : MenuBtnDown()\n
    >
    > but this did not help.
    >
    > Any suggestions would be greatly appreciated.
    >
    > --
    > Jake Colman
    > Sr. Applications Developer
    > Principia Partners LLC
    > Harborside Financial Center
    > 1001 Plaza Two
    > Jersey City, NJ 07311
    > (201) 209-2467
    > www.principiapartners.com


    try CtrlosfDown: ManagerGadgetSelect()

    Also, I advise being a bit more selective than "*XmRowComumn" - you
    probably do not want to set this translation on all RowColumn widgets in
    your application. And I would not capitalize "translations".

    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

  3. Re: Adding a Key Translation to an XmOptionList

    In comp.windows.x.motif Jake Colman wrote:

    |If I traverse to an XmOptionList I can press to open the option
    |list's pulldown menu. How can I specify that Ctrl-downarrow should do the
    |same thing?

    |I've tried the following:

    |*XmRowColumn.Translations: #override \n\
    | CtrlosfDown : MenuBtnDown()\n\
    | CtrlDown : MenuBtnDown()\n

    |but this did not help.

    The big problem with translation #override is that it is placed at the
    end of the translations for the widget. If there is already a different
    and more general translation that matches the same event then that will
    continue to get the event. The default translations for XmRowColumn
    include
    :: MenuGadgetTraverseDown()
    which will match osfDown whether or not there is a control modifier.
    You would need to use #replace to get a different translation in place
    for CtrlosfDown. That leaves it up to you to match the rest of
    the default translations.

    --
    - [HP is committed to respecting your privacy.] For more information,
    visit http://welcome.hp.com/country/us/en/...e_privacy.html
    - or contact me at: [mike.stroyan@hp.com or
    HP Privacy Mailbox , 20555 SH 249, MS 040307 , Houston, Texas 77070]

    Mike Stroyan, mike.stroyan@hp.com

  4. Re: Adding a Key Translation to an XmOptionList

    >>>>> "FLK" == Fred L Kleinschmidt writes:

    FLK> Jake Colman wrote:
    >>
    >> If I traverse to an XmOptionList I can press to open the option
    >> list's pulldown menu. How can I specify that Ctrl-downarrow should do the
    >> same thing?
    >>
    >> I've tried the following:
    >>
    >> *XmRowColumn.Translations: #override \n\
    >> CtrlosfDown : MenuBtnDown()\n\
    >> CtrlDown : MenuBtnDown()\n
    >>
    >> but this did not help.
    >>
    >> Any suggestions would be greatly appreciated.
    >>
    >> --
    >> Jake Colman
    >> Sr. Applications Developer
    >> Principia Partners LLC
    >> Harborside Financial Center
    >> 1001 Plaza Two
    >> Jersey City, NJ 07311
    >> (201) 209-2467
    >> www.principiapartners.com


    FLK> try CtrlosfDown: ManagerGadgetSelect()

    FLK> Also, I advise being a bit more selective than "*XmRowComumn" - you
    FLK> probably do not want to set this translation on all RowColumn widgets in
    FLK> your application. And I would not capitalize "translations".

    Do you have any idea why traversal of an option list (or any menu for that
    matter) is flaky? If I use the space key to open the option list I should be
    able to use the arrow key to traverse the menu items. This only works some
    of the time, usually the first time. Once I select an item, if I go back and
    press the space key the menu opens but the arrows won't traverse.

    Any ideas why that might be? Or what I can look for?

    --
    Jake Colman
    Sr. Applications Developer
    Principia Partners LLC
    Harborside Financial Center
    1001 Plaza Two
    Jersey City, NJ 07311
    (201) 209-2467
    www.principiapartners.com

  5. Re: Adding a Key Translation to an XmOptionList



    Mike Stroyan wrote:
    >
    > In comp.windows.x.motif Jake Colman wrote:
    >
    > |If I traverse to an XmOptionList I can press to open the option
    > |list's pulldown menu. How can I specify that Ctrl-downarrow should do the
    > |same thing?
    >
    > |I've tried the following:
    >
    > |*XmRowColumn.Translations: #override \n\
    > | CtrlosfDown : MenuBtnDown()\n\
    > | CtrlDown : MenuBtnDown()\n
    >
    > |but this did not help.
    >
    > The big problem with translation #override is that it is placed at the
    > end of the translations for the widget. If there is already a different
    > and more general translation that matches the same event then that will
    > continue to get the event. The default translations for XmRowColumn
    > include
    > :: MenuGadgetTraverseDown()
    > which will match osfDown whether or not there is a control modifier.
    > You would need to use #replace to get a different translation in place
    > for CtrlosfDown. That leaves it up to you to match the rest of
    > the default translations.
    >
    > --

    (snip)
    > Mike Stroyan, mike.stroyan@hp.com


    Not true for a RowColumn used as an option menu. For option menus, the
    Motif2.1 translations are:

    externaldef(translations) _XmConst char _XmRowColumn_option_table[]= "\
    : MenuGadgetDrag()\n\
    c: MenuGadgetTraverseCurrent()\n\
    c: MenuGadgetTraverseCurrentUp()\n\
    ~c: MenuBtnDown()\n\
    ~c: MenuBtnUp()\n\
    :osfActivate: ManagerParentActivate()\n\
    :osfCancel: ManagerParentCancel()\n\
    :osfSelect: ManagerGadgetSelect()\n\
    :osfHelp: MenuHelp()\n\
    ~s ~m ~a Return: ManagerParentActivate()\n\
    ~s ~m ~a space: ManagerGadgetSelect()";

    the Motif1.2 translations are different:

    externaldef(translations) _XmConst char _XmRowColumn_option_table[]= "\
    ~s ~m ~a Return:ManagerParentActivate()\n\
    osfActivate:ManagerParentActivate()\n\
    osfCancel:ManagerParentCancel()\n\
    osfSelect:ManagerGadgetSelect()\n\
    osfHelp:MenuHelp()\n\
    ~s ~m ~a space:ManagerGadgetSelect()\n\
    :MenuBtnDown()\n\
    :MenuBtnUp()";

    The space key activation is the same in both, and neither has a general
    translation for osfDown. The solution should thus be to add an
    #override that invokes the ManagerGadgetSelect() action.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

  6. Re: Adding a Key Translation to an XmOptionList

    Fred L. Kleinschmidt wrote:


    |Mike Stroyan wrote:
    |>
    |> continue to get the event. The default translations for XmRowColumn
    |> include
    |> :: MenuGadgetTraverseDown()
    |> which will match osfDown whether or not there is a control modifier.


    |Not true for a RowColumn used as an option menu. For option menus, the
    |Motif2.1 translations are:

    |externaldef(translations) _XmConst char _XmRowColumn_option_table[]= "\
    |: MenuGadgetDrag()\n\
    |c: MenuGadgetTraverseCurrent()\n\
    |c: MenuGadgetTraverseCurrentUp()\n\
    |~c: MenuBtnDown()\n\
    |~c: MenuBtnUp()\n\
    |:osfActivate: ManagerParentActivate()\n\
    |:osfCancel: ManagerParentCancel()\n\
    |:osfSelect: ManagerGadgetSelect()\n\
    |:osfHelp: MenuHelp()\n\
    |~s ~m ~a Return: ManagerParentActivate()\n\
    |~s ~m ~a space: ManagerGadgetSelect()";

    The :: MenuGadgetTraverseDown() translation is
    inherited by an XmMENU_OPTION RowColumn as part of the XmManager
    traversal translations. You can check that with a small hack. You can
    get widgets to report their translations to stdout by adding one more
    translation-

    a.out -xrm "*translations:#augment P:XtDisplayTranslations()"

    Then pressing "p" tells the current focus widget to call an action
    that formats and prints its translations resource.

    --
    Mike Stroyan, mike.stroyan@hp.com

+ Reply to Thread