@@ -17,13 +17,13 @@ inherit
1717
1818feature -- Access
1919
20- min : detachable READABLE_STRING_ 32
20+ min : detachable READABLE_STRING_ 8
2121 -- minimun value accepted by Current field.
2222
23- max : detachable READABLE_STRING_ 32
23+ max : detachable READABLE_STRING_ 8
2424 -- maximun value accepted by Current field.
2525
26- step : detachable READABLE_STRING_ 32
26+ step : detachable READABLE_STRING_ 8
2727 -- step is the increment that the value should adjust up or down, with the default step value being 1.
2828
2929feature -- Element Change
@@ -52,28 +52,46 @@ feature -- Element Change
5252 step_set : attached step as l_step implies l_step .same_string (a_val .out )
5353 end
5454
55- set_min_string (a_val : READABLE_STRING_ 32 )
55+ set_min_string (a_val : READABLE_STRING_GENERAL )
5656 -- Set `min' with `a_val'.
57+ require
58+ is_valid_number : a_val .is_integer
5759 do
58- min := a_val
60+ if a_val .is_string_ 32 then
61+ min := html_encoder .encoded_string (a_val .as_string_ 32 )
62+ elseif a_val .is_string_ 8 then
63+ min := a_val .as_string_ 8
64+ end
5965 ensure
60- min_set : attached min as l_min implies l_min = a_val
66+ min_set : attached min as l_min implies l_min . same_string_general ( a_val )
6167 end
6268
63- set_max_string (a_val : READABLE_STRING_ 32 )
69+ set_max_string (a_val : READABLE_STRING_GENERAL )
6470 -- Set `max' with `a_val'.
71+ require
72+ is_valid_number : a_val .is_integer
6573 do
66- max := a_val
74+ if a_val .is_string_ 32 then
75+ max := html_encoder .encoded_string (a_val .as_string_ 32 )
76+ elseif a_val .is_string_ 8 then
77+ max := a_val .as_string_ 8
78+ end
6779 ensure
68- max_set : attached max as l_max implies l_max = a_val
80+ max_set : attached max as l_max implies l_max . same_string_general ( a_val )
6981 end
7082
71- set_step_string (a_val : READABLE_STRING_ 32 )
83+ set_step_string (a_val : READABLE_STRING_GENERAL )
7284 -- Set `step' with `a_val'.
73- do
74- step := a_val
85+ require
86+ is_valid_sequence : a_val .is_number_sequence or else a_val .is_real_sequence
87+ do
88+ if a_val .is_string_ 32 then
89+ step := html_encoder .encoded_string (a_val .as_string_ 32 )
90+ elseif a_val .is_string_ 8 then
91+ step := a_val .as_string_ 8
92+ end
7593 ensure
76- step_set : attached step as l_step implies l_step = a_val
94+ step_set : attached step as l_step implies l_step . same_string_general ( a_val )
7795 end
7896
7997
@@ -85,21 +103,21 @@ feature {NONE} -- Conversion
85103 -- min
86104 if attached min as l_min then
87105 a_target .append (" min=%" " )
88- a_target.append (html_encoder.encoded_string ( l_min) )
106+ a_target.append( l_min)
89107 a_target.append_character ('%" ')
90108 end
91109
92110 -- max
93111 if attached max as l_max then
94112 a_target .append (" max=%" " )
95- a_target.append (html_encoder.encoded_string ( l_max) )
113+ a_target.append (l_max)
96114 a_target.append_character ('%" ')
97115 end
98116
99117 -- step
100118 if attached step as l_step then
101119 a_target .append (" step=%" " )
102- a_target.append (html_encoder.encoded_string ( l_step) )
120+ a_target.append (l_step)
103121 a_target.append_character ('%" ')
104122 end
105123 end
0 commit comments