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


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

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

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    <2025年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(3)

    隨筆檔案

    文章分類

    文章檔案

    相冊(cè)

    搜索

    •  

    最新評(píng)論

    主站蜘蛛池模板: 亚洲乱码在线播放| 一级做a毛片免费视频| 日韩免费观看的一级毛片| fc2成年免费共享视频网站| 亚洲天天做日日做天天欢毛片| 国产精品成人免费一区二区 | 最近最好的中文字幕2019免费 | jzzjzz免费观看大片免费| 亚洲乱亚洲乱淫久久| 国产精品冒白浆免费视频| 免费观看成人久久网免费观看| 亚洲成a人片在线观看精品| 爱情岛论坛网亚洲品质自拍| 亚洲第一网站免费视频| 一级做a毛片免费视频| 亚洲妇女熟BBW| 国产亚洲AV无码AV男人的天堂| 成年美女黄网站18禁免费| 中国毛片免费观看| 亚洲av综合av一区二区三区| 亚洲第一福利视频| 亚洲M码 欧洲S码SSS222| 国产精品成人免费福利| 美女网站在线观看视频免费的| 亚洲熟妇成人精品一区| 亚洲av福利无码无一区二区 | 亚洲AV无码无限在线观看不卡| 亚洲精品无码永久在线观看你懂的 | 亚洲国产成人精品女人久久久| 最近中文字幕免费2019| 国产福利在线观看永久免费| 亚洲JLZZJLZZ少妇| 亚洲最大免费视频网| 亚洲AV无码一区东京热久久| 亚洲国产成人久久笫一页| 性做久久久久久免费观看| 久久国产精品免费视频| 久久性生大片免费观看性| 美女被爆羞羞网站免费| 在线综合亚洲欧洲综合网站| 亚洲第一页在线视频|