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

Submitter:  gianluca de santis <gianlucadesi>
Submitted:  Wed 22 Mar 2017 10:05:39 AM UTC
   
 
Category:  GUI Severity:  2 - Minor
Item Group:  Functionality error Status:  Fixed
Privacy:  Public Assigned to:  bverheg
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group administrator
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>
Group administrator
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>
Group 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>
Group administrator
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>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-30 bverheg Open/ClosedOpen Closed
    2017-03-22 bverheg CategoryNone GUI
        StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code