futire Drawer button addition
This commit is contained in:
@@ -21,16 +21,19 @@ import view.MainPanel;
|
||||
|
||||
class LPTCManager2026 extends Application {
|
||||
|
||||
private var model:AppModelLocator = AppModelLocator.getInstance();
|
||||
private var services:Services = new Services();
|
||||
private var appController:AppController = new AppController();
|
||||
private var mainPanel:MainPanel = new MainPanel();
|
||||
private var model:AppModelLocator;
|
||||
private var services:Services;
|
||||
private var appController:AppController;
|
||||
private var mainPanel:MainPanel;
|
||||
|
||||
// private var nav:StackNavigator;
|
||||
|
||||
public function new() {
|
||||
|
||||
super();
|
||||
model = AppModelLocator.getInstance();
|
||||
services = new Services();
|
||||
appController = new AppController();
|
||||
|
||||
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
||||
|
||||
@@ -42,6 +45,7 @@ class LPTCManager2026 extends Application {
|
||||
stage.displayState = NORMAL;
|
||||
stage.scaleMode = NO_SCALE;
|
||||
|
||||
mainPanel = new MainPanel();
|
||||
addChild(mainPanel);
|
||||
|
||||
/*mainPanel = new Panel();
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package view;
|
||||
|
||||
import model.Constants;
|
||||
import components.NekoRectangle;
|
||||
import feathers.events.FeathersEvent;
|
||||
import feathers.controls.LayoutGroup;
|
||||
import t9.util.ColorTraces.*;
|
||||
|
||||
class MainFooter extends LayoutGroup {
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
|
||||
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
||||
}
|
||||
|
||||
override private function initialize():Void {
|
||||
super.initialize();
|
||||
final sw:Int = stage.stageWidth;
|
||||
final sh:Int = stage.stageHeight;
|
||||
final footerWidth = Std.int(sw * Constants.MAIN_HEADER_WIDTH_RATIO);
|
||||
final footerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||
|
||||
autoSizeMode = CONTENT;
|
||||
backgroundSkin = new NekoRectangle( Constants.MAIN_COLOR2,
|
||||
0,
|
||||
sh - footerHeight,
|
||||
footerWidth,
|
||||
footerHeight);
|
||||
variant = LayoutGroup.VARIANT_TOOL_BAR;
|
||||
}
|
||||
|
||||
private function onCreationComplete(event:FeathersEvent):Void {
|
||||
traceBlue(this + " --> onCreationComplete()");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package view;
|
||||
|
||||
import feathers.events.TriggerEvent;
|
||||
import feathers.controls.Button;
|
||||
import feathers.layout.HorizontalLayout;
|
||||
import feathers.layout.AnchorLayoutData;
|
||||
import feathers.text.TextFormat;
|
||||
@@ -18,6 +20,7 @@ import t9.util.ColorTraces.*;
|
||||
class MainHeader extends LayoutGroup {
|
||||
|
||||
private var lb1:Label;
|
||||
private var dBtn:Button;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
@@ -47,6 +50,12 @@ class MainHeader extends LayoutGroup {
|
||||
l.paddingTop = l.paddingBottom = Std.int(headerHeight * .2);
|
||||
layout = l;
|
||||
|
||||
// Drawer button
|
||||
dBtn = new Button("menu");
|
||||
dBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
||||
addChild(dBtn);
|
||||
|
||||
|
||||
// Title label
|
||||
lb1 = new Label();
|
||||
//lb1.backgroundSkin = new NekoRectangle(Constants.ACCENT_COLOR2);
|
||||
@@ -63,4 +72,9 @@ class MainHeader extends LayoutGroup {
|
||||
private function onCreationComplete(event:FeathersEvent):Void {
|
||||
traceBlue(this + " --> onCreationComplete()");
|
||||
}
|
||||
|
||||
function onDBtnPress(event:TriggerEvent):Void {
|
||||
var button = cast(event.currentTarget, Button);
|
||||
trace("button triggered: " + button.text);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import t9.util.ColorTraces.*;
|
||||
class MainPanel extends Panel {
|
||||
|
||||
private var mh:MainHeader;
|
||||
private var mf:MainFooter;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
@@ -24,6 +25,9 @@ class MainPanel extends Panel {
|
||||
|
||||
mh = new MainHeader();
|
||||
addChild(mh);
|
||||
|
||||
mf = new MainFooter();
|
||||
addChild(mf);
|
||||
}
|
||||
|
||||
private function onCreationComplete(event:FeathersEvent):Void {
|
||||
|
||||
Reference in New Issue
Block a user