xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject Checkbox in SVG
Date Thu, 01 Aug 2002 12:22:44 GMT
>>>>> "AS" == Arvind Sareen <arvind_sareen@hotmail.com> writes:

AS> Hi

AS> I am trying to embed checkbox in an svg file but I get an error
AS> whenever I try to write checkbox in the svg file.

AS> Brief description of the code is that I have yellow rectangles
AS> which when clicked show change of state but at the same time I
AS> want to show the lines also which depict the colour of the lines
AS> to be displayed.  Instead of yellow rectangles, i want to have
AS> checkboxes over there.  Can anybody give a workaround or solution
AS> to the problem.  Below is the code of the svg file.

    Thanks for including it but it isn't very useful it has a hole
bunch of JSP in it, and it is lacking the ecmascript that goes with it
(no definition of the function 'onoff1').  So I really can't diagnose
what the 'problem' is.

    However, if all you are having trouble with is the adding of
lines, you might try the following as the basic structure of your
'check box' object:

    <g id="cbx1_0" transform="translate(20,52)"
       onclick="onoff('cbx1_0', 'State Boundry')>
       <rect width="10" height="10"
        style="fill:yellow;stroke:black;stroke-width:1" />
       <path d="M0,0 l10,10 m0,-10 l-10,10"
             style="fill:none;stroke:black;stroke-width:2" 
             visibility="hidden"/>
    </g>


    Then in the script you can look up the group, adjust the style on
the rect (firstChild) and change the visibilty property to 'visible'
on the path (nextSibling).

    I think it would actually be possible to do this just by changing
the class of the group and having an appropriate stylesheet that would
be cleaner in the long run but a bit tricker to set up in the short
run.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message