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


C# Gtk.Entry类代码示例

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


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

示例1: ConsoleGtk

		public ConsoleGtk ()
		{
			Window win = new Window ("MonoLOGO");
			win.DeleteEvent += new EventHandler (Window_Delete);
			win.BorderWidth = 4;
			win.DefaultSize = new Size (450, 300);
			
			VBox vbox = new VBox (false, 4);
			win.EmitAdd (vbox);
			
			ScrolledWindow swin = new ScrolledWindow (new Adjustment (0.0, 0.0, 0.0, 0.0, 0.0, 0.0), new Adjustment (0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
			swin.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			swin.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			swin.ShadowType = Gtk.ShadowType.In;
			vbox.PackStart (swin, true, true, 0);
			
			TextBuffer buf = new TextBuffer (new TextTagTable ());
			Out = new TextWriterGtk (buf);
			TextView text = new TextView (buf);
			text.Editable = false;
			swin.EmitAdd (text);

			Entry entry = new Entry ();
			entry.Activate += new EventHandler (Entry_Activate);
			vbox.PackStart (entry, false, false, 0);
			
			win.ShowAll ();
		}
开发者ID:emtees,项目名称:old-code,代码行数:28,代码来源:console-gtk.cs

示例2: WebNavigationBox

        public WebNavigationBox()
        {
            var hbox = new HBox(false, 1);

            _goBackButton = CreateButton("Back", Stock.GoBack, OnGoBack);
            hbox.Add(_goBackButton);
            ((Box.BoxChild)hbox[_goBackButton]).Expand = false;

            _goForwardButton = CreateButton("Forward", Stock.GoForward, OnGoForward);
            hbox.Add(_goForwardButton);
            ((Box.BoxChild)hbox[_goForwardButton]).Expand = false;

            _stopButton = CreateButton("Stop", Stock.Stop, OnStop);
            hbox.Add(_stopButton);
            ((Box.BoxChild)hbox[_stopButton]).Expand = false;

            _refreshButton = CreateButton("Refresh", Stock.Refresh, OnRefresh);
            hbox.Add(_refreshButton);
            ((Box.BoxChild)hbox[_refreshButton]).Expand = false;

            _homeButton = CreateButton("Home", Stock.Home, OnHome);
            hbox.Add(_homeButton);
            ((Box.BoxChild)hbox[_homeButton]).Expand = false;

            _addressEntry = new Entry();
            _addressEntry.CanFocus = true;
            hbox.Add(_addressEntry);
            ((Box.BoxChild)hbox[_addressEntry]).Expand = true;

            _goButton = CreateButton("Go", Stock.Ok, OnGo);
            hbox.Add(_goButton);
            ((Box.BoxChild)hbox[_goButton]).Expand = false;

            Add(hbox);
        }
开发者ID:rajsite,项目名称:lvcef,代码行数:35,代码来源:WebNavigationBox.cs

示例3: ViewOrderTotal

		public ViewOrderTotal() : base()
		{
			HBox hb = new HBox();
			
			Label label2 = new Label("Price:");
			Label label3 = new Label("Tax:");
			Label label4 = new Label("TTC:");
			
			
			entryprice = new Entry();
			entryprice.WidthRequest = 50;
			entryprice.IsEditable = false;
			entrytax = new Entry();
			entrytax.WidthRequest = 50;
			entrytax.IsEditable = false;
			entryttcprice = new Entry();
			entryttcprice.WidthRequest = 50;
			entryttcprice.IsEditable = false;
			
			this.Label = "Total";
			this.Add(hb);
			hb.BorderWidth = 6;
			//hb.PackStart(label1);
			hb.PackStart(label2, false, true, 6);
			hb.PackStart(entryprice, true, true, 0);
			hb.PackStart(label3, false, true, 6);
			hb.PackStart(entrytax, true, true, 0);
			hb.PackStart(label4, false, true, 6);
			hb.PackStart(entryttcprice, true, true, 0);
		}
开发者ID:hpbaotho,项目名称:supos,代码行数:30,代码来源:ViewOrderTotal.cs

示例4: QueryBox

        public QueryBox (Client app)
        {
            this.app = app;
            AppPaintable = true;

            hbox = new HBox () { BorderWidth = 6 };

            Entry = new Gtk.Entry () { WidthChars = 40 };
            Entry.Activated += OnActivated;

            var query_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("Select Matching"), Gtk.Stock.Find);
            query_button.Clicked += OnActivated;

            var close_button = new Hyena.Widgets.ImageButton (null, Gtk.Stock.Close);
            close_button.Clicked += delegate {
                Hide ();
            };

            hbox.PackStart (Entry, true, true, 0);
            hbox.PackStart (query_button, false, false, 0);
            hbox.PackStart (close_button, false, false, 0);
            Child = hbox;

            KeyPressEvent += delegate (object o, KeyPressEventArgs args) {
                if (args.Event.Key == Gdk.Key.Escape) {
                    Hide ();
                }
            };

            ShowAll ();
        }
开发者ID:GNOME,项目名称:pdfmod,代码行数:31,代码来源:SelectMatchingBox.cs

示例5: rename_category

        public void rename_category(bool is_create)
        {
            Gtk.Entry rename_entry = new Gtk.Entry();
            rename_entry.Text = category.metalabel.label;
            rename_entry.Name = "rename_cat";
            rename_entry.AddEvents((int)Gdk.EventMask.KeyReleaseMask);
            rename_entry.KeyReleaseEvent += delegate (object sender, Gtk.KeyReleaseEventArgs e) {
                on_rename_cat_key_release(e, is_create);
            };

            int pos = 0;
            foreach (Widget w in representation) {
                if (w.Name == category.metalabel.label) {
                    w.Destroy();
                    break;
                } else
                    ++pos;
            }

            representation.PackStart(rename_entry, false, false, 6);
            representation.ReorderChild(rename_entry, pos);
            representation.ShowAll();

            rename_entry.GrabFocus();
        }
开发者ID:GNOME,项目名称:nemo,代码行数:25,代码来源:CategoryDrawer.cs

示例6: 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))
			{
				store = new ListStore (typeof(string), typeof(object));

				//if converter doesn't allow nonstandard values, or can't convert from strings, don't have an entry
				if (session.Property.Converter.GetStandardValuesExclusive (session) || !session.Property.Converter.CanConvertFrom (session, typeof(string))) {
					combo = new ComboBox (store);
					var crt = new CellRendererText ();
					combo.PackStart (crt, true);
					combo.AddAttribute (crt, "text", 0);
				} else {
					combo = new ComboBoxEntry (store, 0);
					entry = ((ComboBoxEntry)combo).Entry;
					entry.HeightRequest = combo.SizeRequest ().Height;
				}

				PackStart (combo, true, true, 0);
				combo.Changed += TextChanged;
				
				//fill the list
				foreach (object stdValue in session.Property.Converter.GetStandardValues (session)) {
					store.AppendValues (session.Property.Converter.ConvertToString (session, stdValue), ObjectBox.Box (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 = (model, iter) => separator == ((string)model.GetValue (iter, 0));
				}
			}
			// no standard values, so just use an entry
			else {
				entry = new Entry ();
				PackStart (entry, true, true, 0);
			}

			//if we have an entry, fix it up a little
			if (entry != null) {
				entry.HasFrame = false;
				entry.Changed += TextChanged;
				entry.FocusOutEvent += FirePendingChangeEvent;
			}

			if (entry != null && ShouldShowDialogButton ()) {
				var button = new Button ("...");
				PackStart (button, false, false, 0);
				button.Clicked += ButtonClicked;
			}
			
			Spacing = 3;
			ShowAll ();
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:60,代码来源:TextEditor.cs

示例7: Navbar

		public Navbar (Gtk.IconSize size)
		{
			address = new Entry ("address");
			// FIXME: this doesnt't seem to work yet
			// address.Completion = new EntryCompletion ();
			address.WidthChars = 50;
			address.Activated += new EventHandler (OnGoUrl);

			ActionEntry[] actions = new ActionEntry[]
			{
				new ActionEntry ("back", Gtk.Stock.GoBack, null, null, GettextCatalog.GetString ("Go back"), new EventHandler (OnBackClicked)),
				new ActionEntry ("forward", Gtk.Stock.GoForward, null, null, GettextCatalog.GetString ("Go forward"), new EventHandler (OnForwardClicked)),
				new ActionEntry ("stop", Gtk.Stock.Stop, null, null, GettextCatalog.GetString ("Stop loading"), new EventHandler (OnStopClicked)),
				new ActionEntry ("reload", Gtk.Stock.Refresh, null, null, GettextCatalog.GetString ("Address"), new EventHandler (OnReloadClicked)),
				new ActionEntry ("go", Gtk.Stock.Ok, null, null, GettextCatalog.GetString ("Load address"), new EventHandler (OnGoUrl))
			};

			ActionGroup ag = new ActionGroup ("navbarGroup");
			ag.Add (actions);

			UIManager uim = new UIManager ();
			uim.InsertActionGroup (ag, 0);
			uim.AddWidget += new AddWidgetHandler (OnAddWidget);
			uim.AddUiFromString (uiInfo);

			ToolItem item = new ToolItem ();
			item.Add (address);
	
			Toolbar tb = uim.GetWidget ("/ui/toolbar") as Toolbar;
			tb.IconSize = size;
			tb.Add (item);
			this.ShowAll ();
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:33,代码来源:Navbar.cs

示例8: CategoriaListView

        public CategoriaListView()
        {
            TreeViewHelper t=new TreeViewHelper(treeView,"Select * from categoria");
            Gtk.Action refreshAction = new Gtk.Action("refreshAction", null, null, Stock.Refresh);
            //tengo acceso al actionGroup de IEntityListView
            actionGroup.Add(refreshAction);
            refreshAction.Activated += delegate {t.Refresh ();};
            Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
            actionGroup.Add(editAction);
            editAction.Activated += delegate {
                Window ventana=new Window("Editar");
                ventana.SetDefaultSize(500,500);
                VBox h=new VBox(true,10);
                ventana.Add (h);
                Label enunciado=new Label("Introduce el nuevo valor:");
                h.Add (enunciado);
                Entry caja=new Entry();
                h.Add (caja);
                Button b=new Button("Editar");
                h.Add (b);
                b.Clicked+=delegate
                {
                    IDbCommand dbCommand=App.Instance.DbConnection.CreateCommand();
                    dbCommand.CommandText =
                    string.Format ("update categoria set nombre='{1}' where id={0}", t.Id,caja.Text);
                    dbCommand.ExecuteNonQuery ();
                };

                ventana.ShowAll();

            };
        }
开发者ID:ruben206,项目名称:ad,代码行数:32,代码来源:CategoriaListView.cs

示例9: RecentFileListWindow

        public RecentFileListWindow(string title, Gtk.Window parent, DialogFlags flags, params object[] button_data)
            : base(title, parent, flags, button_data)
        {
            _searchView = new Gtk.Entry ("");
            _searchView.SetSizeRequest (500, 40);
            _searchView.Changed += _searchView_Changed;
            _searchView.KeyReleaseEvent += HandleSearchViewKeyReleaseEvent;
            _searchView.KeyPressEvent += HandleKeyPressEvent;
            _searchView.FocusOutEvent += HandleFocusOutEvent;
            VBox.Add (_searchView);

            CreateTree ();
            VBox.Add (_treeView);

            _pathLabel = new Gtk.Label ();
            _pathLabel.SetSizeRequest (500, 40);
            VBox.Add (_pathLabel);

            MemberExtensionsHelper.Instance.IsDirty = true;
            UpdateDocuments ();
            this.SetSizeRequest (500, 700);

            CanFocus = true;
            _searchView.CanFocus = true;
            _searchView.IsEditable = true;
            _searchView.GrabFocus ();
            ShowAll ();
        }
开发者ID:prashantvc,项目名称:EditorComfortAddin,代码行数:28,代码来源:RecentFileListWindow.cs

示例10: MemberListWindow

        public MemberListWindow(string title, Gtk.Window parent, DialogFlags flags, params object[] button_data)
            : base(title, parent, flags, button_data)
        {
            if (IdeApp.Workbench == null) {
                return;
            }
            var rootWindow = IdeApp.Workbench.RootWindow;
            _searchView = new Gtk.Entry ("");
            _searchView.SetSizeRequest (500, 40);
            _searchView.Changed += _searchView_Changed;
            _searchView.KeyReleaseEvent += HandleSearchViewKeyReleaseEvent;
            _searchView.KeyPressEvent += HandleKeyPressEvent;
            _searchView.FocusOutEvent += HandleFocusOutEvent;
            VBox.Add (_searchView);

            CreateTree ();
            VBox.Add (_treeView);

            MemberExtensionsHelper.Instance.IsDirty = true;
            UpdateMembers ();
            var editor = IdeApp.Workbench.ActiveDocument.Editor;
            var visualInsertLocation = editor.LogicalToVisualLocation (editor.Caret.Location);
            var targetView = IdeApp.Workbench.RootWindow;

            this.SetSizeRequest (500, 700);

            CanFocus = true;
            _searchView.CanFocus = true;
            _searchView.IsEditable = true;
            _searchView.GrabFocus ();
            ShowAll ();
        }
开发者ID:prashantvc,项目名称:EditorComfortAddin,代码行数:32,代码来源:MemberListWindow.cs

示例11: DateTimeEditor

		public DateTimeEditor()
		{
			entry = new Gtk.Entry ();
			entry.Changed += OnChanged;
			PackStart (entry, true, true, 0);
			ShowAll ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:DateTimeEditor.cs

示例12: creaVentanaArticulo

        public void creaVentanaArticulo()
        {
            App.Instance.Tabla=new Table(4,2,false);
            separaFilas(App.Instance.Tabla,10);
            App.Instance.vb.PackStart(App.Instance.Tabla,false,false,0);
            Label cat=new Label("Introduce el nombre del nuevo articulo: ");
            text= new Entry();
            ComboBox cb=new ComboBox();
            Label cat2=new Label("Selecciona la categoria: ");
            combot= new ComboBoxHelper(dbConnection,cb,"nombre","id",0,"categoria");

            App.Instance.Tabla.Attach(cat,0,1,0,1);
            App.Instance.Tabla.Attach(text,1,2,0,1);
            App.Instance.Tabla.Attach(cat2,0,1,1,2);
            App.Instance.Tabla.Attach(cb,1,2,1,2);
            Label pre=new Label("Introduce el precio del nuevo articulo: ");
            precio=new Entry();

            App.Instance.Tabla.Attach(pre,0,1,2,3);
            App.Instance.Tabla.Attach(precio,1,2,2,3);
            Button button=new Button("Añadir");
                    button.Clicked +=delegate{
                    añadirArticulo(dbConnection);
                    if(!enBlanco)
                        App.Instance.Wind.Destroy();
            };

            App.Instance.Tabla.Attach(button,1,2,3,4);
            App.Instance.Wind.ShowAll();
        }
开发者ID:nerea123,项目名称:ad,代码行数:30,代码来源:ArticuloListView.cs

示例13: DemoEntryCompletion

		public DemoEntryCompletion () : base ("Demo Entry Completion", null, DialogFlags.DestroyWithParent)
		{
			Resizable = false;

			VBox vbox = new VBox (false, 5);
			vbox.BorderWidth = 5;
			this.VBox.PackStart (vbox, true, true, 0);

			Label label = new Label ("Completion demo, try writing <b>total</b> or <b>gnome</b> for example.");
			label.UseMarkup = true;
			vbox.PackStart (label, false, true, 0);

			Entry entry = new Entry ();
			vbox.PackStart (entry, false, true, 0);

			entry.Completion = new EntryCompletion ();
			entry.Completion.Model = CreateCompletionModel ();
			entry.Completion.TextColumn = 0;

			AddButton (Stock.Close, ResponseType.Close);

			ShowAll ();
			Run ();
			Destroy ();
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:DemoEntryCompletion.cs

示例14: 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 = new Entry ();
            address_entry.Activated += OnEntryActivated;
            address_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.Ok, ResponseType.Ok, true);
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:31,代码来源:OpenRemoteServer.cs

示例15: FormOrder

		public FormOrder() : base(4,2, false)
		{
			labelid = new Label("Id :");
			labelid.SetAlignment(0, (float)0.5);
			labelcust = new Label("Customer :");
			labelcust.SetAlignment(0, (float)0.5);
			labelpay = new Label("Payment :");
			labelpay.SetAlignment(0, (float)0.5);
			labeltax = new Label("Tax :");
			labeltax.SetAlignment(0, (float)0.5);
			
			entryid = new Entry();
			entryid.Sensitive = false;
			
			combocust = new ComboBoxCustomers();
			combopay = new ComboBoxPayments();
			combopay.NoneRow = true;
			combotax = new ComboBoxTaxes();
			combotax.NoneRow = true;
			
			this.ColumnSpacing = 6;
			Attach(labelid, 0, 1, 0, 1);
			Attach(labelcust, 0, 1, 1, 2);
			Attach(labelpay, 0, 1, 2, 3);
			Attach(labeltax, 0, 1, 3, 4);

			Attach(entryid, 1, 2, 0, 1);
			Attach(combocust, 1, 2, 1, 2);
			Attach(combopay, 1, 2, 2, 3);
			Attach(combotax, 1, 2, 3, 4);
			
			this.ShowAll();
		}
开发者ID:hpbaotho,项目名称:supos,代码行数:33,代码来源:FormOrder.cs


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