00001 <?php
00002
00015 class TKScrollPane extends TKContainer {
00021 public function __construct() {
00022 parent::__construct();
00023
00024 $this->setSlotOption('main', 'size', TKContainer::SLOT_SIZE_SINGLE);
00025 $this->set('style', array('overflow' => 'auto'));
00026 }
00027
00029 protected function renderContainer($class, $style, $events, $id) {
00030 $c = $this->getChildrenBySlot('main');
00031 $k = array_keys($c);
00032 if(count($k) > 0) {
00033 $obj = $c[$k[0]];
00034 $html = is_object($obj) ? $obj->render() : $obj;
00035 }
00036 else {
00037 $html = "";
00038 }
00039
00040 $collect = "<div $id$class[0]$style[0]$events>\n$html\n</div>\n";
00041
00042 return $collect;
00043 }
00044
00046 public static function createFromXML($attrs, $contents, $node) {
00047 $obj = new TKScrollPane();
00048 self::convertStdAttributes($obj, $attrs);
00049 self::convertStdEvents($obj, $node);
00050 self::convertStdChildren($obj, $node['children']);
00051 return $obj;
00052 }
00053 }
00054
00055 ?>