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


C# ComboBoxEntry类代码示例

本文整理汇总了C#中ComboBoxEntry的典型用法代码示例。如果您正苦于以下问题:C# ComboBoxEntry类的具体用法?C# ComboBoxEntry怎么用?C# ComboBoxEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ToolBarComboBox

        public ToolBarComboBox(int width, int activeIndex, bool allowEntry, params string[] contents)
        {
            if (allowEntry)
                ComboBox = new ComboBoxEntry (contents);
            else {
                Model = new ListStore (typeof(string), typeof (object));
                if (contents != null) {
                    foreach (string entry in contents) {
                        Model.AppendValues (entry, null);
                    }
                }
                ComboBox = new ComboBox ();
                ComboBox.Model = Model;
                CellRendererText = new CellRendererText();
                ComboBox.PackStart(CellRendererText, false);
                ComboBox.AddAttribute(CellRendererText,"text",0);
            }

            ComboBox.AddEvents ((int)Gdk.EventMask.ButtonPressMask);
            ComboBox.WidthRequest = width;

            if (activeIndex >= 0)
                ComboBox.Active = activeIndex;

            ComboBox.Show ();

            Add (ComboBox);
            Show ();
        }
开发者ID:RodH257,项目名称:Pinta,代码行数:29,代码来源:ToolBarComboBox.cs

示例2: ToolBarComboBox

		public ToolBarComboBox (int width, int activeIndex, bool allowEntry, params string[] contents)
		{
			if (allowEntry)
				ComboBox = new ComboBoxEntry (contents);
			else {
				Model = new ListStore (typeof(string), typeof (object));

				if (contents != null)
					foreach (string entry in contents)
						Model.AppendValues (entry, null);

				ComboBox = CreateComboBox ();
				ComboBox.Model = Model;
			}

			ComboBox.AddEvents ((int)Gdk.EventMask.ButtonPressMask);
			ComboBox.WidthRequest = width;
			
			if (activeIndex >= 0)
				ComboBox.Active = activeIndex;
			
			ComboBox.Show ();
			
			Add (ComboBox);
			Show ();
		}
开发者ID:RudoCris,项目名称:Pinta,代码行数:26,代码来源:ToolBarComboBox.cs

示例3: OpenLocationDialog

        public OpenLocationDialog () : base (Catalog.GetString ("Open Location"))
        {
            var location_box = new HBox () {
                Spacing = 6
            };

            address_entry = ComboBoxEntry.NewText();
            address_entry.Entry.Activated += (o, e) => Respond (ResponseType.Ok);

            var browse_button = new Button(Catalog.GetString("Browse..."));
            browse_button.Clicked += OnBrowseClicked;

            location_box.PackStart(address_entry, true, true, 0);
            location_box.PackStart(browse_button, false, false, 0);

            VBox.Spacing = 6;
            VBox.PackStart (new Label () {
                Xalign = 0.0f,
                Text = Catalog.GetString (
                    "Enter the address of the file you would like to open:")
                }, false, false, 0);
            VBox.PackStart (location_box, false, false, 0);
            VBox.ShowAll ();

            AddStockButton (Stock.Cancel, ResponseType.Cancel);
            AddStockButton (Stock.Open, ResponseType.Ok, true);

            LoadHistory();

            address_entry.Entry.HasFocus = true;
        }
开发者ID:gclark916,项目名称:banshee,代码行数:31,代码来源:OpenLocationDialog.cs

