Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 22
TGridMemoColumn
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 8
156
0.00% covered (danger)
0.00%
0 / 22
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 5
 getEdit
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 8
 setRows
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getRows
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setColumns
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getColumns
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 setShowCounter
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getShowCounter
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
1<?php
2/*
3 * Formdin Framework
4 * Copyright (C) 2012 Ministério do Planejamento
5 * Criado por Luís Eugênio Barbosa
6 * Essa versão é um Fork https://github.com/bjverde/formDin
7 *
8 * ----------------------------------------------------------------------------
9 * This file is part of Formdin Framework.
10 *
11 * Formdin Framework is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License version 3
13 * as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License version 3
21 * along with this program; if not,  see <http://www.gnu.org/licenses/>
22 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
23 * Fifth Floor, Boston, MA  02110-1301, USA.
24 * ----------------------------------------------------------------------------
25 * Este arquivo é parte do Framework Formdin.
26 *
27 * O Framework Formdin é um software livre; você pode redistribuí-lo e/ou
28 * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
29 * do Software Livre (FSF).
30 *
31 * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
32 * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
33 * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
34 * para maiores detalhes.
35 *
36 * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
37 * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
38 * ou escreva para a Fundação do Software Livre (FSF) Inc.,
39 * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
40 */
41class TGridMemoColumn extends TGridEditColumn
42{
43    private $columns;
44    private $rows;
45    private $showCounter;
46    /**
47    * Implementa coluna para entrada de texto com várias linhas no gride
48    *
49    * @param string $strEditName
50    * @param string $strTitle
51    * @param string $strFieldName
52    * @param integer $intMaxLength
53    * @param integer $intColumns
54    * @param integer $intRows
55    * @param boolean $boolReadOnly
56    * @param boolean $boolShowCounter
57    * @return TGridMemoColumn
58    *
59    */
60    public function __construct(string $strEditName
61                               ,string $strTitle=null
62                               ,string $strFieldName=null
63                               ,int $intMaxLength,$intColumns=null,$intRows=null,$boolReadOnly=null,$boolShowCounter=null)
64    {
65        parent::__construct($strEditName,$strTitle,$strFieldName,'memo',null,$intMaxLength,null,null,null,$boolReadOnly);
66        $this->setRows($intRows);
67        $this->setColumns($intColumns);
68        $this->setShowCounter($boolShowCounter);
69    }
70    ///---------------------------------------------------------------------------------------------------
71    public function getEdit()
72    {
73         $edit = new TMemo(strtolower($this->getEditName()).'['.$this->getKeyValue().']',$this->getValue(),$this->getMaxLength(),false,$this->getColumns(),$this->getRows(),$this->getShowCounter());
74         //$edit = new TMemo(strtolower($this->getEditName()).'['.$this->getKeyValue().']',$this->getValue(),500,false,$this->getColumns(),$this->getRows(),true);
75        $edit->setValue($this->getValue());
76         $edit->setId(strtolower($this->getEditName()).'_'.$this->getRowNum());
77        $edit->setCss($this->getCss());
78        $edit->setEvents($this->getEvents());
79        if( is_null( $edit->getCss('border') ) )
80        {
81            $edit->setCss('border','1px solid silver');
82        }
83        return $edit;
84    }
85    public function setRows($intNewValue=null)
86    {
87        $this->rows = $intNewValue;
88    }
89    public function getRows()
90    {
91        return is_null($this->rows) ? 5 : $this->rows;
92    }
93    public function setColumns($intNewValue=null)
94    {
95        $this->columns = $intNewValue;
96    }
97    public function getColumns()
98    {
99        return is_null($this->columns) ? 30 : $this->columns;
100    }
101    public function setShowCounter($boolNewValue=null)
102    {
103        $this->showCounter = $boolNewValue;
104    }
105    public function getShowCounter()
106    {
107        return is_null($this->showCounter) ? true : $this->showCounter;
108    }
109}
110?>