projects
/
app.Builder.js
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7aa305d
)
Sample/Editor.js
author
Alan Knowles
<alan@akbkhome.com>
Mon, 1 Nov 2010 02:42:46 +0000
(10:42 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Mon, 1 Nov 2010 02:42:46 +0000
(10:42 +0800)
Sample/Editor.js
patch
|
blob
|
history
diff --git
a/Sample/Editor.js
b/Sample/Editor.js
index
c52feb5
..
287683b
100644
(file)
--- a/
Sample/Editor.js
+++ b/
Sample/Editor.js
@@
-52,6
+52,12
@@
Editor=new XObject({
items : [
{
xtype: Gtk.Button,
items : [
{
xtype: Gtk.Button,
+ listeners : {
+ activate : function (self) {
+ this.get('/Editor.RightEditor').save();
+ }
+ },
+ id : "save_button",
label : "Save"
}
]
label : "Save"
}
]
@@
-63,6
+69,7
@@
Editor=new XObject({
save : function() {
this.get('/LeftPanel.model').changed( str , false);
this.get('/Editor').dirty = false;
save : function() {
this.get('/LeftPanel.model').changed( str , false);
this.get('/Editor').dirty = false;
+ this.get('/Editor.save_button').el.sensitive = false;
},
items : [
{
},
items : [
{
@@
-117,11
+124,11
@@
Editor=new XObject({
buf.move_mark(cursor, iter);
this.get('/Editor').dirty = false;
this.el.grab_focus();
buf.move_mark(cursor, iter);
this.get('/Editor').dirty = false;
this.el.grab_focus();
+ this.get('/Editor.save_button').el.sensitive = false;
},
save : function() {
},
save : function() {
- var str = this.get('buffer').toString();
- print("SAVE" + str);
- this.get('/LeftPanel.model').changed( str , false);
+
+ this.get('/Editor.RightEditor').save();
},
show_line_numbers : true,
items : [
},
show_line_numbers : true,
items : [
@@
-130,9
+137,12
@@
Editor=new XObject({
listeners : {
changed : function (self) {
listeners : {
changed : function (self) {
- this.checkSyntax();
+ if(this.checkSyntax()) {
+ this.get('/Editor.save_button').el.sensitive = true;
+ }
// print("EDITOR CHANGED");
this.get('/Editor').dirty = true;
// print("EDITOR CHANGED");
this.get('/Editor').dirty = true;
+
// this.get('/LeftPanel.model').changed( str , false);
return false;
}
// this.get('/LeftPanel.model').changed( str , false);
return false;
}