/** * adiciona um HTMLElement em uma posicao especificada dentro painel * * @param HTMLElement $child * @param int $row * @param int $col */ public function appendChild($child, $top = 0, $left = 0) { //cria uma div para o elemento filho $camada = new HTMLElement("div"); //define a posicao da camada $style = new HTMLStyleInline(); $style->setProperty('position', 'absolute'); $style->setProperty('top', $top . 'px'); $style->setProperty('left', $left . 'px'); $style->setProperty('padding', '0px'); $style->setProperty('margin', '0px'); $style->setProperty('border', 'none'); $camada->setAttribute('style', $style->getOutput()); $camada->appendChild($child); $this->panel->appendChild($camada); }
/** * Define um atributo e seu valor * @param string $name * @param string $value */ public function setAttribute($name, $value) { $this->element->setAttribute($name, $value); }