- public class Xcls_buttonbar : Object
- {
- public Gtk.Box el;
- private Xcls_PopoverProperty _this;
-
-
- // my vars (def)
-
- // ctor
- public Xcls_buttonbar(Xcls_PopoverProperty _owner )
- {
- _this = _owner;
- _this.buttonbar = this;
- this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
-
- // my vars (dec)
-
- // set gobject values
- this.el.margin_top = 20;
- var child_1 = new Xcls_Button18( _this );
- child_1.ref();
- this.el.append( child_1.el );
- var child_2 = new Xcls_Button19( _this );
- child_2.ref();
- this.el.append( child_2.el );
- }
-
- // user defined functions
- }
- public class Xcls_Button18 : Object
- {
- public Gtk.Button el;
- private Xcls_PopoverProperty _this;
-
-
- // my vars (def)
- public bool always_show_image;
-
- // ctor
- public Xcls_Button18(Xcls_PopoverProperty _owner )
- {
- _this = _owner;
- this.el = new Gtk.Button();
-
- // my vars (dec)
- this.always_show_image = true;
-
- // set gobject values
- this.el.hexpand = true;
- this.el.label = "Cancel";
-
- //listeners
- this.el.clicked.connect( () => {
- _this.prop = null;
- _this.is_new = false;
- _this.kname.el.set_text("Cancel");
- _this.el.hide();
-
- });
- }
-
- // user defined functions
- }
-
- public class Xcls_Button19 : Object
- {
- public Gtk.Button el;
- private Xcls_PopoverProperty _this;
-
-
- // my vars (def)
- public bool always_show_image;
-
- // ctor
- public Xcls_Button19(Xcls_PopoverProperty _owner )
- {
- _this = _owner;
- this.el = new Gtk.Button();
-
- // my vars (dec)
- this.always_show_image = true;
-
- // set gobject values
- this.el.hexpand = true;
- this.el.label = "Add Property";
-
- //listeners
- this.el.clicked.connect( () => {
- // check if text is not empty..
- if ( _this.kname.el.get_text().strip().length < 1) {
-
- // error should already be showing?
- return;
- }
-
- // since we can't add listeners?!?!?
- // only check props.
- // check if property already exists in node.
-
-
- var prop = new JsRender.NodeProp(
- _this.kname.el.get_text().strip(),
- _this.ptype.getValue(),
- _this.ktype.el.get_text().strip(),
- _this.prop.val
- );
-
- if (_this.node.props.has_key(prop.to_index_key())) {
- _this.error.setError("Property already exists");
- return;
- }
-
-
-
- _this.node.add_prop(prop);
- // hide self
- _this.prop = null; // skip checks..
- _this.is_new = false;
- _this.el.hide();
- _this.mainwindow.windowstate.left_props.changed();
- _this.mainwindow.windowstate.left_props.view.editProp(prop);
-
-
-
- });
- }
-
- // user defined functions
- }
-
-