<?
    class frmFormZebra extends MForm
    {
        public function __construct()
        {
            parent::__construct("Exemplo de FormZebra");
            $this->eventHandler();
        }

        public function createFields()
        {
            $selection = array('a','b','c','d','e');

            $rYes = new MRadioButton('rYes','yes','',false,'Yes!');
            $rNo = new MRadioButton('rNo','no','',false,'No!');
            $rMaybe = new MRadioButton('rMaybe','maybe','',false,'Maybe...');

            $fields = array (
                new MTextField('idaluno', '', 'Id',15,'autoPostBack'),
                new MLookupTextField('aluno', 'A', 'Aluno',35),
                new MCalendarField('cal', '01/01/2005', "Calendar Field"),
                new MSelection('idmodulo', 'admin', 'Sistema', $selection,false,'autoPostBack'),
                new MRadioButtonGroup('rGroup','A hard choice:',array($rYes,$rNo,$rMaybe)),
                new MCheckBox('chk','default','A check',true,'A text','autoPostBack'),
            );

            $this->setFields($fields);
            $this->setFieldAttr('aluno', 'module', 'example');
            $this->setFieldAttr('aluno', 'item', 'aluno');
            $this->setFieldAttr('aluno', 'event', 'filler');
            $this->setFieldAttr('aluno', 'related', 'idaluno,aluno');

            $this->setFieldAttr('idaluno', 'autoPostBack', true);
            $this->setFieldAttr('idmodulo', 'autoPostBack', true);
            $this->setFieldAttr('chk', 'autoPostBack', true);

            $buttons = Array
                (
                new MButton('btnPost', 'Enviar'),
                new MButton('btnNew', 'Novo'),
                new MButton('btnDelete', 'Excluir'),
                new MButton('btnList', 'Relação'),
                new MButton('btnReport', 'Relatórios'),
                );

            $this->setButtons($buttons);
            $this->setLabelWidth('20');
            $this->setAlternate('#fff','#ccc');
            $this->setBackgroundColor('#FFF');

        }

        public function btnPost_click()
        {
        }

        public function btnEdit_click()
        {
        }

        public function btnList_click()
        {
        }

        public function btnDelete_click()
        {
        }

        public function btnNew_click()
        {
        }
    }
?>