function __construct() { parent::__construct('Transportadoras', 'transportadoras.png'); // barra de ferramentas $this->pack_start($toolbar = new TToolbar(), false); $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'novo_clicked')); $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'editar_clicked')); $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked')); $this->enderecos = $toolbar->append('enderecos.png', latin1('Endereços'), 3, array($this, 'enderecos_clicked')); $this->imprimir = $toolbar->append_stock('gtk-print-preview', 4, array($this, 'imprimir_clicked')); // filtro $this->pack_start($this->filtro = new TFiltroTransportadoras(array($this, 'pega_dados')), false); // grid $this->pack_start($this->grid = new TGridTransportadoras($this)); $this->filtro->set_focus(); $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_transportadora')); $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_transportadora')); $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_transportadora')); $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_transportadoras')); $this->enderecos->set_sensitive(CheckPermissao($this, 'enderecos_transportadora')); }