• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            08年05月07日

            Posted on 2008-05-07 17:00 RichardHe 閱讀(274) 評論(0)  編輯 收藏 引用
            今天在參考WindowsLook.looknfeel自己寫了一個Button
            <?xml version="1.0" ?>
            <Falagard>
                <WidgetLook name="WindowsLook/MyButton">
             1 <ImagerySection name="normal">
             2             <FrameComponent>
             3                 <Area>
             4                     <Dim type="LeftEdge">
             5                         <AbsoluteDim value="0" />
             6                     </Dim>
             7                     <Dim type="TopEdge">
             8                         <AbsoluteDim value="0" />
             9                     </Dim>
            10                     <Dim type="RightEdge">
            11                         <UnifiedDim scale="1" type="RightEdge" />
            12                     </Dim>
            13                     <Dim type="BottomEdge">
            14                         <UnifiedDim scale="1" type="BottomEdge" />
            15                     </Dim>
            16                 </Area>
            17                 <Image type="TopLeftCorner" imageset="WindowsLook" image="ButtonNormalTopLeft" />
            18                 <Image type="TopRightCorner" imageset="WindowsLook" image="ButtonNormalTopRight" />
            19                 <Image type="BottomLeftCorner" imageset="WindowsLook" image="ButtonNormalBottomLeft" />
            20                 <Image type="BottomRightCorner" imageset="WindowsLook" image="ButtonNormalBottomRight" />
            21                 <Image type="LeftEdge" imageset="WindowsLook" image="ButtonNormalLeft" />
            22                 <Image type="TopEdge" imageset="WindowsLook" image="ButtonNormalTop" />
            23                 <Image type="RightEdge" imageset="WindowsLook" image="ButtonNormalRight" />
            24                 <Image type="BottomEdge" imageset="WindowsLook" image="ButtonNormalBottom" />
            25             </FrameComponent>
            26             <ImageryComponent>
            27                 <Area>
            28                     <Dim type="LeftEdge">
            29                         <ImageDim imageset="WindowsLook" image="ButtonNormalLeft" dimension="Width" />
            30                     </Dim>
            31                     <Dim type="TopEdge">
            32                         <ImageDim imageset="WindowsLook" image="ButtonNormalTop" dimension="Height" />
            33                     </Dim>
            34                     <Dim type="RightEdge">
            35                         <UnifiedDim scale="1" type="RightEdge">
            36                             <DimOperator op="Subtract">
            37                                 <ImageDim imageset="WindowsLook" image="ButtonNormalRight" dimension="Width" />
            38                             </DimOperator>
            39                         </UnifiedDim>
            40                     </Dim>
            41                     <Dim type="BottomEdge">
            42                         <UnifiedDim scale="1" type="BottomEdge">
            43                             <DimOperator op="Subtract">
            44                                 <ImageDim imageset="WindowsLook" image="ButtonNormalBottom" dimension="Height" />
            45                             </DimOperator>
            46                         </UnifiedDim>
            47                     </Dim>
            48                 </Area>
            49                 <Image imageset="WindowsLook" image="Background" />
            50                 <Colours topLeft="FFAFAFAF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFAFAFAF" />
            51                 <VertFormat type="Stretched" />
            52                 <HorzFormat type="Stretched" />
            53             </ImageryComponent>
            54         </ImagerySection>


            上面的意思大慨是明白的.但是
            1 <StateImagery name="Normal">
            2             <Layer>
            3                 <Section section="normal" />
            4                 <Section section="label">
            5                     <ColourProperty name="NormalTextColour" />
            6                 </Section>
            7             </Layer>
            8         </StateImagery>

            section = "normal"不是已經設置好了這個Button的所有東西嗎?為什么還要一個section = "label"??這是什么意思呢?
             1 <ImagerySection name="label">
             2             <TextComponent>
             3                 <Area>
             4                     <Dim type="LeftEdge">
             5                         <AbsoluteDim value="0" />
             6                     </Dim>
             7                     <Dim type="TopEdge">
             8                         <AbsoluteDim value="0" />
             9                     </Dim>
            10                     <Dim type="RightEdge">
            11                         <UnifiedDim scale="1" type="RightEdge" />
            12                     </Dim>
            13                     <Dim type="BottomEdge">
            14                         <UnifiedDim scale="1" type="BottomEdge" />
            15                     </Dim>
            16                 </Area>
            17                 <VertFormat type="CentreAligned" />
            18                 <HorzFormat type="WordWrapCentreAligned" />
            19             </TextComponent>
            20         </ImagerySection>
            這個lable主要是用來干嘛的呢?一個朋友的BLOG說是為這個BUTTON設置文本??
            還是不明白是什么意思??

            雖然不明白,但是還是自己寫了一個BUTTON.首先,用CELayoutEditor.exe 來加載TaharezLook.scheme的,
            去對應的TaharezLook.looknfeel里,將這個按鈕添加在后面.你可以改為任意名字,我們把剛才寫的Button外觀改成MyButton
            再到TaharezLook.scheme文件里照著Button復制一下,然后修改
            <FalagardMapping WindowType="WindowsLook/MyButton" TargetType='CEGUI/Button'        Renderer="Falagard/Editbox"             LookNFeel="TaharezLook/MyButton" />
            這個就可以在添加新的窗口下面你的MyButton.

            ---------------------------------------------------------------
            用MSN用了一個朋友總算知道大慨是怎么回事了.一個BUUTON相當于圖片加LABEL文字了...
            section 是一個外觀配置,多個Section構成了 某個狀態的 外觀
            StateImagery 是指 某個狀態下的外觀
            section是可以復用的。而StateImagery 就象是自由組裝它們的 人
            為什么 StateImagery 有那些狀態?因為CEGUI 規定了這些狀態。
            那什么是 section, section就是 具體的表現。它對應著Imageset里具體的 Image區域。
            所以, section 負責實現各種外觀, StateImagery 負責為各種狀態選擇、組合 合適的外觀
            但是 對于其他的 控件 ,一個圖片就不夠了。一般來說,定義一個窗口,我們需要定義9個部分:
            1 2 3
            4 5 6
            7 8 9
            4個邊 4個角, 1個中間
            相當于 一個 Button+ 一個Laber 的復合控件

            posts - 94, comments - 138, trackbacks - 0, articles - 94

            Copyright © RichardHe

            久久91综合国产91久久精品| 精品久久久久久综合日本| 久久无码一区二区三区少妇 | 久久er国产精品免费观看8| 曰曰摸天天摸人人看久久久| 亚洲国产成人精品女人久久久| 久久久无码精品亚洲日韩蜜臀浪潮| 久久狠狠色狠狠色综合| 久久这里的只有是精品23| 久久国产精品成人免费| 麻豆久久久9性大片| 久久精品草草草| 狠狠色狠狠色综合久久| 国产A级毛片久久久精品毛片| 嫩草伊人久久精品少妇AV| 久久久久无码精品国产app| 亚洲精品无码专区久久久| 伊人色综合九久久天天蜜桃| 国产韩国精品一区二区三区久久| 中文字幕亚洲综合久久菠萝蜜| 久久综合九色综合精品| 无码人妻久久一区二区三区免费丨 | 亚洲午夜久久久久久噜噜噜| 久久青青草原精品国产不卡| 国产精品一区二区久久| 久久久久久夜精品精品免费啦| 亚洲一级Av无码毛片久久精品| 久久最新精品国产| 国产精品对白刺激久久久| 亚洲AV无码成人网站久久精品大| 日韩欧美亚洲综合久久影院Ds | 亚洲国产精品一区二区久久hs| 久久无码一区二区三区少妇| 精品久久久久中文字| 婷婷综合久久狠狠色99h| 久久国产亚洲精品无码| 久久亚洲精品成人AV| 久久99精品久久久久婷婷| 久久久婷婷五月亚洲97号色| 色综合久久中文字幕无码| 日韩精品久久久肉伦网站|