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


C# Gtk.Entry类代码示例

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


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

示例1: InitializeComponents

        void InitializeComponents()
        {
            // set up this actual dialog
            this.Modal = true;
            // FIXME: make this a resource in the resource file
            this.Title = String.Format (GettextCatalog.GetString ("{0} Code Group"), titlePrefix);

            // set up the dialog fields and add them
            templateExtensionsTextBox = new Gtk.Entry();
            templateExtensionsTextBox.ActivatesDefault = true;
            // FIXME: make this a resource in the resource file
            Gtk.Label label1 = new Gtk.Label("Extensions (; seperated)");

            label1.Xalign = 0;
            templateExtensionsTextBox.Text    = string.Join(";", codeTemplateGroup.ExtensionStrings);

            // FIXME: make the labels both part of the same sizing group so they have the same left and right rows.
            Gtk.HBox hBox1 = new Gtk.HBox(false, 6);
            hBox1.PackStart(label1, false, false, 6);
            hBox1.PackStart(templateExtensionsTextBox, false, false, 6);

            this.VBox.PackStart(hBox1, false, false, 6);

            // set up the buttons and add them
            this.DefaultResponse = Gtk.ResponseType.Ok;
            Gtk.Button cancelButton = new Gtk.Button(Gtk.Stock.Cancel);
            Gtk.Button okButton = new Gtk.Button(Gtk.Stock.Ok);
            okButton.Clicked += new EventHandler(AcceptEvent);
            cancelButton.Clicked += new EventHandler(CancelEvent);
            this.AddActionWidget (cancelButton, Gtk.ResponseType.Cancel);
            this.AddActionWidget (okButton, (int) Gtk.ResponseType.Ok);
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:32,代码来源:EditTemplateGroupDialog.cs

示例2: MenuButtonEntry

		public MenuButtonEntry (Gtk.Entry entry, Gtk.Button button)
		{
			if (entry == null) entry = new Gtk.Entry ();
			if (button == null) button = new Gtk.Button (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.Out));
			
			this.entry = entry;
			this.button = button;
			
			manager = new CommandManager ();
			manager.RegisterGlobalHandler (this);
			
			if (entry.Parent == null)
				PackStart (entry, true, true, 0);
			if (button.Parent == null)
				PackStart (button, false, false, 2);
			
			ActionCommand cmd = new ActionCommand ("InsertOption", "InsertOption", null);
			cmd.CommandArray = true;
			manager.RegisterCommand (cmd);
			entrySet = new CommandEntrySet ();
			entrySet.AddItem ("InsertOption");
			
			button.Clicked += ShowQuickInsertMenu;
			button.StateChanged += ButtonStateChanged;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:25,代码来源:MenuButtonEntry.cs

示例3: DoubleInputView

        public DoubleInputView(DoubleInputModel model)
        {
            this.Build ();

            for (int i = 0; i < model.Count; ++i)
            {
                var input = new Gtk.Entry();
                var label = new Gtk.Label(model._labels[i] + ": ");

                //The index i was being "captured" by referance in the anonymous function.\
                //This makes a copy
                int j = i;
                input.Changed +=
                (object sender, EventArgs e) =>
                {
                    Double.TryParse((sender as Gtk.Entry).Text, out model._inputs[j]);
                    Console.WriteLine("we wrote: " + model._inputs[j] + " j: " + j);
                };
                MainView.Put(label, 10, 10 + i*40);
                MainView.Put(input, 120, 10 + i*40);
            }

            buttonCancel.Clicked += (o, args) => {model._inputs = null; this.Destroy();};
            buttonOk.Clicked += (o, args) => {this.Destroy();};
        }
开发者ID:jqt3of5,项目名称:StaticsSimulator,代码行数:25,代码来源:DoubleInputView.cs

示例4: WebSyncPreferencesWidget

		public WebSyncPreferencesWidget (Api.OAuth oauth, string server, EventHandler requiredPrefChanged) : base (false, 5)
		{
			this.oauth = oauth;
			
			Gtk.Table prefsTable = new Gtk.Table (1, 2, false);
			prefsTable.RowSpacing = 5;
			prefsTable.ColumnSpacing = 10;

			serverEntry = new Gtk.Entry ();
			serverEntry.Text = server;
			AddRow (prefsTable, serverEntry, Catalog.GetString ("Se_rver:"), 0);
			
			Add (prefsTable);

			authButton = new Gtk.Button ();
			// TODO: If Auth is valid, this text should change
			if (!Auth.IsAccessToken)
				authButton.Label = Catalog.GetString ("Connect to Server");
			else {
				authButton.Label = Catalog.GetString ("Connected");
				authButton.Sensitive = false;
			}
			authButton.Clicked += OnAuthButtonClicked;

			serverEntry.Changed += delegate {
				Auth = null;
			};
			serverEntry.Changed += requiredPrefChanged;

			Add (authButton);

			// TODO: Add a section that shows the user something to verify they put
			//       in the right URL...something that constructs their user URL, maybe?
			ShowAll ();
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:35,代码来源:WebSyncPreferencesWidget.cs

示例5: CreateUmlElement

 // uses reflection to call the corresponding method in the "Create" class.
 public static UML.Element CreateUmlElement(string elementType)
 {
     Type create = typeof(UML.Create);
     object newElement = create.InvokeMember(
         elementType,
         BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static,
         null,
         null,
         null);
     UML.NamedElement ne = newElement as UML.NamedElement;
     if(ne != null)
     {
         _dialog = new Gtk.MessageDialog(
             null, Gtk.DialogFlags.Modal, Gtk.MessageType.Question,
             Gtk.ButtonsType.Ok, GettextCatalog.GetString ("New element name:"));
         Gtk.Entry elementName = new Gtk.Entry();
         elementName.Activated += new EventHandler(CloseNewElementNameModal);
         _dialog.VBox.Add(elementName);
         elementName.Show();
         _dialog.Run();
         ne.Name = String.Format(elementName.Text, elementType);
         _dialog.Destroy();
         _dialog = null;
     }
     return (UML.Element)newElement;
 }
开发者ID:MonoBrasil,项目名称:historico,代码行数:27,代码来源:Helper.cs

示例6: BorderEditor

 public BorderEditor()
 {
     entry = new Gtk.Entry ();
     entry.Changed += OnChanged;
     entry.HasFrame = false;
     PackStart (entry, true, true, 0);
     ShowAll ();
 }
开发者ID:elsupergomez,项目名称:monoreports,代码行数:8,代码来源:BorderEditor.cs

示例7: TextEntryWithCodeCompletion

		public TextEntryWithCodeCompletion ()
		{
			gtkEntry = Xwt.Toolkit.CurrentEngine.GetNativeWidget (this) as Gtk.Entry;
			if (gtkEntry == null)
				throw new NotImplementedException ();
			gtkEntry.KeyReleaseEvent += HandleKeyReleaseEvent;
			gtkEntry.KeyPressEvent += HandleKeyPressEvent;
			CompletionWindowManager.WindowClosed += HandleWindowClosed;
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:9,代码来源:TextEntryWithCodeCompletion.cs

示例8: Build

 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget ocmgtk.CoordinateWidget
     Stetic.BinContainer.Attach(this);
     this.Name = "ocmgtk.CoordinateWidget";
     // Container child ocmgtk.CoordinateWidget.Gtk.Container+ContainerChild
     this.hbox5 = new Gtk.HBox();
     this.hbox5.Name = "hbox5";
     this.hbox5.Spacing = 6;
     // Container child hbox5.Gtk.Box+BoxChild
     this.directionCombo = Gtk.ComboBox.NewText();
     this.directionCombo.WidthRequest = 50;
     this.directionCombo.Name = "directionCombo";
     this.hbox5.Add(this.directionCombo);
     Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.hbox5[this.directionCombo]));
     w1.Position = 0;
     w1.Expand = false;
     // Container child hbox5.Gtk.Box+BoxChild
     this.degreeEntry = new Gtk.Entry();
     this.degreeEntry.CanFocus = true;
     this.degreeEntry.Name = "degreeEntry";
     this.degreeEntry.Text = "000";
     this.degreeEntry.IsEditable = true;
     this.degreeEntry.WidthChars = 3;
     this.degreeEntry.MaxLength = 3;
     this.degreeEntry.InvisibleChar = '•';
     this.hbox5.Add(this.degreeEntry);
     Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox5[this.degreeEntry]));
     w2.Position = 1;
     w2.Expand = false;
     // Container child hbox5.Gtk.Box+BoxChild
     this.label9 = new Gtk.Label();
     this.label9.Name = "label9";
     this.label9.LabelProp = Mono.Unix.Catalog.GetString("°");
     this.hbox5.Add(this.label9);
     Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox5[this.label9]));
     w3.Position = 2;
     w3.Expand = false;
     w3.Fill = false;
     // Container child hbox5.Gtk.Box+BoxChild
     this.minuteEntry = new Gtk.Entry();
     this.minuteEntry.CanFocus = true;
     this.minuteEntry.Name = "minuteEntry";
     this.minuteEntry.Text = "0.000";
     this.minuteEntry.IsEditable = true;
     this.minuteEntry.InvisibleChar = '•';
     this.hbox5.Add(this.minuteEntry);
     Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox5[this.minuteEntry]));
     w4.Position = 3;
     this.Add(this.hbox5);
     if ((this.Child != null)) {
         this.Child.ShowAll();
     }
     this.Hide();
 }
