|
@@ -3,7 +3,7 @@ import ToolBox from './ToolBox';
|
|
import Keyboard from './keyboard';
|
|
import Keyboard from './keyboard';
|
|
import Mouse from './mouse';
|
|
import Mouse from './mouse';
|
|
import React from 'react';
|
|
import React from 'react';
|
|
-import {Dimensions, StyleSheet, View, Text , Button
|
|
|
|
|
|
+import {Dimensions, StyleSheet, View, Text , Button, TouchableOpacity
|
|
} from 'react-native';
|
|
} from 'react-native';
|
|
import { Icon } from 'react-native-elements'
|
|
import { Icon } from 'react-native-elements'
|
|
import Library from 'trapilib/dist/lib';
|
|
import Library from 'trapilib/dist/lib';
|
|
@@ -168,15 +168,22 @@ export default class Gui extends BaseSystem {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ removeFrame(routeName) {
|
|
|
|
+ this.CoreSystem.removePage(routeName);
|
|
|
|
+ this.forceUpdate();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ addFrame(routeName) {
|
|
|
|
+ if(!routeName)
|
|
|
|
+ routeName = "Page " + (Object.keys(this.CoreSystem.Routing.topology.nodes).length + 1);
|
|
|
|
|
|
- addFrame(routeName = Math.random().toString(36).substring(7)) {
|
|
|
|
let VS = new Library.View();
|
|
let VS = new Library.View();
|
|
let container = VS.getDefaultContainer();
|
|
let container = VS.getDefaultContainer();
|
|
container.props.selected = true;
|
|
container.props.selected = true;
|
|
let mainContent = new ViewNode(Math.random(), 'BaseContainer', {width: 375, height: 667});
|
|
let mainContent = new ViewNode(Math.random(), 'BaseContainer', {width: 375, height: 667});
|
|
VS.setContent(mainContent, container);
|
|
VS.setContent(mainContent, container);
|
|
-
|
|
|
|
this.CoreSystem.addPage(routeName,VS);
|
|
this.CoreSystem.addPage(routeName,VS);
|
|
|
|
+ this.CoreSystem.goto(routeName);
|
|
this.forceUpdate()
|
|
this.forceUpdate()
|
|
}
|
|
}
|
|
renderPageBar(){
|
|
renderPageBar(){
|
|
@@ -187,14 +194,21 @@ export default class Gui extends BaseSystem {
|
|
let textColor = view === currentView ? PageButtons.selectedText :(null)
|
|
let textColor = view === currentView ? PageButtons.selectedText :(null)
|
|
return (
|
|
return (
|
|
<View style={[PageButtons.page , background ] } onClick = {(e) => {
|
|
<View style={[PageButtons.page , background ] } onClick = {(e) => {
|
|
- this.CoreSystem.goto(route)
|
|
|
|
|
|
+ console.log(e);
|
|
|
|
+ this.CoreSystem.goto(route);
|
|
this.forceUpdate()
|
|
this.forceUpdate()
|
|
}}>
|
|
}}>
|
|
<View style = {{ flex:1,
|
|
<View style = {{ flex:1,
|
|
- justifyContent:'center',
|
|
|
|
|
|
+ justifyContent:'space-around',
|
|
|
|
+ flexDirection: 'row',
|
|
alignItems:'center'}}>
|
|
alignItems:'center'}}>
|
|
|
|
|
|
<Text style={[PageButtons.text, textColor]}>{route}</Text>
|
|
<Text style={[PageButtons.text, textColor]}>{route}</Text>
|
|
|
|
+ {view !== currentView && <Text style={[PageButtons.text, textColor, {color: '#77000066'}]} onClick={(e) => {
|
|
|
|
+ this.removeFrame(route);
|
|
|
|
+ e.stopPropagation();
|
|
|
|
+ return false;
|
|
|
|
+ }}>X</Text>}
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
|
|
|