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


C# Entry.ModifyBg方法代码示例

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


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

示例1: ProjectPropertyWidget

        public ProjectPropertyWidget(Project project)
        {
            this.project = project;

            Table mainTable = new Table(2,1,false);
            Table propertyTable = new Table(5,2,false);

            Label lblFN = new Label(System.IO.Path.GetFileName(project.ProjectName));
            lblFN.UseUnderline = false;
            lblFN.Selectable = true;
            lblFN.Xalign = 0;

            /*prjDir.LabelProp = this.project.RelativeAppFilePath;
            prjFullPath.LabelProp  = this.project.AbsolutProjectDir;*/

            Entry entr = new Entry(this.project.RelativeAppFilePath);
            entr.ModifyBg(StateType.Normal,this.Style.Background(StateType.Normal));
            entr.IsEditable = false;

            Entry entrFullPath = new Entry(this.project.AbsolutProjectDir);
            entrFullPath.IsEditable = false;

            Entry entrFacebookApi = new Entry(this.project.FacebookAppID);
            entrFacebookApi.Changed+= delegate(object sender, EventArgs e)
            {
                this.project.FacebookAppID = entrFacebookApi.Text;
            };

            Entry entrTitle = new Entry(this.project.AppFile.Title);
            entrTitle.Changed+= delegate(object sender, EventArgs e)
            {
                try{
                    this.project.AppFile.Title = entrTitle.Text;
                } catch (Exception ex){
                    Moscrif.IDE.Tool.Logger.Error(ex.Message);
                }
            };

            ComboBox cbType = new ComboBox();
            ListStore projectModel = new ListStore(typeof(string), typeof(string));
            CellRendererText textRenderer = new CellRendererText();
            cbType.PackStart(textRenderer, true);
            cbType.AddAttribute(textRenderer, "text", 0);
            cbType.Model= projectModel;
            TreeIter ti = new TreeIter();
            foreach(SettingValue ds in MainClass.Settings.ApplicationType){// MainClass.Settings.InstallLocations){
                if(ds.Value == this.project.ApplicationType){
                    ti = projectModel.AppendValues(ds.Display,ds.Value);
                    cbType.SetActiveIter(ti);
                } else  projectModel.AppendValues(ds.Display,ds.Value);
            }
            if(cbType.Active <0)
                cbType.Active =0;
            cbType.Changed+= delegate(object sender, EventArgs e) {
                TreeIter tiSelect = new TreeIter();
                cbType.GetActiveIter(out tiSelect);
                string text = cbType.Model.GetValue(tiSelect,1).ToString();
                project.ApplicationType =text;
            };

            AddControl(ref propertyTable,0,lblFN,"Project ");
            AddControl(ref propertyTable,1,entr,"Project App ");
            AddControl(ref propertyTable,2,entrFullPath,"Project Path ");
            AddControl(ref propertyTable,3,entrTitle,"Title ");
            AddControl(ref propertyTable,4,cbType,"Type ");
            AddControl(ref propertyTable,5,entrFacebookApi,"Facebook ID ");

            mainTable.Attach(propertyTable,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            /*int rowCount = project.ConditoinsDefine.Count;
            Table conditionsTable = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;
            foreach (Condition cd in project.ConditoinsDefine) {
                GenerateContent(ref conditionsTable, cd.Name, i, cd,false);
                i++;
            }
            mainTable.Attach(conditionsTable,0,1,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
            */
            this.PackStart(mainTable,true,true,0);
            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:84,代码来源:ProjectPropertyWidget.cs

示例2: CreateEditWidget

        private Widget CreateEditWidget()
        {
            statusEntry = new Entry ();
            statusEntry.ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            statusEntry.Activated += OnStatusEntryActivated;
            statusEntry.KeyPressEvent += OnStatusEntryKeyPressEvent;
            statusEntry.Show ();

            return statusEntry;
        }
开发者ID:GNOME,项目名称:banter,代码行数:10,代码来源:StatusEntry.cs


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