开发者ID:cbuehler,项目名称:opencachemanager,代码行数:56,代码来源:ocmgtk.CoordinateWidget.cs

示例9: Initialize

		public override void Initialize (PropertyDescriptor prop)
		{
			base.Initialize (prop);
			
			entry = new Gtk.Entry ();
			entry.HasFrame = false;
			entry.Show ();
			entry.Changed += EntryChanged;
			Add (entry);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:10,代码来源:String.cs

示例10: BuildFileNameGroup

        private void BuildFileNameGroup(Gtk.HBox hbFileName)
        {
            this.btOpen = new Gtk.Button( Gtk.Stock.Open );
            this.edFileName = new Gtk.Entry();

            this.edFileName.IsEditable = false;
            this.btOpen.Clicked += (sender, e) => this.OnOpen();

            hbFileName.PackStart( this.edFileName, true, true, 5 );
            hbFileName.PackStart( this.btOpen, false, false, 5 );
        }
开发者ID:Baltasarq,项目名称:Tacto,代码行数:11,代码来源:ChooseConversionFormatView.cs

示例11: Build

 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget MonoDevelop.TaskForce.LocalProvider.Gui.NewCategory
     this.Name = "MonoDevelop.TaskForce.LocalProvider.Gui.NewCategory";
     this.Title = Mono.Unix.Catalog.GetString("NewCategory");
     this.WindowPosition = ((Gtk.WindowPosition)(4));
     // Container child MonoDevelop.TaskForce.LocalProvider.Gui.NewCategory.Gtk.Container+ContainerChild
     this.vbox1 = new Gtk.VBox();
     this.vbox1.Name = "vbox1";
     this.vbox1.Spacing = 6;
     // Container child vbox1.Gtk.Box+BoxChild
     this.label1 = new Gtk.Label();
     this.label1.Name = "label1";
     this.label1.LabelProp = Mono.Unix.Catalog.GetString("label1");
     this.vbox1.Add(this.label1);
     Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.label1]));
     w1.Position = 0;
     w1.Expand = false;
     w1.Fill = false;
     // Container child vbox1.Gtk.Box+BoxChild
     this.categoryName = new Gtk.Entry();
     this.categoryName.CanFocus = true;
     this.categoryName.Name = "categoryName";
     this.categoryName.IsEditable = true;
     this.categoryName.InvisibleChar = '●';
     this.vbox1.Add(this.categoryName);
     Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.categoryName]));
     w2.Position = 1;
     w2.Expand = false;
     w2.Fill = false;
     // Container child vbox1.Gtk.Box+BoxChild
     this.button1 = new Gtk.Button();
     this.button1.CanFocus = true;
     this.button1.Name = "button1";
     this.button1.UseUnderline = true;
     this.button1.Label = Mono.Unix.Catalog.GetString("button1");
     this.vbox1.Add(this.button1);
     Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.button1]));
     w3.Position = 2;
     w3.Expand = false;
     w3.Fill = false;
     this.Add(this.vbox1);
     if ((this.Child != null)) {
         this.Child.ShowAll();
     }
     this.DefaultWidth = 400;
     this.DefaultHeight = 300;
     this.Show();
     this.button1.Clicked += new System.EventHandler(this.OnButton1Clicked);
 }
