当前位置: 首页>>代码示例>>C#>>正文


C# TreeView.ModifyFont方法代码示例

本文整理汇总了C#中Gtk.TreeView.ModifyFont方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.ModifyFont方法的具体用法?C# TreeView.ModifyFont怎么用?C# TreeView.ModifyFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.TreeView的用法示例。


在下文中一共展示了TreeView.ModifyFont方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BookmarkOutput

        public BookmarkOutput()
        {
            this.ShadowType = ShadowType.Out;
            treeView = new TreeView();
            treeView.Selection.Mode = Gtk.SelectionMode.Single;

            treeView.Model = outputModel;

            FontDescription customFont =  Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            treeView.ModifyFont(customFont);

            TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Line"),  new CellRendererText(), "text", 1);
            tvcState.MinWidth = 25;
            treeView.AppendColumn(tvcState);

            TreeViewColumn tvcName = new TreeViewColumn (MainClass.Languages.Translate("file"),  new CellRendererText(), "text", 0);
            tvcName.MinWidth = 100;
            treeView.AppendColumn(tvcName);

            TreeViewColumn tvcText = new TreeViewColumn (MainClass.Languages.Translate("name"),  new CellRendererText(), "text", 2);
            tvcText.MinWidth = 100;
            treeView.AppendColumn(tvcText);

            treeView.HeadersVisible = true;
            treeView.EnableTreeLines = true;

            treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
            treeView.EnableSearch =false;
            treeView.HasFocus = false;

            this.Add(treeView);

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:34,代码来源:BookmarkOutput.cs

示例2: DataGrid

		public DataGrid () : base(false, 4) 
		{		
			ScrolledWindow sw = new ScrolledWindow ();
			this.PackStart (sw, true, true, 0);

			treeView = new TreeView (store);
			treeView.HeadersVisible = true;
			treeView.ModifyFont (Pango.FontDescription.FromString ("courier new"));

			gridColumns = new ArrayList(0);

			sw.Add (treeView);

			store = new ListStore (GLib.GType.String);
			dataMember = "";
			dataSource = null;
		}
开发者ID:emtees,项目名称:old-code,代码行数:17,代码来源:DataGrid.cs

示例3: ProcessOutput

        public ProcessOutput()
        {
            this.ShadowType = ShadowType.Out;
            treeView = new TreeView();
            treeView.Selection.Mode = Gtk.SelectionMode.Single;

            treeView.Model = outputModel;

            FontDescription customFont =  Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            treeView.ModifyFont(customFont);

            TreeViewColumn tvcName = new TreeViewColumn (MainClass.Languages.Translate("Name"),  new CellRendererText(), "text", 0);
            tvcName.MinWidth = 100;
            treeView.AppendColumn(tvcName);
            TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Stat"),  new CellRendererText(), "text", 1);
            tvcState.MinWidth = 100;
            treeView.AppendColumn(tvcState);
            TreeViewColumn tvcMessage = new TreeViewColumn (MainClass.Languages.Translate("Message"),  new CellRendererText(), "text", 2);
            tvcMessage.MinWidth = 100;
            treeView.AppendColumn(tvcMessage);
            TreeViewColumn tvcPlace = new TreeViewColumn (MainClass.Languages.Translate("Place"),  new CellRendererText(), "text", 3);
            tvcPlace.MinWidth = 100;
            treeView.AppendColumn(tvcPlace);

            treeView.HeadersVisible = true;
            treeView.EnableTreeLines = true;

            treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
            treeView.EnableSearch =false;
            treeView.HasFocus = false;

            outputDispatcher = new GLib.TimeoutHandler(OutputDispatchHandler);

            this.Add(treeView);

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:37,代码来源:ProcessOutput.cs

示例4: ErrorOutput

        public ErrorOutput()
        {
            this.ShadowType = ShadowType.Out;
            treeView = new TreeView();
            treeView.Selection.Mode = Gtk.SelectionMode.Single;

            treeView.Model = outputModel;

            FontDescription customFont =  Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            treeView.ModifyFont(customFont);

            //treeView.AppendColumn("Name", new CellRendererText(), "text", 0);
            //treeView.AppendColumn("Stat", new CellRendererText(), "text", 1);
            //treeView.AppendColumn("Message", new CellRendererText(), "text", 2);
            //treeView.AppendColumn("Place", new CellRendererText(), "text", 3);

            TreeViewColumn tvcName = new TreeViewColumn (MainClass.Languages.Translate("file"),  new CellRendererText(), "text", 0);
            tvcName.MinWidth = 100;
            tvcName.Resizable = true;
            treeView.AppendColumn(tvcName);
            TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Line"),  new CellRendererText(), "text", 1);
            tvcState.MinWidth = 25;
            tvcState.Resizable = true;
            treeView.AppendColumn(tvcState);
            TreeViewColumn tvcMessage = new TreeViewColumn (MainClass.Languages.Translate("message"),  new CellRendererText(), "text", 2);
            tvcMessage.MinWidth = 100;
            tvcMessage.Resizable = true;
            treeView.AppendColumn(tvcMessage);
            TreeViewColumn tvcPlace = new TreeViewColumn (MainClass.Languages.Translate("location"),  new CellRendererText(), "text", 3);
            tvcPlace.MinWidth = 100;
            tvcPlace.Resizable = true;
            treeView.AppendColumn(tvcPlace);

            treeView.HeadersVisible = true;
            treeView.EnableTreeLines = true;

            treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
            treeView.EnableSearch =false;
            treeView.HasFocus = false;

            treeView.ButtonReleaseEvent += delegate(object o, ButtonReleaseEventArgs args) {
                if (args.Event.Button != 3) return;

                Menu popupMenu = new Menu();

                MenuItem miClear = new MenuItem( MainClass.Languages.Translate("clear" ));
                miClear.Activated+= delegate(object sender, EventArgs e) {
                    Clear();
                };
                popupMenu.Append(miClear);

                TreeSelection ts = treeView.Selection;
                Gtk.TreePath[] selRow = ts.GetSelectedRows();

                MenuItem miCopy = new MenuItem( MainClass.Languages.Translate("copy_f2" ));
                miCopy.Activated+= delegate(object sender, EventArgs e) {

                    Gtk.TreePath tp = selRow[0];
                    TreeIter ti = new TreeIter();
                    outputModel.GetIter(out ti, tp);
                    string type = outputModel.GetValue(ti, 0).ToString();
                    string timeStamp = outputModel.GetValue(ti, 1).ToString();
                    string message = outputModel.GetValue(ti, 2).ToString();

                    Gtk.Clipboard clipboard = this.GetClipboard(Gdk.Selection.Clipboard);
                    string txt =type +"\t"+timeStamp+"\t"+message;

                    clipboard.Text=txt;

                };
                popupMenu.Append(miCopy);

                if(selRow.Length<1){
                    miCopy.Sensitive = false;
                }
                popupMenu.Popup();
                popupMenu.ShowAll();
            };

            outputDispatcher = new GLib.TimeoutHandler(OutputDispatchHandler);

            this.Add(treeView);

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:85,代码来源:ErrorOutput.cs


注:本文中的Gtk.TreeView.ModifyFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。