@@ -71,6 +71,11 @@ package com.hendrix.feathers.controls.flex
7171 */
7272 private var _textNo : String ;
7373
74+ private var _dialogPercentWidth : Number = NaN ;
75+ private var _dialogPercentHeight : Number = NaN ;
76+ private var _fontSizePercent : Number = NaN ;
77+
78+
7479 /**
7580 * a warning popup comp, supports:<br >
7681 * <li >one/two action buttons
@@ -145,6 +150,36 @@ package com.hendrix.feathers.controls.flex
145150 _textHeadline = value ;
146151 }
147152
153+ public function get fontSizePercent ():Number { return _fontSizePercent ; }
154+ public function set fontSizePercent (value :Number ):void
155+ {
156+ _fontSizePercent = value ;
157+ }
158+
159+ private var _colorBg : uint = 0x00 ;
160+
161+ public function get colorBg ():uint { return _colorBg ; }
162+ public function set colorBg (value :uint ):void
163+ {
164+ _colorBg = value ;
165+
166+ if (_quadBgDark ) {
167+ _quadBgDark . color = _colorBg ;
168+ }
169+ }
170+
171+ public function get dialogPercentWidth ():Number { return _dialogPercentWidth ; }
172+ public function set dialogPercentWidth (value :Number ):void
173+ {
174+ _dialogPercentWidth = value ;
175+ }
176+
177+ public function get dialogPercentHeight ():Number { return _dialogPercentHeight ; }
178+ public function set dialogPercentHeight (value :Number ):void
179+ {
180+ _dialogPercentHeight = value ;
181+ }
182+
148183 override public function set visible (value :Boolean ):void
149184 {
150185 if (value == true )
@@ -188,9 +223,9 @@ package com.hendrix.feathers.controls.flex
188223 _lblWarning = CompsFactory. newLabel(_textWarning , tf_lbl, true , true , TextAlign. CENTER );
189224
190225 _quadBg = new Quad(1 , 1 , 0xffffff );
191- _quadBgDark = new Quad(1 , 1 , 0x00 );
226+ _quadBgDark = new Quad(1 , 1 , _colorBg );
192227
193- _quadBgDark . alpha = 0.7 ;
228+ _quadBgDark . alpha = 0.4 ;
194229
195230 _quadStrip0 = new Quad(1 , 1 , 0xEF7F3C ); // 0x7DD9FF
196231 _quadStrip1 = new Quad(1 , 1 , 0xD1D1D1 );
@@ -207,7 +242,7 @@ package com.hendrix.feathers.controls.flex
207242 addChild (_quadStrip1 );
208243 addChild (_quadStrip2 );
209244 }
210-
245+
211246 override protected function draw ():void
212247 {
213248 super . draw ();
@@ -219,12 +254,12 @@ package com.hendrix.feathers.controls.flex
219254
220255 var padding : Number = height * 0.01 ;
221256
222- _quadBg . width = width * 0.95 ;
257+ _quadBg . width = isNaN ( _dialogPercentWidth ) ? width * 0.95 : width * _dialogPercentWidth / 100 ;
223258 _quadBg . x = (width - _quadBg . width ) * 0.5 ;
224259 _quadBg . y = (height - _quadBg . height ) * 0.5 ;
225260
226261 _lblWarning . width = _quadBg . width * 0.95 ;
227- _lblWarning . textRendererProperties. textFormat. size = width * 0.05 ;
262+ _lblWarning . textRendererProperties. textFormat. size = isNaN ( _fontSizePercent ) ? width * 0.05 : height * _fontSizePercent / 100 ;
228263 _lblWarning . validate ();
229264 _lblWarning . height *= 2 ;
230265 _lblWarning . x = _quadBg . x + (_quadBg . width - _lblWarning . width ) * 0.5 ;
@@ -245,7 +280,7 @@ package com.hendrix.feathers.controls.flex
245280
246281 var tf: TextFormat = _btnNo . defaultLabelProperties. textFormat;
247282
248- tf. size = width * 0.06 ;
283+ tf. size = isNaN ( _fontSizePercent ) ? width * 0.06 : height * _fontSizePercent / 100 ;
249284
250285 _btnNo . defaultLabelProperties. textFormat = null ;
251286 _btnNo . defaultLabelProperties. textFormat = tf;
@@ -289,7 +324,7 @@ package com.hendrix.feathers.controls.flex
289324 {
290325 var tf_lbl: TextFormat = new TextFormat ("arial11" , 22 , 0x3C3C3C );
291326 _lblHeadLine = CompsFactory. newLabel(_textHeadline , tf_lbl, false , true , TextAlign. CENTER );
292- _lblHeadLine . textRendererProperties. textFormat. size = width * 0.05 ;
327+ _lblHeadLine . textRendererProperties. textFormat. size = isNaN ( _fontSizePercent ) ? width * 0.05 : height * _fontSizePercent / 100 ; ;
293328
294329 addChild (_lblHeadLine );
295330
0 commit comments