- 追加された行はこの色です。
- 削除された行はこの色です。
#topicpath
----
***CoolBar [#w0bee67a]
#ref(02.png)
CoolBarとはマウスでドラッグ可能なツールバーです。他のウィジェットとの構成はこのようになっています。
#ref(01.png)
***スニペット [#w1e29d2b]
// CoolBarを作成
final CoolBar coolBar = new CoolBar(shell, SWT.NONE);
coolBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
{
final CoolItem coolItem1 = new CoolItem(coolBar, SWT.PUSH);
coolItem1.setText("coolItemの1");
{
final ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
coolItem1.setControl(toolBar);
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.NONE);
toolItem.setText("アイテム1-1");
}
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setText("アイテム1-2");
}
Point point = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
point = coolItem1.computeSize(point.x, point.y);
coolItem1.setSize(point);
}
}
{
final CoolItem coolItem2 = new CoolItem(coolBar, SWT.PUSH);
coolItem2.setText("coolItemの2");
{
toolBar = new ToolBar(coolBar, SWT.FLAT);
coolItem2.setControl(toolBar);
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.DROP_DOWN);
toolItem.setText("アイテム2-1");
}
{
final ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setText("アイテム2-2");
}
Point point = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
point = coolItem2.computeSize(point.x, point.y);
coolItem2.setSize(point);
}
}
----
この記事は
#vote(おもしろかった[5],そうでもない[3])
#vote(おもしろかった[6],そうでもない[3])
#comment
#topicpath
SIZE(10){現在のアクセス:&counter;}