1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import Tool from '../Systems/Tool';
- import { View , Text , Button , TextInput , StyleSheet} from 'react-native';
- import { Icon } from 'react-native-elements'
- import React from 'react';
- import Library from 'trapilib/dist/lib';
- let {
- CoreSystem,
- ViewSystem,
- ViewNode,
- Node
- } = Library;
- export default class Add extends Tool{
- constructor(){
- super()
- this.selectedNode = null;
- }
- editViewNode(CS,node){
- if(!node) return;
-
- if( this.selectedNode ) {
- this.selectedNode.props.selected = false;
-
- }
- node.props = {
- ...node.props,
- selected: true
- }
- this.selectedNode = node;
- let viewName = CS.Routing.getCurrentView();
- let View = CS.ViewSystem.getView(viewName);
- let rows = View.getRows(this.selectedNode);
- View.setRows(this.selectedNode,rows.length + 1)
- rows = View.getRows(this.selectedNode)
- console.log(rows[rows.length-1])
- View.setColumns(rows[rows.length-1],1)
- rows[rows.length-1].props.selected = true;
- /*
- rows.forEach((row) => {
- View.setColumns(row,1);
- row.props.selected = true})
- */
- }
- render(){
- return(
- <View style={{backgroundColor:"red"}}>
- <Button style={{backgroundColor:"red"}}
- title={<Icon name='add'
- color="#606060"
- />}
- />
-
- </View>
- )
- }
- }
|