added : ConfirmationPanel

This commit is contained in:
2025-12-23 12:30:43 +01:00
parent ace49bf193
commit 153b6031a3
5 changed files with 152 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g id="rectangle-with-no-fill---no-border" serif:id="rectangle with no fill &amp; no border" transform="matrix(4.51012,0,0,4,-12.0809,-10)">
<rect x="2.679" y="2.5" width="5.321" height="6" style="fill:none;"/>
</g>
<g id="cancel" transform="matrix(1,0,0,1,12,12)">
<g transform="matrix(1,0,0,1,-12,-12)">
<path d="M12,2C17.5,2 22,6.5 22,12C22,17.5 17.5,22 12,22C6.5,22 2,17.5 2,12C2,6.5 6.5,2 12,2M12,4C10.1,4 8.4,4.6 7.1,5.7L18.3,16.9C19.3,15.5 20,13.8 20,12C20,7.6 16.4,4 12,4M16.9,18.3L5.7,7.1C4.6,8.4 4,10.1 4,12C4,16.4 7.6,20 12,20C13.9,20 15.6,19.4 16.9,18.3Z" style="fill-rule:nonzero;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g id="rectangle-with-no-fill---no-border" serif:id="rectangle with no fill &amp; no border" transform="matrix(4.51012,0,0,4,-12.0809,-10)">
<rect x="2.679" y="2.5" width="5.321" height="6" style="fill:none;"/>
</g>
<g transform="matrix(1,0,0,1,12,12)">
<g transform="matrix(1,0,0,1,-12,-12)">
<path d="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z" style="fill-rule:nonzero;"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 915 B

