8000 Text box widget by HastingsGreer · Pull Request #5375 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Text box widget #5375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e0440cc
Added a text entry widget, that allows usere to register to be notifi…
HastingsGreer Oct 27, 2015
5b06d3f
resolved merge conflict in CHANGELOG
HastingsGreer Jan 25, 2016
23c5a74
Added description of textbox widget and example
HastingsGreer Oct 31, 2015
1f37c22
Added a text box example: evaluates any string inputs as y(x).
HastingsGreer Oct 31, 2015
507b6a4
Whitespace adjustments for PEP8 compliance
HastingsGreer Oct 31, 2015
ff8afc3
Removed a newline that was accidentally commited
HastingsGreer Oct 31, 2015
f1df42f
removed w accidentally added to the first line
HastingsGreer Oct 31, 2015
606d4a3
fixed PEP8 formatting
HastingsGreer Oct 31, 2015
02b9ffd
Fixed formatting of textbox widget entry in whats_new.rst
HastingsGreer Oct 31, 2015
497452e
formatting changes for Pep8 compliance
HastingsGreer Nov 3, 2015
382057d
removed "time the" from end of document, added last commit by mistake
HastingsGreer Nov 3, 2015
06ab4ce
refactored "start typing" and "stop typing" into their own functions …
HastingsGreer Jan 20, 2016
9826a3c
fixed typos from last commit
HastingsGreer Jan 20, 2016
bf4bccd
made textbox lose focus when window is resized: this prevents cursor …
HastingsGreer Jan 20, 2016
954dfd0
added adjustable padding between label and text box
HastingsGreer Jan 20, 2016
b26ec58
removed trailing whitespace
HastingsGreer Jan 25, 2016
0025a26
enabled moving the cursor by clicking
HastingsGreer Feb 13, 2016
2734051
Document feature: caret can be moved by clicking
HastingsGreer Feb 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed trailing whitespace
  • Loading branch information
HastingsGreer committed Jan 25, 2016
commit b26ec58b82c440ec6fcc123d0fac6e2452dcb25d
10 changes: 5 additions & 5 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def _keypress(self, event):
func(self.text)
if key == "enter":
self._notify_submit_observers()

def begin_typing(self, x):
self.capturekeystrokes = True
#disable command keys so that the user can type without
Expand All @@ -815,7 +815,7 @@ def begin_typing(self, x):
#approximate it based on assuming all characters the same length
self.cursor_index = len(self.text)
self._rendercursor()

def stop_typing(self):
notifysubmit = False
# because _notify_submit_users might throw an error in the
Expand All @@ -833,7 +833,7 @@ def stop_typing(self):
if notifysubmit:
self._notify_submit_observers()


def _click(self, event):
if self.ignore(event):
return
Expand All @@ -846,10 +846,10 @@ def _click(self, event):
event.canvas.grab_mouse(self.ax)
if not(self.capturekeystrokes):
self.begin_typing(event.x)

def _resize(self, event):
self.stop_typing()

def _motion(self, event):
if self.ignore(event):
return
Expand Down
0