Skip to content
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
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Nov 23, 2021

  1. Refactored the RangeEditor backend for Qt and Wx so that their behavi…

    …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 committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    6e83a0e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c5ab38c View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2021

  1. In order to correctly handle floating point numbers without rounding …

    …errors, `SimpleSpinEditor` uses the built in `Decimal` class
    pbrod committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    7090b82 View commit details
    Browse the repository at this point in the history
  2. Gave the QLineEdit widget a parent in _make_text_entry method in orde…

    …r to spark a focusOutEvent when a OK button is clicked in the unittests.
    pbrod committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    7fd3f89 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2021

  1. Configuration menu
    Copy the full SHA
    86e8ff1 View commit details
    Browse the repository at this point in the history