-
Notifications
You must be signed in to change notification settings - Fork 96
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
Refactored the RangeEditor for Qt and Wx to be more consistent #1783
Open
pbrod
wants to merge
5
commits into
enthought:main
Choose a base branch
from
pbrod:update_range_editor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…or becomes more consistent. (Closes issue enthought#1771) Updated the key_click_text_entry function in wx/_interaction_helpers.py to respond to "Right" or "Left" interaction. (Closes issue enthought#1772) Replaced the use of possibly insecure eval function with the safer ast.literal_eval in RangeEditor. (See issue enthought#1773) Fixed a bug on wx where the text style RangeEditor did raise an error whenever the textbox was empty, even if enter was not pressed. Changed the default low and high attribute of RangeEditor from 0, 1 to Undefined, so that the limits are from -infinite to +infinite by default. (Closes issue enthought#1775) Updated SimpleSpinEditor (for both Wx and PyQt) to allow floats and be able to specify the step of the spin control as well as allow low and/or high to be Undefined. Also added the possibility to increase the step value for the spinner by the use of the modifier keys "Shift", "Ctrl" or "Alt". They will increase the step value for the spinner by a factor of 2, 10 and 100, respectively. If a combination of "Shift", "Ctrl", "Alt" -keys are pressed the step increment will be the product of their factors. (Closes issue enthought#1776) Registered the interaction helper for SimpleSpinEditor for both Qt and Wx: (traitsui/testing/tester/_ui_tester_registry/qt4/_traitsui/range_editor.py, traitsui/testing/tester/_ui_tester_registry/wx/_traitsui/range_editor.py) Made the behavior of LargeRangeSliderEditor more userfriendly. It now allows low and/or high to be Undefined. Its increase/decrease method also increase/decrease the trait value of a factor 10 so that the value remains the same if the increase range button is pushed once followed by a push on the decrease range button (given that the value did not exceed the boundaries low or high). (Closes issue enthought#1777) Added a show_error_dialog attribute to the EditorFactory class in editor_factory.py, which will disable the error popup dialog when set to False. Set the show_error_dialog attribute to False in RangeEditorDemo.py and test_range_editor_text.py in order to avoid that the popup error dialog blocks and eventually makes the tests hang indefinitely. (Closes issue enthought#1778) Changed the default behavior of mode attribute in the RangeEditor. Now the the 'View' conforms to the view explicitly set by the mode attribute unless it is set to 'auto'. Eg. if the mode is set to 'spinner' you will always get a SimpleSpinEditor as view. (Closes issue enthought#1779) Updated the mouse_click function in wx/_interaction_helpers.py to set focus to current control. (Closes issue enthought#1780)
pbrod
force-pushed
the
update_range_editor
branch
from
November 23, 2021 09:51
5fdbe8a
to
6e83a0e
Compare
…errors, `SimpleSpinEditor` uses the built in `Decimal` class
…r to spark a focusOutEvent when a OK button is clicked in the unittests.
pbrod
force-pushed
the
update_range_editor
branch
from
November 24, 2021 19:52
e92b9fa
to
7fd3f89
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactored the RangeEditor backend for Qt and Wx so that their behavior becomes more consistent. (Closes issue #1771)
Updated the key_click_text_entry function in wx/_interaction_helpers.py to respond to "Right" or "Left" interaction. (Closes issue #1772)
Replaced the use of possibly insecure eval function with the safer ast.literal_eval in RangeEditor. (See issue #1773)
Fixed a bug on wx where the text style RangeEditor did raise an error whenever the textbox was empty, even if enter was not pressed.
Changed the default low and high attribute of RangeEditor from 0, 1 to Undefined, so that
the limits are from -infinite to +infinite by default. (Closes issue #1775)
Updated SimpleSpinEditor (for both Wx and PyQt) to allow floats and be able to specify the step of the spin control as well as allow low and/or high to be Undefined. Also added the possibility to increase the step value for the spinner by the use of the modifier keys "Shift", "Ctrl" or "Alt". They will increase the step value for the spinner by a factor of 2, 10 and 100, respectively. If a combination of "Shift", "Ctrl", "Alt" -keys are pressed the step increment will be the product of their factors. (Closes issue #1776)
Registered the interaction helper for SimpleSpinEditor for both Qt and Wx: (traitsui/testing/tester/_ui_tester_registry/qt4/_traitsui/range_editor.py,
traitsui/testing/tester/_ui_tester_registry/wx/_traitsui/range_editor.py)
Made the behavior of LargeRangeSliderEditor more userfriendly. It now allows low and/or high to be Undefined. Its increase/decrease method also increase/decrease the trait value of a factor 10 so that the value remains the same if the increase range button is pushed once followed by a push on the decrease range button (given that the value did not exceed the boundaries low or high). (Closes issue #1777)
Added a show_error_dialog attribute to the EditorFactory class in editor_factory.py, which will disable the error popup dialog when set to False.
In order to avoid that the popup error dialog blocks and eventually makes the tests hang indefinitely the show_error_dialog attribute is set to False in RangeEditorDemo.py and test_range_editor_text.py. (Closes issue #1778)
Changed the default behavior of mode attribute in the RangeEditor. Now the 'View' conforms to the view explicitly set by the mode attribute unless it is set to 'auto'. Eg. if the mode is set to 'spinner' you will always get a SimpleSpinEditor as view. (Closes issue #1779)
Updated the mouse_click function in wx/_interaction_helpers.py to set focus to current control. (Closes issue #1780)
Checklist