This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Mozilla XML > April 2005 > svg/xforms calculator sample (and some smaller test cases)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author svg/xforms calculator sample (and some smaller test cases)
Andrew Douglas

2005-04-04, 12:35 pm

this is the same functionality as the xforms calc program but uses svg
elements to fire the xforms events. There are a couple of little issues
(like I want to implement the "." and SquareRoot button and I want to get a
nice rollover/mousedown effect, etc. I'd like to add xforms validation and
keyboard support as well, but that'll come in time).

The biggest "hack" in there right now is outputting the xforms instance data
inside the SVG interface. Namely, xforms binding isn't supported for svg
elements and I couldn't use xforms binding inside an svg foreignObject
element.. even though "hardcoding" the <xf:output> works.. it won't bind.
See sample02 and sample04 for how I wish it would have worked. Suggestions
for how to do this in script are welcome as well, but for now there's not
javascript anywhere.

I'm open to suggestions for how you would have implemented the display of
the "Result" and "Memory" fields.. or any other suggestions too. Note: I'm
not an artist/designer.. so I apologize if the svg isn't "all it could be."

If I get really ambitious it'd be interesting to see if I could break out
the xform actions and the UI so that you could plug in either an SVG or
XHTML output (possibly dependent on if svg is available?)

http://artforms.progressivex.com/mozilla/svgcalc.xml

http://artforms.progressivex.com/mozilla/sample02.xml
http://artforms.progressivex.com/mozilla/sample04.xml

http://artforms.progressivex.com/mozilla/sample01.xml -- I posted this
early as a proof of concept of having xforms output inside an svg element
(using svg's foreignObject)

http://artforms.progressivex.com/mozilla/sample03.xml -- silly test of
xf:extension to output svg. It works, but I don't know how useful this is.

you need xforms and svg support enabled in your browser to view these
properly. I can post a screenshot of it if you wanna see but don't have it
and don't want to get one. Just let me know.

-Andrew


smaug

2005-04-04, 12:35 pm

What is the <xf:external> element?


Andrew Douglas wrote:
> this is the same functionality as the xforms calc program but uses svg
> elements to fire the xforms events. There are a couple of little issues
> (like I want to implement the "." and SquareRoot button and I want to get a
> nice rollover/mousedown effect, etc. I'd like to add xforms validation and
> keyboard support as well, but that'll come in time).
>
> The biggest "hack" in there right now is outputting the xforms instance data
> inside the SVG interface. Namely, xforms binding isn't supported for svg
> elements and I couldn't use xforms binding inside an svg foreignObject
> element.. even though "hardcoding" the <xf:output> works.. it won't bind.
> See sample02 and sample04 for how I wish it would have worked. Suggestions
> for how to do this in script are welcome as well, but for now there's not
> javascript anywhere.
>
> I'm open to suggestions for how you would have implemented the display of
> the "Result" and "Memory" fields.. or any other suggestions too. Note: I'm
> not an artist/designer.. so I apologize if the svg isn't "all it could be."
>
> If I get really ambitious it'd be interesting to see if I could break out
> the xform actions and the UI so that you could plug in either an SVG or
> XHTML output (possibly dependent on if svg is available?)
>
> http://artforms.progressivex.com/mozilla/svgcalc.xml
>
> http://artforms.progressivex.com/mozilla/sample02.xml
> http://artforms.progressivex.com/mozilla/sample04.xml
>
> http://artforms.progressivex.com/mozilla/sample01.xml -- I posted this
> early as a proof of concept of having xforms output inside an svg element
> (using svg's foreignObject)
>
> http://artforms.progressivex.com/mozilla/sample03.xml -- silly test of
> xf:extension to output svg. It works, but I don't know how useful this is.
>
> you need xforms and svg support enabled in your browser to view these
> properly. I can post a screenshot of it if you wanna see but don't have it
> and don't want to get one. Just let me know.
>
> -Andrew
>
>

Andrew Douglas

2005-04-04, 12:35 pm

a mistake.. it should have been xf:extension..

The corrected version has been posted. Thanks!

Note: for those without svg or xforms enabled for some reason (or for those
with linux libart problems), there is a screenshot here:
http://artforms.progressivex.com/mozilla/calc.png
-Andrew

"smaug" <smaug@welho.com> wrote in message
news:cuqi92$ea22@ripley.netscape.com...[color=darkred]
> What is the <xf:external> element?
>
>
> Andrew Douglas wrote:

Steve

2005-04-04, 12:35 pm

Hi Andrew,

Andrew Douglas wrote:
> this is the same functionality as the xforms calc program but uses svg
> elements to fire the xforms events. There are a couple of little issues
> (like I want to implement the "." and SquareRoot button and I want to get a
> nice rollover/mousedown effect, etc. I'd like to add xforms validation and
> keyboard support as well, but that'll come in time).
>
> The biggest "hack" in there right now is outputting the xforms instance data
> inside the SVG interface. Namely, xforms binding isn't supported for svg
> elements and I couldn't use xforms binding inside an svg foreignObject
> element.. even though "hardcoding" the <xf:output> works.. it won't bind.
> See sample02 and sample04 for how I wish it would have worked. Suggestions
> for how to do this in script are welcome as well, but for now there's not
> javascript anywhere.
>
> I'm open to suggestions for how you would have implemented the display of
> the "Result" and "Memory" fields.. or any other suggestions too. Note: I'm
> not an artist/designer.. so I apologize if the svg isn't "all it could be."
>
> If I get really ambitious it'd be interesting to see if I could break out
> the xform actions and the UI so that you could plug in either an SVG or
> XHTML output (possibly dependent on if svg is available?)
>
> http://artforms.progressivex.com/mozilla/svgcalc.xml
>
> http://artforms.progressivex.com/mozilla/sample02.xml
> http://artforms.progressivex.com/mozilla/sample04.xml
>
> http://artforms.progressivex.com/mozilla/sample01.xml -- I posted this
> early as a proof of concept of having xforms output inside an svg element
> (using svg's foreignObject)
>
> http://artforms.progressivex.com/mozilla/sample03.xml -- silly test of
> xf:extension to output svg. It works, but I don't know how useful this is.
>
> you need xforms and svg support enabled in your browser to view these
> properly. I can post a screenshot of it if you wanna see but don't have it
> and don't want to get one. Just let me know.
>
> -Andrew
>
>


Very nice use of both SVG and XForms. Can't wait to see the final product.

Regards,
Steve
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews