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


C# Gtk.CheckButton类代码示例

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


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

示例1: Create

		public static Gtk.Window Create ()
		{
			HBox options = new HBox (false, 0);
			CheckButton check_button = null;

			window = new ColorSelectionDialog ("Color selection dialog");
			window.ColorSelection.HasOpacityControl = true;
			window.ColorSelection.HasPalette = true;

			window.SetDefaultSize (250, 200);
			window.VBox.PackStart (options, false, false, 0);
			window.VBox.BorderWidth = 10;

			check_button = new CheckButton("Show Opacity");
			check_button.Active = true;
			options.PackStart (check_button, false, false, 0);
			check_button.Toggled += new EventHandler (Opacity_Callback);

			check_button = new CheckButton("Show Palette");
			check_button.Active = true;
			options.PackEnd (check_button, false, false, 0);
			check_button.Toggled += new EventHandler (Palette_Callback);

			window.ColorSelection.ColorChanged += new EventHandler (Color_Changed);
			window.OkButton.Clicked += new EventHandler (Color_Selection_OK);
			window.CancelButton.Clicked += new EventHandler (Color_Selection_Cancel); 

			options.ShowAll ();

			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:31,代码来源:TestColorSelection.cs

示例2: Load

        public void Load()
        {
            // Remove old children list
            var depsChildren = ((ArrayList)vbox_ProjectDeps.AllChildren);
            for (int k = depsChildren.Count - 1; k >= 0; k--)
                vbox_ProjectDeps.Remove((Widget)depsChildren[k]);

            // Init new project dep list
            int i = 0;
            foreach(var prj in Project.ParentSolution.GetAllProjects())
            {
                if (prj == Project)
                    continue;

                var cb = new Gtk.CheckButton(prj.Name){
                    CanFocus=true,
                    DrawIndicator=true,
                    UseUnderline=false,
                    Active = Project.ProjectDependencies.Contains(prj.ItemId)
                };

                cb.Data.Add("prj", prj);

                vbox_ProjectDeps.Add(cb);

                var bc=(Box.BoxChild)vbox_ProjectDeps[cb];
                bc.Expand=false;
                bc.Fill=false;
                bc.Position=i++;
            }
            vbox_ProjectDeps.ShowAll();
        }
开发者ID:simendsjo,项目名称:Mono-D,代码行数:32,代码来源:ProjectDependenciesWidget.cs

示例3: NewWithLabel

		public static new CheckButton NewWithLabel(string label)
		{
			IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label);
			CheckButton result = new CheckButton (gtk_check_button_new_with_label(native_label));
			GLib.Marshaller.Free (native_label);
			return result;
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:CheckButton.cs

示例4: ErrorMatrixPanel

        public ErrorMatrixPanel(uint rows, uint cols)
            : base(4, 2, false)
        {
            divisorSpinButton = new SpinButton(1, 10000, 1);
            sourceOffsetXSpinButton = new SpinButton(1, cols, 1);
            customDivisorCheckButton = new CheckButton("Use a custom divisor?");
            customDivisorCheckButton.Toggled += delegate
            {
                divisorSpinButton.Sensitive = customDivisorCheckButton.Active;
            };

            matrixPanel = new MatrixPanel(rows, cols);
            matrixPanel.MatrixResized += delegate
            {
                sourceOffsetXSpinButton.Adjustment.Upper =
                    matrixPanel.Columns;
            };

            presets = new List<ErrorMatrix>(ErrorMatrix.Samples.listMatrices());
            var presetsNames = from preset in presets select preset.Name;
            presetComboBox = new ComboBox(presetsNames.ToArray());
            presetComboBox.Changed += delegate
            {
                int active = presetComboBox.Active;
                if (active >= 0) {
                    Matrix = presets[active];
                }
            };

            ColumnSpacing = 2;
            RowSpacing = 2;
            BorderWidth = 2;

            Attach(new Label("Preset:") { Xalign = 0.0f }, 0, 1, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);
            Attach(presetComboBox, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            Attach(matrixPanel, 0, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            Attach(new Label("Source offset X:") { Xalign = 0.0f },
                0, 1, 2, 3, AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);
            Attach(sourceOffsetXSpinButton, 1, 2, 2, 3,
                AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            Attach(customDivisorCheckButton, 0, 2, 3, 4,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            Attach(new Label("Divisor:") { Xalign = 0.0f }, 0, 1, 4, 5,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);
            Attach(divisorSpinButton, 1, 2, 4, 5,
                AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
        }
开发者ID:bzamecnik,项目名称:HalftoneLab,代码行数:60,代码来源:ErrorMatrixPanel.cs

示例5: Login

        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Login Dialog
        public Login()
        {
            SetDefaultSize(240, 355);
            DefaultIcon = StockIcons.GetPixbuf("NyFolderIcon");

            // Initialize Dialog Options
            Title = Info.Name + " Login";
            Logo = StockIcons.GetPixbuf("NyFolderLogo", 240, 140);

            // Remember Password (CheckButton)
            checkRememberPassword.Image = new Gtk.Image(Stock.Save, IconSize.Button);

            // Secure Authentication (CheckButton)
            checkSecureAuth = new CheckButton("Use Secure Authentication");
            checkSecureAuth.Active = true;
            checkSecureAuth.Image = StockIcons.GetImage("Lock", 22);
            checkSecureAuth.Toggled += new EventHandler(OnCheckSecureAuthToggled);
            VBox.PackStart(checkSecureAuth, false, false, 2);

            // Initialize MenuBar
            this.menuBar = new Gtk.MenuBar();
            VBox.PackStart(this.menuBar, false, false, 0);
            this.VBox.ReorderChild(this.menuBar, 0);
            InitializeMenuBar();

            // Initialize Dialog Buttons
            AddButton(Gtk.Stock.Ok, ResponseType.Ok);
            AddButton(Gtk.Stock.Quit, ResponseType.Close);

            ShowAll();
        }
开发者ID:BackupTheBerlios,项目名称:nyfolder-svn,代码行数:35,代码来源:Login.cs

示例6: CreateConfigWidget

        /// <summary>
        /// Creates the config widget.
        /// </summary>
        /// <returns>The config widget.</returns>
        public override Gtk.Widget CreateConfigWidget()
        {
            var container = new VBox();
            var citiesNumber = new SpinButton(2, 10000, 2);
            citiesNumber.Text = "Number of cities";
            citiesNumber.Value = m_numberOfCities;
            citiesNumber.ValueChanged += delegate
            {
                m_numberOfCities = citiesNumber.ValueAsInt - (citiesNumber.ValueAsInt % 2);
                citiesNumber.Value = m_numberOfCities;
                OnReconfigured();
            };
            container.Add(citiesNumber);

            var generateButton = new Button();
            generateButton.Label = "Generate cities";
            generateButton.Clicked += delegate
            {
                m_numberOfCities = citiesNumber.ValueAsInt;
                OnReconfigured();
            };
            container.Add(generateButton);

            var showIndexes = new CheckButton();
            showIndexes.Active = m_showIndexes;
            showIndexes.Label = "Show indexes";
            showIndexes.Toggled += delegate
            {
                m_showIndexes = showIndexes.Active;
            };

            container.Add(showIndexes);

            return container;
        }
开发者ID:denmerc,项目名称:GeneticSharp,代码行数:39,代码来源:TspSampleController.cs

示例7: AnalysisOptionsWidget

		public AnalysisOptionsWidget ()
		{
			enabledCheck = new CheckButton (GettextCatalog.GetString ("Enable source analysis of open files"));
			PackStart (enabledCheck, false, false, 0);
			
			ShowAll ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:AnalysisOptionsPanel.cs

示例8: LogAgentPanelWidget

		public LogAgentPanelWidget ()
		{
			global::Stetic.BinContainer.Attach (this);

			var reportingLabel = GettextCatalog.GetString ("Report errors and usage information to help {0} improve my experience.", BrandingService.SuiteName);

			var value = LoggingService.ReportUsage;
			chkUsage = new CheckButton (reportingLabel);
			if (value.HasValue)
				chkUsage.Active = value.Value;
			chkUsage.Toggled += (sender, e) => reportUsage = chkUsage.Active;
			
			container = new Gtk.VBox ();
			container.PackStart (chkUsage, false, false, 0);

			var privacyStatement = BrandingService.PrivacyStatement;
			if (!string.IsNullOrEmpty (privacyStatement)) {
				var privacyLabel = new Xwt.Label { Markup = privacyStatement, Wrap = Xwt.WrapMode.Word };
				container.Add (new HBox ());
				container.PackEnd (privacyLabel.ToGtkWidget (), false, false, 30);
			}
			
			Add (container);
			ShowAll ();
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:25,代码来源:LogAgentOptionsPanel.cs

示例9: LiveAnalysisPreferences

        public LiveAnalysisPreferences()
        {
            this.Build ();

            rendercb = new CheckButton ();
            table1.Attach (rendercb, 1, 2, 0, 1,
                AttachOptions.Shrink,
                AttachOptions.Shrink, 0, 0);
            rendercb.CanFocus = false;
            rendercb.Show ();
            rendercb.Active = App.Current.Config.AutoRenderPlaysInLive;
            rendercb.Toggled += (sender, e) => {
                App.Current.Config.AutoRenderPlaysInLive = rendercb.Active;
            };

            reviewcb = new CheckButton ();
            table1.Attach (reviewcb, 1, 2, 2, 3,
                AttachOptions.Shrink,
                AttachOptions.Shrink, 0, 0);
            reviewcb.CanFocus = false;
            reviewcb.Show ();
            reviewcb.Active = App.Current.Config.ReviewPlaysInSameWindow;
            reviewcb.Toggled += (sender, e) => {
                App.Current.Config.ReviewPlaysInSameWindow = reviewcb.Active;
            };

            mediafilechooser1.FileChooserMode = FileChooserMode.Directory;
            mediafilechooser1.CurrentPath = App.Current.Config.AutoRenderDir;
            mediafilechooser1.ChangedEvent += HandleChangedEvent;
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:30,代码来源:LiveAnalysisPreferences.cs

示例10: EditColumnsDialog

        public EditColumnsDialog(Gtk.TreeViewColumn[] columns)
        {
            this.Build();

            Title = _("Edit columns");
            Modal = true;
            table.Homogeneous = true;

            Array.Sort <TreeViewColumn> (columns, delegate (TreeViewColumn left, TreeViewColumn right) {
                return left.Title.CompareTo (right.Title);
            });
            for (uint i = 0 ; i < columns.Length; i++) {
                TorrentTreeView.Column c = (TorrentTreeView.Column) columns [i];
                if (c.Ignore)
                    continue;

                CheckButton check = new CheckButton { Label = c.Title, Active = c.Visible  };
                check.Clicked += delegate {
                    Console.WriteLine ("Setting {0} to {1} with width {2}/", c.Title, check.Active, c.Width, c.FixedWidth);
                    c.Visible = check.Active;
                    c.FixedWidth = Math.Max (c.FixedWidth, 10);
                };
                Console.WriteLine ("Appending one");
                this.table.Attach (check, i % 2, i % 2 + 1, i / 2, i / 2 + 1);
            }
            ShowAll ();
        }
开发者ID:ArsenShnurkov,项目名称:monsoon,代码行数:27,代码来源:EditColumnsDialog.cs

示例11: Create

		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Title = "Bi-directional flipping";
			window.SetDefaultSize (200, 100);

			label = new Label ("Label direction: <b>Left-to-right</b>");
			label.UseMarkup = true;
			label.SetPadding (3, 3);
			window.VBox.PackStart (label, true, true, 0);

			check_button = new CheckButton ("Toggle label direction");
			window.VBox.PackStart (check_button, true, true, 2);

			if (window.Direction == TextDirection.Ltr)
				check_button.Active = true;

			check_button.Toggled += new EventHandler (Toggle_Flip);
			check_button.BorderWidth = 10;

			button = new Button (Stock.Close);
			button.Clicked += new EventHandler (Close_Button);
			button.CanDefault = true;
			
			window.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			window.ShowAll ();
			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:30,代码来源:TestFlipping.cs

示例12: EnableStartupNotesPreference

		public EnableStartupNotesPreference ()
		{
			IPropertyEditorBool enableStartupNotes_peditor;
			Gtk.CheckButton enableStartupNotesCheckbox;
			Gtk.Label enableStartupNotesLabel;

			// Enable Startup Notes option
			enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes"));
			enableStartupNotesLabel.UseMarkup = true;
			enableStartupNotesLabel.Justify = Gtk.Justification.Left;
			enableStartupNotesLabel.SetAlignment (0.0f, 0.5f);
			enableStartupNotesLabel.Show ();

			enableStartupNotesCheckbox = new Gtk.CheckButton ();
			enableStartupNotesCheckbox.Add (enableStartupNotesLabel);
			enableStartupNotesCheckbox.Show ();

			enableStartupNotes_peditor =
				Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
			Preferences.Get (enableStartupNotes_peditor.Key);
			enableStartupNotes_peditor.Setup ();

			align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
			align.Show ();
			align.Add (enableStartupNotesCheckbox);
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:26,代码来源:EnableStartupNotesPreference.cs

示例13: MainWindow_Event

        public MainWindow_Event()
            : base("")
        {
            SetDefaultSize(250, 200);
            SetPosition(WindowPosition.Center);

            DeleteEvent += delegate { Application.Quit(); };

            Fixed fix = new Fixed();

            Button btn = new Button("Enter");
            btn.EnterNotifyEvent += OnEnter;

            _quit = new Button("Quit");
            //_quit.Clicked += OnClick;
            _quit.SetSizeRequest(80, 35);

            CheckButton cb = new CheckButton("connect");
            cb.Toggled += OnToggled;

            fix.Put(btn, 50, 20);
            fix.Put(_quit, 50, 50);
            fix.Put(cb, 120, 20);
            Add(fix);
            ShowAll();
        }
开发者ID:oraora81,项目名称:NOCmono,代码行数:26,代码来源:MainWindow_Event.cs

示例14: Build

		void Build ()
		{
			Stetic.Gui.Initialize (this);
			Stetic.BinContainer.Attach (this);

			var vbox = new VBox ();
			vbox.Spacing = 6;

			packOnBuildButton = new CheckButton ();
			packOnBuildButton.Label = GettextCatalog.GetString ("Create a NuGet Package when building the project.");

			vbox.PackStart (packOnBuildButton, false, false, 10);

			missingMetadataLabel = new Label ();
			missingMetadataLabel.LineWrapMode = Pango.WrapMode.Word;
			missingMetadataLabel.Wrap = true;
			missingMetadataLabel.Xalign = 0;
			missingMetadataLabel.Yalign = 0;
			missingMetadataLabel.Xpad = 20;
			missingMetadataLabel.WidthRequest = 600;
			missingMetadataLabel.Text = GettextCatalog.GetString ("The project does not have NuGet package metadata so a NuGet package will not be created. NuGet package metadata can be specified in the Metadata section in Project Options");

			vbox.PackStart (missingMetadataLabel);

			Add (vbox);

			ShowAll ();
		}
开发者ID:PlayScriptRedux,项目名称:monodevelop,代码行数:28,代码来源:GtkProjectNuGetBuildOptionsPanelWidget.UI.cs

示例15: CredentialsDialog

		public CredentialsDialog (URIish uri, IEnumerable<CredentialItem> credentials)
		{
			this.Build ();
			this.credentials = credentials;
			
			labelTop.Text = string.Format (labelTop.Text, uri.ToString ());
			
			Gtk.Table table = new Gtk.Table (0, 0, false);
			table.ColumnSpacing = 6;
			vbox.PackStart (table, true, true, 0);
			
			uint r = 0;
			Widget firstEditor = null;
			foreach (CredentialItem c in credentials) {
				Label lab = new Label (c.GetPromptText () + ":");
				lab.Xalign = 0;
				table.Attach (lab, 0, 1, r, r + 1);
				Table.TableChild tc = (Table.TableChild) table [lab];
				tc.XOptions = AttachOptions.Shrink;
				
				Widget editor = null;
				
				if (c is CredentialItem.YesNoType) {
					CredentialItem.YesNoType cred = (CredentialItem.YesNoType) c;
					CheckButton btn = new CheckButton ();
					editor = btn;
					btn.Toggled += delegate {
						cred.SetValue (btn.Active);
					};
				}
				else if (c is CredentialItem.StringType || c is CredentialItem.CharArrayType) {
					CredentialItem cred = c;
					Entry e = new Entry ();
					editor = e;
					e.ActivatesDefault = true;
					if (cred.IsValueSecure ())
						e.Visibility = false;
					e.Changed += delegate {
						if (cred is CredentialItem.StringType)
							((CredentialItem.StringType)cred).SetValue (e.Text);
						else
							((CredentialItem.CharArrayType)cred).SetValue (e.Text.ToCharArray ());
					};
				}
				if (editor != null) {
					table.Attach (editor, 1, 2, r, r + 1);
					tc = (Table.TableChild) table [lab];
					tc.XOptions = AttachOptions.Fill;
					if (firstEditor == null)
						firstEditor = editor;
				}
				
				r++;
			}
			table.ShowAll ();
			Focus = firstEditor;
			Default = buttonOk;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:58,代码来源:CredentialsDialog.cs


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