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對(duì)象
          getTabList()、setTabList(Control[])
          指定widgets在Composite中的Tab順序(按鍵盤tab鍵的切換順序)

          Composite類是Scrollable類的直接子類,這就是說SWT/JFace中的所有Composite對(duì)象都有Scrollbars.所有的Scrollable對(duì)象都可使用如下方法:
          getClientArea()、 computeTrim(int, int,int, int)
          trim--Composite的不可編輯區(qū)域,如title bars, scrollbars, 或status bars等.
          client area--那些可編輯,使用的區(qū)域
          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的關(guān)系,如下圖
          ??

          • Groups

          Composite子類中最簡(jiǎn)單的一個(gè),自身不執(zhí)行任何動(dòng)作,僅僅是將一組子widgets用矩形邊框起來,此邊框類似于之前提到的分隔符,同樣也提供SWT.SHADOW_IN, SWT.SHADOW_OUT, SWT.SHADOW_NONE風(fēng)格,還可以通過選擇SWT.SHADOW_ETCHED_IN or SWT.SHADOW_ETCHED_OUT來客制化陰影效果。

          可以通過setText()方法來設(shè)定它的label

          與許多Widgets子類一樣,Group類不可被繼承。

          • SashForms

          可以在子widgets之間創(chuàng)建可移動(dòng)的分界,此分界稱為Sash.Sash類可以在org.eclipse.swt.widgets包中找到,而SashForms卻存在于org.eclipse.swt.custom包中。

          SWT.HORIZONTAL和SWT.VERTICAL--用來設(shè)定Sash的方向
          setOrientation()--用來設(shè)定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的四個(gè)步驟:
          1.?創(chuàng)建一個(gè)TabFolder實(shí)例
          2. 為每個(gè)頁面構(gòu)建一個(gè)TabItem對(duì)象
          3. 用setText()方法來設(shè)定tab的label
          4. setControl()--關(guān)聯(lián)一個(gè)control,當(dāng)它的tab被選中時(shí),顯示此control

          TabFolder類提供了一些用來獲得TabItems信息的方法,如下:
          getItemCount()
          返回此TabFolder所包含的TabItems數(shù)
          getItems()
          返回TabItems對(duì)象的數(shù)組
          getSelection()
          確定user選擇了哪個(gè)TabItem
          setSelection()
          Makes this decision from within the application

          posted on 2006-03-22 17:55 JOO 閱讀(347) 評(píng)論(0)  編輯  收藏 所屬分類: SWT & JFace IN ACTION
          Hit the target!

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

          常用鏈接

          留言簿(2)

          隨筆分類(23)

          隨筆檔案(22)

          文章檔案(1)

          相冊(cè)

          Neighbor

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 泸溪县| 益阳市| 古交市| 冷水江市| 民县| 疏附县| 蛟河市| 莱芜市| 安宁市| 上林县| 巍山| 辽阳县| 林口县| 贵溪市| 门源| 保亭| 宜兰市| 广河县| 察隅县| 碌曲县| 安宁市| 江陵县| 建瓯市| 德化县| 开封县| 枣庄市| 阜阳市| 南郑县| 乌拉特前旗| 汕头市| 安多县| 依兰县| 甘洛县| 东乌珠穆沁旗| 陇南市| 屏东市| 公主岭市| 孟州市| 天峨县| 夹江县| 保山市|