bugpyFormex - Bugs: bug #50607, The ESC on idraw (in viewport.py)...

 
 

bug #50607: The ESC on idraw (in viewport.py) does not work from console

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Wed 22 Mar 2017 10:05:39 AM UTC  
 
Category: GUISeverity: 2 - Minor
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 22 Mar 2017 01:12:33 PM UTC, comment #5:

The problem has been solved in 743cbb8 by explicitely setting the keyboard focus to the canvas widget in the related functions
QtCanvas.pick and QtCanvas.idraw.

In 739d87 the same was done for QtCanvas.drawLinesInter.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 22 Mar 2017 12:37:31 PM UTC, comment #4:

The problem is not just with the ESC, but with all key presses.
This is because the console takes the input focus, and key presses are then processed by the console, not the canvas. Clicking on the canvas gives focus to the canvas.

Indeed the problem does not exist if you deactivate the console.
The console is started as lasat, and therefore takes the default focus. After the first click, focus is in the canvas.
When entering the command in the console, you always return focus to the console.

The user can solve the problem in a script by explicitely giving focus to the canvas: pf.canvas.setFocus().

But I intend to add this in the pick() and idraw() functions, to automatically setting it when you use any of these.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 22 Mar 2017 11:36:26 AM UTC, comment #3:

The same also happens with the pick() function, and it is even documented in the docstring of that function
(viewport.QtCanvas.pick)

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 22 Mar 2017 11:33:09 AM UTC, comment #2:

I confirm this is also the case for me: this also happens when executing the statement from a script, but only the first time the script is executed after a pyFormex startup.

gianluca de santis <gianlucadesi>
Project Member
Wed 22 Mar 2017 11:08:12 AM UTC, comment #1:

This also happens to me when executing the statement from a script, but only the first time the script is executed after a pyFormex startup.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 22 Mar 2017 10:05:39 AM UTC, original submission:

The ESC on idraw (in viewport.py) does not work from console.

If you execute a script with the following line you can do left mouse click, right mouse click (or keyboard ENTER) or keyboard ESC. In case of ESC the pf.canvas.draw_accepted is False

p = pf.canvas.idraw(mode='point', npoints=1) print(pf.canvas.draw_accepted)

However, if you execute the same line from console the keyboard ESC does not work.

gianluca de santis <gianlucadesi>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by gianlucadesi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 22 Mar 2017 01:12:33 PM UTCbverhegCategoryNone=>GUI
      StatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1