SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IsIndeterminate() method renders engineer insane

    I refer you to the documentation of the
    JavaJFCPushButton IsIndeterminate() method:

    "Determines whether a button on a tool bar is in a state that is neither pressed nor not pressed."

    Who wrote this piece of documentation?
    Where do they live?
    Which method of execution would they prefer?

    Can someone please explain...?

    ------------------
    Tempus fugit, Carpe Diem, et al

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    I have seen this too and never figured it out :-) But until you need it -- don't worry about it.

    ------------------
    Rob Kapteyn
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    But how do I know that I don't need it...?

    OK, fair enough.

    My main reason for looking through the methods for JavaJFCPushButton is that I am trying to determine when a button has finished being pressed.
    My AUT has an 'apply' button, which writes the current state of the GUI to a database.
    When this process is finished, the button becomes unpressed and the focus switches to an 'OK' button. Unfortunately, there don't seem to be any methods to determine whether a component has focus or not. The 'HasFocus' method simply tests whether the control has input focus.
    Any ideas...?



    ------------------
    Tempus fugit, Carpe Diem, et al

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    Take a look at GetFocus().



    ------------------

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    OK the problem is this.
    I assumed that the dotted line around the inner edge of a button is an indication that the button currently has the focus.
    This is not the case with Java.
    I stuck in loads of debug and found that as soon as I pressed the 'Apply' button the 'OK' button gained the focus, even though the 'Apply' button had not finished being pressed and still had the dotted line
    around the inner edge.
    I confirmed this by looking at our code base to find that the very first thing the developers did when the 'Apply' button was pressed was to restore focus to the 'OK' button, before the updating of the database etc.
    The fact is you can call the java method 'requestFocus' on a component, but a repaint will not happen until the GUI returns to a state when the user can have input. This would explain why the dotted line only shifts across to the 'OK' button after the 'Apply' button has finished being pressed.
    The moral to this story:
    assume nothing, throw in shed loads of debug


    ------------------
    Tempus fugit, Carpe Diem, et al

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    I know that JavaJFCButtons are a bit flaky -- I have several custom methods of my own for dealing with them -- but if a button has a dotted line around its inner edge and does not actually have focus, I think that your developers have messed up and a bug report is in order.

    ------------------
    Rob Kapteyn
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    Agreed. That's terribly misleading.

    ------------------

  8. #8
    Senior Member
    Join Date
    Nov 2001
    Location
    UK, Oxford
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    I agree up to a point.
    I do think that the developers should have noticed this and investigated, but I also think that the method requestFocus() should probably not allow the focus to shift until such time that it can do an immediate repaint.
    Anyway, bug reported it has been.

    ------------------
    Tempus fugit, Carpe Diem, et al

  9. #9
    Senior Member
    Join Date
    Aug 2000
    Location
    NY,NY,USA
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    Hoe can I tell if a VB push button has focus, if I do a getfocus with the button with the dotted lines around it, which means in you throw an enter key at it, it will actuate. but nooooo...

    BARS2 is window name
    Button is "Select" (has focus)

    print(BARS2.GetFocus ())
    I get
    *** Error: No window has input focus

  10. #10
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: IsIndeterminate() method renders engineer insane

    Depending on how BARS2 is defined, it might NOT have input focus.

    As an example consider a Notepad application with its File Open dialog exposed and input focus on the Cancel button. Using Notepad.GetFocus() will result in the "No window has input focus" error. But Notepad.Open.GetFocus() will return the Cancel button. Try this:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> Print(Desktop.GetActive().GetFocus()) ;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">to expose what your app' sees.


    John


    John

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:46 AM.

Copyright BetaSoft Inc.