2 * as state management is a bit too complicated inside the builder
3 * it's better to seperate this into this class
5 * This class has references to all the Class instances that make up the window..
8 public class WindowState : Object
10 public MainWindow win;
21 public Xcls_WindowLeftTree left_tree;
22 public Xcls_WindowAddProp add_props;
31 public About(MainWindow win)
44 public void leftTreeInit()
47 this.left_tree = new Xcls_WindowLeftTree();
49 this.left_tree.main_window = _this.win;
51 this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
52 this.left_tree.el.show_all();
54 this.left_tree.before_node_change.connect(() => {
55 return this.leftTreeBeforeChange();
59 this.left_tree.node_selected.connect((sel) => {
60 this.leftTreeNodeSelected(sel);
63 this.left_tree.changed.connect(() => {
64 this.window_rooview.requestRedraw();
65 this.left_tree.model.file.save();
70 public bool leftTreeBeforeChange(JsRender.Node? sel)
72 if (this.state != "codeedit") {
73 this.left_props.finish_editing();
76 if (!this.code_editor.saveContents()) {
82 public void leftTreeNodeSelected(JsRender.Node? sel)
85 print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
88 this.left_props.el.hide();
90 this.left_props.el.show();
91 this.left_props.load(this.left_tree.getActiveFile(), sel);
97 this.rightpalete.clear();
100 this.rightpalete.load(this.left_tree.getActiveFile().palete(), sel.fqn());
106 this.add_props.clear();
109 this.add_props.show(this.left_tree.getActiveFile().palete(), "props", sel.fqn());
115 this.add_props.clear();
118 this.add_props.show(_this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
135 public void propsListInit()
138 this.left_props =new Xcls_LeftProps();
139 this.left_props.ref();
140 this.left_props.main_window = _this;
141 this.win.props.el.pack_start(this.left_props.el,true, true,0);
142 this.left_props.el.show_all();
144 this.left_props.show_editor.connect( (file, node, type, key) => {
145 this.codeEditShow(file, node, type, key);
149 this.left_props.stop_editor.connect( () => {
150 if (this.state != "codeedit") {
154 var ret = this.code_editor.saveContents();
162 this.left_props.changed.connect(() => {
163 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
164 this.window_rooview.requestRedraw();
167 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
169 this.left_tree.model.updateSelected();
170 this.left_tree.model.file.save();
179 // ----------- properties adding list...
180 // listener uses the properties
181 public void propsAddInit()
184 this.add_props = new Xcls_WindowAddProp();
185 this.add_props.ref(); /// really?
186 ((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
187 //this.projectsettings.el.show_all();
189 var stage = _this.win.addpropsview.el.get_stage();
190 stage.set_background_color( Clutter.Color.from_string("#000"));
193 this.add_props.select.connect( (key,type,skel, etype) => {
194 this.left_props.addProp(etype, key, skel, type);
198 public void propsAddShow()
202 public void propsAddHide()
207 // ----------- Add / Edit listener
208 // listener uses the properties
209 public void listenerInit()
213 public void listenerShow()
217 public void listenerHide()