示例4: OpenRemoteServer

        public OpenRemoteServer () : base (Catalog.GetString ("Open remote DAAP server"), null)
        {
            VBox.Spacing = 6;
            VBox.PackStart (new Label () {
                Xalign = 0.0f,
                Text = Catalog.GetString ("Enter server IP address and port:")
            }, true, true, 0);

            HBox box = new HBox ();
            box.Spacing = 12;
            VBox.PackStart (box, false, false, 0);

            address_entry = ComboBoxEntry.NewText ();
            address_entry.Entry.Activated += OnEntryActivated;
            address_entry.Entry.WidthChars = 30;
            address_entry.Show ();

            port_entry = new SpinButton (1d, 65535d, 1d);
            port_entry.Value = 3689;
            port_entry.Show ();

            box.PackStart (address_entry, true, true, 0);
            box.PackEnd (port_entry, false, false, 0);

            address_entry.HasFocus = true;

            VBox.ShowAll ();

            AddStockButton (Stock.Cancel, ResponseType.Cancel);
            AddStockButton (Stock.Add, ResponseType.Ok, true);

            LoadHistory();
        }
开发者ID:gclark916,项目名称:banshee,代码行数:33,代码来源:OpenRemoteServer.cs

示例5: Initialize

		public void Initialize (EditSession session)
		{
			this.session = session;
			
			//if standard values are supported by the converter, then 
			//we list them in a combo
			if (session.Property.Converter.GetStandardValuesSupported (session))
			{
				ListStore store = new ListStore (typeof (string));
				ComboBoxEntry combo = new ComboBoxEntry (store, 0);
				PackStart (combo, true, true, 0);
				combo.Changed += TextChanged;
				entry = combo.Entry;
				entry.HeightRequest = combo.SizeRequest ().Height;
				
				//but if the converter doesn't allow nonstandard values, 
				// then we make the entry uneditable
				if (session.Property.Converter.GetStandardValuesExclusive (session)) {
					entry.IsEditable = false;
					entry.CanFocus = false;
				}
				
				//fill the list
				foreach (object stdValue in session.Property.Converter.GetStandardValues (session)) {
					store.AppendValues (session.Property.Converter.ConvertToString (session, stdValue));
				}
				
				//a value of "--" gets rendered as a --, if typeconverter marked with UsesDashesForSeparator
				object[] atts = session.Property.Converter.GetType ()
					.GetCustomAttributes (typeof (StandardValuesSeparatorAttribute), true);
				if (atts.Length > 0) {
					string separator = ((StandardValuesSeparatorAttribute)atts[0]).Separator;
					combo.RowSeparatorFunc = delegate (TreeModel model, TreeIter iter) {
						return separator == ((string) model.GetValue (iter, 0));
					};
				}
			}
			// no standard values, so just use an entry
			else {
				entry = new Entry ();
				PackStart (entry, true, true, 0);
			}
			
			//either way we have an entry to play with
			entry.HasFrame = false;
			entry.Activated += TextChanged;
			
			if (ShouldShowDialogButton ()) {
				Button button = new Button ("...");
				PackStart (button, false, false, 0);
				button.Clicked += ButtonClicked;
			}
			
			Spacing = 3;
			ShowAll ();
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:56,代码来源:TextEditor.cs

示例6: ReceiptSaveDialog

        public ReceiptSaveDialog(Window parent, string rawFileName)
            : base()
        {
            mRawFileName = rawFileName;

            // Laying out

            Title = "Save receipt for " + System.IO.Path.GetFileName(mRawFileName);
            SetPosition(WindowPosition.Center);
            SetSizeRequest(450, 180);
            //this.AllowGrow = false;
            this.SkipPagerHint = true;
            this.SkipTaskbarHint = true;
            this.HasSeparator = false;
            Parent = parent;
            mCancelButton = (Button)AddButton("Cancel", ResponseType.Cancel);
            mSaveButton = (Button)AddButton("Save", ResponseType.Accept);
            this.Default = mSaveButton;

            VBox radio_buttons_box = new VBox(false, 2);
            radio_buttons_box.BorderWidth = 6;
            mDefault = new RadioButton("Default receipt for this photo (no name)");
            mCustom = new RadioButton(mDefault, "Custom receipt for this photo");
            mClass = new RadioButton(mDefault, "A common receipt for all photos in the same folder");
            radio_buttons_box.PackStart(mDefault);
            radio_buttons_box.PackStart(mCustom);
            radio_buttons_box.PackStart(mClass);
            VBox.Add(radio_buttons_box);

            HBox name_box = new HBox(false, 8);
            name_box.BorderWidth = 6;
            Image receipt_icon = new Image();
            receipt_icon.Pixbuf = Gdk.Pixbuf.LoadFromResource("CatEye.UI.Gtk.res.png.cestage-small-24x24.png");

            Label name_label = new Label("Name:");

            ListStore name_store = new ListStore(typeof(string));
            mNameComboBoxEntry = new ComboBoxEntry(name_store, 0);

            name_box.PackStart(receipt_icon, false, false, 0);
            name_box.PackStart(name_label, false, false, 0);
            name_box.PackStart(mNameComboBoxEntry, true, true, 0);
            VBox.PackStart(name_box, false, false, 0);

            // Adding events

            Shown += HandleUIChange;
            mDefault.Clicked += HandleUIChange;
            mCustom.Clicked += HandleUIChange;
            mClass.Clicked += HandleUIChange;
            mNameComboBoxEntry.Entry.Changed += HandleUIChange;

            this.ShowAll();
        }
开发者ID:bigfatbrowncat,项目名称:CatEye,代码行数:54,代码来源:ReceiptSaveDialog.cs

示例7: set_setting

		public void set_setting (Setting s)
		{
			if(_s != null)
				throw new Exception("set_setting may only be used once per instance!");
			_s = s;

			name_label.Text = _s.Name;

			if (_s.Choices != null && _s.Limited) {

				// TODO: This is broken, code was originally written to store a string
				// but in this particular case there is a setting with string type
				// and you are given an array of choices, so what should really be
				// stored is a value between 0 and the length of the array; to 
				// indicate which choice is selected. As I am changing User-Agent
				// switcher to "Un Limited" I do not have a use case for this yet.
				ComboBox cobo = new ComboBox ((String[])_s.Choices);
				cobo.SetSizeRequest (100, 20);
				cobo.Name = _s.Name;
				cobo.Changed += cobo_changed;
				vbox2.Add (cobo);
			} else if (_s.Choices != null && !_s.Limited) {
				ComboBoxEntry combo = new ComboBoxEntry ((String[])_s.Choices);
				combo.SetSizeRequest (100, 20);
				combo.Name = _s.Name;
				combo.Entry.Text = (String)_s.Value;
				combo.Changed += combo_changed;
				vbox2.Add (combo);
			} else {
				Entry e = new Entry ((string)_s.Value);
				e.Name = _s.Name;
				e.Changed += e_changed;
				vbox2.Add (e);
			}
			Label l = new Label (_s.Description);
			l.SetSizeRequest (315, 100);
			l.SetAlignment (0, 0);
			l.LineWrap = true;
			l.SingleLineMode = false;
			l.SetPadding (10, 2);
			Pango.FontDescription pf2 = new Pango.FontDescription ();
			pf2.Weight = Pango.Weight.Light;
			l.ModifyFont (pf2);
			vbox2.Add(l);
		}
开发者ID:Meticulus,项目名称:tactical,代码行数:45,代码来源:string_setting_viewer.cs

示例8: ToolBarComboBox

        public ToolBarComboBox(int width, int activeIndex, bool allowEntry, params string[] contents)
        {
            if (allowEntry)
                ComboBox = new ComboBoxEntry (contents);
            else
                ComboBox = new ComboBox (contents);

            ComboBox.AddEvents ((int)Gdk.EventMask.ButtonPressMask);
            ComboBox.WidthRequest = width;

            if (activeIndex >= 0)
                ComboBox.Active = activeIndex;

            ComboBox.Show ();

            Add (ComboBox);
            Show ();
        }
开发者ID:xxgreg,项目名称:Pinta,代码行数:18,代码来源:ToolBarComboBox.cs

示例9: Create

    public override Widget Create(object caller)
    {
        List<String> licenseTemplateTexts = new List<String>();
        licenseTemplateTexts.Add("non-redistributable (forbid sharing and modification of this level)");
        licenseTemplateTexts.Add("GPL 2+ / CC-by-sa 3.0 (allow sharing and modification of this level)");

        comboBox = new ComboBoxEntry(licenseTemplateTexts.ToArray());

        OnFieldChanged(Field);	//same code for initialization

        comboBox.Changed += OnComboBoxChanged;

        HBox box = new HBox();
        box.PackStart(comboBox, true, true, 0);
        box.Name = Field.Name;

        CreateToolTip(caller, comboBox);

        return box;
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:20,代码来源:ChooseLicenseWidget.cs

示例10: CreateiFolderActionButtonArea


//.........这里部分代码省略.........
     new EventHandler(OnResolveConflicts);
        buttontips.SetTip(ResolveConflictsButton, Util.GS("Resolve conflicts"),"");
        SynchronizedFolderTasks = new VBox(false, 0);
        ButtonControl.PackStart(SynchronizedFolderTasks, false, false, 0);
        spacerHBox = new HBox(false, 0);
        SynchronizedFolderTasks.PackStart(spacerHBox, false, false, 0);
        hbox = new HBox(false, 0);
        OpenSynchronizedFolderButton = new Button(hbox);
        vbox.PackStart(OpenSynchronizedFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Open...")));
        hbox.PackStart(buttonText, false, false, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        OpenSynchronizedFolderButton.Visible = false;
        OpenSynchronizedFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        OpenSynchronizedFolderButton.Clicked +=
     new EventHandler(OnOpenSynchronizedFolder);
        buttontips.SetTip(OpenSynchronizedFolderButton, Util.GS("Open iFolder"),"");
        hbox = new HBox(false, 0);
        SynchronizeNowButton = new Button(hbox);
        vbox.PackStart(SynchronizeNowButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Synchronize Now")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        SynchronizeNowButton.Sensitive = false;
       SynchronizeNowButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-sync48.png")));
        SynchronizeNowButton.Clicked +=
     new EventHandler(OnSynchronizeNow);
        buttontips.SetTip(SynchronizeNowButton, Util.GS("Synchronize Now"),"");
        hbox = new HBox(false, 0);
        RemoveiFolderButton = new Button(hbox);
        vbox.PackStart(RemoveiFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Revert to a Normal Folder")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        RemoveiFolderButton.Sensitive = false;
        RemoveiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("revert48.png")));
        RemoveiFolderButton.Clicked +=
     new EventHandler(RemoveiFolderHandler);
        buttontips.SetTip(RemoveiFolderButton, Util.GS("Revert to a Normal Folder"),"");
        hbox = new HBox(false, 0);
        ViewFolderPropertiesButton = new Button(hbox);
        vbox.PackStart(ViewFolderPropertiesButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Properties...")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        ViewFolderPropertiesButton.Visible = false;
        ViewFolderPropertiesButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        ViewFolderPropertiesButton.Clicked +=
     new EventHandler(OnShowFolderProperties);
        buttontips.SetTip(ViewFolderPropertiesButton, Util.GS("Properties"),"");
        ButtonControl.PackStart(new Label(""), false, false, 4);
        HBox searchHBox = new HBox(false, 4);
        searchHBox.WidthRequest = 110;
        ButtonControl.PackEnd(searchHBox, false, false, 0);
        SearchEntry = new Entry();
        searchHBox.PackStart(SearchEntry, true, true, 0);
        SearchEntry.SelectRegion(0, -1);
        SearchEntry.CanFocus = true;
        SearchEntry.Changed +=
     new EventHandler(OnSearchEntryChanged);
        Label l = new Label("<span size=\"small\"></span>");
        l = new Label(
     string.Format(
      "<span size=\"large\">{0}</span>",
      Util.GS("Filter")));
        ButtonControl.PackEnd(l, false, false, 0);
        l.UseMarkup = true;
        l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
        l.Xalign = 0.0F;
       VBox viewChanger = new VBox(false,0);
        string[] list = {Util.GS("Open Panel"),Util.GS("Close Panel"),Util.GS("Thumbnail View"),Util.GS("List View") };
       viewList = new ComboBoxEntry (list);
        viewList.Active = 0;
        viewList.WidthRequest = 110;
        viewList.Changed += new EventHandler(OnviewListIndexChange);
        VBox dummyVbox = new VBox(false,0);
       Label labeldummy = new Label( string.Format( ""));
       labeldummy.UseMarkup = true;
        dummyVbox.PackStart(labeldummy,false,true,0);
        viewChanger.PackStart(dummyVbox,false,true,0);
        viewChanger.PackStart(viewList,false,true,0);
        ButtonControl.PackEnd(viewChanger, false, true,0);
        return buttonArea;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:iFolderWindow.cs

示例11: frmExclusions_Load

        /// <summary>
        /// Setup the form.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]	   03/07/2012	ADD: 3131609, exclusions
        /// [Curtis_Beard]	   11/11/2014	CHG: use FilterItem
        /// </history>
        private void frmExclusions_Load(object sender, EventArgs e)
        {
            Language.ProcessForm(this);

             cboCategories.DisplayMember = "DisplayName";
             foreach (string name in Enum.GetNames(typeof(FilterType.Categories)))
             {
            ComboBoxEntry entry = new ComboBoxEntry();
            entry.DisplayName = Language.GetGenericText("Exclusions." + name);
            entry.ValueName = name;
            cboCategories.Items.Add(entry);
             }

             // load fields with values if in edit mode.
             if (_item != null)
             {
            cboCategories.SelectedIndex = cboCategories.FindStringExact(Language.GetGenericText("Exclusions." + _item.FilterType.Category.ToString()));
            cboTypes.SelectedIndex = cboTypes.FindStringExact(Language.GetGenericText("Exclusions." + _item.FilterType.SubCategory.ToString()));
            switch (_item.FilterType.ValueType)
            {
               case FilterType.ValueTypes.DateTime:
                  fvtValue.SetViewType(FilterValueType.ViewTypes.DateTime);
                  break;
               case FilterType.ValueTypes.Long:
                  fvtValue.SetViewType(FilterValueType.ViewTypes.Numeric);
                  break;
               case FilterType.ValueTypes.Size:
                  fvtValue.SetViewType(FilterValueType.ViewTypes.Size);
                  fvtValue.SetSizeDropDown(_item.ValueSizeOption);
                  break;
               case FilterType.ValueTypes.String:
                  fvtValue.SetViewType(FilterValueType.ViewTypes.String);
                  break;
            }
            if (_item.FilterType.ValueType != FilterType.ValueTypes.Null)
            {
               if (_item.FilterType.ValueType == FilterType.ValueTypes.Size)
               {
                  fvtValue.Value = AstroGrep.Core.Convertors.ConvertFileSizeForDisplay(_item.Value, _item.ValueSizeOption);
               }
               else
               {
                  fvtValue.Value = _item.Value;
               }
            }
            cboOptions.SelectedIndex = cboOptions.FindStringExact(Language.GetGenericText("Exclusions." + _item.ValueOption.ToString()));
            chkIgnoreCase.Checked = _item.ValueIgnoreCase;
             }
        }
开发者ID:joshball,项目名称:astrogrep,代码行数:58,代码来源:frmAddEditExclusions.cs

示例12: LoadHistory

		static void LoadHistory (string propertyName, ComboBoxEntry entry)
		{
			entry.Entry.Completion = new EntryCompletion ();
			var store = new ListStore (typeof(string));
			entry.Entry.Completion.Model = store;
			entry.Model = store;
			entry.Entry.ActivatesDefault = true;
			entry.TextColumn = 0;
			var history = PropertyService.Get<string> (propertyName);
			if (!string.IsNullOrEmpty (history)) {
				string[] items = history.Split (historySeparator);
				foreach (string item in items) {
					if (string.IsNullOrEmpty (item))
						continue;
					store.AppendValues (item);
				}
				entry.Entry.Text = items[0];
			}
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:19,代码来源:FindInFilesDialog.cs

示例13: ShowDirectoryPathUI

		void ShowDirectoryPathUI ()
		{
			if (labelPath != null)
				return;
			
			// We want to add the Path combo box right below the Scope 
			uint row = TableGetRowForItem (tableFindAndReplace, labelScope) + 1;
			
			// DirectoryScope
			labelPath = new Label {
				LabelProp = GettextCatalog.GetString ("_Path:"),
				UseUnderline = true, 
				Xalign = 0f
			};
			labelPath.Show ();
			
			hboxPath = new HBox ();
			comboboxentryPath = new ComboBoxEntry ();
			comboboxentryPath.Destroyed += ComboboxentryPathDestroyed;
			LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath);
			comboboxentryPath.Show ();
			hboxPath.PackStart (comboboxentryPath);
			
			labelPath.MnemonicWidget = comboboxentryPath;
			
			buttonBrowsePaths = new Button { Label = "..." };
			buttonBrowsePaths.Clicked += ButtonBrowsePathsClicked;
			buttonBrowsePaths.Show ();
			hboxPath.PackStart (buttonBrowsePaths, false, false, 0);
			hboxPath.Show ();
			
			// Add the Directory Path row to the table
			TableAddRow (tableFindAndReplace, row++, labelPath, hboxPath);
			
			// Add a checkbox for searching the directory recursively...
			checkbuttonRecursively = new CheckButton {
				Label = GettextCatalog.GetString ("Re_cursively"),
				Active = properties.Get ("SearchPathRecursively", true),
				UseUnderline = true
			};
			
			checkbuttonRecursively.Destroyed += CheckbuttonRecursivelyDestroyed;
			checkbuttonRecursively.Show ();
			
			TableAddRow (tableFindAndReplace, row, null, checkbuttonRecursively);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:46,代码来源:FindInFilesDialog.cs

示例14: ShowReplaceUI

		void ShowReplaceUI ()
		{
			if (replaceMode)
				return;
			
			labelReplace = new Label { Text = GettextCatalog.GetString ("_Replace:"), Xalign = 0f, UseUnderline = true };
			comboboxentryReplace = new ComboBoxEntry ();
			LoadHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace);
			comboboxentryReplace.Show ();
			labelReplace.Show ();
			
			TableAddRow (tableFindAndReplace, 1, labelReplace, comboboxentryReplace);
			
			buttonReplace = new Button () {
				Label = "gtk-find-and-replace",
				UseUnderline = true,
				CanDefault = true,
				UseStock = true,
			};
			// Note: We override the stock label text instead of using SetButtonIcon() because the
			// theme may override whether or not the icons are shown. Using SetButtonIcon() would
			// break the theme by forcing icons even if the theme says "no".
			OverrideStockLabel (buttonReplace, GettextCatalog.GetString ("R_eplace"));
			buttonReplace.Clicked += HandleReplaceClicked;
			buttonReplace.Show ();
			
			AddActionWidget (buttonReplace, 0);
			buttonReplace.GrabDefault ();
			
			replaceMode = true;
			
			Requisition req = SizeRequest ();
			Resize (req.Width, req.Height);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:34,代码来源:FindInFilesDialog.cs

示例15: HandleScopeChanged

		void HandleScopeChanged (object sender, EventArgs e)
		{
			if (hboxPath != null) {
				// comboboxentryPath and buttonBrowsePaths are destroyed with hboxPath
				foreach (Widget w in new Widget[] {
					labelPath,
					hboxPath,
					checkbuttonRecursively
				}) {
					tableFindAndReplace.Remove (w);
					w.Destroy ();
				}
				labelPath = null;
				hboxPath = null;
				comboboxentryPath = null;
				buttonBrowsePaths = null;
				checkbuttonRecursively = null;

				//tableFindAndReplace.NRows = showReplace ? 4u : 3u;

				var childCombo = (Table.TableChild)tableFindAndReplace[labelFileMask];
				childCombo.TopAttach = tableFindAndReplace.NRows - 3;
				childCombo.BottomAttach = tableFindAndReplace.NRows - 2;

				childCombo = (Table.TableChild)tableFindAndReplace[searchentry1];
				childCombo.TopAttach = tableFindAndReplace.NRows - 3;
				childCombo.BottomAttach = tableFindAndReplace.NRows - 2;
			}

			if (comboboxScope.Active == ScopeDirectories) {
				// DirectoryScope
				tableFindAndReplace.NRows = showReplace ? 6u : 5u;
				labelPath = new Label {
					LabelProp = GettextCatalog.GetString("_Path:"),
					UseUnderline = true, 
					Xalign = 0f
				};

				tableFindAndReplace.Add (labelPath);

				var childCombo = (Table.TableChild)tableFindAndReplace[labelPath];
				childCombo.TopAttach = tableFindAndReplace.NRows - 3;
				childCombo.BottomAttach = tableFindAndReplace.NRows - 2;
				childCombo.XOptions = childCombo.YOptions = (AttachOptions)4;

				hboxPath = new HBox ();
				var properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ());
				comboboxentryPath = new ComboBoxEntry ();
				comboboxentryPath.Destroyed += ComboboxentryPathDestroyed;
				LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath);
				hboxPath.PackStart (comboboxentryPath);

				labelPath.MnemonicWidget = comboboxentryPath;

				var boxChild = (Box.BoxChild)hboxPath[comboboxentryPath];
				boxChild.Position = 0;
				boxChild.Expand = boxChild.Fill = true;

				buttonBrowsePaths = new Button { Label = "..." };
				buttonBrowsePaths.Clicked += ButtonBrowsePathsClicked;
				hboxPath.PackStart (buttonBrowsePaths);
				boxChild = (Box.BoxChild)hboxPath[buttonBrowsePaths];
				boxChild.Position = 1;
				boxChild.Expand = boxChild.Fill = false;

				tableFindAndReplace.Add (hboxPath);
				childCombo = (Table.TableChild)tableFindAndReplace[hboxPath];
				childCombo.TopAttach = tableFindAndReplace.NRows - 3;
				childCombo.BottomAttach = tableFindAndReplace.NRows - 2;
				childCombo.LeftAttach = 1;
				childCombo.RightAttach = 2;
				childCombo.XOptions = childCombo.YOptions = (AttachOptions)4;

				checkbuttonRecursively = new CheckButton {
					Label = GettextCatalog.GetString ("Re_cursively"),
					Active = properties.Get ("SearchPathRecursively", true),
					UseUnderline = true
				};

				checkbuttonRecursively.Destroyed += CheckbuttonRecursivelyDestroyed;
				tableFindAndReplace.Add (checkbuttonRecursively);
				childCombo = (Table.TableChild)tableFindAndReplace[checkbuttonRecursively];
				childCombo.TopAttach = tableFindAndReplace.NRows - 2;
				childCombo.BottomAttach = tableFindAndReplace.NRows - 1;
				childCombo.LeftAttach = 1;
				childCombo.RightAttach = 2;
				childCombo.XOptions = childCombo.YOptions = (AttachOptions)4;

				childCombo = (Table.TableChild)tableFindAndReplace[labelFileMask];
				childCombo.TopAttach = tableFindAndReplace.NRows - 1;
				childCombo.BottomAttach = tableFindAndReplace.NRows;

				childCombo = (Table.TableChild)tableFindAndReplace[searchentry1];
				childCombo.TopAttach = tableFindAndReplace.NRows - 1;
				childCombo.BottomAttach = tableFindAndReplace.NRows;
			}
			Requisition req = SizeRequest ();
			Resize (req.Width, req.Height);
			//	this.QueueResize ();
			ShowAll ();
//.........这里部分代码省略.........
开发者ID:yayanyang,项目名称:monodevelop,代码行数:101,代码来源:FindInFilesDialog.cs


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