チェンジセット 1546
- コミット日時:
- 2008/10/09 03:28:52 (3 ヶ月前)
- ファイル:
-
- mxp/specialbutton/as3/src/BorderBox.as (更新) (6 diffs)
- mxp/specialbutton/as3/src/ButtonBox.as (更新) (3 diffs)
- mxp/specialbutton/as3/src/SpecialButton.as (更新) (10 diffs)
- mxp/specialbutton/as3/src/SpecialButton_sample.fla (更新) (変更前)
- mxp/specialbutton/as3/src/SpecialButton_sample.swf (更新) (変更前)
- mxp/specialbutton/as3/src/sample.txt (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
mxp/specialbutton/as3/src/BorderBox.as
r1522 r1546 2 2 // BorderBox 3 3 // Develop Code n_mattun(まっつん◆SW1/SWF8io) 4 // Last Update 2008/ 09/294 // Last Update 2008/10/09 5 5 // 6 // 境界線を描画するコンポーネント6 // 矩形(線のみ)を描画するコンポーネント 7 7 // --------------------------------------------------------------------- 8 8 // ■コンポーネント定数 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 31 17 // -------------------------------------------------------------------// 32 18 … … 47 33 public var __borderSize :Number = 2; 48 34 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 50 41 51 42 // コンストラクタ … … 63 54 this.color = __color; 64 55 this.borderSize = __borderSize; 56 updateLineEnabled(); 65 57 } 66 58 // -------------------------------------------------------------------// … … 162 154 this["B"].width -= _num; 163 155 } 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 } 164 184 } 165 185 // -------------------------------------------------------------------// … … 264 284 this.cornerSize = __cornerSize; 265 285 } 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 } 266 310 // ===================================================================// 267 311 // getter … … 291 335 } 292 336 // -------------------------------------------------------------------// 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 // -------------------------------------------------------------------// 293 364 } 294 365 } mxp/specialbutton/as3/src/ButtonBox.as
r1522 r1546 25 25 public var __innerAlpha :Number = 100; 26 26 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; 27 31 28 32 public function ButtonBox() { … … 194 198 } 195 199 // -------------------------------------------------------------------// 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 // -------------------------------------------------------------------// 196 228 // getter 197 229 // -------------------------------------------------------------------// … … 254 286 public function get bodyAlpha():Number { 255 287 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; 256 304 } 257 305 // -------------------------------------------------------------------// mxp/specialbutton/as3/src/SpecialButton.as
r1539 r1546 30 30 public var __innerAlpha :Number = 100; 31 31 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; 32 36 // -------------------------------------------------------------------// 33 37 //ButtomBox_Labels Property … … 121 125 this.__disableView.handler = "disableHandler"; 122 126 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; 127 131 128 132 this.enabled = __enabled; … … 147 151 body_mc.cornerSize = _num; 148 152 mask_mc.cornerSize = _num-outerSize; 149 hit_mc.cornerSize = _num; 153 154 cornerPart = __cornerPart; 150 155 } 151 156 // -------------------------------------------------------------------// … … 176 181 body_mc.cornerPart = _str; 177 182 mask_mc.cornerPart = _str; 178 hit_mc.cornerPart = _str;179 183 } 180 184 // -------------------------------------------------------------------// … … 248 252 } 249 253 // -------------------------------------------------------------------// 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 // -------------------------------------------------------------------// 250 278 // ButtomBox_Labels setter 251 279 // -------------------------------------------------------------------// … … 365 393 mask_mc.width = __w-outerSize*2; 366 394 body_mc.width = __w; 367 hit_mc.width = __w;368 395 updateLabelPosition(); 369 396 innerPosition = __innerPosition; 397 cornerPart = __cornerPart; 370 398 } 371 399 } … … 375 403 __h = _num; 376 404 body_mc.height = __h; 377 hit_mc.height = __h;378 405 mask_mc.height = __h-outerSize*2; 379 406 updateLabelPosition(); 380 407 innerPosition = __innerPosition; 408 cornerPart = __cornerPart; 381 409 } 382 410 } … … 442 470 var vMouseEvent:Object = new Object(); 443 471 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); 448 476 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); 452 480 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); 456 484 457 this ["hit_mc"].buttonMode = true;458 this ["hit_mc"].useHandCursor = __useHandCursor;485 this.buttonMode = true; 486 this.useHandCursor = __useHandCursor; 459 487 vMouseEvent.type=MouseEvent.MOUSE_OUT; 460 488 updateViewCatcher(vMouseEvent); 461 489 462 490 }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); 467 495 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); 471 499 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); 475 503 476 this ["hit_mc"].buttonMode = false;477 this ["hit_mc"].useHandCursor = __useHandCursor;504 this.buttonMode = false; 505 this.useHandCursor = __useHandCursor; 478 506 vMouseEvent.type="disable"; 479 507 updateViewCatcher(vMouseEvent); … … 605 633 public function get labelAlpha():Number { 606 634 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; 607 651 } 608 652 // -------------------------------------------------------------------// … … 1007 1051 mask_mc.width = Math.ceil(vw); 1008 1052 body_mc.width = Math.ceil(vw); 1009 hit_mc.width = Math.ceil(vw);1010 1053 mask_mc.height = Math.ceil(vh); 1011 1054 body_mc.height = Math.ceil(vh); 1012 hit_mc.height = Math.ceil(vh);1013 1055 innerPosition = __innerPosition; 1014 1056 updateLabelPosition(); mxp/specialbutton/as3/src/sample.txt
r1539 r1546 3 3 Cornerにアルファが通用していない(ジャスト0はなぜか大丈夫) 〆 4 4 Cornerに矛盾が発生するデカい値を入れるとCornerがはみ出して表示される 〆 5 xxViewのlabelColorのinitプレビューができてない(あとからセットは動く) 6 7 ■実装したもの 8 up/over/dowm/disable時のviewまわり 〆 9 borderBoxに各種lineEnabledを実装したいね。 〆 5 10 6 11 7 12 ■これから実装するもの 8 up/over/dowm/disable時のviewまわり 〆9 13 10 14 toolTip 11 15 shortCut 16 →shortCutクラスを作っちゃった方がよさげ。isDownとかチェックしたいし。 12 17 sizeChangePoint 13 18 overImage 14 19 日本語プロパティの英語表記プロパティも平行実装? 20 15 21
