Added comments to autocompletion, input, navbar, progressbar, validator, webcontrol. Some more little changes.

This commit is contained in:
Severin Münger
2013-09-21 23:01:36 +02:00
parent 252b5ff758
commit 57dd4ce259
33 changed files with 232 additions and 138 deletions

View File

@@ -18,9 +18,10 @@ inherit
create
make_autocomplete, make_autocomplete_with_agent
feature {NONE} -- Creation
feature {NONE} -- Initialization
make_autocomplete (n: STRING; c: WSF_AUTOCOMPLETION)
-- Initialize with specified name and autocompletion
do
make_autocomplete_with_agent (n, agent c.autocompletion)
if attached c.template as t then
@@ -29,6 +30,7 @@ feature {NONE} -- Creation
end
make_autocomplete_with_agent (n: STRING; c: FUNCTION [ANY, TUPLE [STRING], JSON_ARRAY])
-- Initialize with specified name and autocompletion function
do
make_input (n, "")
create_json_list := c
@@ -53,7 +55,7 @@ feature -- Callback
end
end
feature -- Autocomplete
feature -- Properties
create_json_list: FUNCTION [ANY, TUPLE [STRING], JSON_ARRAY]

View File

@@ -14,16 +14,17 @@ inherit
create
make_checkbox
feature {NONE}
feature {NONE} -- Initialization
make_checkbox (n: STRING; l: STRING; c: STRING)
make_checkbox (n, l, c: STRING)
-- Initialize with specified control name,
do
make_control (n, "input")
label := l
checked_value := c
end
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
set_state (new_state: JSON_OBJECT)
-- Restore text from json
@@ -42,7 +43,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
Result.put (create {JSON_BOOLEAN}.make_boolean (attached change_event), "callback_change")
end
feature --EVENT HANDLING
feature --Event handling
set_change_event (e: attached like change_event)
-- Set text change event handle
@@ -77,14 +78,18 @@ feature -- Implementation
Result := checked
end
feature
feature -- Properties
label: STRING
-- The label of the checkbox control
checked: BOOLEAN
-- The checked value of the checkbox control
checked_value: STRING
-- String checked value
change_event: detachable PROCEDURE [ANY, TUPLE]
-- Function to be executed on change
end

View File

@@ -21,14 +21,15 @@ inherit
create
make_checkbox_list_control
feature {NONE}
feature {NONE} -- Initializaton
make_checkbox_list_control (n: STRING)
-- Initialize with specified control name
do
make_multi_control (n)
end
feature
feature -- Implementation
value: LIST [STRING]
do

View File

@@ -14,16 +14,17 @@ inherit
create
make_input
feature {NONE}
feature {NONE} -- Initialization
make_input (n: STRING; v: STRING)
make_input (n, v: STRING)
-- Initialize with specified name and value
do
make_control (n, "input")
type := "text"
text := v
end
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
set_state (new_state: JSON_OBJECT)
-- Restore text from json
@@ -41,7 +42,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
Result.put (create {JSON_BOOLEAN}.make_boolean (attached change_event), "callback_change")
end
feature --EVENT HANDLING
feature --Event handling
set_change_event (e: attached like change_event)
-- Set text change event handle
@@ -58,14 +59,17 @@ feature --EVENT HANDLING
end
end
feature -- Implementation
feature -- Rendering
render: STRING
do
Result := render_tag ("", "type=%"" + type + "%" value=%"" + text + "%"")
end
feature -- Change
set_text (t: STRING)
-- Set text to be displayed
do
if not t.same_string (text) then
text := t
@@ -73,17 +77,22 @@ feature -- Implementation
end
end
feature -- Implementation
value: STRING
do
Result := text
end
feature
feature -- Properties
text: STRING
-- Text to be displayed
type: STRING
-- Type of this input control
change_event: detachable PROCEDURE [ANY, TUPLE]
-- Procedure to be execued on change
end

View File

@@ -14,9 +14,10 @@ inherit
create
make_password
feature {NONE}
feature {NONE} -- Initialization
make_password (n: STRING; v: STRING)
make_password (n, v: STRING)
-- Initialize with specified control name and text
do
make_input (n, v)
type := "password"

View File

@@ -17,15 +17,16 @@ inherit
create
make_textarea
feature {NONE}
feature {NONE} -- Initialization
make_textarea (n, t: STRING)
-- Initialize with specified control name and text to be displayed in this textarea
do
make_input (n, t)
tag_name := "textarea"
end
feature
feature -- Rendering
render: STRING
do