<klip>
   <identity>
      <title>
         API: Checkbox Radio
      </title>
   </identity>
   <locations>
      <contentsource>
         http://support.klipfolio.com/files/demo/demo.xml
      </contentsource>
      <icon>
         http://www.klipfolio.com/static/klips/klipfolio/sample_icon.png
      </icon>
      <banner>
         http://www.klipfolio.com/static/klips/klipfolio/sample_banner.png   
      </banner>
   </locations>
   <style>
      alert {
         type: item;
      }

      sender {
         itemcol: 2;
         noterow: 1;

         label: 'Sender';

         emphasis: strong;
      }


      summary {
         itemcol: 3;
         noterow: 4;

         wrap: false;

         notelabel: false;
      }

      date {
         itemcol: 4;
         noterow: 2;

         label: 'Date';
      }

      category {
         noterow: 3;

         label: 'Category';
      }


      level {
         itemcol: 1;
         noterow: 5;
         notelabel: false;
         
         type: image;
      }

      url {
         type: link;
      }
            
      id {
         key: override;
      }
   </style>
   <klipscript>
   <![CDATA[
   
var checkBox1, checkBox2;
 
 function onLoad() {
 
     // Create a new tab
     var tab = Setup.addTab( "New Tab" );
 
     // Add a drop-down combo box to the tab
     checkBox1 = tab.addCheckbox( "First CheckBox" )
     checkBox2 = tab.addCheckbox( "Second CheckBox" )
     
     checkBox1.radio = true;
     checkBox2.radio = true;
 
     checkBox1.checked = true;  	// set first checkbox by default
 
     checkBox1.onClick = checkBox_onClick;
     checkBox2.onClick = checkBox_onClick;
 }
 
 function checkBox_onClick( state ) {
     trace( "You clicked: '" + this.value + "'\r\n");

     if (this == checkBox1) {		// clicked on checkBox1
     	checkBox1.checked = true;
     	checkBox2.checked = false;
     }
     
     if (this == checkBox2) {		// clicked on checkBox2
      	checkBox1.checked = false;
     	checkBox2.checked = true;
     }
     
     trace( "checkBox1 state: " + checkBox1.checked + "\r\n" );
     trace( "checkBox2 state: " + checkBox2.checked + "\r\n" );
     
     trace( "\r\n" );
 }

function onRefresh()
{
	return Engines.Data.process( Prefs.contentsource );
}
 
   ]]>
   </klipscript>
</klip>

