Specifing Field for Initial Focus - Motif

This is a discussion on Specifing Field for Initial Focus - Motif ; How can I specify which field in a window gets the initial focus? -- Jake Colman Principia Partners LLC Phone: (201) 209-2467 Harborside Financial Center Fax: (201) 946-0320 902 Plaza Two E-mail: colman@ppllc.com Jersey City, NJ 07311 www.principiapartners.com...

+ Reply to Thread
Results 1 to 11 of 11

Thread: Specifing Field for Initial Focus

  1. Specifing Field for Initial Focus


    How can I specify which field in a window gets the initial focus?

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  2. Re: Specifing Field for Initial Focus

    >>>>> "Jake" == Jake Colman writes:

    Jake> How can I specify which field in a window gets the initial focus?

    Sorry to follow up myself...

    I just did a bit more research and I need to clarify this question a bit. I
    am using a suggestion given me by Fred L. Kleinschmidt to specify the tab
    order for fields on my screen. My screens are all UIL-based and it would be
    very difficult to fix the layout as I need. Fred's solution was to create
    all my widgets with XmNnavigationType specified as XmNONE. Then, for each
    widget in the tab list, and in the desired order, specify XmNnavigationType
    of XmEXCLUSIVE_TAB_GROUP.

    Having said this, how can I specify which of these widgets gets the initial
    focus? Is it always the first one in the list?

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  3. Re: Specifing Field for Initial Focus



    Jake Colman wrote:
    >
    > >>>>> "Jake" == Jake Colman writes:

    >
    > Jake> How can I specify which field in a window gets the initial focus?
    >
    > Sorry to follow up myself...
    >
    > I just did a bit more research and I need to clarify this question a bit. I
    > am using a suggestion given me by Fred L. Kleinschmidt to specify the tab
    > order for fields on my screen. My screens are all UIL-based and it would be
    > very difficult to fix the layout as I need. Fred's solution was to create
    > all my widgets with XmNnavigationType specified as XmNONE. Then, for each
    > widget in the tab list, and in the desired order, specify XmNnavigationType
    > of XmEXCLUSIVE_TAB_GROUP.
    >
    > Having said this, how can I specify which of these widgets gets the initial
    > focus? Is it always the first one in the list?
    >
    > --
    > Jake Colman
    >
    > Principia Partners LLC Phone: (201) 209-2467
    > Harborside Financial Center Fax: (201) 946-0320
    > 902 Plaza Two E-mail: colman@ppllc.com
    > Jersey City, NJ 07311 www.principiapartners.com


    Call XmProcessTraversal( widget, XmTRAVERSE_CURRENT) immediately after
    you manage the dialog.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

  4. Re: Specifing Field for Initial Focus

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


    FLK> Call XmProcessTraversal( widget, XmTRAVERSE_CURRENT) immediately
    FLK> after you manage the dialog.

    I've tried this but to no effect.

    Here's an interesting piece to the puzzle. The technique you suggested works
    like a charm and my tab traversal proceeds as specified. But for each
    screen, focus starts in some other field that is not part of my specified tab
    order and that other field remains in the traversal list. In other words, if
    I specify that the order is F1, F2, F3, F4, F5, focus starts in Fx and then
    proceeds to 1-5 and that back to x.

    Any ideas on this littlw wrinkle?

    Thanks again for all your help!

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  5. Re: Specifing Field for Initial Focus



    Jake Colman wrote:
    >
    > ????? "FLK" == Fred L Kleinschmidt ?fred.l.kleinschmidt@nospam_boeing.com?
    > ????? writes:
    >
    > FLK? Call XmProcessTraversal( widget, XmTRAVERSE_CURRENT) immediately
    > FLK? after you manage the dialog.
    >
    > I've tried this but to no effect.
    >
    > Here's an interesting piece to the puzzle. The technique you suggested works
    > like a charm and my tab traversal proceeds as specified. But for each
    > screen, focus starts in some other field that is not part of my specified tab
    > order and that other field remains in the traversal list. In other words, if
    > I specify that the order is F1, F2, F3, F4, F5, focus starts in Fx and then
    > proceeds to 1-5 and that back to x.
    >
    > Any ideas on this littlw wrinkle?
    >
    > Thanks again for all your help!
    >
    > --
    > Jake Colman
    >
    > Principia Partners LLC Phone: (201) 209-2467
    > Harborside Financial Center Fax: (201) 946-0320
    > 902 Plaza Two E-mail: colman@ppllc.com
    > Jersey City, NJ 07311 www.principiapartners.com


    For all other widgets (that you do not want in the traversal list), set
    XmNnavigationType to XmNONE.
    On some platforms, I have also found that I couldn't get the initial
    focus to work right by using a call to XmProcessTraversal. Here's what I
    did as a workaround:
    Just before managing the dialog, I set an expose event handler on the
    widget that I want to get focus. In the event handler, I call
    XmProcesstraversal(me, XmTRAVERSE_CURRENT), then remove the event
    handler.

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

  6. Re: Specifing Field for Initial Focus

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

    FLK> Jake Colman wrote:
    >>
    >> ????? "FLK" == Fred L Kleinschmidt ?fred.l.kleinschmidt@nospam_boeing.com?
    >> ????? writes:
    >>
    >> FLK? Call XmProcessTraversal( widget, XmTRAVERSE_CURRENT) immediately
    >> FLK? after you manage the dialog.
    >>
    >> I've tried this but to no effect.
    >>
    >> Here's an interesting piece to the puzzle. The technique you suggested works
    >> like a charm and my tab traversal proceeds as specified. But for each
    >> screen, focus starts in some other field that is not part of my specified tab
    >> order and that other field remains in the traversal list. In other words, if
    >> I specify that the order is F1, F2, F3, F4, F5, focus starts in Fx and then
    >> proceeds to 1-5 and that back to x.
    >>
    >> Any ideas on this littlw wrinkle?
    >>
    >> Thanks again for all your help!
    >>
    >> --
    >> Jake Colman
    >>
    >> Principia Partners LLC Phone: (201) 209-2467
    >> Harborside Financial Center Fax: (201) 946-0320
    >> 902 Plaza Two E-mail: colman@ppllc.com
    >> Jersey City, NJ 07311 www.principiapartners.com


    FLK> For all other widgets (that you do not want in the traversal list),
    FLK> set XmNnavigationType to XmNONE. On some platforms, I have also
    FLK> found that I couldn't get the initial focus to work right by using a
    FLK> call to XmProcessTraversal. Here's what I did as a workaround: Just
    FLK> before managing the dialog, I set an expose event handler on the
    FLK> widget that I want to get focus. In the event handler, I call
    FLK> XmProcesstraversal(me, XmTRAVERSE_CURRENT), then remove the event
    FLK> handler.

    Fred,

    There are two issues here. First is the issue of the initial focus and I
    will try to implement your latest suggestion.

    The second problem is that I am getting an extra field in the tab ordering
    and that extra field is getting the initial focus. I create all my widgets
    with XmNnavigationType of XmNONE. I then specify XmNnavigationType of
    XmEXCLUSIVE_TAB_GROUP for the widgets in the tab list. I still get one extra
    widget even though I did not ask for it! That widget has the initial focus
    and focus wraps back to it after the last field in the tab list. I have this
    problem on all the screens I have been working with so I know it is not
    limited to one strange situation. Any ideas how I can track this down and
    fix it? This is CRUCIAL to me for rolling out this screen change.

    Thanks!

    ....Jake

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  7. Re: Specifing Field for Initial Focus

    >>>>> "Jake" == Jake Colman writes:

    Jake> Fred,

    Jake> There are two issues here. First is the issue of the initial focus
    Jake> and I will try to implement your latest suggestion.

    Jake> The second problem is that I am getting an extra field in the tab
    Jake> ordering and that extra field is getting the initial focus. I
    Jake> create all my widgets with XmNnavigationType of XmNONE. I then
    Jake> specify XmNnavigationType of XmEXCLUSIVE_TAB_GROUP for the widgets
    Jake> in the tab list. I still get one extra widget even though I did not
    Jake> ask for it! That widget has the initial focus and focus wraps back
    Jake> to it after the last field in the tab list. I have this problem on
    Jake> all the screens I have been working with so I know it is not limited
    Jake> to one strange situation. Any ideas how I can track this down and
    Jake> fix it? This is CRUCIAL to me for rolling out this screen change.

    Yet another piece to the puzzle. Again, all widgets are initially created
    XmNnavigationType of XmNONE. Yet, one additional widget is added to the tab
    order - one that I know I have not asked for. If I specify for that widget
    'XmNtraversalOn=false' focus no longer begins at that widget, rather, it
    goes to a different widget.

    It wouuld seem that there is something that is adding widgets to my
    traversal list even though I am not asking for it? Could it be the
    default value of something's XmNinitialFocus attribute? If so, I tried
    specifying that at varioius manager levels but still coud not fix this.

    HELP!!

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  8. Re: Specifing Field for Initial Focus

    Jake Colman wrote:
    > Yet another piece to the puzzle. Again, all widgets are initially created
    > XmNnavigationType of XmNONE. Yet, one additional widget is added to the tab
    > order - one that I know I have not asked for.


    Is the unwanted widget a simgle line text widget, or is it a more complex
    widget that is made of of a parent and many children ? (for instance a
    scrolled text widget) ? Perhaps the navigationType value is applied to the
    wrong widget in the group that makes up the complex widget.

    In your program, you might want to obtain from the offending widget, upon
    receiving focus, the XmNnavigationType value to see what it is really set to.

  9. Re: Specifing Field for Initial Focus

    >>>>> "JM" == JF Mezei writes:

    JM> Jake Colman wrote:
    >> Yet another piece to the puzzle. Again, all widgets are initially
    >> created XmNnavigationType of XmNONE. Yet, one additional widget is
    >> added to the tab order - one that I know I have not asked for.


    JM> Is the unwanted widget a simgle line text widget, or is it a more
    JM> complex widget that is made of of a parent and many children ? (for
    JM> instance a scrolled text widget) ? Perhaps the navigationType value is
    JM> applied to the wrong widget in the group that makes up the complex
    JM> widget.

    JM> In your program, you might want to obtain from the offending widget,
    JM> upon receiving focus, the XmNnavigationType value to see what it is
    JM> really set to.

    It might be a XmPushButton or a XmToggleButton, it doesn't matter. I have
    confirmed that the widgets have an XmNnavigationType of XmNONE. Fred assures
    me that a widget simply cannot be part of the traversal if the widget's value
    is XmNONE and the others are XmEXCLUSIVE_TAB_GROUP yet this is what seems to
    be happening. I am totally stumped!

    Is there some way to debug this? Some way to explore the widgets internals
    and see what's going on?

    --
    Jake Colman

    Principia Partners LLC Phone: (201) 209-2467
    Harborside Financial Center Fax: (201) 946-0320
    902 Plaza Two E-mail: colman@ppllc.com
    Jersey City, NJ 07311 www.principiapartners.com

  10. Re: Specifing Field for Initial Focus

    Jake Colman wrote:
    > It might be a XmPushButton or a XmToggleButton, it doesn't matter. I have
    > confirmed that the widgets have an XmNnavigationType of XmNONE.


    Is the guilty widget included in some container widget (form, frame rowcolumn
    etc) ?
    It could be that the container widget is the one that provides the navigation
    to its only child widget.

  11. Re: Specifing Field for Initial Focus


+ Reply to Thread