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


C# Notebook.GetTabLabel方法代码示例

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


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

示例1: PublishDialogWizzard


//.........这里部分代码省略.........
            nvOutput.Model = storeOutput;
            Gtk.CellRendererText collumnRenderer = new Gtk.CellRendererText();

            //nvOutput.AppendColumn ("", new Gtk.CellRendererPixbuf (), "pixbuf", 2);
            nvOutput.AppendColumn ("", collumnRenderer, "text", 0);
            nvOutput.AppendColumn ("", collumnRenderer, "text", 1);
            nvOutput.Columns[0].FixedWidth = 200;
            nvOutput.Columns[1].Expand = true;

            //nvOutput.Columns[0].SetCellDataFunc(collumnRenderer, new Gtk.TreeCellDataFunc(RenderOutput));
            //nvOutput.Columns[1].SetCellDataFunc(collumnRenderer, new Gtk.TreeCellDataFunc(RenderOutput));

            this.Title = MainClass.Languages.Translate("publish_title" , project.ProjectName);

            if(project.ProjectUserSetting.CombinePublish == null || project.ProjectUserSetting.CombinePublish.Count==0){
                project.GeneratePublishCombination();
            }

            if(project.DevicesSettings == null || project.DevicesSettings.Count == 0)
                project.GenerateDevices();

            foreach (Rule rl in MainClass.Settings.Platform.Rules){

                if( (rl.Tag == -1 ) && !MainClass.Settings.ShowUnsupportedDevices) continue;
                if( (rl.Tag == -2 ) && !MainClass.Settings.ShowDebugDevices) continue;

                Device dvc = project.DevicesSettings.Find(x => x.TargetPlatformId == rl.Id);
                if (dvc == null) {
                    Console.WriteLine("generate device -{0}",rl.Id);
                    dvc = new Device();
                    dvc.TargetPlatformId = rl.Id;
                    dvc.PublishPropertisMask = project.GeneratePublishPropertisMask(rl.Id);
                    project.DevicesSettings.Add(dvc);
                }
            }

            project.Save();
            notebook = new Notebook();
            GenerateNotebookPages();

            this.vbox2.PackStart(notebook,true,true,0);//PackEnd

            VBox vbox1 = new VBox();

            chbOpenOutputDirectory = new CheckButton( MainClass.Languages.Translate("open_open_directory_after_publish"));
            chbOpenOutputDirectory.Toggled += new EventHandler(OnChbOpenOutputDirectoryToggled);

            chbIncludeAllResolution = new CheckButton( MainClass.Languages.Translate("include_all_resolution"));
            chbIncludeAllResolution.Active = project.IncludeAllResolution;
            chbIncludeAllResolution.Sensitive = false;
            chbIncludeAllResolution.Toggled+= delegate {
                project.IncludeAllResolution =chbIncludeAllResolution.Active;
            };

            vbox1.PackStart(chbIncludeAllResolution,false,false,0);
            vbox3.PackEnd(chbOpenOutputDirectory,false,false,0);

            chbDebugLog = new Gtk.CheckButton(MainClass.Languages.Translate("debug_log_publish"));
            chbDebugLog.Active = MainClass.Settings.LogPublish;
            chbDebugLog.Toggled+= delegate {
                MainClass.Settings.LogPublish =  chbDebugLog.Active;
            };

            vbox1.PackEnd(chbDebugLog,false,false,0);

            this.vbox2.PackEnd(vbox1,false,false,0);

            VBox hbox = new VBox();
            hbox.PackStart(chbSignApp,false,false,0);

            this.vbox2.PackEnd(hbox,false,false,0);

            this.ShowAll();

            int cpage = project.ProjectUserSetting.PublishPage;

            notebook.SwitchPage += delegate(object o, SwitchPageArgs args) {
                project.ProjectUserSetting.PublishPage = notebook.CurrentPage;

                NotebookLabel nl = (NotebookLabel)notebook.GetTabLabel(notebook.CurrentPageWidget);
                chbIncludeAllResolution.Sensitive = false;

                if(nl.Tag == null) return;

                Device d = project.DevicesSettings.Find(x=>(int)x.Devicetype==(int)nl.Tag);
                if(d!=null){
                    if(d.Includes != null){
                        if(d.Includes.Skin!=null){
                            if(!String.IsNullOrEmpty(d.Includes.Skin.Name))
                                chbIncludeAllResolution.Sensitive = true;
                        }
                    }
                }
            };

            chbOpenOutputDirectory.Active = MainClass.Settings.OpenOutputAfterPublish;

            notebook.CurrentPage =cpage;
            btnNext.GrabFocus();
        }
开发者ID:moscrif,项目名称:ide,代码行数:101,代码来源:PublishDialogWizzard.cs