开发者ID:skyronic,项目名称:TFAddin,代码行数:51,代码来源:MonoDevelop.TaskForce.LocalProvider.Gui.NewCategory.cs

示例12: Accelerator

		public Accelerator ()
		{
			entry = new Gtk.Entry ();
			clearButton = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu));
			PackStart (entry, true, true, 0);
			PackStart (clearButton, false, false, 3);
			clearButton.Clicked += delegate (object s, EventArgs args) {
				Value = null;
			};
			entry.IsEditable = false;
			entry.ButtonPressEvent += OnButtonPressEvent;
			entry.KeyPressEvent += OnKeyPressEvent;
			ShowAll ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:14,代码来源:Accelerator.cs

示例13: Build

 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget HollyLibrary.HBaseComboBox
     Stetic.BinContainer.Attach(this);
     this.Name = "HollyLibrary.HBaseComboBox";
     // Container child HollyLibrary.HBaseComboBox.Gtk.Container+ContainerChild
     this.hbox3 = new Gtk.HBox();
     this.hbox3.Name = "hbox3";
     // Container child hbox3.Gtk.Box+BoxChild
     this.hbox4 = new Gtk.HBox();
     this.hbox4.Name = "hbox4";
     this.hbox4.Spacing = 2;
     this.hbox4.BorderWidth = ((uint)(5));
     // Container child hbox4.Gtk.Box+BoxChild
     this.entry = new Gtk.Entry();
     this.entry.CanFocus = true;
     this.entry.Name = "entry";
     this.entry.IsEditable = true;
     this.entry.HasFrame = false;
     this.entry.InvisibleChar = '●';
     this.hbox4.Add(this.entry);
     Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.hbox4[this.entry]));
     w1.Position = 0;
     this.hbox3.Add(this.hbox4);
     Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox3[this.hbox4]));
     w2.Position = 0;
     // Container child hbox3.Gtk.Box+BoxChild
     this.popupButton = new Gtk.Button();
     this.popupButton.WidthRequest = 30;
     this.popupButton.CanFocus = true;
     this.popupButton.Name = "popupButton";
     // Container child popupButton.Gtk.Container+ContainerChild
     this.arrow1 = new Gtk.Arrow(((Gtk.ArrowType)(1)), ((Gtk.ShadowType)(2)));
     this.arrow1.Name = "arrow1";
     this.popupButton.Add(this.arrow1);
     this.popupButton.Label = null;
     this.hbox3.Add(this.popupButton);
     Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox3[this.popupButton]));
     w4.Position = 1;
     w4.Expand = false;
     this.Add(this.hbox3);
     if ((this.Child != null)) {
         this.Child.ShowAll();
     }
     this.Show();
     this.entry.FocusInEvent += new Gtk.FocusInEventHandler(this.OnEntryFocusInEvent);
     this.entry.FocusOutEvent += new Gtk.FocusOutEventHandler(this.OnEntryFocusOutEvent);
 }
