The Goal
Keep walking……
posts - 23,  comments - 1,  trackbacks - 0
  • Composite类

getChildren()
lists the children of a Composite as an array of Control objects.
getLayout()、setLayout(Layout)
处理layout对象
getTabList()、setTabList(Control[])
指定widgets在Composite中的Tab顺序(按键盘tab键的切换顺序)

Composite类是Scrollable类的直接子类,这就是说SWT/JFace中的所有Composite对象都有Scrollbars.所有的Scrollable对象都可使用如下方法:
getClientArea()、 computeTrim(int, int,int, int)
trim--Composite的不可编辑区域,如title bars, scrollbars, 或status bars等.
client area--那些可编辑,使用的区域
getClientArea()--Returns the available display area of a Scrollable object
computeTrim(int,int,int,int)--Returns the necessary dimensions of the Composite for the desired client area
getHorizontalBar()、getVerticalBar()
Returns the horizontal/vertical ScrollBar object

Control, Scrollable, and Composite的关系,如下图
  

  • Groups

Composite子类中最简单的一个,自身不执行任何动作,仅仅是将一组子widgets用矩形边框起来,此边框类似于之前提到的分隔符,同样也提供SWT.SHADOW_IN, SWT.SHADOW_OUT, SWT.SHADOW_NONE风格,还可以通过选择SWT.SHADOW_ETCHED_IN or SWT.SHADOW_ETCHED_OUT来客制化阴影效果。

可以通过setText()方法来设定它的label

与许多Widgets子类一样,Group类不可被继承。

  • SashForms

可以在子widgets之间创建可移动的分界,此分界称为Sash.Sash类可以在org.eclipse.swt.widgets包中找到,而SashForms却存在于org.eclipse.swt.custom包中。

SWT.HORIZONTAL和SWT.VERTICAL--用来设定Sash的方向
setOrientation()--用来设定Sash的方向
getMaximizedControl()--returns the Control object that has been expanded the most.
getWeights()--returns an int array containing the weight of each of the SashForm’s children.uses an int array to specify weights for each of the widgets in the Composite.

  • TabFolders

creating and populating a TabFolder的四个步骤:
1. 创建一个TabFolder实例
2. 为每个页面构建一个TabItem对象
3. 用setText()方法来设定tab的label
4. setControl()--关联一个control,当它的tab被选中时,显示此control

TabFolder类提供了一些用来获得TabItems信息的方法,如下:
getItemCount()
返回此TabFolder所包含的TabItems数
getItems()
返回TabItems对象的数组
getSelection()
确定user选择了哪个TabItem
setSelection()
Makes this decision from within the application

posted on 2006-03-22 17:55 JOO 阅读(335) 评论(0)  编辑  收藏 所属分类: SWT & JFace IN ACTION

只有注册用户登录后才能发表评论。


网站导航:
 
Hit the target!

<2006年3月>
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用链接

留言簿(2)

随笔分类(23)

随笔档案(22)

文章档案(1)

相册

Neighbor

搜索

  •  

最新评论

阅读排行榜

评论排行榜