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 閱讀(347) 評論(0)  編輯  收藏 所屬分類: SWT & JFace IN ACTION
          Hit the target!

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

          常用鏈接

          留言簿(2)

          隨筆分類(23)

          隨筆檔案(22)

          文章檔案(1)

          相冊

          Neighbor

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 南城县| 芮城县| 海兴县| 田林县| 孝昌县| 岳阳市| 西乌珠穆沁旗| 太和县| 丹棱县| 金沙县| 扬州市| 江陵县| 衡阳县| 七台河市| 涞水县| 鄄城县| 且末县| 八宿县| 金寨县| 五大连池市| 澄迈县| 紫金县| 无棣县| 花垣县| 汶川县| 南陵县| 宿迁市| 岗巴县| 女性| 黄梅县| 鄂伦春自治旗| 万载县| 呈贡县| 元江| 内乡县| 册亨县| 库尔勒市| 南康市| 沙雅县| 集安市| 遂平县|