futire Drawer button addition
This commit is contained in:
@@ -21,16 +21,19 @@ import view.MainPanel;
|
|||||||
|
|
||||||
class LPTCManager2026 extends Application {
|
class LPTCManager2026 extends Application {
|
||||||
|
|
||||||
private var model:AppModelLocator = AppModelLocator.getInstance();
|
private var model:AppModelLocator;
|
||||||
private var services:Services = new Services();
|
private var services:Services;
|
||||||
private var appController:AppController = new AppController();
|
private var appController:AppController;
|
||||||
private var mainPanel:MainPanel = new MainPanel();
|
private var mainPanel:MainPanel;
|
||||||
|
|
||||||
// private var nav:StackNavigator;
|
// private var nav:StackNavigator;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
model = AppModelLocator.getInstance();
|
||||||
|
services = new Services();
|
||||||
|
appController = new AppController();
|
||||||
|
|
||||||
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
||||||
|
|
||||||
@@ -42,6 +45,7 @@ class LPTCManager2026 extends Application {
|
|||||||
stage.displayState = NORMAL;
|
stage.displayState = NORMAL;
|
||||||
stage.scaleMode = NO_SCALE;
|
stage.scaleMode = NO_SCALE;
|
||||||
|
|
||||||
|
mainPanel = new MainPanel();
|
||||||
addChild(mainPanel);
|
addChild(mainPanel);
|
||||||
|
|
||||||
/*mainPanel = new Panel();
|
/*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;
|
package view;
|
||||||
|
|
||||||
|
import feathers.events.TriggerEvent;
|
||||||
|
import feathers.controls.Button;
|
||||||
import feathers.layout.HorizontalLayout;
|
import feathers.layout.HorizontalLayout;
|
||||||
import feathers.layout.AnchorLayoutData;
|
import feathers.layout.AnchorLayoutData;
|
||||||
import feathers.text.TextFormat;
|
import feathers.text.TextFormat;
|
||||||
@@ -18,6 +20,7 @@ import t9.util.ColorTraces.*;
|
|||||||
class MainHeader extends LayoutGroup {
|
class MainHeader extends LayoutGroup {
|
||||||
|
|
||||||
private var lb1:Label;
|
private var lb1:Label;
|
||||||
|
private var dBtn:Button;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
@@ -46,6 +49,12 @@ class MainHeader extends LayoutGroup {
|
|||||||
l.paddingLeft = l.paddingRight = Std.int(headerHeight * .3);
|
l.paddingLeft = l.paddingRight = Std.int(headerHeight * .3);
|
||||||
l.paddingTop = l.paddingBottom = Std.int(headerHeight * .2);
|
l.paddingTop = l.paddingBottom = Std.int(headerHeight * .2);
|
||||||
layout = l;
|
layout = l;
|
||||||
|
|
||||||
|
// Drawer button
|
||||||
|
dBtn = new Button("menu");
|
||||||
|
dBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
||||||
|
addChild(dBtn);
|
||||||
|
|
||||||
|
|
||||||
// Title label
|
// Title label
|
||||||
lb1 = new Label();
|
lb1 = new Label();
|
||||||
@@ -63,4 +72,9 @@ class MainHeader extends LayoutGroup {
|
|||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
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 {
|
class MainPanel extends Panel {
|
||||||
|
|
||||||
private var mh:MainHeader;
|
private var mh:MainHeader;
|
||||||
|
private var mf:MainFooter;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
@@ -24,6 +25,9 @@ class MainPanel extends Panel {
|
|||||||
|
|
||||||
mh = new MainHeader();
|
mh = new MainHeader();
|
||||||
addChild(mh);
|
addChild(mh);
|
||||||
|
|
||||||
|
mf = new MainFooter();
|
||||||
|
addChild(mf);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
|
|||||||
Reference in New Issue
Block a user