Merge branch 'widget' of github.com:souvarin/EWF into widget_state_redesign

Conflicts:
	examples/widgetapp/base_page.e
This commit is contained in:
YNH Webdev
2013-09-22 19:11:46 +02:00
5 changed files with 122 additions and 50 deletions

View File

@@ -10,6 +10,9 @@ class
inherit
WSF_STATELESS_CONTROL
redefine
attributes
end
create
make_control, make_with_body
@@ -30,14 +33,6 @@ feature {NONE} -- Initialization
body := b
end
feature -- Access
attributes: STRING
-- Attributes string of this control
body: STRING
-- Body of this control
feature -- Rendering
render: STRING
@@ -46,7 +41,7 @@ feature -- Rendering
Result := render_tag (body, attributes)
end
feature
feature -- Change
set_attributes (a: STRING)
-- Set the attributes string of this control
@@ -60,4 +55,12 @@ feature
body := b
end
feature -- Access
attributes: STRING
-- Attributes of this control
body: STRING
-- Body of this control
end

View File

@@ -23,6 +23,9 @@ feature {NONE} -- Initialization
make_control (n, a_tag_name: STRING)
-- Initialize with specified control name and tag
require
not n.is_empty
not a_tag_name.is_empty
do
make (a_tag_name)
control_name := n

View File

@@ -11,11 +11,11 @@ feature {NONE} -- Initialization
make (a_tag_name: STRING)
-- Initialize with specified tag
require
not a_tag_name.is_empty
do
tag_name := a_tag_name
create css_classes.make (0)
ensure
attached css_classes
end
feature -- Access
@@ -26,7 +26,8 @@ feature -- Access
css_classes: ARRAYED_LIST [STRING]
-- List of classes (appear in the "class" attribute)
-- TODO: Maybe improve
attributes: detachable STRING
-- Attributes string
feature -- Change
@@ -71,6 +72,16 @@ feature -- Rendering
end
end
render_tag_with_body (body: STRING): STRING
-- Generate HTML of this control with the specified body
do
if attached attributes as attrs then
Result := render_tag (body, attrs)
else
Result := render_tag (body, "")
end
end
render: STRING
-- Return html representation of control
deferred