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


C# TreeView.QueueDraw方法代码示例

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


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

示例1: WorkspaceTree


//.........这里部分代码省略.........

            icon_column.PackStart (fileNameRenderer, true);
            icon_column.AddAttribute (fileNameRenderer, "markup", NAME_ROW);

            treeView.AppendColumn(icon_column);

            //treeView.AppendColumn("Icon", crp, "pixbuf", ICO_ROW);

            treeView.AppendColumn("Name", fileNameRenderer, "text", NAME_ROW);
            treeView.Columns[NAME_ROW].Visible = false;

            CellRendererText textRenderer = new CellRendererText();
            textRenderer.Ypad =0;

            treeView.AppendColumn("FullPath", textRenderer, "text", PATH_ROW);
            treeView.Columns[PATH_ROW].Visible = false;
            treeView.HeadersVisible = false;
            treeView.EnableTreeLines = true;
            treeView.HoverExpand = false;
            treeView.HoverSelection = false;

            treeView.Columns[NAME_ROW].SetCellDataFunc(fileNameRenderer, new Gtk.TreeCellDataFunc(RenderFileNme));

            sw.ShadowType = ShadowType.Out;
            sw.Add(treeView);

            this.PackEnd(sw, true, true, 0);

            Toolbar toolbar = new Toolbar ();

            refreshButton = new ToolButton ("refresh.png");//Stock.Home);
            refreshButton.IsImportant = true;
            refreshButton.Label = MainClass.Languages.Translate("menu_refresh");
            refreshButton.BorderWidth = 1;
            refreshButton.Clicked+= delegate {
                MainClass.MainWindow.RefreshProject();
            };
            toolbar.Insert (refreshButton, -1);

            Gtk.Menu menuAdd = new Gtk.Menu ();

            MenuItem mi = new MenuItem (MainClass.Languages.Translate("menu_create_file"));
            mi.Activated += delegate(object sender, EventArgs e) {
                NewAction nw = new NewAction();
                nw.Activate();
            };

            menuAdd.Insert (mi, -1);
            mi = new MenuItem (MainClass.Languages.Translate("menu_create_dir"));
            mi.Activated += delegate(object sender, EventArgs e) {
                NewDirectoryAction nw = new NewDirectoryAction();
                nw.Activate();
            };

            menuAdd.Insert (mi, -1);
            menuAdd.ShowAll ();

            mtbCreate= new MenusToolButton(menuAdd,"file-new.png");
            mtbCreate.IsImportant = true;
            mtbCreate.Label = "Create";
            toolbar.Insert (mtbCreate, -1);

            if(MainClass.Settings.LogicalSort == null)
                MainClass.Settings.LogicalSort = LogicalSystem.GetDefaultLogicalSystem();

            Gtk.Menu menuFilter = new Gtk.Menu ();

            MenuItem menuItemFilter = new MenuItem (MainClass.Languages.Translate("all_files") );
            menuItemFilter.Activated += delegate(object sender, EventArgs e) {
                activetFilter = null;
                filter.Refilter();
                treeView.QueueDraw();
            };
            menuFilter.Insert (menuItemFilter, -1);

            foreach (LogicalSystem ls in MainClass.Settings.LogicalSort){
                LogicalSystem lsTemp = ls;
                menuItemFilter = new MenuItem (lsTemp.Display);
                menuItemFilter.Activated += delegate(object sender, EventArgs e) {
                    if (lsTemp != null) {
                        activetFilter = lsTemp;
                    } else {
                        activetFilter = null;
                    }
                    filter.Refilter();
                    treeView.QueueDraw();
                };
                menuFilter.Insert (menuItemFilter, -1);
                //filterModel.AppendValues(ls.Display, "", ls);
            }
            menuFilter.ShowAll();

            MenusToolButton mtbFilter= new MenusToolButton(menuFilter,"filter.png");
            mtbFilter.IsImportant = true;
            mtbFilter.Label = "Filter";
            toolbar.Insert (mtbFilter, -1);
            this.PackStart(toolbar, false, false, 0);
            //this.PackStart(ComboFilter, false, false, 0);
            //ComboFilter.Active = 0;
        }
开发者ID:moscrif,项目名称:ide,代码行数:101,代码来源:WorkspaceTree.cs


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