<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 1,  comments - 25,  trackbacks - 0
    First , The nomal composite is very different from the Table Viewer and Tree Viewer.
    The Table viewer and Tree Viewer only need add the SWT.H_SCROLL and SWT.V_SCROLL into  the Constructor. The context will be move with scroll bar.
    This is because the viewer has been include the scrollabled composite. 

    So . nomal composite should implment the scrollableComposte by ourself.

            1. Set parent compsoite's layout as FillLayout.   

           parentComposite.setLayout(new FillLayout());
            ScrolledComposite scrolledComposite = new ScrolledComposite(parentComposite,  SWT.H_SCROLL|SWT.V_SCROLL);
            
             2. Create the main composite and use the scrolled Composite as it's father.
            Composite mainComposite = new Composite(scrolledComposite,SWT.NONE);

            3. Set scrolled composite can controll the main composite.
            scrolledComposite.setContent(mainComposite);
            mainComposite.setBackground(Display.getCurrent().getSystemColor (SWT.COLOR_WHITE));// White color
            mainComposite.setLayout(new GridLayout(1,true));
            GridData data = new GridData(GridData.FILL_BOTH);
            mainComposite.setLayoutData(data);
             
           4. Set the other attributes.        
            scrolledComposite.setExpandHorizontal(true);
            scrolledComposite.setExpandVertical(true);
            scrolledComposite.setMinWidth(800);
            scrolledComposite.setMinHeight(400);


     總結:
     1)在為Composite添加滾動條時,最上面的Composite的布局需設為FillLayout();
     2) 不要直接往scrolledComposite上面添加控件;
     3) 在創建完ScrolledComposite后不要忘記使用setContent()方法去設置滾動條所控制的Composite;
     4) 最重要的是,Scrolledcomposite的以下四個參數必須設置才能出現滾動條:
        scrolledComposite.setExpandHorizontal(true);
        scrolledComposite.setExpandVertical(true);
        scrolledComposite.setMinWidth(800);
        scrolledComposite.setMinHeight(400);
        只有前兩項設為true之后,后面的兩項才起作用。
    5) 對于setMinWidth()和setMinHeight()方法,API的注釋中是說用來設置滾動條出現的最小寬度和高度,但是我試了一下,有時出現滾動條了,
        但是拖動滾動條還是不能顯示Composite里面的全部內容,于是把setMinWidth()和setMinHeight()設大一些就可以了,個人感覺滾動條出現的
        寬度和高度檢測Scrolledcomposite自己已經實現了,這里的寬度和高度是指拖動滾動條里可以看到的Composite的最大寬度和最大高度。

    posted on 2009-03-20 16:37 Daniel 閱讀(379) 評論(0)  編輯  收藏 所屬分類: SWT

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(3)

    隨筆檔案

    文章分類

    文章檔案

    相冊

    搜索

    •  

    最新評論

    主站蜘蛛池模板: 日本亚洲国产一区二区三区| 免费观看的a级毛片的网站| 亚洲乱亚洲乱少妇无码| 亚洲av午夜电影在线观看| 无限动漫网在线观看免费| 亚洲精品偷拍无码不卡av| 69免费视频大片| 91亚洲国产在人线播放午夜| 国产精品免费高清在线观看| 亚洲免费在线播放| av无码久久久久不卡免费网站| 亚洲精品在线免费观看| 国产a视频精品免费观看| 国产精品亚洲精品观看不卡| 免费无码AV电影在线观看| 亚洲精华液一二三产区| mm1313亚洲精品国产| 韩国免费a级作爱片无码| 久久精品亚洲一区二区| 久久久久久精品免费免费自慰| 亚洲人配人种jizz| 国产中文字幕免费观看| 中文在线观看国语高清免费| 亚洲AV无码一区东京热久久| 97国产免费全部免费观看| 亚洲av色香蕉一区二区三区蜜桃| 四虎永久在线精品免费观看地址 | 亚洲人成77777在线播放网站不卡| 毛色毛片免费观看| 全部一级一级毛片免费看| 亚洲小说区图片区另类春色| 99久久免费中文字幕精品| 亚洲一卡2卡3卡4卡5卡6卡| 哒哒哒免费视频观看在线www| 中文在线日本免费永久18近| 亚洲高清中文字幕| 白白国产永久免费视频| 怡红院免费全部视频在线视频| 亚洲国产成人久久精品app| 国产hs免费高清在线观看| 日本黄色动图免费在线观看|