+8 -2
View File
@@ -10,14 +10,20 @@ class Strings {
// MainFooter strings
public static final MF_S1:String = "Licences FFE";
//ToolBar strings
// ToolBar strings
public static final TB_S1:String = "Recherche";
// RidersList strings
public static final RL_S1:String = "Crédit: ";
//RideCardDrawer strings
// RideCardDrawer strings
public static final RCD_S1:String = "Cours restants sur la carte : ";
public static final RCD_S2:String = "Décompter un cours";
// ConfirmationPanel strings
public static final CP_S1:String = "Confirmation";
public static final CP_S2:String = "Annuler";
public static final CP_S3:String = "Confirmer";
public static final CP_S4:String = "Vous allez décompter un cours pour ";
}
+118
View File
@@ -0,0 +1,118 @@
package view;
import model.AppModelLocator;
import model.String.Strings;
import feathers.layout.HorizontalAlign;
import feathers.layout.VerticalLayout;
import openfl.text.TextFormatAlign;
import feathers.controls.Label;
import feathers.layout.HorizontalLayout;
import feathers.events.TriggerEvent;
import feathers.core.PopUpManager;
import feathers.controls.ButtonState;
import ui.LPTCTheme;
import feathers.layout.VerticalAlign;
import ui.SVGIconFactory;
import feathers.controls.Button;
import feathers.layout.HorizontalDistributedLayout;
import feathers.controls.LayoutGroup;
import openfl.Assets;
import feathers.text.TextFormat;
import model.Constants;
import feathers.skins.RectangleSkin;
import feathers.controls.Header;
import feathers.events.FeathersEvent;
import feathers.controls.Panel;
import t9.util.ColorTraces.*;
class ConfirmationPanel extends Panel {
private var head:Header;
private var foot:LayoutGroup;
private var b1:Button;
private var b2:Button;
private var mainLabel:Label;
public function new(pB1Text:String, pB2Text:String) {
super();
head = new Header();
mainLabel = new Label();
foot = new LayoutGroup();
b1 = new Button(pB1Text);
b2 = new Button(pB2Text);
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
}
override private function initialize():Void {
super.initialize();
// general
//autoSizeMode = STAGE;
width = stage.stageWidth - (Constants.GLOBAL_PADDING * 2);
height = stage.stageHeight - (Constants.GLOBAL_PADDING * 2);
setPadding(Constants.GLOBAL_PADDING);
var hl:VerticalLayout = new VerticalLayout();
hl.verticalAlign = VerticalAlign.MIDDLE;
hl.horizontalAlign = HorizontalAlign.JUSTIFY;
layout = hl;
var bkg1:RectangleSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR3, 1));
bkg1.cornerRadius = Constants.GLOBAL_CORNER_RADIUS;
backgroundSkin = bkg1;
// header
var bkg2:RectangleSkin = new RectangleSkin(SolidColor(Constants.WARNING, 1));
bkg2.cornerRadius = Constants.GLOBAL_CORNER_RADIUS;
head.backgroundSkin = bkg2;
head.height = Std.int(stage.stageHeight * Constants.MAIN_HEADER_HEIGHT_RATIO);
head.textFormat = new TextFormat(Assets.getFont(Constants.MONTSERRAT_MEDIUM_500).fontName, Constants.FONT_SIZE_22, Constants.MAIN_COLOR3);
head.text = Strings.CP_S1;
header = head;
// content
var mainLabelTF:TextFormat = new TextFormat(Assets.getFont(Constants.MONTSERRAT_MEDIUM_500).fontName, Constants.FONT_SIZE_22, Constants.MAIN_COLOR1);
mainLabelTF.align = TextFormatAlign.CENTER;
mainLabel.embedFonts = true;
mainLabel.wordWrap = true;
mainLabel.textFormat = mainLabelTF;
mainLabel.setPadding(Constants.GLOBAL_PADDING * 8);
//mainLabel.backgroundSkin = new RectangleSkin(SolidColor(Constants.WARNING, 1));
mainLabel.text = Strings.CP_S4 + AppModelLocator.getInstance().selectedRider.firstName;
addChild(mainLabel);
// buttons
b1.icon = SVGIconFactory.makeIcon("vector/cancel_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.HERO_COLOR);
b1.setIconForState(ButtonState.DOWN, SVGIconFactory.makeIcon("vector/cancel_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.MAIN_COLOR3));
b1.variant = LPTCTheme.BUTTON_VARIANT_WHITE;
b1.addEventListener(TriggerEvent.TRIGGER, (e) -> {
PopUpManager.removePopUp(this);
});
b2.icon = SVGIconFactory.makeIcon("vector/check_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.MAIN_COLOR3);
b2.setIconForState(ButtonState.DOWN, SVGIconFactory.makeIcon("vector/check_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.HERO_COLOR));
// footer
foot.height = Std.int(stage.stageHeight * Constants.MAIN_HEADER_HEIGHT_RATIO);
var bkg3:RectangleSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR3, 1));
bkg3.cornerRadius = Constants.GLOBAL_CORNER_RADIUS;
foot.backgroundSkin = bkg3;
var hdl:HorizontalDistributedLayout = new HorizontalDistributedLayout();
hdl.verticalAlign = VerticalAlign.MIDDLE;
hdl.gap = Constants.GLOBAL_PADDING;
hdl.setPadding(Constants.GLOBAL_PADDING);
foot.layout = hdl;
foot.addChild(b1);
foot.addChild(b2);
footer = foot;
}
private function onCreationComplete(event:FeathersEvent):Void {
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
}
}
+2
View File
@@ -1,5 +1,6 @@
package view;
import feathers.core.PopUpManager;
import components.VSpacer;
import feathers.controls.AssetLoader;
import feathers.controls.Button;
@@ -142,6 +143,7 @@ class RiderCardDrawer extends Drawer {
removeOneCredit.text = Strings.RCD_S2;
removeOneCredit.addEventListener(TriggerEvent.TRIGGER, (e) -> {
traceRed("removeOneCredit()");
PopUpManager.addPopUp(new ConfirmationPanel(Strings.CP_S2, Strings.CP_S3), parent, true, true);
});
mainScrollContainer.addChild(removeOneCredit);