开发者ID:tizianomanni,项目名称:holly-gtk-widgets,代码行数:49,代码来源:HollyLibrary.HBaseComboBox.cs

示例14: CreateNotebookDialog

		public CreateNotebookDialog(Gtk.Window parent,
									Gtk.DialogFlags flags)
				: base (parent, flags, Gtk.MessageType.Info,
						Gtk.ButtonsType.None,
						Catalog.GetString ("Create a new notebook"),
						Catalog.GetString ("Type the name of the notebook you'd like to create."))
		{
			this.Pixbuf = newNotebookIconDialog;
			
			Gtk.Table table = new Gtk.Table (2, 2, false);
			
			Gtk.Label label = new Gtk.Label (Catalog.GetString ("N_otebook name:"));
			label.Xalign = 0;
			label.UseUnderline = true;
			label.Show ();
			
			nameEntry = new Gtk.Entry ();
			nameEntry.Changed += OnNameEntryChanged;
			nameEntry.ActivatesDefault = true;
			nameEntry.Show ();
			label.MnemonicWidget = nameEntry;
			
			errorLabel = new Gtk.Label ();
			errorLabel.Xalign = 0;
			errorLabel.Markup = string.Format("<span foreground='red' style='italic'>{0}</span>",
			                                  Catalog.GetString ("Name already taken"));
			
			table.Attach (label, 0, 1, 0, 1);
			table.Attach (nameEntry, 1, 2, 0, 1);
			table.Attach (errorLabel, 1, 2, 1, 2);
			table.Show ();
			
			ExtraWidget = table;
			
			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
			AddButton (
				newNotebookIcon,
				// Translation note: This is the Create button in the Create
				// New Note Dialog.
				Catalog.GetString ("C_reate"),
				Gtk.ResponseType.Ok,
				true);
			
			// Only let the Ok response be sensitive when
			// there's something in nameEntry
			SetResponseSensitive (Gtk.ResponseType.Ok, false);
			errorLabel.Hide ();
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:48,代码来源:CreateNotebookDialog.cs

示例15: CreatePanelWidget

        public override Gtk.Widget CreatePanelWidget ()
        {
            Gtk.VBox box = new Gtk.VBox ();
            box.Spacing = 6;

            Gtk.HBox labelBox = new Gtk.HBox ();

            Gtk.Label label = CreateLabel ("Android studio executable location:");

            labelBox.PackStart (label, false, false, 0);

            entry = new FileEntry ();
            entry.Path = AddInPreferences.AndroidStudioLocation;


            Gtk.HBox sdkVersions = new Gtk.HBox ();
            Gtk.Label minSdkLabel = CreateLabel ("Min SDK version:");
            MinSdkEntry = new Gtk.Entry (AddInPreferences.MinSdkVersion);
            Gtk.Label targetSdkLabel = CreateLabel ("Target/Compile SDK version:");
            TargetSdkEntry = new Gtk.Entry (AddInPreferences.CompileSdkVersion);


            sdkVersions.PackStart (minSdkLabel, false, false, 0);
            sdkVersions.PackStart (MinSdkEntry, true, false, 0);
            sdkVersions.PackStart (targetSdkLabel, false, false, 0);
            sdkVersions.PackStart (TargetSdkEntry, true, false, 0);


            Gtk.HBox otherVersions = new Gtk.HBox ();
            Gtk.Label supportVersionLabel = CreateLabel ("Support library versions:");
            SupportVersionEntry = new Gtk.Entry (AddInPreferences.SupportVersion);
            Gtk.Label buildToolsVersionLabel = CreateLabel ("Build tools version:");
            BuildToolsVersionEntry = new Gtk.Entry (AddInPreferences.BuildToolsVersion);


            otherVersions.PackStart (supportVersionLabel, false, false, 0);
            otherVersions.PackStart (SupportVersionEntry, true, false, 0);
            otherVersions.PackStart (buildToolsVersionLabel, false, false, 0);
            otherVersions.PackStart (BuildToolsVersionEntry, true, false, 0);

            box.PackStart (labelBox, false, false, 0);
            box.PackStart (entry, false, false, 0);
            box.PackStart (sdkVersions, false, false, 0);
            box.PackStart (otherVersions, false, false, 0);
            box.ShowAll ();
            return box;

        }
开发者ID:taiste,项目名称:ViewInAndroidStudio,代码行数:48,代码来源:GeneralOptions.cs


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