示例2: GetTabOfWidget

 // Is there a better way?
 /// <summary>
 /// Helper function for dealing with clicks on the tab labels, or whatever
 /// widgets the tab label might control. Tests to see which tab the 
 /// indicated objects is on. This lets us identify the tabs associated
 /// with click events, for example.
 /// </summary>
 /// <param name="o">The widget that we are seaching for</param>
 /// <returns>Page number of the tab, or -1 if not found</returns>
 private int GetTabOfWidget(object o, ref Notebook notebook, ref string tabName)
 {
     tabName = null;
     Widget widg = o as Widget;
     if (widg == null)
         return -1;
     notebook = IsControlOnLeft(o) ? notebook1 : notebook2;
     for (int i = 0; i < notebook.NPages; i++)
     {
         // First check the tab labels
         Widget testParent = notebook.GetTabLabel(notebook.GetNthPage(i));
         if (testParent == widg || widg.IsAncestor(testParent))
         {
             tabName = notebook.GetTabLabelText(notebook.GetNthPage(i));
             return i;
         }
         // If not found, check the tab contents
         testParent = notebook.GetNthPage(i);
         if (testParent == widg || widg.IsAncestor(testParent))
         {
             tabName = notebook.GetTabLabelText(notebook.GetNthPage(i));
             return i;
         }
     }
     return -1;
 }
开发者ID:hol353,项目名称:ApsimX,代码行数:35,代码来源:MainView.cs

示例3: PublishDialog

        public PublishDialog()
        {
            project  = MainClass.Workspace.ActualProject;

            this.TransientFor = MainClass.MainWindow;
            this.Build();

            btnResetMatrix.Label = MainClass.Languages.Translate("reset_matrix");
            this.Title = MainClass.Languages.Translate("publish_title" , project.ProjectName);

            if(project.ProjectUserSetting.CombinePublish == null || project.ProjectUserSetting.CombinePublish.Count==0){
                project.GeneratePublishCombination();
            }

            if(project.DevicesSettings == null || project.DevicesSettings.Count == 0)
                project.GenerateDevices();

            foreach (Rule rl in MainClass.Settings.Platform.Rules){

                if( (rl.Tag == -1 ) && !MainClass.Settings.ShowUnsupportedDevices) continue;
                if( (rl.Tag == -2 ) && !MainClass.Settings.ShowDebugDevices) continue;

                Device dvc = project.DevicesSettings.Find(x => x.TargetPlatformId == rl.Id);
                if (dvc == null) {
                    Console.WriteLine("generate device -{0}",rl.Id);
                    dvc = new Device();
                    dvc.TargetPlatformId = rl.Id;
                    dvc.PublishPropertisMask = project.GeneratePublishPropertisMask(rl.Id);
                    project.DevicesSettings.Add(dvc);
                }
            }
            project.Save();
            notebook = new Notebook();
            GenerateNotebookPages();

            this.vbox2.PackStart(notebook,true,true,0);//PackEnd

            VBox vbox1 = new VBox();

            chbOpenOutputDirectory = new CheckButton( MainClass.Languages.Translate("open_open_directory_after_publish"));
            chbOpenOutputDirectory.Toggled += new EventHandler(OnChbOpenOutputDirectoryToggled);

            chbIncludeAllResolution = new CheckButton( MainClass.Languages.Translate("include_all_resolution"));
            chbIncludeAllResolution.Active = project.IncludeAllResolution;
            chbIncludeAllResolution.Sensitive = false;
            chbIncludeAllResolution.Toggled+= delegate {
                project.IncludeAllResolution =chbIncludeAllResolution.Active;
            };

            vbox1.PackStart(chbIncludeAllResolution,false,false,0);
            vbox1.PackEnd(chbOpenOutputDirectory,false,false,0);

            chbDebugLog = new Gtk.CheckButton(MainClass.Languages.Translate("debug_log_publish"));
            //MainClass.Settings.LogPublish =false;
            chbDebugLog.Active = MainClass.Settings.LogPublish;
            chbDebugLog.Toggled+= delegate {
                MainClass.Settings.LogPublish =  chbDebugLog.Active;
            };

            vbox1.PackEnd(chbDebugLog,false,false,0);

            this.vbox2.PackEnd(vbox1,false,false,0);
            //this.vbox2.PackEnd(chbOpenOutputDirectory,false,false,0);//

            chbSignApp= new CheckButton( MainClass.Languages.Translate("sign_app"));
            chbSignApp.Toggled += new EventHandler(OnChbSignAppToggled);
            chbSignApp.Sensitive = true;//MainClass.Settings.SignAllow;
            //this.vbox2.PackEnd(chbSignApp,false,false,0);//

            VBox hbox = new VBox();
            hbox.PackStart(chbSignApp,false,false,0);

            this.vbox2.PackEnd(hbox,false,false,0);

            this.ShowAll();

            int cpage = project.ProjectUserSetting.PublishPage;

            notebook.SwitchPage += delegate(object o, SwitchPageArgs args) {
                project.ProjectUserSetting.PublishPage = notebook.CurrentPage;

                NotebookLabel nl = (NotebookLabel)notebook.GetTabLabel(notebook.CurrentPageWidget);
                chbIncludeAllResolution.Sensitive = false;

                if(nl.Tag == null) return;

                Device d = project.DevicesSettings.Find(x=>(int)x.Devicetype==(int)nl.Tag);
                if(d!=null){
                    if(d.Includes != null){
                        if(d.Includes.Skin!=null){
                            if(!String.IsNullOrEmpty(d.Includes.Skin.Name))
                                chbIncludeAllResolution.Sensitive = true;
                        }
                    }
                }
            };

            chbOpenOutputDirectory.Active = MainClass.Settings.OpenOutputAfterPublish;
            chbSignApp.Active = MainClass.Workspace.SignApp;

//.........这里部分代码省略.........
开发者ID:moscrif,项目名称:ide,代码行数:101,代码来源:PublishDialog.cs


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