= Description = 

 * [WBGridLayout] 보다 좀 더 다양한 형태의 Grid 를 만들어주는 레이아웃 입니다.

 * TableLayout 은 columns, rows 매개변수로 실제로 그려질 영역을 지정합니다.
  * 지정할 수 있는 형태
   * '*' : 나머지 크기 
   * 정수 : 고정크기 px 
   * 실수 : 실제 크기의 % 크기 

 * 예를 들어서 

 {{{ array(500, 0.5, *)  }}}

 라고 지정을 하면 첫번째 column은 500, 두번째는 전체 크기의 반(0.5), 세번째는 첫번째와 두번째를 뺀 나머지 크기를 지정한다.

 * 각각의 Component에 지정된 colspan, rowspan 속성을 이용해서 사이즈 조절하는 기능 추가 
  * 속성이 지정이 되어 있지 않으면 기본값 1 로 적용이 됩니다.

 * 상위 패널의 여백으로 인한 크기 조절 기능 추가

= Structure = 

[[그림:WBTableLayout_Structure.jpg]]

= Sample =

== colspan, rowspan 사용 == 
{{{#!vim php 
<?php

/** 
 * WBTableLayout, winbinder 
 * 
 * 
 *  written by easylogic
 * 
 */

$window = new WBResizableWindow(array(
	'width' => 600,
	'height' => 600,
	'title' => 'WBTableLayout, colspan, rowspan example',
	'layout' => new WBTableLayout( array('*', 0.5, 0.3), array_fill(0, 9, '*') )
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '3 * 1',
	'colspan' => 3,
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 3',
	'rowspan' => 3,
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 6',
	'rowspan' => 6,
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 1',
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 1',
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 3',
	'rowspan' => 3,
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 5',
	'rowspan' => 5,
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 2',
	'rowspan' => 2,
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '1 * 1',
));

$window->add(array(
	'wbtype' => 'PushButton',
	'caption' => '2 * 1',
	'colspan' => 2,
));

$window->setVisible(true);

WBApplication::start();

?>
}}}

== 다른 크기의 영역 지정 == 
{{{#!vim php 

<?php

/** 
 *
 * TableLayout, winbinder 
 *
 * written by easylogic 
 */

$window = new WBResizableWindow(array(
	'width' => 300,
	'height' => 300,
	'title' => 'WBTableLayout 예제'
));

$panel = $window->getRootPanel();
$panel->setLayout(new WBTableLayout(
	array(0.5, 0.3, '*'),    // columns : 3
	array(0.5, 0.3, '*')     // rows : 3
));

for($i = 0; $i < 9; $i++) { 
	$panel->add(new WBPushButton(array(
		'parent' => $window,
		'caption' => "{$i}번 버튼",
		'event' => array(
			'click' => 'test'
		)
	)));
}

$window->setVisible(true);

WBApplication::start();

function test($eo) { 
	WBDialog::info($eo->window(), $eo->object()->getText(), "버튼");
}

?>
}}}

== 같은 영역 지정 == 
{{{#!vim php 
<?php

$window = new WBResizableWindow(array(
	'width' => 600,
	'height' => 600,
	'title' => 'WBTableLayout 예제'
));

$panel = $window->getRootPanel();
$panel->setLayout(new WBTableLayout(
	array(0.5, 0.5),    // columns : 2 
	array(0.5, 0.5)     // rows : 2 
));

for($i = 0; $i < 3; $i++) { 
	$panel->add(new WBPushButton(array(
		'parent' => $window,
		'caption' => "{$i}번 버튼",
		'event' => array(
			'click' => 'test'
		)
	)));
}


$panel2 = $panel->add(new WBPanel(new WBTableLayout(
	array(0.3, 0.3, '*'),    // columns 
	array(0.3, 0.3, '*')     // rows 
)));

for($i = 0; $i <9 ; $i++) { 
	$panel2->add(new WBPushButton(array(
		'parent' => $window,
		'caption' => "1{$i}번 버튼",
		'event' => array(
			'click' => 'test'
		)
	)));
}

$window->setVisible(true);

WBApplication::start();

function test($eo) { 
	WBDialog::info($eo->window(), $eo->object()->getText(), "버튼");
}

?>
}}}

= Image = 

== Colspan, Rowspan 적용 == 
[[그림:TableLayout4.jpg]]

== Set Same Area == 
[[그림:TableLayout.jpg]]

== Set Different Area == 
[[그림:TableLayout2.jpg]]

== Complex TableLayout == 
[[그림:TableLayout3.jpg]]
