Add set value to value controls
This commit is contained in:
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
|
|||||||
make (l, c: STRING)
|
make (l, c: STRING)
|
||||||
-- Initialize with specified control name,
|
-- Initialize with specified control name,
|
||||||
do
|
do
|
||||||
make_value_control ( "input")
|
make_value_control ("input")
|
||||||
label := l
|
label := l
|
||||||
checked_value := c
|
checked_value := c
|
||||||
end
|
end
|
||||||
@@ -54,9 +54,9 @@ feature --Event handling
|
|||||||
change_event := e
|
change_event := e
|
||||||
end
|
end
|
||||||
|
|
||||||
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable ANY)
|
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY)
|
||||||
do
|
do
|
||||||
if Current.control_name.same_string (cname[1]) and attached change_event as cevent then
|
if Current.control_name.same_string (cname [1]) and attached change_event as cevent then
|
||||||
if event.same_string ("change") then
|
if event.same_string ("change") then
|
||||||
cevent.call (Void)
|
cevent.call (Void)
|
||||||
end
|
end
|
||||||
@@ -81,6 +81,11 @@ feature -- Implementation
|
|||||||
Result := checked
|
Result := checked
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: BOOLEAN)
|
||||||
|
do
|
||||||
|
checked := v
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
label: STRING
|
label: STRING
|
||||||
|
|||||||
@@ -48,4 +48,13 @@ feature -- Implementation
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: LIST [STRING])
|
||||||
|
do
|
||||||
|
across
|
||||||
|
controls as c
|
||||||
|
loop
|
||||||
|
c.item.set_value (v.has (c.item.checked_value))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -146,6 +146,11 @@ feature -- Change
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: detachable WSF_FILE)
|
||||||
|
do
|
||||||
|
file := v
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
disabled: BOOLEAN
|
disabled: BOOLEAN
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ feature -- Implementation
|
|||||||
Result := text
|
Result := text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: STRING)
|
||||||
|
do
|
||||||
|
text := v
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
disabled: BOOLEAN
|
disabled: BOOLEAN
|
||||||
|
|||||||
@@ -71,6 +71,11 @@ feature -- Access
|
|||||||
Result := value_control.value
|
Result := value_control.value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: G)
|
||||||
|
do
|
||||||
|
value_control.set_value (v)
|
||||||
|
end
|
||||||
|
|
||||||
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
||||||
|
|
||||||
load_state (new_states: JSON_OBJECT)
|
load_state (new_states: JSON_OBJECT)
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ class
|
|||||||
inherit
|
inherit
|
||||||
|
|
||||||
WSF_VALUE_CONTROL [STRING]
|
WSF_VALUE_CONTROL [STRING]
|
||||||
rename make as make_value_control end
|
rename
|
||||||
|
make as make_value_control
|
||||||
|
end
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -20,7 +22,7 @@ feature {NONE} -- Initialization
|
|||||||
make (t, v: STRING)
|
make (t, v: STRING)
|
||||||
-- Initialize
|
-- Initialize
|
||||||
do
|
do
|
||||||
make_value_control ( t)
|
make_value_control (t)
|
||||||
html := v
|
html := v
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
|||||||
|
|
||||||
feature --Event handling
|
feature --Event handling
|
||||||
|
|
||||||
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable ANY)
|
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY)
|
||||||
do
|
do
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -68,6 +70,11 @@ feature -- Implementation
|
|||||||
Result := html
|
Result := html
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: STRING)
|
||||||
|
do
|
||||||
|
html := v
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
html: STRING
|
html: STRING
|
||||||
|
|||||||
@@ -18,4 +18,8 @@ feature -- Access
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: G)
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ feature -- Implementation
|
|||||||
Result := input.value
|
Result := input.value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_value (v: STRING)
|
||||||
|
do
|
||||||
|
input.set_value (v)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
input: WSF_INPUT_CONTROL
|
input: WSF_INPUT_CONTROL
|
||||||
|
|||||||
Reference in New Issue
Block a user