public class WindowState : Object
{
public Xcls_MainWindow win;
-
+
public enum State {
NONE,
PREVIEW,
public Project.Project project;
public JsRender.JsRender file;
-
-
+
public Xcls_WindowLeftTree left_tree;
public Xcls_WindowAddProp add_props;
this.template_select = new DialogTemplateSelect();
this.children_loaded = true;
- this.left_tree.node_selected.connect((sel) => {
- if (this.file.xtype == "Roo") {
- this.window_rooview.sourceview.nodeSelected(sel);
- } else {
- this.window_gladeview.sourceview.nodeSelected(sel);
- }
- });
+
this.valasource = new Palete.ValaSource();
- this.valasource.compiled.connect(this.valaCompiled);
+ this.valasource.compiled.connect(this.showCompileResult);
this.compile_results = new Xcls_ValaCompileResults();
this.compile_results.window = this.win;
this.left_tree.el.show_all();
this.left_tree.before_node_change.connect(() => {
+ // if the node change is caused by the editor (code preview)
+ if (this.left_tree.view.lastEventSource == "editor") {
+ return true;
+ }
return this.leftTreeBeforeChange();
});
-
- this.left_tree.node_selected.connect((sel) => {
- this.leftTreeNodeSelected(sel);
+
+ this.left_tree.node_selected.connect((sel, source) => {
+ if (source == "editor") {
+ return;
+ }
+ if (this.file.xtype == "Roo") {
+ this.window_rooview.sourceview.nodeSelected(sel,true); // foce scroll.
+ } else {
+ this.window_gladeview.sourceview.nodeSelected(sel);
+ }
+ });
+
+ this.left_tree.node_selected.connect((sel, source) => {
+ this.leftTreeNodeSelected(sel, source);
});
this.left_tree.changed.connect(() => {
-
+ print("LEFT TREE: Changed fired\n");
this.file.save();
if (this.left_tree.getActiveFile().xtype == "Roo" ) {
this.window_rooview.requestRedraw();
return false;
}
- public void leftTreeNodeSelected(JsRender.Node? sel)
+ public void leftTreeNodeSelected(JsRender.Node? sel, string source)
{
print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
}
+
// our project properties is different for Roo and Gtk
// it would be better to change the above code to use this,
public void attachProjectSettings() {
ctr_p.add(this.vala_projectsettings.el);
this.vala_projectsettings.el.show_all();
}
-
-
+ }
+ /*
+ public void fileViewOpenPlain(string fname)
+ {
+
+ this.switchState (State.CODEONLY);
+ this.code_editor.showPlainFile(fname);
}
+ */
+
// --------- webkit view
public void webkitViewInit()
{
}
- public void valaCompiled(Json.Object obj)
+ public void showCompileResult(Json.Object obj)
{
// vala has finished compiling...
print("vala compiled");
this.win.statusbar_run.el.show();
}
if (this.file.xtype == "Gtk") {
-
+ // not sure how this is working ok? - as highlighting is happening on the vala files at present..
var gbuf = this.window_gladeview.sourceview;
gbuf.highlightErrorsJson("ERR", obj);
gbuf.highlightErrorsJson("WARN", obj);