<%@ Page Language="C#" Inherits="HawhawPage" %>
<%@ Register Assembly="Hawhaw" Namespace="Hawhaw" TagPrefix="Haw" %>

<!--
        HAWHAW example for usage of checkboxes
        Norbert Huffschmid
        22.3.2009
-->

<script runat="server">

    protected void OnClick(object sender, EventArgs e)
    {
        solution.Visible = true;
        
        StringBuilder result = new StringBuilder();
        
        if (c1.Checked)
            result.Append("You don't go to school yet, do you? ");

        if (!c2.Checked)
            result.Append("Do you know what a circle is? ");

        if (!c3.Checked)
            result.Append("Have you heard about squares and roots? ");

        if (result.Length > 0)
            this.solution.Text = result.ToString();
        else
            this.solution.Text ="Great!";
    }
    
</script>

<Haw:Deck runat="server" Title="Correct?" Simulator="Skin">

    <!-- This label is filled programmatically after postback -->
    <Haw:Label runat="server" Text="" ID="solution" Visible="False" />

    <Haw:Form runat="server" ID="inputForm">
        <Haw:CheckBox runat="server" ID="c1" Text="2+3=6" /> 
        <Haw:CheckBox runat="server" ID="c2" Text="SIN(PI)=0" /> 
        <Haw:CheckBox runat="server" ID="c3" Text="SQRT(16)=4" /> 
        <Haw:Button runat="server" Text="Solution" OnClick="OnClick" />
    </Haw:Form>

</Haw:Deck>