チェンジセット 1546

差分発生行の前後
無視リスト:
コミット日時:
2008/10/09 03:28:52 (3 ヶ月前)
コミッタ:
n_mattun
ログメッセージ:

ButtonBox/BorderBox/SpecialButton?にメソッドxxxLineEnabled(線の表示可否)を追加。あと細かい修正をちょこちょこ。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • mxp/specialbutton/as3/src/BorderBox.as

    r1522 r1546  
    22// BorderBox 
    33// Develop Code        n_mattun(まっつん◆SW1/SWF8io) 
    4 // Last Update         2008/09/2
     4// Last Update         2008/10/0
    55// 
    6 // 境界線を描画するコンポーネント 
     6// 矩形(線のみ)を描画するコンポーネント 
    77// --------------------------------------------------------------------- 
    88// ■コンポーネント定数 
    9 // 色                    color           0xRRGGBB 
    10 // 角の丸み         cornerSize      Number 
    11 // 太さ                   borderSize      Number 
    12 // 角の丸め位置       cornerPart      String 
    13 //  
    14 //  
    15 // ■Getter 
    16 // getWidth 
    17 // getHeight 
    18 // getColor 
    19 // getCornerSize 
    20 // getBorderSize 
    21 // getCornerPart 
    22 //  
    23 // ■Setter 
    24 // setWidth 
    25 // setHeight 
    26 // setColor 
    27 // setCornerSize 
    28 // setBorderSize 
    29 // setCornerPart 
    30 //  
     9// 01.色                         color                           Color 
     10// 02.角の丸み                      cornerSize                      Number 
     11// 03.太さ                                borderSize                      Number 
     12// 04.角の丸め位置            cornerPart                      String 
     13// 05.線(上)の表示可否 topLineMargin           Boolean 
     14// 06.線(下)の表示可否 bottomLineMargin        Boolean 
     15// 07.線(左)の表示可否 leftLineMargin          Boolean 
     16// 08.線(右)の表示可否 rightLineMargin         Boolean 
    3117// -------------------------------------------------------------------// 
    3218 
     
    4733                public var __borderSize :Number = 2; 
    4834                public var __cornerPart :String = "All"; 
    49                 public var __cornerPartEnabled:Object; 
     35                public var __cornerPartEnabled  :Object; 
     36                public var __topLineEnabled             :Boolean = true; 
     37                public var __bottomLineEnabled  :Boolean = true; 
     38                public var __leftLineEnabled    :Boolean = true; 
     39                public var __rightLineEnabled   :Boolean = true; 
     40                 
    5041                 
    5142                // コンストラクタ 
     
    6354                        this.color      = __color; 
    6455                        this.borderSize = __borderSize; 
     56                        updateLineEnabled(); 
    6557                } 
    6658                // -------------------------------------------------------------------// 
     
    162154                                this["B"].width -= _num; 
    163155                        } 
     156                         
     157                        //線が続いて非表示の場合はその間にあるcornerも非表示にしてしまう。 
     158                        if(!topLineEnabled && !leftLineEnabled) this["LT"].visible = false; 
     159                        if(!topLineEnabled && !rightLineEnabled) this["RT"].visible = false; 
     160                        if(!bottomLineEnabled && !leftLineEnabled) this["LB"].visible = false; 
     161                        if(!bottomLineEnabled && !rightLineEnabled) this["RB"].visible = false; 
     162                         
     163                        //線の表示状態に応じて線の位置を若干変える 
     164                        if(bottomLineEnabled == false && cornerPart == "Top"){ 
     165                                this["L"].height -= borderSize; 
     166                                this["R"].height -= borderSize; 
     167                        } 
     168                        if(topLineEnabled == false && cornerPart == "Bottom"){ 
     169                                this["L"].height -= borderSize; 
     170                                this["R"].height -= borderSize; 
     171                                this["L"].y += borderSize; 
     172                                this["R"].y += borderSize; 
     173                        } 
     174                        if(rightLineEnabled == false && cornerPart == "Left"){ 
     175                                this["T"].width -= borderSize; 
     176                                this["B"].width -= borderSize; 
     177                        } 
     178                        if(leftLineEnabled == false && cornerPart == "Right"){ 
     179                                this["T"].width -= borderSize; 
     180                                this["B"].width -= borderSize; 
     181                                this["T"].x += borderSize; 
     182                                this["B"].x += borderSize; 
     183                        } 
    164184                } 
    165185                // -------------------------------------------------------------------// 
     
    264284                        this.cornerSize = __cornerSize; 
    265285                } 
     286                // -------------------------------------------------------------------// 
     287                [Inspectable(defaultValue=true, name="05.線(上)の表示可否", type="Boolean")] 
     288                public function set topLineEnabled(_bool:Boolean){ 
     289                        __topLineEnabled = _bool; 
     290                        updateLineEnabled(); 
     291                } 
     292                // -------------------------------------------------------------------// 
     293                [Inspectable(defaultValue=true, name="06.線(下)の表示可否", type="Boolean")] 
     294                public function set bottomLineEnabled(_bool:Boolean){ 
     295                        __bottomLineEnabled = _bool; 
     296                        updateLineEnabled(); 
     297                } 
     298                // -------------------------------------------------------------------// 
     299                [Inspectable(defaultValue=true, name="07.線(左)の表示可否", type="Boolean")] 
     300                public function set leftLineEnabled(_bool:Boolean){ 
     301                        __leftLineEnabled = _bool; 
     302                        updateLineEnabled(); 
     303                } 
     304                // -------------------------------------------------------------------// 
     305                [Inspectable(defaultValue=true, name="08.線(右)の表示可否", type="Boolean")] 
     306                public function set rightLineEnabled(_bool:Boolean){ 
     307                        __rightLineEnabled = _bool; 
     308                        updateLineEnabled(); 
     309                } 
    266310                // ===================================================================// 
    267311                // getter 
     
    291335                } 
    292336                // -------------------------------------------------------------------// 
     337                public function get topLineEnabled():Boolean{ 
     338                        return __topLineEnabled; 
     339                } 
     340                // -------------------------------------------------------------------// 
     341                public function get bottomLineEnabled():Boolean{ 
     342                        return __bottomLineEnabled; 
     343                } 
     344                // -------------------------------------------------------------------// 
     345                public function get leftLineEnabled():Boolean{ 
     346                        return __leftLineEnabled; 
     347                } 
     348                // -------------------------------------------------------------------// 
     349                public function get rightLineEnabled():Boolean{ 
     350                        return __rightLineEnabled; 
     351                } 
     352                // ===================================================================// 
     353                // private function 
     354                // ===================================================================// 
     355                //線の表示可否を更新 
     356                private function updateLineEnabled():void { 
     357                        (__topLineEnabled)    ? this["T"].visible = true : this["T"].visible = false; 
     358                        (__bottomLineEnabled) ? this["B"].visible = true : this["B"].visible = false; 
     359                        (__leftLineEnabled)   ? this["L"].visible = true : this["L"].visible = false; 
     360                        (__rightLineEnabled)  ? this["R"].visible = true : this["R"].visible = false; 
     361                        cornerSize = __cornerSize; 
     362                } 
     363                // -------------------------------------------------------------------// 
    293364        } 
    294365} 
  • mxp/specialbutton/as3/src/ButtonBox.as

    r1522 r1546  
    2525                public var __innerAlpha         :Number = 100; 
    2626                public var __bodyAlpha          :Number = 100; 
     27                public var __topLineEnabled             :Boolean = true; 
     28                public var __bottomLineEnabled  :Boolean = true; 
     29                public var __leftLineEnabled    :Boolean = true; 
     30                public var __rightLineEnabled   :Boolean = true; 
    2731 
    2832                public function ButtonBox() { 
     
    194198                } 
    195199                // -------------------------------------------------------------------// 
     200                [Inspectable(defaultValue=true, name="14.線(上)の表示可否", type="Boolean")] 
     201                public function set topLineEnabled(_bool:Boolean){ 
     202                        __topLineEnabled = _bool; 
     203                        outer.topLineEnabled = _bool; 
     204                        inner.topLineEnabled = _bool; 
     205                } 
     206                // -------------------------------------------------------------------// 
     207                [Inspectable(defaultValue=true, name="15.線(下)の表示可否", type="Boolean")] 
     208                public function set bottomLineEnabled(_bool:Boolean){ 
     209                        __bottomLineEnabled = _bool; 
     210                        outer.bottomLineEnabled = _bool; 
     211                        inner.bottomLineEnabled = _bool; 
     212                } 
     213                // -------------------------------------------------------------------// 
     214                [Inspectable(defaultValue=true, name="16.線(左)の表示可否", type="Boolean")] 
     215                public function set leftLineEnabled(_bool:Boolean){ 
     216                        __leftLineEnabled = _bool; 
     217                        outer.leftLineEnabled = _bool; 
     218                        inner.leftLineEnabled = _bool; 
     219                } 
     220                // -------------------------------------------------------------------// 
     221                [Inspectable(defaultValue=true, name="17.線(右)の表示可否", type="Boolean")] 
     222                public function set rightLineEnabled(_bool:Boolean){ 
     223                        __rightLineEnabled = _bool; 
     224                        outer.rightLineEnabled = _bool; 
     225                        inner.rightLineEnabled = _bool; 
     226                } 
     227                // -------------------------------------------------------------------// 
    196228                // getter 
    197229                // -------------------------------------------------------------------// 
     
    254286                public function get bodyAlpha():Number { 
    255287                        return __bodyAlpha; 
     288                } 
     289                // -------------------------------------------------------------------// 
     290                public function get topLineEnabled():Boolean{ 
     291                        return __topLineEnabled; 
     292                } 
     293                // -------------------------------------------------------------------// 
     294                public function get bottomLineEnabled():Boolean{ 
     295                        return __bottomLineEnabled; 
     296                } 
     297                // -------------------------------------------------------------------// 
     298                public function get leftLineEnabled():Boolean{ 
     299                        return __leftLineEnabled; 
     300                } 
     301                // -------------------------------------------------------------------// 
     302                public function get rightLineEnabled():Boolean{ 
     303                        return __rightLineEnabled; 
    256304                } 
    257305                // -------------------------------------------------------------------// 
  • mxp/specialbutton/as3/src/SpecialButton.as

    r1539 r1546  
    3030                public var __innerAlpha         :Number = 100; 
    3131                public var __bodyAlpha          :Number = 100; 
     32                public var __topLineEnabled             :Boolean = true; 
     33                public var __bottomLineEnabled  :Boolean = true; 
     34                public var __leftLineEnabled    :Boolean = true; 
     35                public var __rightLineEnabled   :Boolean = true; 
    3236                // -------------------------------------------------------------------// 
    3337                //ButtomBox_Labels Property 
     
    121125                        this.__disableView.handler      = "disableHandler"; 
    122126                         
    123                         this.hit_mc.buttonMode      = true; 
    124                         this.hit_mc.focusRect       = false; 
    125                         this.hit_mc.mouseChildren   = false; 
    126                         this.hit_mc.useHandCursor   = __useHandCursor; 
     127                        this.buttonMode      = true; 
     128                        this.focusRect       = false; 
     129                        this.mouseChildren   = false; 
     130                        this.useHandCursor   = __useHandCursor; 
    127131                         
    128132                        this.enabled                            = __enabled; 
     
    147151                        body_mc.cornerSize = _num; 
    148152                        mask_mc.cornerSize = _num-outerSize; 
    149                         hit_mc.cornerSize  = _num; 
     153                         
     154                        cornerPart = __cornerPart; 
    150155                } 
    151156                // -------------------------------------------------------------------// 
     
    176181                        body_mc.cornerPart = _str; 
    177182                        mask_mc.cornerPart = _str; 
    178                         hit_mc.cornerPart  = _str; 
    179183                } 
    180184                // -------------------------------------------------------------------// 
     
    248252                } 
    249253                // -------------------------------------------------------------------// 
     254                //[Inspectable(defaultValue=true, name="14.線(上)の表示可否", type="Boolean")] 
     255                public function set topLineEnabled(_bool:Boolean){ 
     256                        __topLineEnabled = _bool; 
     257                        body_mc.topLineEnabled = _bool; 
     258                } 
     259                // -------------------------------------------------------------------// 
     260                //[Inspectable(defaultValue=true, name="15.線(下)の表示可否", type="Boolean")] 
     261                public function set bottomLineEnabled(_bool:Boolean){ 
     262                        __bottomLineEnabled = _bool; 
     263                        body_mc.bottomLineEnabled = _bool; 
     264                } 
     265                // -------------------------------------------------------------------// 
     266                //[Inspectable(defaultValue=true, name="16.線(左)の表示可否", type="Boolean")] 
     267                public function set leftLineEnabled(_bool:Boolean){ 
     268                        __leftLineEnabled = _bool; 
     269                        body_mc.leftLineEnabled = _bool; 
     270                } 
     271                // -------------------------------------------------------------------// 
     272                //[Inspectable(defaultValue=true, name="17.線(右)の表示可否", type="Boolean")] 
     273                public function set rightLineEnabled(_bool:Boolean){ 
     274                        __rightLineEnabled = _bool; 
     275                        body_mc.rightLineEnabled = _bool; 
     276                } 
     277                // -------------------------------------------------------------------// 
    250278                // ButtomBox_Labels setter 
    251279                // -------------------------------------------------------------------// 
     
    365393                                mask_mc.width = __w-outerSize*2; 
    366394                                body_mc.width = __w; 
    367                                 hit_mc.width  = __w; 
    368395                                updateLabelPosition(); 
    369396                                innerPosition = __innerPosition; 
     397                                cornerPart = __cornerPart; 
    370398                        } 
    371399                } 
     
    375403                                __h = _num; 
    376404                                body_mc.height = __h; 
    377                                 hit_mc.height  = __h; 
    378405                                mask_mc.height = __h-outerSize*2; 
    379406                                updateLabelPosition(); 
    380407                                innerPosition = __innerPosition; 
     408                                cornerPart = __cornerPart; 
    381409                        } 
    382410                } 
     
    442470                        var vMouseEvent:Object = new Object(); 
    443471                        if(_bool){ 
    444                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_OVER,updateViewCatcher); 
    445                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_OUT,updateViewCatcher); 
    446                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_DOWN,updateViewCatcher); 
    447                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_UP,updateViewCatcher); 
     472                                this.addEventListener(MouseEvent.MOUSE_OVER,updateViewCatcher); 
     473                                this.addEventListener(MouseEvent.MOUSE_OUT,updateViewCatcher); 
     474                                this.addEventListener(MouseEvent.MOUSE_DOWN,updateViewCatcher); 
     475                                this.addEventListener(MouseEvent.MOUSE_UP,updateViewCatcher); 
    448476                                 
    449                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_OVER,btnOverHandler); 
    450                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_DOWN,btnDownHandler); 
    451                                 this["hit_mc"].addEventListener(MouseEvent.MOUSE_UP,btnUpHandler); 
     477                                this.addEventListener(MouseEvent.MOUSE_OVER,btnOverHandler); 
     478                                this.addEventListener(MouseEvent.MOUSE_DOWN,btnDownHandler); 
     479                                this.addEventListener(MouseEvent.MOUSE_UP,btnUpHandler); 
    452480                                 
    453                                 this["hit_mc"].addEventListener(FocusEvent.FOCUS_IN,updateViewCatcher); 
    454                                 this["hit_mc"].addEventListener(FocusEvent.FOCUS_IN,btnOverHandler); 
    455                                 this["hit_mc"].addEventListener(FocusEvent.FOCUS_OUT,updateViewCatcher); 
     481                                this.addEventListener(FocusEvent.FOCUS_IN,updateViewCatcher); 
     482                                this.addEventListener(FocusEvent.FOCUS_IN,btnOverHandler); 
     483                                this.addEventListener(FocusEvent.FOCUS_OUT,updateViewCatcher); 
    456484 
    457                                 this["hit_mc"].buttonMode     = true; 
    458                                 this["hit_mc"].useHandCursor  = __useHandCursor; 
     485                                this.buttonMode     = true; 
     486                                this.useHandCursor  = __useHandCursor; 
    459487                                vMouseEvent.type=MouseEvent.MOUSE_OUT; 
    460488                                updateViewCatcher(vMouseEvent); 
    461489 
    462490                        }else{ 
    463                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_OVER,updateViewCatcher); 
    464                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_OUT,updateViewCatcher); 
    465                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_DOWN,updateViewCatcher); 
    466                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_UP,updateViewCatcher); 
     491                                this.removeEventListener(MouseEvent.MOUSE_OVER,updateViewCatcher); 
     492                                this.removeEventListener(MouseEvent.MOUSE_OUT,updateViewCatcher); 
     493                                this.removeEventListener(MouseEvent.MOUSE_DOWN,updateViewCatcher); 
     494                                this.removeEventListener(MouseEvent.MOUSE_UP,updateViewCatcher); 
    467495                                 
    468                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_OVER,btnOverHandler); 
    469                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_DOWN,btnDownHandler); 
    470                                 this["hit_mc"].removeEventListener(MouseEvent.MOUSE_UP,btnUpHandler); 
     496                                this.removeEventListener(MouseEvent.MOUSE_OVER,btnOverHandler); 
     497                                this.removeEventListener(MouseEvent.MOUSE_DOWN,btnDownHandler); 
     498                                this.removeEventListener(MouseEvent.MOUSE_UP,btnUpHandler); 
    471499                                 
    472                                 this["hit_mc"].removeEventListener(FocusEvent.FOCUS_IN,updateViewCatcher); 
    473                                 this["hit_mc"].removeEventListener(FocusEvent.FOCUS_IN,btnOverHandler); 
    474                                 this["hit_mc"].removeEventListener(FocusEvent.FOCUS_OUT,updateViewCatcher); 
     500                                this.removeEventListener(FocusEvent.FOCUS_IN,updateViewCatcher); 
     501                                this.removeEventListener(FocusEvent.FOCUS_IN,btnOverHandler); 
     502                                this.removeEventListener(FocusEvent.FOCUS_OUT,updateViewCatcher); 
    475503 
    476                                 this["hit_mc"].buttonMode     = false; 
    477                                 this["hit_mc"].useHandCursor  = __useHandCursor; 
     504                                this.buttonMode     = false; 
     505                                this.useHandCursor  = __useHandCursor; 
    478506                                vMouseEvent.type="disable"; 
    479507                                updateViewCatcher(vMouseEvent); 
     
    605633                public function get labelAlpha():Number { 
    606634                        return __labelAlpha; 
     635                } 
     636                // -------------------------------------------------------------------// 
     637                public function get topLineEnabled():Boolean{ 
     638                        return __topLineEnabled; 
     639                } 
     640                // -------------------------------------------------------------------// 
     641                public function get bottomLineEnabled():Boolean{ 
     642                        return __bottomLineEnabled; 
     643                } 
     644                // -------------------------------------------------------------------// 
     645                public function get leftLineEnabled():Boolean{ 
     646                        return __leftLineEnabled; 
     647                } 
     648                // -------------------------------------------------------------------// 
     649                public function get rightLineEnabled():Boolean{ 
     650                        return __rightLineEnabled; 
    607651                } 
    608652                // -------------------------------------------------------------------// 
     
    10071051                                mask_mc.width = Math.ceil(vw); 
    10081052                                body_mc.width = Math.ceil(vw); 
    1009                                 hit_mc.width  = Math.ceil(vw); 
    10101053                                mask_mc.height = Math.ceil(vh); 
    10111054                                body_mc.height = Math.ceil(vh); 
    1012                                 hit_mc.height  = Math.ceil(vh); 
    10131055                                innerPosition  = __innerPosition; 
    10141056                                updateLabelPosition(); 
  • mxp/specialbutton/as3/src/sample.txt

    r1539 r1546  
    33 Cornerにアルファが通用していない(ジャスト0はなぜか大丈夫)                              〆 
    44 Cornerに矛盾が発生するデカい値を入れるとCornerがはみ出して表示される       〆 
     5 xxViewのlabelColorのinitプレビューができてない(あとからセットは動く) 
     6 
     7■実装したもの 
     8 up/over/dowm/disable時のviewまわり  〆 
     9 borderBoxに各種lineEnabledを実装したいね。                〆 
    510 
    611 
    712■これから実装するもの 
    8  up/over/dowm/disable時のviewまわり  〆 
    913 
    1014 toolTip 
    1115 shortCut 
     16        →shortCutクラスを作っちゃった方がよさげ。isDownとかチェックしたいし。 
    1217 sizeChangePoint 
    1318 overImage 
    1419 日本語プロパティの英語表記プロパティも平行実装? 
     20 
    1521