コード例 #1
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);
                }
            };
        }
コード例 #2
0
        public ResourceList() : base()
        {
            NameColumn = new LocalizationColumn(true)
            {
                Title = "Name"
            };
            var ValueColumn = new LocalizationColumn(true)
            {
                Title = "Value"
            };
            var CommentColumn = new LocalizationColumn(true)
            {
                Title = "Comment"
            };

            AddCol(NameColumn, 0);
            AddCol(ValueColumn, 1);
            AddCol(CommentColumn, 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);
                }
            };
            this.KeyPressEvent += OnUserKeyPress;
        }
コード例 #3
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);
                }
            };
        }
コード例 #4
0
 private void AddCol(LocalizationColumn col, int index)
 {
     this.AppendColumn(col);
     col.Data.Add("text", index);
     col.AddAttribute("text", index);
 }