MXHX try
This commit is contained in:
@@ -23,6 +23,8 @@
|
|||||||
<haxelib name="haxe-strings" />
|
<haxelib name="haxe-strings" />
|
||||||
<haxelib name="fuzzaldrin" />
|
<haxelib name="fuzzaldrin" />
|
||||||
<haxelib name="bindx2" />
|
<haxelib name="bindx2" />
|
||||||
|
<haxelib name="mxhx-feathersui" />
|
||||||
|
<haxelib name="mxhx-component" />
|
||||||
|
|
||||||
<icon path="assets/icons/app_icon.svg"/>
|
<icon path="assets/icons/app_icon.svg"/>
|
||||||
|
|
||||||
@@ -44,6 +46,8 @@
|
|||||||
<config:android permission="android.permission.INTERNET" />
|
<config:android permission="android.permission.INTERNET" />
|
||||||
<config:android permission="android.permission.ACCESS_NETWORK_STATE" />
|
<config:android permission="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
|
<define name="mxhx_disable_experimental_warning"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -73,11 +73,10 @@ class AppModelLocator extends EventDispatcher implements IModelLocator {
|
|||||||
|
|
||||||
public function filterRiderListDP(pTestValue:String) {
|
public function filterRiderListDP(pTestValue:String) {
|
||||||
ridersListDP.filterFunction = function(rider:RiderVO):Bool {
|
ridersListDP.filterFunction = function(rider:RiderVO):Bool {
|
||||||
return StringTools.contains(rider.firstName, pTestValue);
|
return StringTools.contains(rider.firstName.toLowerCase(), pTestValue.toLowerCase());
|
||||||
};
|
};
|
||||||
//ridersListDP.refresh();
|
//ridersListDP.refresh();
|
||||||
dispatchEvent(new Event(AppModelLocator.RIDERS_LIST_DP_CHANGE));
|
dispatchEvent(new Event(AppModelLocator.RIDERS_LIST_DP_CHANGE));
|
||||||
traceCyan(ridersListDP.length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// variable to store error messages from the httpservice
|
// variable to store error messages from the httpservice
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<f:LayoutGroup xmlns:mx="https://ns.mxhx.dev/2024/mxhx" xmlns:f="https://ns.feathersui.com/mxhx">
|
||||||
|
<!-- <f:Button text="{Date.now().toString()}" width="150" height="40" click="{trace('Hi!');}"/>-->
|
||||||
|
<f:Button text="{Date.now().toString()}" width="150" height="40" click="{trace('Hi!');}"/>
|
||||||
|
</f:LayoutGroup>
|
||||||
+53
-12
@@ -1,9 +1,6 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
import haxe.macro.Expr;
|
|
||||||
import bindx.Bind;
|
import bindx.Bind;
|
||||||
import openfl.utils.Function;
|
|
||||||
import feathers.core.PopUpManager;
|
|
||||||
import components.VSpacer;
|
import components.VSpacer;
|
||||||
import feathers.controls.AssetLoader;
|
import feathers.controls.AssetLoader;
|
||||||
import feathers.controls.Button;
|
import feathers.controls.Button;
|
||||||
@@ -13,7 +10,7 @@ import feathers.controls.HProgressBar;
|
|||||||
import feathers.controls.Label;
|
import feathers.controls.Label;
|
||||||
import feathers.controls.LayoutGroup;
|
import feathers.controls.LayoutGroup;
|
||||||
import feathers.controls.ScrollContainer;
|
import feathers.controls.ScrollContainer;
|
||||||
import feathers.controls.TextInput;
|
import feathers.core.PopUpManager;
|
||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
import feathers.events.TriggerEvent;
|
import feathers.events.TriggerEvent;
|
||||||
import feathers.layout.VerticalLayout;
|
import feathers.layout.VerticalLayout;
|
||||||
@@ -21,9 +18,11 @@ import feathers.skins.RectangleSkin;
|
|||||||
import model.AppModelLocator;
|
import model.AppModelLocator;
|
||||||
import model.Constants;
|
import model.Constants;
|
||||||
import model.String.Strings;
|
import model.String.Strings;
|
||||||
|
import mxhx.macros.MXHXComponent;
|
||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
import openfl.events.Event;
|
import openfl.events.Event;
|
||||||
import openfl.text.TextFormat;
|
import openfl.text.TextFormat;
|
||||||
|
import openfl.utils.Function;
|
||||||
import t9.util.ColorTraces.*;
|
import t9.util.ColorTraces.*;
|
||||||
import ui.LPTCTheme;
|
import ui.LPTCTheme;
|
||||||
import ui.SVGIconFactory;
|
import ui.SVGIconFactory;
|
||||||
@@ -42,7 +41,9 @@ class RiderCardDrawer extends Drawer {
|
|||||||
private var nameLabel:Label;
|
private var nameLabel:Label;
|
||||||
private var creditLabel:Label;
|
private var creditLabel:Label;
|
||||||
private var creditProgressBar:HProgressBar;
|
private var creditProgressBar:HProgressBar;
|
||||||
private var removeOneCredit:Button;
|
private var removeOneCreditButton:Button;
|
||||||
|
private var lastLessonDateTextLabel:Label;
|
||||||
|
private var lastLessonDateValueLabel:Label;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
@@ -94,7 +95,7 @@ class RiderCardDrawer extends Drawer {
|
|||||||
// ##### SPACER
|
// ##### SPACER
|
||||||
mainScrollContainer.addChild(new VSpacer(10));
|
mainScrollContainer.addChild(new VSpacer(10));
|
||||||
|
|
||||||
// ########################################################################## FIRSTNAME & NAME LABELS
|
// ########################################################################## firstname & name labels group
|
||||||
// layout
|
// layout
|
||||||
var lg1:LayoutGroup = new LayoutGroup();
|
var lg1:LayoutGroup = new LayoutGroup();
|
||||||
lg1.backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR1, 0));
|
lg1.backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR1, 0));
|
||||||
@@ -139,12 +140,12 @@ class RiderCardDrawer extends Drawer {
|
|||||||
mainScrollContainer.addChild(new VSpacer(10));
|
mainScrollContainer.addChild(new VSpacer(10));
|
||||||
|
|
||||||
// ########################################################################## Remove 1 credit button
|
// ########################################################################## Remove 1 credit button
|
||||||
removeOneCredit = new Button();
|
removeOneCreditButton = new Button();
|
||||||
removeOneCredit.icon = SVGIconFactory.makeIcon("vector/ticket_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.MAIN_COLOR3);
|
removeOneCreditButton.icon = SVGIconFactory.makeIcon("vector/ticket_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.MAIN_COLOR3);
|
||||||
removeOneCredit.setIconForState(ButtonState.DOWN,
|
removeOneCreditButton.setIconForState(ButtonState.DOWN,
|
||||||
SVGIconFactory.makeIcon("vector/ticket_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.HERO_COLOR));
|
SVGIconFactory.makeIcon("vector/ticket_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.HERO_COLOR));
|
||||||
removeOneCredit.text = Strings.RCD_S2;
|
removeOneCreditButton.text = Strings.RCD_S2;
|
||||||
removeOneCredit.addEventListener(TriggerEvent.TRIGGER, (e) -> {
|
removeOneCreditButton.addEventListener(TriggerEvent.TRIGGER, (e) -> {
|
||||||
traceRed("removeOneCredit()");
|
traceRed("removeOneCredit()");
|
||||||
// this function will be exectuted when the user will click on the ConfirmationPanel's "confirm" button
|
// this function will be exectuted when the user will click on the ConfirmationPanel's "confirm" button
|
||||||
var f:Function = function() {
|
var f:Function = function() {
|
||||||
@@ -153,19 +154,57 @@ class RiderCardDrawer extends Drawer {
|
|||||||
}
|
}
|
||||||
PopUpManager.addPopUp(new ConfirmationPanel(Strings.CP_S2, Strings.CP_S3, f), parent, true, true);
|
PopUpManager.addPopUp(new ConfirmationPanel(Strings.CP_S2, Strings.CP_S3, f), parent, true, true);
|
||||||
});
|
});
|
||||||
mainScrollContainer.addChild(removeOneCredit);
|
mainScrollContainer.addChild(removeOneCreditButton);
|
||||||
|
|
||||||
// ##### SPACER
|
// ##### SPACER
|
||||||
mainScrollContainer.addChild(new VSpacer(10));
|
mainScrollContainer.addChild(new VSpacer(10));
|
||||||
// mainScrollContainer.addChild(new VSpacer(2, Constants.MAIN_COLOR2, 1));
|
// mainScrollContainer.addChild(new VSpacer(2, Constants.MAIN_COLOR2, 1));
|
||||||
|
|
||||||
|
// ########################################################################## rider basic infos group (lastLessonDate, age, level)
|
||||||
|
/*var lg2:LayoutGroup = new LayoutGroup();
|
||||||
|
lg2.backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR3, 1));
|
||||||
|
var vl2:VerticalLayout = new VerticalLayout();
|
||||||
|
vl2.horizontalAlign = JUSTIFY;
|
||||||
|
lg2.layout = vl2;
|
||||||
|
mainScrollContainer.addChild(lg2);
|
||||||
|
|
||||||
|
lastLessonDateTextLabel = new Label();
|
||||||
|
lastLessonDateTextLabel.embedFonts = true;
|
||||||
|
lastLessonDateTextLabel.textFormat = new TextFormat(Assets.getFont(Constants.MONTSERRAT_MEDIUM_500).fontName, Constants.FONT_SIZE_12, Constants.MAIN_COLOR1);
|
||||||
|
lastLessonDateTextLabel.text = "Dernier cours";
|
||||||
|
lg2.addChild(lastLessonDateTextLabel);*/
|
||||||
|
|
||||||
|
/*var m = MXHXComponent.withMarkup('
|
||||||
|
<f:LayoutGroup xmlns:mx="https://ns.mxhx.dev/2024/basic" xmlns:f="https://ns.feathersui.com/mxhx">
|
||||||
|
<f:layout>
|
||||||
|
<f:HorizontalLayout gap="10" horizontalAlign="RIGHT"/>
|
||||||
|
</f:layout>
|
||||||
|
<f:Button id="okButton" text="OK"/>
|
||||||
|
<f:Button id="cancelButton" text="Cancel"/>
|
||||||
|
</f:LayoutGroup>
|
||||||
|
');*/
|
||||||
|
|
||||||
|
var m = MXHXComponent.withFile('MyMXHXcomp.mxhx');
|
||||||
|
mainScrollContainer.addChild(m);
|
||||||
|
|
||||||
|
|
||||||
|
//mainScrollContainer.addChild(m);
|
||||||
|
|
||||||
drawer = mainScrollContainer;
|
drawer = mainScrollContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function onCreationComplete(e:FeathersEvent):Void {
|
private function onCreationComplete(e:FeathersEvent):Void {
|
||||||
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height);
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function populateAndShow() {
|
public function populateAndShow() {
|
||||||
// var rvo:RiderVO = model.selectedRider;
|
// var rvo:RiderVO = model.selectedRider;
|
||||||
|
|
||||||
@@ -196,6 +235,8 @@ class RiderCardDrawer extends Drawer {
|
|||||||
updateCreditUIElments(null, model.selectedRider.credit);
|
updateCreditUIElments(null, model.selectedRider.credit);
|
||||||
Bind.bind(model.selectedRider.credit, updateCreditUIElments);
|
Bind.bind(model.selectedRider.credit, updateCreditUIElments);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
openDrawer();
|
openDrawer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import t9.util.ColorTraces.*;
|
|||||||
import vo.RiderVO;
|
import vo.RiderVO;
|
||||||
|
|
||||||
class RidersList extends ListView {
|
class RidersList extends ListView {
|
||||||
private var model = AppModelLocator.getInstance();
|
|
||||||
private var rowHeight:Int;
|
private var rowHeight:Int;
|
||||||
private var localRidersListDP:ArrayCollection<RiderVO>;
|
private var localRidersListDP:ArrayCollection<RiderVO>;
|
||||||
|
|
||||||
@@ -79,7 +78,7 @@ class RidersList extends ListView {
|
|||||||
loader.source = null; */
|
loader.source = null; */
|
||||||
};
|
};
|
||||||
|
|
||||||
model.addEventListener(AppModelLocator.RIDERS_LIST_DP_CHANGE, onRiderListDpChange);
|
AppModelLocator.getInstance().addEventListener(AppModelLocator.RIDERS_LIST_DP_CHANGE, onRiderListDpChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
@@ -89,7 +88,7 @@ class RidersList extends ListView {
|
|||||||
private function onRiderListDpChange(e:Event):Void {
|
private function onRiderListDpChange(e:Event):Void {
|
||||||
|
|
||||||
if(localRidersListDP.length > 0) localRidersListDP.removeAll();
|
if(localRidersListDP.length > 0) localRidersListDP.removeAll();
|
||||||
localRidersListDP.addAll(model.ridersListDP);
|
localRidersListDP.addAll(AppModelLocator.getInstance().ridersListDP);
|
||||||
dataProvider = localRidersListDP;
|
dataProvider = localRidersListDP;
|
||||||
//dataProvider = model.ridersListDP;
|
//dataProvider = model.ridersListDP;
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ class ToolBar extends LayoutGroup {
|
|||||||
|
|
||||||
private function onTextInputChange(e:Event) {
|
private function onTextInputChange(e:Event) {
|
||||||
var ti:TextInput = cast(e.currentTarget, TextInput);
|
var ti:TextInput = cast(e.currentTarget, TextInput);
|
||||||
trace("text input change: " + ti.text);
|
|
||||||
AppModelLocator.getInstance().filterRiderListDP(ti.text);
|
AppModelLocator.getInstance().filterRiderListDP(ti.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user