Skip to content

Commit f2eed00

Browse files
committed
Merge branch 'master' of github.com:HendrixString/Feathers-Flex-UI
Conflicts: .actionScriptProperties bin/Feathers Comps UI.swc
2 parents 553758b + 4f6fbd3 commit f2eed00

17 files changed

+317
-78
lines changed

.actionScriptProperties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@
4747
<buildCSSFiles/>
4848
<flashCatalyst validateFlashCatalystCompatibility="false"/>
4949
</actionScriptProperties>
50+

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## How to use
66
simply fork or download the project, you can also download the binary itself and link it
77
to your project, or import to your IDE of choice such as `Flash Builder 4.7`. We support
8-
`Starling 1.5` and `Feathers 2` and at least version 15 of `Adobe AIR SDK` is recommended.
8+
`Starling 1.6` and `Feathers 2` and at least version 15 of `Adobe AIR SDK` is recommended.
99

1010
## Features
1111
- flexible ui components will save you tons of code for layout purposes.
@@ -187,7 +187,8 @@ public function startSplash(flashSpriteParent:flash.display.DisplayObjectContain
187187
* `AudioNote` an audio recording component
188188
* `BitmapLayersComposer` flash based image composer, works with a data provider with
189189
layout options. great for dynamic splash screens
190-
* `BidiTextField` Bidirectional Text field for bitmap fonts. based on another repository i have published
190+
* `BidiTextField` Bidirectional Text field with *bitmap fonts*. based on another repository i have published
191+
* `TLFLabel` Bidirectional Image text label based on `Adobe TLF`.
191192

192193
- a set of widgets
193194
* `ListUpdateWidget` - a widget that hooks to a list to augment it with pull to refresh feature.
@@ -208,3 +209,15 @@ layout options. great for dynamic splash screens
208209
" target="_blank"><img src="http://img.youtube.com/vi/MCp_mLN_W94/0.jpg"
209210
alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
210211

212+
### Dependencies
213+
* [`Starling-Framework`](https://github.com/Gamua/Starling-Framework)
214+
* [`Feathers`](https://github.com/joshtynjala/feathers)
215+
216+
### Terms
217+
* completely free source code. [Apache License, Version 2.0.](http://www.apache.org/licenses/LICENSE-2.0)
218+
* if you like it -> star or share it with others
219+
220+
### Contact Author
221+
222+
* [Google+ TomershalevMan](https://plus.google.com/+TomershalevMan/about)
223+
* [Facebook - HendrixString](https://www.facebook.com/HendrixString)

bin/Feathers Comps UI.swc

-1.6 MB
Binary file not shown.

src/com/hendrix/feathers/controls/CompsFactory.as

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.hendrix.feathers.controls
22
{
3+
import com.hendrix.collection.SetData.Set;
4+
import com.hendrix.collection.idCollection.IdCollection;
35
import com.hendrix.feathers.controls.flex.FlexButton;
46
import com.hendrix.feathers.controls.flex.FlexLabel;
57
import com.hendrix.gfxManager.GfxManager;
@@ -39,6 +41,8 @@ package com.hendrix.feathers.controls
3941
{
4042
// placed here in order to load the TextFieldLibarary
4143
var btf:BidiTextField;
44+
var coll:IdCollection;
45+
var col2:Set;
4246
}
4347

4448
/**
@@ -123,9 +127,7 @@ package com.hendrix.feathers.controls
123127

124128
button.selectedUpSkin = button.downSkin;
125129
button.selectedDownSkin = button.upSkin;
126-
button.selectedHoverSkin = button.downSkin;
127-
128-
button.stateToSkinFunction
130+
button.selectedHoverSkin = button.downSkin;
129131
}
130132

131133
if($textFormat is TextFormat)

src/com/hendrix/feathers/controls/core/ExtScreenNavigator.as

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ package com.hendrix.feathers.controls.core
113113
{
114114
if(recordHistory)
115115
_screenIdHistory.push(activeScreenID);
116-
116+
117117
showScreen($id);
118118
}
119119

@@ -138,7 +138,7 @@ package com.hendrix.feathers.controls.core
138138

139139
public function getScreenNavigatorItemById($id:String):ScreenNavigatorItem
140140
{
141-
return _screensVec(getScreenIndexById($id));
141+
return _screensVec[getScreenIndexById($id)];
142142
}
143143

144144
/**

src/com/hendrix/feathers/controls/flex/DateAndTimePickerDialog.as

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
package com.hendrix.feathers.controls.flex
22
{
3+
import com.hendrix.feathers.controls.utils.SColors;
4+
5+
import flash.text.TextFormat;
6+
37
/**
48
* a combined Date and Time picker dialog
9+
*
10+
* a Dialog control <br>
11+
* <li>use <code>this.textOK, this.textCANCEL, this.textHEADLINE</code> to alter the text.
12+
* <li>use <code>this.textCANCEL</code> to put a DisplayObject as the content of the dialog.
13+
* <li>use <code>this.tf_buttons, tf_headline</code> to control textFormat of buttons and headline respectively.
14+
* <li>use <code>this.onAction</code> callback to listen to OK/CANCEL, callback will return ACTION_OK/ACTION_CANCEL respectively.
15+
* <li>use <code>this.show()/close()</code> to show/close the dialog.
16+
*
517
* @author Tomer Shalev
618
*/
719
public class DateAndTimePickerDialog extends Dialog
@@ -16,6 +28,13 @@ package com.hendrix.feathers.controls.flex
1628
public function DateAndTimePickerDialog()
1729
{
1830
super();
31+
32+
textOK = "ok";
33+
textCANCEL = "cancel";
34+
textHEADLINE = "Date and Time";
35+
36+
tf_buttons = new TextFormat("arial", null, SColors.BLUE_LIGHT);
37+
tf_headline = new TextFormat("arial", null, SColors.BLUE_LIGHT);
1938
}
2039

2140
/**

src/com/hendrix/feathers/controls/flex/DatePicker.as

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@ package com.hendrix.feathers.controls.flex
1616
* <li><code>getSelectedDay()
1717
* <li>getSelectedMonth()
1818
* <li>getSelectedYear()
19-
* <li>getSelectedDate()</code>
19+
* <li>getSelectedDate()
20+
* <li>this.COUNT_YEARS_BEFORE, this.COUNT_YEARS_AFTER, to control how many years are displayed before and after this year
21+
* <li>getSelectedDate()
22+
* </code>
2023
* @author Tomer Shalev
2124
*/
2225
public class DatePicker extends FlexComp
2326
{
2427
/**
2528
* years to diaplay in list before current year
2629
*/
27-
static private const COUNT_YEARS_BEFORE: uint = 5;
30+
public var COUNT_YEARS_BEFORE: uint = 5;
2831
/**
2932
* years to diaplay in list after current year
3033
*/
31-
static private const COUNT_YEARS_AFTER: uint = 25;
34+
public var COUNT_YEARS_AFTER: uint = 25;
3235

3336
private var _list_months: LabelList = null;
3437
private var _list_days: LabelList = null;

src/com/hendrix/feathers/controls/flex/DatePickerDialog.as

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
package com.hendrix.feathers.controls.flex
22
{
3+
import com.hendrix.feathers.controls.utils.SColors;
4+
5+
import flash.text.TextFormat;
36

47
/**
58
* Date picker dialog
9+
10+
* a Dialog control <br>
11+
*
12+
* a Dialog control <br>
13+
* <li>use <code>this.textOK, this.textCANCEL, this.textHEADLINE</code> to alter the text.
14+
* <li>use <code>this.textCANCEL</code> to put a DisplayObject as the content of the dialog.
15+
* <li>use <code>this.tf_buttons, tf_headline</code> to control textFormat of buttons and headline respectively.
16+
* <li>use <code>this.onAction</code> callback to listen to OK/CANCEL, callback will return ACTION_OK/ACTION_CANCEL respectively.
17+
* <li>use <code>this.show()/close()</code> to show/close the dialog.
18+
*
619
* @author Tomer Shalev
720
*/
821
public class DatePickerDialog extends Dialog
@@ -18,6 +31,13 @@ package com.hendrix.feathers.controls.flex
1831
super();
1932

2033
_date_picker = new DatePicker();
34+
35+
textOK = "ok";
36+
textCANCEL = "cancel";
37+
textHEADLINE = "Date";
38+
39+
tf_buttons = new TextFormat("arial", null, SColors.BLUE_LIGHT);
40+
tf_headline = new TextFormat("arial", null, SColors.BLUE_LIGHT);
2141
}
2242

2343
/**

src/com/hendrix/feathers/controls/flex/Dialog.as

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ package com.hendrix.feathers.controls.flex
2424
* <li>use <code>this.textOK, this.textCANCEL, this.textHEADLINE</code> to alter the text.
2525
* <li>use <code>this.textCANCEL</code> to put a DisplayObject as the content of the dialog.
2626
* <li>use <code>this.tf_buttons, tf_headline</code> to control textFormat of buttons and headline respectively.
27+
* <li>use <code>this.embeddedFonts</code> to specify that the fonts are embedded or not.
2728
* <li>use <code>this.onAction</code> callback to listen to OK/CANCEL, callback will return ACTION_OK/ACTION_CANCEL respectively.
2829
* <li>use <code>this.show()/close()</code> to show/close the dialog.
2930
* @author Tomer Shalev
@@ -40,6 +41,7 @@ package com.hendrix.feathers.controls.flex
4041

4142
private var _tf_buttons: TextFormat = null;
4243
private var _tf_headline: TextFormat = null;
44+
private var _embeddedFonts: Boolean = true;
4345

4446
private var _textOK: String = "ok";
4547
private var _textCANCEL: String = "cancel";
@@ -58,6 +60,7 @@ package com.hendrix.feathers.controls.flex
5860
* <li>use <code>this.tf_buttons, tf_headline</code> to control textFormat of buttons and headline respectively.
5961
* <li>use <code>this.onAction</code> callback to listen to OK/CANCEL, callback will return ACTION_OK/ACTION_CANCEL respectively.
6062
* <li>use <code>this.show()/close()</code> to show/close the dialog.
63+
*
6164
* @author Tomer Shalev
6265
*
6366
*/
@@ -66,6 +69,16 @@ package com.hendrix.feathers.controls.flex
6669
super();
6770
}
6871

72+
public function get embeddedFonts():Boolean
73+
{
74+
return _embeddedFonts;
75+
}
76+
77+
public function set embeddedFonts(value:Boolean):void
78+
{
79+
_embeddedFonts = value;
80+
}
81+
6982
/**
7083
* main content of the dialog
7184
*/
@@ -170,9 +183,9 @@ package com.hendrix.feathers.controls.flex
170183
_container = new FlexComp();
171184
_quad_bg = new FlexQuad(0x00);
172185

173-
var lbl_headline: FlexLabel = CompsFactory.newLabel(_textHEADLINE, _tf_headline, false, true, TextAlign.CENTER, true) as FlexLabel;
174-
var btn_ok: FlexButton = CompsFactory.newButton(0x7DD9FF, null, btn_onAction, _tf_buttons, _textOK, false, null, true, "center", true) as FlexButton;
175-
var btn_cancel: FlexButton = CompsFactory.newButton(0x7DD9FF, null, btn_onAction, _tf_buttons, _textCANCEL, false, null, true, "center", true) as FlexButton;
186+
var lbl_headline: FlexLabel = CompsFactory.newLabel(_textHEADLINE, _tf_headline, false, _embeddedFonts, TextAlign.CENTER, true) as FlexLabel;
187+
var btn_ok: FlexButton = CompsFactory.newButton(0x7DD9FF, null, btn_onAction, _tf_buttons, _textOK, false, null, true, "center", _embeddedFonts) as FlexButton;
188+
var btn_cancel: FlexButton = CompsFactory.newButton(0x7DD9FF, null, btn_onAction, _tf_buttons, _textCANCEL, false, null, true, "center", _embeddedFonts) as FlexButton;
176189

177190
btn_ok.id = ACTION_OK;
178191
btn_cancel.id = ACTION_CANCEL;

src/com/hendrix/feathers/controls/flex/FlexComp.as

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ package com.hendrix.feathers.controls.flex
361361
public function set isSensitiveToParent(value:Boolean):void
362362
{
363363
_isSensitiveToParent = value;
364+
365+
if(isCreated)
366+
internal_parent_observer();
364367
}
365368

366369
public function get id():String { return _id; }
@@ -373,21 +376,7 @@ package com.hendrix.feathers.controls.flex
373376
{
374377
super.initialize();
375378

376-
if(_isSensitiveToParent) {
377-
var parentWidthDop: DisplayObject = _relativeCalcWidthParent ? _relativeCalcWidthParent as DisplayObject : getValidAncestorWidth() as DisplayObject;
378-
var parentHeightDop: DisplayObject = _relativeCalcHeightParent ? _relativeCalcHeightParent as DisplayObject : getValidAncestorHeight() as DisplayObject;
379-
380-
if(parentHeightDop == parentWidthDop) {
381-
}
382-
else {
383-
if(parentHeightDop)
384-
parentHeightDop.addEventListener(FeathersEventType.RESIZE, onParentResized);
385-
}
386-
387-
if(parentWidthDop)
388-
parentWidthDop.addEventListener(FeathersEventType.RESIZE, onParentResized);
389-
390-
}
379+
internal_parent_observer();
391380

392381
if(_backgroundSkin)
393382
addChildAt(_backgroundSkin, 0);
@@ -409,6 +398,24 @@ package com.hendrix.feathers.controls.flex
409398
(parent as FeathersControl).invalidate(INVALIDATION_FLAG_LAYOUT);
410399
}
411400

401+
validateBackground();
402+
}
403+
404+
protected function internal_parent_observer():void {
405+
if(_isSensitiveToParent) {
406+
var parentWidthDop: DisplayObject = _relativeCalcWidthParent ? _relativeCalcWidthParent as DisplayObject : getValidAncestorWidth() as DisplayObject;
407+
var parentHeightDop: DisplayObject = _relativeCalcHeightParent ? _relativeCalcHeightParent as DisplayObject : getValidAncestorHeight() as DisplayObject;
408+
409+
if(parentHeightDop == parentWidthDop) {
410+
}
411+
else {
412+
if(parentHeightDop)
413+
parentHeightDop.addEventListener(FeathersEventType.RESIZE, onParentResized);
414+
}
415+
416+
if(parentWidthDop)
417+
parentWidthDop.addEventListener(FeathersEventType.RESIZE, onParentResized);
418+
}
412419
}
413420

414421
private function onCreationComplete(evt:Event):void

0 commit comments

Comments
 (0)