<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)

    隨筆檔案

    文章分類

    文章檔案

    相冊

    搜索

    •  

    最新評論

    主站蜘蛛池模板: 国产亚洲人成无码网在线观看| 毛片免费观看的视频在线| 免费人妻av无码专区| 天堂亚洲国产中文在线| 国产v精品成人免费视频400条| 亚洲国产高清在线| 免费在线观看一级片| 亚洲国产精品成人精品无码区| 手机看片国产免费永久| 亚洲精品无码成人AAA片| 国产一区二区免费| 97久久精品亚洲中文字幕无码| 99精品视频免费在线观看| 亚洲色图黄色小说| 在人线av无码免费高潮喷水| 亚洲AV无码久久久久网站蜜桃| 成人免费视频软件网站| 精品在线免费视频| 亚洲深深色噜噜狠狠爱网站| 国产精品免费高清在线观看| 亚洲成人免费网址| 在线看片无码永久免费aⅴ| 人妖系列免费网站观看| 亚洲日韩乱码中文无码蜜桃臀网站 | 日本高清免费不卡在线| 国产成人亚洲午夜电影| 亚洲中文字幕无码永久在线| 日本一道本不卡免费| 亚洲宅男精品一区在线观看| 国产中文字幕免费观看| 三上悠亚电影全集免费| 亚洲精品mv在线观看| 免费va人成视频网站全| 免费福利电影在线观看| 最新国产成人亚洲精品影院| 免费又黄又爽又猛的毛片| 中文成人久久久久影院免费观看| 亚洲网站在线播放| 亚洲Av无码国产情品久久 | 亚洲欧美黑人猛交群| 亚洲人成网站色在线入口|