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


C# ComboBox.Show方法代码示例

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


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

示例1: GroupsChanged

		void GroupsChanged ()
		{
			if (combo != null) {
				combo.Changed -= combo_Changed;
				Remove (combo);
			}

			combo = Gtk.ComboBox.NewText ();
			combo.Changed += combo_Changed;
#if GTK_SHARP_2_6
			combo.RowSeparatorFunc = RowSeparatorFunc;
#endif
			combo.Show ();
			PackStart (combo, true, true, 0);

			values = new ArrayList ();
			int i = 0;
			foreach (string name in manager.GroupNames) {
				values.Add (name);
				combo.AppendText (name);
				if (name == group)
					combo.Active = i;
				i++;
			}

#if GTK_SHARP_2_6
			combo.AppendText ("");
#endif

			combo.AppendText (Catalog.GetString ("Rename Group..."));
			combo.AppendText (Catalog.GetString ("New Group..."));
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:GroupPicker.cs

示例2: TasksPanelWidget

		public TasksPanelWidget ()
		{
			Build ();
			
			comboPriority = ComboBox.NewText ();
			foreach (TaskPriority priority in Enum.GetValues (typeof (TaskPriority)))
				comboPriority.AppendText (Enum.GetName (typeof (TaskPriority), priority));
			comboPriority.Changed += new EventHandler (Validate);
			comboPriority.Show ();
			vboxPriority.PackEnd (comboPriority, false, false, 0);
			
			tokensStore = new ListStore (typeof (string), typeof (int));
			tokensTreeView.AppendColumn (String.Empty, new CellRendererText (), "text", 0);
			tokensTreeView.Selection.Changed += new EventHandler (OnTokenSelectionChanged);
			tokensTreeView.Model = tokensStore;
			
			OnTokenSelectionChanged (null, null);
			
			buttonAdd.Clicked += new EventHandler (AddToken);
			buttonChange.Clicked += new EventHandler (ChangeToken);
			buttonRemove.Clicked += new EventHandler (RemoveToken);
			entryToken.Changed += new EventHandler (Validate);

			Styles.Changed += HandleUserInterfaceSkinChanged;
		}
开发者ID:vvarshne,项目名称:monodevelop,代码行数:25,代码来源:TasksOptionsPanel.cs

示例3: createCombo

        void createCombo()
        {
            serverTypeComboBox = ComboBox.NewText ();
            serverTypeComboBox.AppendText ("OpenLDAP");
            serverTypeComboBox.AppendText ("Microsoft Active Directory");
            serverTypeComboBox.AppendText ("Fedora Directory Server");
            serverTypeComboBox.AppendText ("Generic LDAP server");

            serverTypeComboBox.Active = 0;
            serverTypeComboBox.Show ();

            stHBox.PackStart (serverTypeComboBox, true, true, 5);
        }
开发者ID:MrJoe,项目名称:lat,代码行数:13,代码来源:ProfileDialog.cs

示例4: BuildMatchHeader

        private HBox BuildMatchHeader ()
        {
            HBox header = new HBox ();
            header.Show ();

            terms_enabled_checkbox = new CheckButton (Catalog.GetString ("_Match"));
            terms_enabled_checkbox.Show ();
            terms_enabled_checkbox.Active = true;
            terms_enabled_checkbox.Toggled += OnMatchCheckBoxToggled;
            header.PackStart (terms_enabled_checkbox, false, false, 0);

            terms_logic_combo = ComboBox.NewText ();
            terms_logic_combo.AppendText (Catalog.GetString ("all"));
            terms_logic_combo.AppendText (Catalog.GetString ("any"));
            terms_logic_combo.Show ();
            terms_logic_combo.Active = 0;
            header.PackStart (terms_logic_combo, false, false, 0);

            terms_label = new Label (Catalog.GetString ("of the following:"));
            terms_label.Show ();
            terms_label.Xalign = 0.0f;
            header.PackStart (terms_label, true, true, 0);

            header.Spacing = 5;

            return header;
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:27,代码来源:QueryBox.cs

示例5: MakeGeneralPage

        private Gtk.Widget MakeGeneralPage()
        {
            VBox vbox = new VBox (false, 6);
            vbox.BorderWidth = 10;

            //
            // ITask Management System
            //
            VBox sectionVBox = new VBox (false, 4);
            Label l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Task Management System"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            backendComboBox = ComboBox.NewText ();
            backendComboMap = new Dictionary<int, string> ();
            // Fill out the ComboBox
            int i = 0;
            selectedBackend = -1;
            foreach (var backend in application.BackendManager.AvailableBackends) {
                backendComboBox.AppendText (backend.Value);
                backendComboMap [i] = backend.Key;
                if (backend.Key == application.BackendManager.CurrentBackend)
                    selectedBackend = i;
                i++;
            }
            if (selectedBackend >= 0)
                backendComboBox.Active = selectedBackend;
            backendComboBox.Changed += OnBackendComboBoxChanged;
            backendComboBox.Show ();

            HBox hbox = new HBox (false, 6);
            l = new Label (string.Empty); // spacer
            l.Show ();
            hbox.PackStart (l, false, false, 0);
            hbox.PackStart (backendComboBox, false, false, 0);
            hbox.Show ();
            sectionVBox.PackStart (hbox, false, false, 0);
            sectionVBox.Show ();
            vbox.PackStart (sectionVBox, false, false, 0);

            //
            // ITask Filtering
            //
            sectionVBox = new VBox (false, 4);
            l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Task Filtering"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            HBox sectionHBox = new HBox (false, 6);
            l = new Label (string.Empty); // spacer
            l.Show ();
            sectionHBox.PackStart (l, false, false, 0);
            VBox innerSectionVBox = new VBox (false, 6);
            hbox = new HBox (false, 6);

            bool showCompletedTasks = application.Preferences.GetBool (
                PreferencesKeys.ShowCompletedTasksKey);
            showCompletedTasksCheckButton =
                new CheckButton (Catalog.GetString ("Sh_ow completed tasks"));
            showCompletedTasksCheckButton.UseUnderline = true;
            showCompletedTasksCheckButton.Active = showCompletedTasks;
            showCompletedTasksCheckButton.Show ();
            hbox.PackStart (showCompletedTasksCheckButton, true, true, 0);
            hbox.Show ();
            innerSectionVBox.PackStart (hbox, false, false, 0);

            // TaskLists TreeView
            l = new Label (Catalog.GetString ("Only _show these lists when \"All\" is selected:"));
            l.UseUnderline = true;
            l.Xalign = 0;
            l.Show ();
            innerSectionVBox.PackStart (l, false, false, 0);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType = ShadowType.EtchedIn;

            taskListsTree = new TreeView ();
            taskListsTree.Selection.Mode = SelectionMode.None;
            taskListsTree.RulesHint = false;
            taskListsTree.HeadersVisible = false;
            l.MnemonicWidget = taskListsTree;

            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
            column.Title = Catalog.GetString ("Task List");
//.........这里部分代码省略.........
开发者ID:GNOME,项目名称:tasque,代码行数:101,代码来源:PreferencesDialog.cs

示例6: MakeSyncPane

		public Gtk.Widget MakeSyncPane ()
		{
			Gtk.VBox vbox = new Gtk.VBox (false, 0);
			vbox.Spacing = 4;
			vbox.BorderWidth = 8;

			Gtk.HBox hbox = new Gtk.HBox (false, 4);

			Gtk.Label label = new Gtk.Label (Catalog.GetString ("Ser_vice:"));
			label.Xalign = 0;
			label.Show ();
			hbox.PackStart (label, false, false, 0);

			// Populate the store with all the available SyncServiceAddins
			syncAddinStore = new Gtk.ListStore (typeof (SyncServiceAddin));
			syncAddinIters = new Dictionary<string,Gtk.TreeIter> ();
			SyncServiceAddin [] addins = Tomboy.DefaultNoteManager.AddinManager.GetSyncServiceAddins ();
			Array.Sort (addins, CompareSyncAddinsByName);
			foreach (SyncServiceAddin addin in addins) {
				Gtk.TreeIter iter = syncAddinStore.Append ();
				syncAddinStore.SetValue (iter, 0, addin);
				syncAddinIters [addin.Id] = iter;
			}

			syncAddinCombo = new Gtk.ComboBox (syncAddinStore);
			label.MnemonicWidget = syncAddinCombo;
			Gtk.CellRendererText crt = new Gtk.CellRendererText ();
			syncAddinCombo.PackStart (crt, true);
			syncAddinCombo.SetCellDataFunc (crt,
			                                new Gtk.CellLayoutDataFunc (ComboBoxTextDataFunc));

			// Read from Preferences which service is configured and select it
			// by default.  Otherwise, just select the first one in the list.
			string addin_id = Preferences.Get (
			                          Preferences.SYNC_SELECTED_SERVICE_ADDIN) as String;

			Gtk.TreeIter active_iter;
			if (addin_id != null && syncAddinIters.ContainsKey (addin_id)) {
				active_iter = syncAddinIters [addin_id];
				syncAddinCombo.SetActiveIter (active_iter);
			} else {
				if (syncAddinStore.GetIterFirst (out active_iter) == true) {
					syncAddinCombo.SetActiveIter (active_iter);
				}
			}

			syncAddinCombo.Changed += OnSyncAddinComboChanged;

			syncAddinCombo.Show ();
			hbox.PackStart (syncAddinCombo, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			// Get the preferences GUI for the Sync Addin
			if (active_iter.Stamp != Gtk.TreeIter.Zero.Stamp)
				selectedSyncAddin = syncAddinStore.GetValue (active_iter, 0) as SyncServiceAddin;

			if (selectedSyncAddin != null)
				syncAddinPrefsWidget = selectedSyncAddin.CreatePreferencesControl (OnSyncAddinPrefsChanged);
			if (syncAddinPrefsWidget == null) {
				Gtk.Label l = new Gtk.Label (Catalog.GetString ("Not configurable"));
				l.Yalign = 0.5f;
				l.Yalign = 0.5f;
				syncAddinPrefsWidget = l;
			}
			if (syncAddinPrefsWidget != null && addin_id != null &&
			                syncAddinIters.ContainsKey (addin_id) && selectedSyncAddin.IsConfigured)
				syncAddinPrefsWidget.Sensitive = false;

			syncAddinPrefsWidget.Show ();
			syncAddinPrefsContainer = new Gtk.VBox (false, 0);
			syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
			syncAddinPrefsContainer.Show ();
			vbox.PackStart (syncAddinPrefsContainer, true, true, 10);

			// Autosync preference
			int timeout = (int) Preferences.Get (Preferences.SYNC_AUTOSYNC_TIMEOUT);
			if (timeout > 0 && timeout < 5) {
				timeout = 5;
				Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT, 5);
			}
			Gtk.HBox autosyncBox = new Gtk.HBox (false, 5);
			// Translators: This is and the next string go together.
			// Together they look like "Automatically Sync in Background Every [_] Minutes",
			// where "[_]" is a GtkSpinButton.
			autosyncCheck =
				new Gtk.CheckButton (Catalog.GetString ("Automaticall_y Sync in Background Every"));
			autosyncSpinner = new Gtk.SpinButton (5, 1000, 1);
			autosyncSpinner.Value = timeout >= 5 ? timeout : 10;
			Gtk.Label autosyncExtraText =
				// Translators: See above comment for details on
				// this string.
				new Gtk.Label (Catalog.GetString ("Minutes"));
			autosyncCheck.Active = autosyncSpinner.Sensitive = timeout >= 5;
			EventHandler updateTimeoutPref = (o, e) => {
				Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT,
				                 autosyncCheck.Active ? (int) autosyncSpinner.Value : -1);
			};
			autosyncCheck.Toggled += (o, e) => {
//.........这里部分代码省略.........
开发者ID:rashoodkhan,项目名称:tomboy,代码行数:101,代码来源:PreferencesDialog.cs

示例7: createCombo

        void createCombo()
        {
            if (primaryGroupComboBox != null) {
                primaryGroupComboBox.Changed -= OnPrimaryGroupChanged;
                primaryGroupComboBox.Destroy ();
                primaryGroupComboBox = null;
            }

            primaryGroupComboBox = ComboBox.NewText ();

            string defaultGroup = "None";
            if (defaultValues != null && defaultValues.ContainsKey ("defaultGroup")) {
                defaultGroup = defaultValues["defaultGroup"];
                primaryGroupComboBox.AppendText (defaultGroup);
            }

            foreach (string key in _allGroups.Keys) {
                if (key.ToLower() == defaultGroup.ToLower())
                    continue;

                primaryGroupComboBox.AppendText (key);
            }

            primaryGroupComboBox.AppendText ("Create new group...");

            primaryGroupComboBox.Active = 0;
            primaryGroupComboBox.Changed += OnPrimaryGroupChanged;
            primaryGroupComboBox.Show ();

            comboHbox.Add (primaryGroupComboBox);
        }
开发者ID:MrJoe,项目名称:lat,代码行数:31,代码来源:NewUserViewDialog.cs

示例8: AddMultiOptionCombo

		void AddMultiOptionCombo (SortedDictionary<string, List<TargetFramework>> options)
		{
			var alignment = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) { LeftPadding = 18 };
			var model = new ListStore (new Type[] { typeof (string), typeof (object) });
			var renderer = new CellRendererText ();
			var combo = new ComboBox (model);
			var check = new CheckButton ();
			List<TargetFramework> targets;
			var hbox = new HBox ();
			int current = 0;
			int active = -1;
			string label;

			foreach (var kvp in options) {
				label = kvp.Key;

				if (current + 1 < options.Count)
					label += " or later";

				targets = kvp.Value;
				if (active == -1) {
					foreach (var target in targets) {
						if (target.Id.Equals (project.TargetFramework.Id)) {
							active = current;
							break;
						}
					}
				}

				model.AppendValues (label, targets);
				current++;
			}

			combo.PackStart (renderer, true);
			combo.AddAttribute (renderer, "text", 0);

			check.Show ();
			combo.Show ();

			if (active != -1) {
				combo.Active = active;
				check.Active = true;
			} else {
				check.Active = false;
				combo.Active = 0;
			}

			combo.Changed += (sender, e) => {
				if (check.Active)
					TargetFrameworkChanged (check, combo);
			};
			check.Toggled += (sender, e) => {
				TargetFrameworkChanged (check, combo);
			};

			comboboxes.Add (check, combo);

			hbox.PackStart (check, false, false, 0);
			hbox.PackStart (combo, false, true, 0);
			hbox.Show ();

			alignment.Add (hbox);
			alignment.Show ();

			vbox1.PackStart (alignment, false, false, 0);
		}
开发者ID:halleyxu,项目名称:monodevelop,代码行数:66,代码来源:PortableRuntimeOptionsPanel.cs

示例9: BuildLimitFooter

        private HBox BuildLimitFooter()
        {
            HBox limitFooter = new HBox();
            limitFooter.Show();
            limitFooter.Spacing = 5;

            limitCheckBox = new CheckButton("Limit to");
            limitCheckBox.Show();
            limitCheckBox.Toggled += OnLimitCheckBoxToggled;
            limitFooter.PackStart(limitCheckBox, false, false, 0);

            limitEntry = new Entry("25");
            limitEntry.Show();
            limitEntry.SetSizeRequest(50, -1);
            limitFooter.PackStart(limitEntry, false, false, 0);

            limitComboBox = ComboBox.NewText();
            limitComboBox.Show();
            foreach(string criteria in model.LimitCriteria)
                limitComboBox.AppendText(criteria);
            limitComboBox.Active = 0;
            limitFooter.PackStart(limitComboBox, false, false, 0);

            Label orderLabel = new Label("selected by");
            orderLabel.Show();
            limitFooter.PackStart(orderLabel, false, false, 0);

            orderComboBox = ComboBox.NewText();
            orderComboBox.Show();
            foreach(string order in model.OrderCriteria)
                orderComboBox.AppendText(order);
            orderComboBox.Active = 0;
            limitFooter.PackStart(orderComboBox, false, false, 0);

            limitCheckBox.Active = false;
            OnLimitCheckBoxToggled(limitCheckBox, null);

            return limitFooter;
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:39,代码来源:QueryBuilder.cs

示例10: createCombos

        private void createCombos()
        {
            templateComboBox = ComboBox.NewText ();

            string[] templates = Global.Templates.GetTemplateNames ();

            foreach (string s in templates)
                templateComboBox.AppendText (s);

            templateComboBox.Active = 0;
            templateComboBox.Show ();

            comboHBox.PackStart (templateComboBox, true, true, 0);
        }
开发者ID:MrJoe,项目名称:lat,代码行数:14,代码来源:NewEntryDialog.cs

示例11: InitWindow

        void InitWindow()
        {
            int height;
            int width;

            this.Icon = Utilities.GetIcon ("tasque-48", 48);
            // Update the window title
            Title = string.Format ("Tasque");

            width = GtkApplication.Instance.Preferences.GetInt("MainWindowWidth");
            height = GtkApplication.Instance.Preferences.GetInt("MainWindowHeight");

            if(width == -1)
                width = 600;
            if(height == -1)
                height = 600;

            this.DefaultSize = new Gdk.Size( width, height);

            accelGroup = new AccelGroup ();
            AddAccelGroup (accelGroup);
            globalKeys = new GlobalKeybinder (accelGroup);

            VBox mainVBox = new VBox();
            mainVBox.BorderWidth = 0;
            mainVBox.Show ();
            this.Add (mainVBox);

            HBox topHBox = new HBox (false, 0);
            topHBox.BorderWidth = 4;

            categoryComboBox = new ComboBox ();
            categoryComboBox.Accessible.Description = "Category Selection";
            categoryComboBox.WidthRequest = 150;
            categoryComboBox.WrapWidth = 1;
            categoryComboBox.Sensitive = false;
            CellRendererText comboBoxRenderer = new Gtk.CellRendererText ();
            comboBoxRenderer.WidthChars = 20;
            comboBoxRenderer.Ellipsize = Pango.EllipsizeMode.End;
            categoryComboBox.PackStart (comboBoxRenderer, true);
            categoryComboBox.SetCellDataFunc (comboBoxRenderer,
                new Gtk.CellLayoutDataFunc (CategoryComboBoxDataFunc));

            categoryComboBox.Show ();
            topHBox.PackStart (categoryComboBox, false, false, 0);

            // Space the addTaskButton and the categoryComboBox
            // far apart by using a blank label that expands
            Label spacer = new Label (string.Empty);
            spacer.Show ();
            topHBox.PackStart (spacer, true, true, 0);

            // The new task entry widget
            addTaskEntry = new Entry (Catalog.GetString ("New task..."));
            addTaskEntry.Sensitive = false;
            addTaskEntry.Focused += OnAddTaskEntryFocused;
            addTaskEntry.Changed += OnAddTaskEntryChanged;
            addTaskEntry.Activated += OnAddTaskEntryActivated;
            addTaskEntry.FocusInEvent += OnAddTaskEntryFocused;
            addTaskEntry.FocusOutEvent += OnAddTaskEntryUnfocused;
            addTaskEntry.DragDataReceived += OnAddTaskEntryDragDataReceived;
            addTaskEntry.Show ();
            topHBox.PackStart (addTaskEntry, true, true, 0);

            // Use a small add icon so the button isn't mammoth-sized
            HBox buttonHBox = new HBox (false, 6);
            Gtk.Image addImage = new Gtk.Image (Gtk.Stock.Add, IconSize.Menu);
            addImage.Show ();
            buttonHBox.PackStart (addImage, false, false, 0);
            Label l = new Label (Catalog.GetString ("_Add"));
            l.Show ();
            buttonHBox.PackStart (l, true, true, 0);
            buttonHBox.Show ();
            addTaskButton =
                new MenuToolButton (buttonHBox, Catalog.GetString ("_Add Task"));
            addTaskButton.UseUnderline = true;
            // Disactivate the button until the backend is initialized
            addTaskButton.Sensitive = false;
            Gtk.Menu addTaskMenu = new Gtk.Menu ();
            addTaskButton.Menu = addTaskMenu;
            addTaskButton.Clicked += OnAddTask;
            addTaskButton.Show ();
            topHBox.PackStart (addTaskButton, false, false, 0);

            globalKeys.AddAccelerator (OnGrabEntryFocus,
                        (uint) Gdk.Key.n,
                        Gdk.ModifierType.ControlMask,
                        Gtk.AccelFlags.Visible);

            globalKeys.AddAccelerator (delegate (object sender, EventArgs e) {
                GtkApplication.Instance.Quit (); },
                        (uint) Gdk.Key.q,
                        Gdk.ModifierType.ControlMask,
                        Gtk.AccelFlags.Visible);

            this.KeyPressEvent += KeyPressed;

            topHBox.Show ();
            mainVBox.PackStart (topHBox, false, false, 0);

//.........这里部分代码省略.........
开发者ID:mono-soc-2012,项目名称:Tasque,代码行数:101,代码来源:TaskWindow.cs

示例12: CreateCombo

        void CreateCombo(string defaultGroup)
        {
            if (primaryGroupComboBox != null) {
                primaryGroupComboBox.Destroy ();
                primaryGroupComboBox = null;
            }

            primaryGroupComboBox = ComboBox.NewText ();
            primaryGroupComboBox.AppendText (defaultGroup);

            LdapEntry[] grps = conn.Data.SearchByClass ("posixGroup");
            foreach (LdapEntry e in grps) {
                LdapAttribute nameAttr = e.getAttribute ("cn");
                if (nameAttr.StringValue.ToLower() == defaultGroup.ToLower())
                    continue;

                primaryGroupComboBox.AppendText (nameAttr.StringValue);
            }

            primaryGroupComboBox.Active = 0;
            primaryGroupComboBox.Show ();

            hbox417.Add (primaryGroupComboBox);
        }
开发者ID:MrJoe,项目名称:lat,代码行数:24,代码来源:UserDefaultValuesDialog.cs

示例13: SqlQueryView

        public SqlQueryView()
            : base()
        {
            control = new Frame ();
            control.Show ();

            VBox vbox = new VBox ();
            vbox.Show ();

            Tooltips tips = new Tooltips ();

            Toolbar toolbar = new Toolbar ();
            vbox.PackStart 	(toolbar, false, true, 0);
            toolbar.Show ();

            Image image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Execute");
            image.Show ();

            Button execute = new Button (image);
            execute.Clicked += new EventHandler (OnExecute);
            execute.Relief = ReliefStyle.None;
            tips.SetTip (execute, "Execute", "");
            toolbar.Add (execute);
            execute.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.RunFromCursor");
            image.Show ();

            Button run = new Button (image);
            run.Clicked += new EventHandler (OnRunFromCursor);
            run.Relief = ReliefStyle.None;
            tips.SetTip (run, "Run from cursor", "");
            toolbar.Add (run);
            run.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Explain");
            image.Show ();

            Button explain = new Button (image);
            explain.Clicked += new EventHandler (OnExplain);
            explain.Relief = ReliefStyle.None;
            tips.SetTip (explain, "Explain query", "");
            toolbar.Add (explain);
            explain.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Stop");
            image.Show ();

            Button stop = new Button (image);
            stop.Clicked += new EventHandler (OnStop);
            stop.Relief = ReliefStyle.None;
            stop.Sensitive = false;
            tips.SetTip (stop, "Stop", "");
            toolbar.Add (stop);
            stop.Show ();

            VSeparator sep = new VSeparator ();
            toolbar.Add (sep);
            sep.Show ();

            model = new ListStore (typeof (string), typeof (DbProviderBase));

            providers = new ComboBox ();
            providers.Model = model;
            CellRendererText ctext = new CellRendererText ();
            providers.PackStart (ctext, true);
            providers.AddAttribute (ctext, "text", 0);
            toolbar.Add (providers);
            providers.Show ();

            SourceLanguagesManager lm = new SourceLanguagesManager ();
            SourceLanguage lang = lm.GetLanguageFromMimeType ("text/x-sql");
            SourceBuffer buf = new SourceBuffer (lang);
            buf.Highlight = true;
            sourceView = new SourceView (buf);
            sourceView.ShowLineNumbers = true;
            sourceView.Show ();

            ScrolledWindow scroller = new ScrolledWindow ();
            scroller.Add (sourceView);
            scroller.Show ();
            vbox.PackStart (scroller, true, true, 0);

            control.Add (vbox);

            service = (MonoQueryService)
                ServiceManager.GetService (typeof (MonoQueryService));
            changedHandler
                 = (EventHandler) Runtime.DispatchService.GuiDispatch (
                    new EventHandler (OnProvidersChanged));
            service.Providers.Changed += changedHandler;

            foreach (DbProviderBase p in service.Providers) {
                model.AppendValues (p.Name, p);
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:100,代码来源:SqlQueryView.cs

示例14: PreferenceDialog

		public PreferenceDialog () : base ("main_preferences")
		{
			tag_button = new MenuButton ();
			LoadPreference (Preferences.METADATA_EMBED_IN_IMAGE);
			LoadPreference (Preferences.COLOR_MANAGEMENT_ENABLED);
			LoadPreference (Preferences.COLOR_MANAGEMENT_USE_X_PROFILE);
			LoadPreference (Preferences.SCREENSAVER_TAG);
			LoadPreference (Preferences.GNOME_SCREENSAVER_THEME);
			if (Global.PhotoDirectory == Preferences.Get<string> (Preferences.STORAGE_PATH)) {
				photosdir_chooser.CurrentFolderChanged += HandlePhotosdirChanged;
				photosdir_chooser.SetCurrentFolder (Global.PhotoDirectory);
			} else {
				photosdir_chooser.SetCurrentFolder(Global.PhotoDirectory);
				photosdir_chooser.Sensitive = false;
			}

			Gtk.CellRendererText name_cell = new Gtk.CellRendererText ();
			Gtk.CellRendererText desc_cell = new Gtk.CellRendererText ();
			
			use_x_profile_check.Sensitive = colormanagement_check.Active;
			
			display_combo.Sensitive = colormanagement_check.Active;
			display_combo.Model = new ProfileList ();                                                                                    
			display_combo.PackStart (desc_cell, false);
			display_combo.PackStart (name_cell, true);
			display_combo.SetCellDataFunc (name_cell, new CellLayoutDataFunc (ProfileList.ProfileNameDataFunc));
			//FIXME
			int it_ = 0;
			foreach (Cms.Profile profile in FSpot.ColorManagement.Profiles) {
				if (profile.ProductName == Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE))
					display_combo.Active = it_;
				it_++;
			}

			display_combo.Changed += HandleDisplayChanged;

			destination_combo.Sensitive = colormanagement_check.Active;
			destination_combo.Model = new ProfileList ();
			destination_combo.PackStart (desc_cell, false);
			destination_combo.PackStart (name_cell, true);
			destination_combo.SetCellDataFunc (name_cell, new CellLayoutDataFunc (ProfileList.ProfileNameDataFunc));
			destination_combo.Changed += HandleDestinationChanged;
			//FIXME
			it_ = 0;
			foreach (Cms.Profile profile in FSpot.ColorManagement.Profiles) {
				if (profile.ProductName ==  Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_OUTPUT_PROFILE))
					destination_combo.Active = it_;
				it_++;
			}

			TagMenu tagmenu = new TagMenu (null, MainWindow.Toplevel.Database.Tags);
	
			tagmenu.Populate (false);

			tag_button.Menu = tagmenu;
			tag_button.ShowAll ();
			tagselectionhbox.Add (tag_button);

			tagmenu.TagSelected += HandleTagMenuSelected;
			set_saver_button.Clicked += HandleUseFSpot;
			screensaverall_radio.Toggled += ToggleTagRadio;

			themenone_radio.Toggled += ToggleThemeRadio;
			themelist_combo = ComboBox.NewText ();
			theme_list = new Dictionary<string, string> ();
			string gtkrc = Path.Combine ("gtk-2.0", "gtkrc");
			string [] search = {Path.Combine (Global.HomeDirectory, ".themes"), "/usr/share/themes"};
			foreach (string path in search)
				if (Directory.Exists (path)) 
					foreach (string dir in Directory.GetDirectories (path))
						if (File.Exists (Path.Combine (dir, gtkrc)) && !theme_list.ContainsKey (Path.GetFileName (dir)))
							theme_list.Add (Path.GetFileName (dir), Path.Combine (dir, gtkrc));
			
			string active_theme = Preferences.Get<string> (Preferences.GTK_RC);
			int it = 0;
			foreach (string theme in theme_list.Keys) {
				themelist_combo.AppendText (Path.GetFileName (theme));
				if (active_theme.Contains (Path.DirectorySeparatorChar + Path.GetFileName (theme) + Path.DirectorySeparatorChar))
					themelist_combo.Active = it;
				it ++;
			}
			
			theme_table.Attach (themelist_combo, 2, 3, 0, 1);
			themelist_combo.Changed += HandleThemeComboChanged;
			themelist_combo.Show ();
			theme_filechooser.Visible = themefile_label.Visible = FSpot.Utils.Log.Debugging;

			themelist_combo.Sensitive = theme_filechooser.Sensitive = themecustom_radio.Active; 
			if (File.Exists (active_theme))
				theme_filechooser.SetFilename (Preferences.Get<string> (Preferences.GTK_RC));
			theme_filechooser.SelectionChanged += HandleThemeFileActivated;
			themecustom_radio.Active = (active_theme != String.Empty);	

#if GTK_2_12_2
			restartlabel.Visible = false;
#endif

#if DEBUGTHEMES
			refreshtheme_button = true;
#endif
//.........这里部分代码省略.........
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:101,代码来源:PreferenceDialog.cs

示例15: TaskOptionsDialog

		public TaskOptionsDialog(Gtk.Window parent,
		                         Gtk.DialogFlags flags,
		                         Task task)
: base (Catalog.GetString ("Task Options"), parent, flags)
		{
			HasSeparator = false;
			//BorderWidth = 0;
			Resizable = false;
			//Decorated = false;
			this.SetDefaultSize (400, 300);
			this.task = task;

//   Frame frame = new Frame();
//   frame.Shadow = ShadowType.Out;
//   frame.Show();
//   VBox.PackStart (frame, true, true, 0);

			VBox vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			vbox.Show ();
			VBox.PackStart (vbox, true, true, 0);
//   frame.Add (vbox);

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

			accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);

//   Gtk.Label l = new Gtk.Label (
//     string.Format (
//      "<span weight=\"bold\">{0}</span>",
//      Catalog.GetString ("Task Options")));
//   l.UseMarkup = true;
//   l.Show ();
//   vbox.PackStart (l, false, false, 0);

			///
			/// Summary
			///
			Gtk.Label l = new Label (Catalog.GetString ("_Summary:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			summary_entry = new Gtk.Entry ();
			l.MnemonicWidget = summary_entry;
			summary_entry.Text = task.Summary;
			summary_entry.Show ();
			vbox.PackStart (summary_entry, false, false, 0);

			///
			/// Details
			///
			l = new Label (Catalog.GetString ("_Details:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			details_text_view = new TextView ();
			l.MnemonicWidget = details_text_view;
			details_text_view.WrapMode = WrapMode.Word;
			details_text_view.Show ();

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.EtchedIn;
			sw.Add (details_text_view);
			sw.Show ();

			vbox.PackStart (sw, true, true, 0);

			///
			/// Completion Checkbox
			///
			HBox hbox = new Gtk.HBox (false, 4);

			completed_check_button = new Gtk.CheckButton (
			        task.IsComplete ?
			        Catalog.GetString ("_Completed:") :
			        Catalog.GetString ("_Complete"));
			if (task.IsComplete)
				completed_check_button.Active = true;
			completed_check_button.UseUnderline = true;
			completed_check_button.Toggled += OnCompletedCheckButtonToggled;
			completed_check_button.Show ();
			hbox.PackStart (completed_check_button, false, false, 0);

			completed_label = new Gtk.Label (
			        task.IsComplete ?
			        GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) :
			        string.Empty);
			completed_label.Xalign = 0;
			completed_label.Show ();
			hbox.PackStart (completed_label, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Due Date
			///
//.........这里部分代码省略.........
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:101,代码来源:TaskOptionsDialog.cs


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