Added generalized input control similiar to text

This commit is contained in:
Severin Münger
2013-09-02 03:44:30 +02:00
parent bc6b4f90c3
commit 16c89180d2
3 changed files with 15 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ class WSF_TEXT_CONTROL extends WSF_CONTROL
window.states[@control_name]['text'] = state.text
@$el.val(state.text)
#map class name to effectiv class
#map class name to effective class
typemap =
"WSF_BUTTON_CONTROL":WSF_BUTTON_CONTROL
"WSF_TEXT_CONTROL":WSF_TEXT_CONTROL

View File

@@ -16,10 +16,10 @@ create
feature {NONE}
make_button (n: STRING; v: STRING)
make_button (n: STRING; t: STRING)
do
make (n)
text := v
text := t
end
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT

View File

@@ -30,6 +30,13 @@ feature {NONE}
controls := create {LINKED_LIST [WSF_CONTROL]}.make;
end
make_with_controls (n: STRING; c: LINKED_LIST [WSF_CONTROL])
do
control_name := n
controls := c
create state_changes.make
end
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
load_state (new_states: JSON_OBJECT)
@@ -45,6 +52,11 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
set_state (new_state: JSON_OBJECT)
do
across
controls as c
loop
c.item.set_state (new_state)
end
end
read_state (states: JSON_OBJECT)