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;
22 public Xcls_WindowLeftTree left_tree;
23 public Xcls_WindowAddProp add_props;
24 public Xcls_LeftProps left_props;
32 public About(MainWindow win)
45 public void leftTreeInit()
48 this.left_tree = new Xcls_WindowLeftTree();
50 this.left_tree.main_window = _this.win;
52 this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
53 this.left_tree.el.show_all();
55 this.left_tree.before_node_change.connect(() => {
56 return this.leftTreeBeforeChange();
60 this.left_tree.node_selected.connect((sel) => {
61 this.leftTreeNodeSelected(sel);
64 this.left_tree.changed.connect(() => {
65 this.window_rooview.requestRedraw();
66 this.left_tree.model.file.save();
71 public bool leftTreeBeforeChange(JsRender.Node? sel)
73 if (this.state != "codeedit") {
74 this.left_props.finish_editing();
77 if (!this.code_editor.saveContents()) {
83 public void leftTreeNodeSelected(JsRender.Node? sel)
86 print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
89 this.left_props.el.hide();
91 this.left_props.el.show();
92 this.left_props.load(this.left_tree.getActiveFile(), sel);
98 this.rightpalete.clear();
101 this.rightpalete.load(this.left_tree.getActiveFile().palete(), sel.fqn());
107 this.add_props.clear();
110 this.add_props.show(this.left_tree.getActiveFile().palete(), "props", sel.fqn());
116 this.add_props.clear();
119 this.add_props.show(_this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
136 public void propsListInit()
139 this.left_props =new Xcls_LeftProps();
140 this.left_props.ref();
141 this.left_props.main_window = _this;
142 this.win.props.el.pack_start(this.left_props.el,true, true,0);
143 this.left_props.el.show_all();
145 this.left_props.show_editor.connect( (file, node, type, key) => {
146 this.codeEditShow(file, node, type, key);
150 this.left_props.stop_editor.connect( () => {
151 if (this.state != "codeedit") {
155 var ret = this.code_editor.saveContents();
163 this.left_props.changed.connect(() => {
164 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
165 this.window_rooview.requestRedraw();
168 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
170 this.left_tree.model.updateSelected();
171 this.left_tree.model.file.save();
180 // ----------- properties adding list...
181 // listener uses the properties
182 public void propsAddInit()
185 this.add_props = new Xcls_WindowAddProp();
186 this.add_props.ref(); /// really?
187 ((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
188 //this.projectsettings.el.show_all();
190 var stage = _this.win.addpropsview.el.get_stage();
191 stage.set_background_color( Clutter.Color.from_string("#000"));
194 this.add_props.select.connect( (key,type,skel, etype) => {
195 this.left_props.addProp(etype, key, skel, type);
199 public void propsAddShow()
203 public void propsAddHide()
208 // ----------- Add / Edit listener
209 // listener uses the properties
210 public void listenerInit()
214 public void listenerShow()
218 public void listenerHide()