<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from traits . has_traits import HasTraits <EOL> from traits . trait_types import Int <EOL> from traitsui . item import Item <EOL> from traitsui . view import View <EOL> from traitsui . editors . range_editor import RangeEditor <EOL> from traitsui . tests . _tools import * <EOL> class NumberWithTextEditor ( HasTraits ) : <EOL> """<STR_LIT>""" <EOL> number = Int <EOL> traits_view = View ( <EOL> Item ( label = "<STR_LIT>" ) , <EOL> Item ( '<STR_LIT>' , editor = RangeEditor ( low = <NUM_LIT:3> , high = <NUM_LIT:8> , mode = '<STR_LIT:text>' ) ) , <EOL> buttons = [ '<STR_LIT:OK>' ] <EOL> ) <EOL> @ skip_if_not_wx <EOL> def test_wx_spin_control_editing ( ) : <EOL> with store_exceptions_on_all_threads ( ) : <EOL> num = NumberWithTextEditor ( ) <EOL> ui = num . edit_traits ( ) <EOL> textctrl = ui . control . FindWindowByName ( '<STR_LIT:text>' ) <EOL> textctrl . SetValue ( '<STR_LIT:1>' ) <EOL> press_ok_button ( ui ) <EOL> assert num . number >= <NUM_LIT:3> and num . number <= <NUM_LIT:8> <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> num = NumberWithTextEditor ( ) <EOL> num . configure_traits ( ) <EOL> print ( num . number ) </s>
