コード例 #1
0
ファイル: string.php プロジェクト: eneiasramos/xmoney
 function __construct($required = false, $duplicated = false, $table = null, $field = null)
 {
     parent::__construct($required, $duplicated, $table, $field);
     $this->label->set_text(' String: ');
     $this->entry->set_max_length(50);
     /* max 50 chars */
     $this->entry->connect('changed', array($this, 'string_changed'));
 }
コード例 #2
0
 function pega_dados()
 {
     $db = new Database($this, true);
     if (!$db->link) {
         return;
     }
     $sql = 'SELECT * FROM Vw_Contas_Pagar';
     $i = 1;
     foreach ($this->InfoLinha as $key => $value) {
         if (!$db->multi_query($sql . ' WHERE Id = ' . $key)) {
             return;
         }
         $line = $db->line();
         if ($line['CodSit'] != 1) {
             new Message($this, 'Selecione somente contas que estao em ABERTO!');
             return;
         }
         $id = $line['Id'];
         $valor_doc = $line['ValorDoc'];
         $this->ValorDoc[$id] = $valor_doc;
         $this->lista->attach(new GtkLabel($id), 0, 1, $i, $i + 1);
         $this->lista->attach(new GtkLabel($line['Fornecedor']), 1, 2, $i, $i + 1);
         $this->lista->attach(new GtkLabel($line['NumDoc']), 2, 3, $i, $i + 1);
         $this->lista->attach(new GtkLabel(PointToComma($valor_doc)), 3, 4, $i, $i + 1);
         $this->lista->attach($juros = new TFloat(), 4, 5, $i, $i + 1, 0, 0, 0, 0);
         $juros->label->destroy();
         $this->lista->attach($desconto = new TFloat(), 5, 6, $i, $i + 1, 0, 0, 0, 0);
         $desconto->label->destroy();
         $this->lista->attach($total = new TFloat(true), 6, 7, $i, $i + 1, 0, 0, 0, 0);
         $total->label->destroy();
         $total->entry->set_editable(false);
         $this->lista->attach($anotacoes = new AEntry(), 7, 8, $i, $i + 1);
         $juros->entry->connect('changed', array($this, 'juros_changed'), array($id, $desconto, $total));
         $desconto->entry->connect('changed', array($this, 'desconto_changed'), array($id, $juros, $total));
         ++$i;
     }
     $this->lista->show_all();
     $anotacoes->set_next_focus($this->ok);
     return true;
 }