public ResourceList()
            : base()
        {
            NameColumn = new LocalizationColumn (true) { Title = "Name" };
            ValueColumn = new LocalizationColumn (true) { Title = "Value" };
            CommentColumn = new LocalizationColumn (true) { Title = "Comment" };

            this.AppendColumn (NameColumn);
            this.AppendColumn (ValueColumn);
            this.AppendColumn (CommentColumn);

            NameColumn.AddAttribute ("text", 0);
            ValueColumn.AddAttribute ("text", 1);
            CommentColumn.AddAttribute ("text", 2);

            NameColumn.Edited += (_, e) => {
                OnNameEdited(this, e);
                OnResourceAdded(this, e.NextText);
                SetCursor (new TreePath (e.Path), ValueColumn, true);
            };
            ValueColumn.Edited += (_, e) => {
                OnValueEdited (this, e);
                SetCursor (new TreePath (e.Path), CommentColumn, true);
            };
            CommentColumn.Edited += (_, e) => OnCommentEdited (this, e);

            this.ButtonReleaseEvent += (object o, ButtonReleaseEventArgs args) => {
                // Right click event
                if (args.Event.Type == Gdk.EventType.ButtonRelease && args.Event.Button == 3) {
                    RightClicked(this, args);
                }
            };
        }
Beispiel #2
0
        public ResourceList() : base()
        {
            NameColumn = new LocalizationColumn(true)
            {
                Title = "Name"
            };
            ValueColumn = new LocalizationColumn(true)
            {
                Title = "Value"
            };
            CommentColumn = new LocalizationColumn(true)
            {
                Title = "Comment"
            };

            this.AppendColumn(NameColumn);
            this.AppendColumn(ValueColumn);
            this.AppendColumn(CommentColumn);

            NameColumn.AddAttribute("text", 0);
            ValueColumn.AddAttribute("text", 1);
            CommentColumn.AddAttribute("text", 2);

            NameColumn.Edited += (_, e) => {
                OnNameEdited(this, e);
                OnResourceAdded(this, e.NextText);
                SetCursor(new TreePath(e.Path), ValueColumn, true);
            };
            ValueColumn.Edited += (_, e) => {
                OnValueEdited(this, e);
                SetCursor(new TreePath(e.Path), CommentColumn, true);
            };
            CommentColumn.Edited += (_, e) => OnCommentEdited(this, e);

            this.ButtonReleaseEvent += (object o, ButtonReleaseEventArgs args) => {
                // Right click event
                if (args.Event.Type == Gdk.EventType.ButtonRelease && args.Event.Button == 3)
                {
                    RightClicked(this, args);
                }
            };
        }
Beispiel #3
0
 private void AddCol(LocalizationColumn col, int index)
 {
     this.AppendColumn(col);
     col.Data.Add("text", index);
     col.AddAttribute("text", index);
 }