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); }
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(); }
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(); }
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 (); }
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(); }
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); }
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); }
public AttributeEntry(FileTemplate.Attribute attribute) { this.attribute = attribute; Label lblApp = new Label(attribute.Name.Replace("_","__")+": "); lblApp.Xalign = 1; lblApp.Yalign = 0.5F; lblApp.WidthRequest = 115; Entry entr = new Entry(); entr.Name = "entr"; if (attribute.Value != null) entr.Text = attribute.Value.ToString(); entr.Changed+= delegate(object sender, EventArgs e) { if (!String.IsNullOrEmpty(attribute.ValidateExpr)){ Regex regex = new Regex(attribute.ValidateExpr, RegexOptions.Compiled); if (regex.IsMatch(entr.Text)){ this.attribute.Value = (object)entr.Text; } else { if (attribute.Value != null) entr.Text = attribute.Value.ToString(); } } else this.attribute.Value = (object)entr.Text; }; this.PackStart(lblApp,false,false,2); this.PackEnd(entr,true,true,2); }
public Spec(InvoiceSpec ispec, Table table, uint row) { description = new Entry(); number = new Entry(); price = new Entry(); total = new Entry(); number.Changed += new EventHandler(UpdateTotal); price.Changed += new EventHandler(UpdateTotal); total.Changed += new EventHandler(TotalChanged); number.SetUsize(NumberEntryWidth, -2); price.SetUsize(NumberEntryWidth, -2); total.SetUsize(NumberEntryWidth, -2); description.SetUsize(300, -2); table.Attach(description, 0, 1, row, row+1, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); table.Attach(number, 1, 2, row, row+1, 0, 0, 0, 0); table.Attach(price, 2, 3, row, row+1, 0, 0, 0, 0); table.Attach(total, 3, 4, row, row+1, 0, 0, 0, 0); description.Text = ispec.beskrivning; if (ispec.antal.Length > 0) number.Text = ispec.antal; price.Text = ispec.styckpris; total.Text = ispec.belopp; }
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 (); }
public void creaVentanaArticulo() { titulo="Añadir articulo"; ventana(titulo); 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(App.Instance.DbConnection,cb,"nombre","id",0,"categoria"); tabla.Attach(cat,0,1,0,1); tabla.Attach(text,1,2,0,1); tabla.Attach(cat2,0,1,1,2); tabla.Attach(cb,1,2,1,2); Label pre=new Label("Introduce el precio del nuevo articulo: "); precio=new Entry(); tabla.Attach(pre,0,1,2,3); tabla.Attach(precio,1,2,2,3); Button button=new Button("Añadir"); button.Clicked +=delegate{ añadirArticulo(App.Instance.DbConnection); if(!enBlanco){ window.Destroy(); refresh(); } }; tabla.Attach(button,1,2,3,4); window.Add(vbox); window.ShowAll(); }
/* * Constructor */ public FindBar(PhotoQuery query, TreeModel model) : base(new HBox()) { this.query = query; box = Child as HBox; box.Spacing = 6; box.BorderWidth = 2; box.PackStart (new Label (Catalog.GetString ("Find:")), false, false, 0); entry = new Entry (); entry.Completion = new LogicEntryCompletion (entry, model); entry.TextInserted += HandleEntryTextInserted; entry.TextDeleted += HandleEntryTextDeleted; entry.KeyPressEvent += HandleEntryKeyPress; box.PackStart (entry, true, true, 0); Button clear_button = new Gtk.Button (); clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button)); clear_button.Clicked += HandleCloseButtonClicked; clear_button.Relief = Gtk.ReliefStyle.None; box.PackStart (clear_button, false, false, 0); }
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 (); }
public void GetToken() { window = new Gtk.Window ("packingdemo"); window.Title = "CircleCi Indicator Configuration"; window.WindowPosition = WindowPosition.Center; HBox hbox = new HBox (); VBox vbox = new VBox (false, 0); Label label = new Label (); label.Markup = "Please provide your CircleCi token.\nYou can get one <a href=\"https://circleci.com/account/api\">here</a>."; entry = new Entry (); Button okButton = new Button ("OK"); vbox.PackStart (label, false, false, 20); vbox.PackStart (entry, false, false, 0); vbox.PackStart (okButton, false, false, 20); hbox.PackStart (vbox, false, false, 50); window.Add(hbox); entry.KeyReleaseEvent += HandleKeyReleaseEvent; okButton.Clicked += HandleClicked;; window.ShowAll (); }
public ConfigurationDialog (LCDService plugin) { this.plugin = plugin; Title = AddinManager.CurrentLocalizer.GetString ("LCD configuration"); BorderWidth = 5; HasSeparator = false; Resizable = false; VBox lcdproc_box = new VBox (); HBox host_box = new HBox (); host_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Hostname:")), false, false, 3); host_entry = new Entry (); host_box.PackStart (host_entry, true, true, 3); host_entry.Text = this.plugin.Host; host_entry.Changed += new EventHandler (Host_Changed); HBox port_box = new HBox (); port_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Port:")), false, false, 3); port_spin = new SpinButton (1, 65535, 1); port_box.PackStart (port_spin, true, true, 3); port_spin.Value = this.plugin.Port; port_spin.Changed += new EventHandler (Port_Changed); Frame lcdproc_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("LCDProc Daemon:")); lcdproc_box.PackStart (host_box); lcdproc_box.PackStart (port_box); lcdproc_frame.Add (lcdproc_box); lcdproc_frame.ShowAll (); VBox.PackStart (lcdproc_frame, false, false, 3); AddButton (Stock.Close, ResponseType.Close); }
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 (); }
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(); }; }
public DebugView(Settings set, DebugManager mgr) { debugManager = mgr; layout = new Table(2, 2, false); runStop = new Button("Interrupt"); command = new Entry(); log = new ConsoleLog(set); command.Activated += OnCommand; runStop.Clicked += OnRunStop; layout.Attach(log.View, 0, 2, 0, 1, AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 4, 4); layout.Attach(command, 0, 1, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 4, 4); layout.Attach(runStop, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4); runStop.SetSizeRequest(80, -1); command.Sensitive = false; runStop.Sensitive = false; mgr.MessageReceived += OnDebugOutput; mgr.DebuggerBusy += OnBusy; mgr.DebuggerReady += OnReady; mgr.DebuggerStarted += OnStarted; mgr.DebuggerExited += OnExited; layout.Destroyed += OnDestroy; }
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 (); }
public DateTimeEditor() { entry = new Gtk.Entry (); entry.Changed += OnChanged; PackStart (entry, true, true, 0); ShowAll (); }
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 (); }
public StringQueryValueEntry () : base () { entry = new Entry (); entry.WidthRequest = DefaultWidth; entry.Changed += HandleChanged; Add (entry); }
public static void AddNewWordToDic(object sender, EventArgs e) { var win = new Gtk.Window("Přidej slovo"); win.SetPosition( WindowPosition.Mouse ); Label l = new Label(); l.Text = "Vloží slovo do aktuálně načteného slovníku, avšak nezmění zdroj (např. soubor dic.txt )"; Entry entry = new Entry(); Button b = new Button("Přidej"); VBox vbox = new VBox(); HBox hbox = new HBox(); vbox.BorderWidth = 10; vbox.PackStart( l ); vbox.PackEnd( hbox ); hbox.PackStart( entry ); hbox.PackEnd( b ); b.Clicked += delegate { game.dictionary.Add( entry.Text ); win.HideAll(); win.Destroy(); win.Dispose(); }; win.Add(vbox); win.ShowAll(); }
Widget CreateEntry (Table table, string text, bool password) { var lab = new Label (text); lab.Xalign = 0; table.Attach (lab, 0, 1, r, r + 1); var tc = (Table.TableChild)table [lab]; tc.XOptions = AttachOptions.Shrink; var e = new Entry (); Widget editor = e; e.ActivatesDefault = true; if (password) e.Visibility = false; e.Changed += delegate { if (password) { if (upcred != null) upcred.Password = e.Text ?? ""; else sshcred.Passphrase = e.Text ?? ""; } else { if (upcred != null) upcred.Username = e.Text; } }; if (editor != null) { table.Attach (editor, 1, 2, r, r + 1); tc = (Table.TableChild)table [lab]; tc.XOptions = AttachOptions.Fill; } r++; return editor; }
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 (); }
public TimeSpanEditor() { entry = new Gtk.Entry (); entry.Changed += OnChanged; entry.HasFrame = false; PackStart (entry, true, true, 0); ShowAll (); }
public SimpleTextTool (IDrawingEditor editor, SimpleTextFigure fig, ITool dt) : base (editor, fig, dt) { _entry = new Gtk.Entry (); _entry.HasFrame = false; _entry.Alignment = 0.5f; _entry.Changed += new System.EventHandler (ChangedHandler); _entry.ModifyFont (fig.PangoLayout.FontDescription.Copy ()); }
/// <summary>Constructor</summary> public EditView(ViewBase owner) : base(owner) { textentry1 = new Entry(); _mainWidget = textentry1; textentry1.FocusOutEvent += OnSelectionChanged; _mainWidget.Destroyed += _mainWidget_Destroyed; }
public SearchCriteria(HBox aHbox, Gtk.Entry attr, ComboBox op, Gtk.Entry val, ComboBox bc) { hbox = aHbox; attrEntry = attr; critCombo = op; valEntry = val; boolCombo = bc; }
public PreferencesDialog(Settings set, Window parent, string argsOver) { settings = set; argsOverride = argsOver; dialog = new Dialog("Preferences", parent, DialogFlags.Modal | DialogFlags.DestroyWithParent, new object[]{Gtk.Stock.Close, -1}); var table = new Table(4, 3, false); sUseBundledDebugger = new CheckButton("Use bundled MSPDebug"); sUseBundledDebugger.Clicked += OnBundledState; table.Attach(sUseBundledDebugger, 0, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, 0, 4, 4); Label lbl; lbl = new Label("MSPDebug path:"); lbl.SetAlignment(0.0f, 0.5f); table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4); sMSPDebugPath = new Entry(); table.Attach(sMSPDebugPath, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, 0, 4, 4); chooseMSPDebug = new Button("Choose..."); chooseMSPDebug.Clicked += OnChoose; table.Attach(chooseMSPDebug, 2, 3, 1, 2, AttachOptions.Fill, 0, 4, 4); lbl = new Label("MSPDebug arguments:"); lbl.SetAlignment(0.0f, 0.5f); table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4); sMSPDebugArgs = new Entry(); sMSPDebugArgs.Sensitive = (argsOverride == null); table.Attach(sMSPDebugArgs, 1, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, 0, 4, 4); lbl = new Label("Console font:"); lbl.SetAlignment(0.0f, 0.5f); table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4); sConsoleFont = new FontButton(); table.Attach(sConsoleFont, 1, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, 0, 4, 4); table.ShowAll(); ((Container)dialog.Child).Add(table); chooseDialog = new FileChooserDialog("Choose MSPDebug binary", dialog, FileChooserAction.Open, new object[]{Stock.Cancel, ResponseType.Cancel, Stock.Ok, ResponseType.Ok}); chooseDialog.DefaultResponse = ResponseType.Ok; }
public DateEdit(System.DateTime time, DateEditFlags flags) { datetime = new DateTimeZone(time); datetime.Changed += HandleDateTimeZoneChanged; this.flags = flags; date_entry = new Gtk.Entry(); date_entry.WidthChars = 10; date_entry.Changed += HandleDateEntryChanged; PackStart(date_entry, true, true, 0); Gtk.HBox b_box = new Gtk.HBox(); b_box.PackStart(new Gtk.Label(Catalog.GetString("Calendar")), true, true, 0); b_box.PackStart(new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out), true, false, 0); date_button = new Gtk.Button(b_box); date_button.Clicked += HandleCalendarButtonClicked; PackStart(date_button, false, false, 0); calendar = new Gtk.Calendar(); calendar.DaySelected += HandleCalendarDaySelected; Gtk.Frame frame = new Gtk.Frame(); frame.Add(calendar); cal_popup = new Gtk.Window(Gtk.WindowType.Popup); cal_popup.DestroyWithParent = true; cal_popup.Add(frame); cal_popup.Shown += HandleCalendarPopupShown; cal_popup.GrabNotify += HandlePopupGrabNotify; frame.Show(); calendar.Show(); time_entry = new Gtk.Entry(); time_entry.WidthChars = 8; time_entry.Changed += HandleTimeEntryChanged; PackStart(time_entry, true, true, 0); Gtk.CellRendererText timecell = new Gtk.CellRendererText(); time_combo = new Gtk.ComboBox(); time_store = new Gtk.TreeStore(typeof(string), typeof(int), typeof(int)); time_combo.Model = time_store; time_combo.PackStart(timecell, true); time_combo.SetCellDataFunc(timecell, new CellLayoutDataFunc(TimeCellFunc)); time_combo.Realized += FillTimeCombo; time_combo.Changed += HandleTimeComboChanged; PackStart(time_combo, false, false, 0); zone_entry = new Gtk.Entry(); zone_entry.IsEditable = false; zone_entry.MaxLength = 6; zone_entry.WidthChars = 6; PackStart(zone_entry, true, true, 0); Gtk.CellRendererText offsetcell = new Gtk.CellRendererText(); offset_combo = new Gtk.ComboBox(); offset_combo.Model = new Gtk.TreeStore(typeof(string), typeof(int)); offset_combo.PackStart(offsetcell, true); offset_combo.SetCellDataFunc(offsetcell, new CellLayoutDataFunc(OffsetCellFunc)); FillOffsetCombo(); offset_combo.Changed += HandleOffsetComboChanged; PackStart(offset_combo, false, false, 0); Update(); ShowAll(); }
void createCritRow(string attr, string op, string val) { _numCriteria++; HBox hbox = new HBox(false, 0); critVbox.PackStart(hbox, true, true, 0); Gtk.Entry attrEntry = new Gtk.Entry(); attrEntry.Text = attr; attrEntry.Show(); hbox.PackStart(attrEntry, true, true, 5); VBox vbox75 = new VBox(false, 0); vbox75.Show(); hbox.PackStart(vbox75, true, true, 5); ComboBox critCombo = createCombo(ops); comboSetActive(critCombo, ops, op); vbox75.PackStart(critCombo, false, true, 16); Gtk.Entry valEntry = new Gtk.Entry(); valEntry.Text = val; valEntry.Show(); hbox.PackStart(valEntry, true, true, 5); VBox vbox76 = new VBox(false, 0); vbox76.Show(); hbox.PackStart(vbox76, true, true, 5); ComboBox boolCombo = createCombo(boolOps); boolCombo.Sensitive = false; vbox76.PackStart(boolCombo, false, true, 16); if (_numCriteria == 1) { firstCritCombo = boolCombo; firstCritCombo.Changed += new EventHandler(OnBoolChanged); } else if (_numCriteria > 1) { _allCombos.Add(boolCombo); } SearchCriteria sc = new SearchCriteria( hbox, attrEntry, critCombo, valEntry, boolCombo); string key = "row" + _numCriteria.ToString(); _critTable.Add(key, sc); if (_numCriteria > 1) { toggleBoolCombo(_numCriteria); } critVbox.ShowAll(); }
private void modify_job(ArrayList al, string id) { string jobid = null; string number = null; string status = null; string user = null; string pages = null; string dials = null; object sendat = null; string error = null; IEnumerator enu = al.GetEnumerator(); while (enu.MoveNext()) { enu.MoveNext(); jobid = (string)enu.Current; enu.MoveNext(); number = (string)enu.Current; enu.MoveNext(); status = (string)enu.Current; enu.MoveNext(); user = (string)enu.Current; enu.MoveNext(); pages = (string)enu.Current; enu.MoveNext(); int idx = ((string)enu.Current).LastIndexOf(':'); dials = ((string)enu.Current).Substring(idx + 1); enu.MoveNext(); sendat = (object)enu.Current; enu.MoveNext(); error = (string)enu.Current; } #if DEBUG Console.WriteLine("[ModifyJob] Date is {0}", sendat); #endif Glade.XML xml = new Glade.XML(null, "gfax.glade", "vbox74", null); Dialog mjd = new Dialog(); mjd.VBox.Add(xml.GetWidget("vbox74")); Gtk.Entry mje = (Gtk.Entry)xml.GetWidget("ModifyJobNumberEntry"); Gnome.DateEdit mjde = (Gnome.DateEdit)xml.GetWidget("ModifyJobDate"); Gtk.SpinButton mjmd = (Gtk.SpinButton)xml.GetWidget("MaxDialsSpinbutton"); mjd.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); mjd.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok); // this is to re-enable the entry for editing so it won't be selected // to begin with??? Maybe something to do with re-parenting or something. mje.FocusInEvent += new FocusInEventHandler(on_ModifyJobNumberEntry_focus_in_event); mje.IsEditable = false; mje.Text = number.Trim(); mjde.Time = sendat == null ? new DateTime(): (DateTime)sendat; mjmd.Value = Convert.ToDouble(dials.Trim()); ResponseType result = (ResponseType)mjd.Run(); if (result == ResponseType.Ok) { DateTime newsend = (mjde.Time).ToUniversalTime(); // Format time to send - timezone is in UTC format. string tts = String.Format("{0}{1:00}{2:00}{3:00}{4:00}", newsend.Year, newsend.Month, newsend.Day, newsend.Hour, newsend.Minute); if (id == "sendq") { Fax.modify_job(jobid, mje.Text, tts, (mjmd.ValueAsInt).ToString()); } else // "doneq" { Fax.resubmit_job(jobid, mje.Text, tts, (mjmd.ValueAsInt).ToString()); } mjd.Destroy(); } else { mjd.Destroy(); } async_update_queue_status("sendq"); ModifyJobButton.Sensitive = false; DeleteJobButton.Sensitive = false; }
/// <summary> /// setup fields like: store password:yes/no and the actual password entry, /// if it should be stored /// </summary> /// <param name="insertTo"></param> /// <param name="defaultSpacing"></param> void SetupGuiEncryptionRelated(Gtk.Box insertTo, int defaultSpacing) { Gtk.HBox customBox = new Gtk.HBox(false, defaultSpacing); insertTo.PackStart(customBox); rbt_storePw = new Gtk.RadioButton(Catalog.GetString("_Store password")); customBox.PackStart(rbt_storePw); customBox = new Gtk.HBox(false, defaultSpacing); insertTo.PackStart(customBox); // --- Password Boxes --- #if WIN32 && DPAPI String pw = DPAPIUtil.getPassword(); #else String pw = Convert.ToString(Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_PASSWORD)); #endif pw = (pw == null) ? "" : pw; Gtk.VBox pwbox = new Gtk.VBox(false, defaultSpacing); Gtk.HBox superbox = new Gtk.HBox(false, defaultSpacing); superbox.PackStart(new Gtk.Alignment(0, 0, 200, 0)); // spacer superbox.PackStart(pwbox); customBox.PackStart(superbox); stored_pw = new Gtk.Entry(); // set password style: stored_pw.InvisibleChar = '*'; stored_pw.Visibility = false; stored_pw.Text = pw; pwbox.PackStart(stored_pw); stored_pw2 = new Gtk.Entry(); // set password style: stored_pw2.InvisibleChar = '*'; stored_pw2.Visibility = false; stored_pw2.Text = pw; pwbox.PackStart(stored_pw2); match_label = new Gtk.Label(); match_label.Markup = Catalog.GetString(AddinPreferences.MATCH_TEXT); pwbox.PackStart(match_label); customBox = new Gtk.HBox(false, defaultSpacing); insertTo.PackStart(customBox); // give the first rbt here to link the 2 rbt_alwaysAsk = new Gtk.RadioButton(rbt_storePw, Catalog.GetString("_Always ask for password")); customBox.PackStart(rbt_alwaysAsk); // assign event-listener rbt_storePw.Toggled += PasswordMethodChanged; // init with values from preferences object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_ASKEVERYTIME); if (value == null || value.Equals(false)) { rbt_storePw.Active = true; } else { rbt_alwaysAsk.Active = true; } // assign event-listeners stored_pw.Changed += PasswordChanged; stored_pw2.Changed += PasswordChanged; }
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 /// hbox = new HBox (false, 4); due_date_check_button = new CheckButton (Catalog.GetString ("Due Date:")); if (task.DueDate != DateTime.MinValue) due_date_check_button.Active = true; due_date_check_button.Toggled += OnDueDateCheckButtonToggled; due_date_check_button.Show (); hbox.PackStart (due_date_check_button, false, false, 0); due_date_button = new Gtk.Extras.DateButton (task.DueDate, false); if (task.DueDate == DateTime.MinValue) due_date_button.Sensitive = false; due_date_button.Show (); hbox.PackStart (due_date_button, false, false, 0); // Spacer hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0); hbox.Show (); vbox.PackStart (hbox, false, false, 0); /// /// Priority /// hbox = new HBox (false, 4); priority_check_button = new CheckButton (Catalog.GetString ("Priority:")); if (task.Priority != TaskPriority.Undefined) priority_check_button.Active = true; priority_check_button.Toggled += OnPriorityCheckButtonToggled; priority_check_button.Show (); hbox.PackStart (priority_check_button, false, false, 0); priority_combo_box = ComboBox.NewText (); priority_combo_box.AppendText (Catalog.GetString ("None")); priority_combo_box.AppendText (Catalog.GetString ("Low")); priority_combo_box.AppendText (Catalog.GetString ("Normal")); priority_combo_box.AppendText (Catalog.GetString ("High")); if (task.Priority == TaskPriority.Undefined) priority_combo_box.Sensitive = false; priority_combo_box.Active = (int) task.Priority; priority_combo_box.Changed += OnPriorityComboBoxChanged; priority_combo_box.Show (); hbox.PackStart (priority_combo_box, false, false, 0); // Spacer hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0); hbox.Show (); vbox.PackStart (hbox, false, false, 0); AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false); AddButton (Gtk.Stock.Save, Gtk.ResponseType.Ok, true); // if (parent != null) // TransientFor = parent; // if ((int) (flags & Gtk.DialogFlags.Modal) != 0) // Modal = true; // if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0) // DestroyWithParent = true; }
public DemoMain() { window = new Gtk.Window("TestForm1"); Gtk.HBox hbox = new Gtk.HBox(false, 0); hbox1 = new Gtk.HBox(false, 0); Gtk.HBox hbox2 = new Gtk.HBox(false, 0); Gtk.HBox hbox3 = new Gtk.HBox(false, 0); hbox.Add(hbox1); window.SetDefaultSize(600, 400); window.DeleteEvent += new DeleteEventHandler(WindowDelete); button1 = new Gtk.Button("button1"); button1.Clicked += Button1Clicked; button2 = new Gtk.Button("button2"); button3 = new Gtk.Button("button3"); Gtk.Button button4 = new Gtk.Button("button4"); button4.Clicked += Button4Clicked; Gtk.Button button5 = new Gtk.Button("button5"); Gtk.Button button6 = new Gtk.Button("button6"); Gtk.Button button7 = new Gtk.Button("button7"); button7.Sensitive = false; scaleButton1 = new Gtk.ScaleButton(0, 0, 100, 10, new string [0]); hbox1.Add(hbox3); hbox1.Add(hbox2); hbox1.Add(button3); hbox1.Add(button2); button3.Accessible.Description = "help text 3"; button3.Sensitive = false; label1 = new Gtk.Label("label1"); textBox1 = new Gtk.Entry(); Gtk.Entry textBox2 = new Gtk.Entry(); textBox2.Visibility = false; textBox2.Sensitive = false; textBox2.IsEditable = false; textBox3 = new Gtk.TextView(); // TODO: scrollbars Gtk.CheckButton checkbox1 = new Gtk.CheckButton("checkbox1"); Gtk.CheckButton checkbox2 = new Gtk.CheckButton("checkbox2"); checkbox2.Sensitive = false; Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string)); Gtk.TreeIter [] iters = new Gtk.TreeIter [2]; iters [0] = store.AppendNode(); store.SetValues(iters [0], "item 1", "item 1 (2)"); iters [1] = store.AppendNode(iters [0]); store.SetValues(iters [1], "item 1a", "item 1a (2)"); iters [0] = store.AppendNode(); store.SetValues(iters [0], "item 2", "item 2 (2)"); iters [1] = store.AppendNode(iters [0]); store.SetValues(iters [1], "item 2a", "item 2a (2)"); iters [1] = store.AppendNode(iters [0]); store.SetValues(iters [1], "item 2b", "item 2b (2)"); treeView1 = new Gtk.TreeView(store); AddTreeViewColumn(treeView1, 0, "column 1"); treeView1.CollapseAll(); treeView2 = new Gtk.TreeView(store); AddTreeViewColumn(treeView2, 0, "column 1"); AddTreeViewColumn(treeView2, 1, "column 2"); treeView2.CollapseAll(); treeView2.Accessible.Name = "treeView2"; tableStore = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string), typeof(string)); iters [0] = tableStore.AppendNode(); tableStore.SetValues(iters [0], "False", "Alice", "24", ""); iters [0] = tableStore.AppendNode(); tableStore.SetValues(iters [0], "True", "Bob", "28", ""); dataGridView1 = new Gtk.TreeView(tableStore); dataGridView1 = new Gtk.TreeView(tableStore); dataGridView1 = new Gtk.TreeView(tableStore); AddTreeViewColumn(dataGridView1, 0, "Gender"); AddTreeViewColumn(dataGridView1, 1, "Name"); AddTreeViewColumn(dataGridView1, 2, "Age"); dataGridView1.Accessible.Name = "dataGridView1"; hboxPanel = new Gtk.HBox(); Gtk.Button btnRemoveTextBox = new Gtk.Button("Remove"); btnRemoveTextBox.Clicked += RemoveTextBoxClicked; Gtk.Button btnAddTextBox = new Gtk.Button("Add"); btnAddTextBox.Clicked += AddTextBoxClicked; txtCommand = new Gtk.Entry(); txtCommand.Accessible.Name = "txtCommand"; Gtk.Button btnRun = new Gtk.Button("Run"); btnRun.Clicked += btnRunClicked; hboxPanel.Add(btnRemoveTextBox); hboxPanel.Add(btnAddTextBox); Gtk.TreeStore treeStore = new Gtk.TreeStore(typeof(string)); Gtk.TreeIter iter = treeStore.AppendNode(); treeStore.SetValue(iter, 0, "Item 0"); iter = treeStore.AppendNode(); treeStore.SetValue(iter, 0, "Item 1"); listView1 = new Gtk.TreeView(treeStore); AddTreeViewColumn(listView1, 0, "items"); listView1.Accessible.Name = "listView1"; listView1.ExpandAll(); hbox2.Add(button5); hbox2.Add(checkbox1); hbox2.Add(checkbox2); hbox2.Add(button4); hbox2.Accessible.Name = "groupBox2"; hbox3.Add(button7); hbox3.Add(button6); hbox3.Sensitive = false; hbox3.Accessible.Name = "groupBox3"; hbox.Add(textBox3); hbox.Add(textBox2); hbox.Add(textBox1); hbox.Add(label1); hbox.Add(button1); hbox.Add(treeView1); hbox.Add(treeView2); hbox.Add(listView1); hbox.Add(dataGridView1); hbox.Add(txtCommand); hbox.Add(btnRun); hbox.Add(hboxPanel); hbox.Add(scaleButton1); Gtk.Menu file = new Gtk.Menu(); file.Append(new Gtk.MenuItem("_New")); file.Append(new Gtk.MenuItem("_Open")); file.Append(new Gtk.CheckMenuItem("Check")); Gtk.MenuItem fileItem = new Gtk.MenuItem("File"); fileItem.Submenu = file; Gtk.Menu edit = new Gtk.Menu(); edit.Append(new Gtk.MenuItem("_Undo")); edit.Append(new Gtk.SeparatorMenuItem()); edit.Append(new Gtk.MenuItem("_Cut")); edit.Append(new Gtk.MenuItem("Copy")); edit.Append(new Gtk.MenuItem("_Paste")); Gtk.MenuItem editItem = new Gtk.MenuItem("Edit"); editItem.Submenu = edit; Gtk.MenuBar menuBar = new Gtk.MenuBar(); menuBar.Append(fileItem); menuBar.Append(editItem); hbox.Add(menuBar); hbox.Add(new Gtk.SpinButton(0, 100, 1)); hbox.Add(new Gtk.ToggleButton("ToggleButton")); Gtk.Adjustment adj = new Gtk.Adjustment(50, 0, 100, 1, 10, 10); hbox.Add(new Gtk.VScrollbar(adj)); window.Add(hbox); window.ShowAll(); }
private void Initialize() { DefaultResponse = Gtk.ResponseType.Ok; AddStockButton(Stock.Cancel, ResponseType.Cancel); AddStockButton(Stock.Ok, ResponseType.Ok, true); SetGeometryHints(this, new Gdk.Geometry() { MinWidth = SizeRequest().Width, MaxWidth = Gdk.Screen.Default.Width, MinHeight = -1, MaxHeight = -1 }, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize); var table = new Table(2, 2, false) { RowSpacing = 12, ColumnSpacing = 6 }; table.Attach(new Label() { Text = Catalog.GetString("Station _Type:"), UseUnderline = true, Xalign = 0.0f }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); table.Attach(arg_label = new Label() { Xalign = 0.0f }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); table.Attach(type_combo = ComboBox.NewText(), 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0); table.Attach(arg_entry = new Entry(), 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0); VBox.PackStart(table, true, true, 0); VBox.Spacing = 12; VBox.ShowAll(); type_combo.RemoveText(0); int active_type = 0; int i = 0; foreach (StationType type in StationType.Types) { if (!type.SubscribersOnly || lastfm.Account.Subscriber) { type_combo.AppendText(type.Label); if (source != null && type == source.Type) { active_type = i; } i++; } } type_combo.Changed += HandleTypeChanged; type_combo.Active = active_type; type_combo.GrabFocus(); }
public SyncTitleConflictDialog(Note existingNote, IList <string> noteUpdateTitles) : base(Catalog.GetString("Note Conflict"), null, Gtk.DialogFlags.Modal) { this.existingNote = existingNote; this.noteUpdateTitles = noteUpdateTitles; // Suggest renaming note by appending " (old)" to the existing title string suggestedRenameBase = existingNote.Title + Catalog.GetString(" (old)"); string suggestedRename = suggestedRenameBase; for (int i = 1; !IsNoteTitleAvailable(suggestedRename); i++) { suggestedRename = suggestedRenameBase + " " + i.ToString(); } VBox outerVBox = new VBox(false, 12); outerVBox.BorderWidth = 12; outerVBox.Spacing = 8; HBox hbox = new HBox(false, 8); Image image = new Image(GuiUtils.GetIcon(Gtk.Stock.DialogWarning, 48)); // TODO: Is this the right icon? image.Show(); hbox.PackStart(image, false, false, 0); VBox vbox = new VBox(false, 8); headerLabel = new Label(); headerLabel.UseMarkup = true; headerLabel.Xalign = 0; headerLabel.UseUnderline = false; headerLabel.Show(); vbox.PackStart(headerLabel, false, false, 0); messageLabel = new Label(); messageLabel.Xalign = 0; messageLabel.UseUnderline = false; messageLabel.LineWrap = true; messageLabel.Wrap = true; messageLabel.Show(); vbox.PackStart(messageLabel, false, false, 0); vbox.Show(); hbox.PackStart(vbox, true, true, 0); hbox.Show(); outerVBox.PackStart(hbox); VBox.PackStart(outerVBox); Gtk.HBox renameHBox = new Gtk.HBox(); renameRadio = new Gtk.RadioButton(Catalog.GetString("Rename local note:")); renameRadio.Toggled += radio_Toggled; Gtk.VBox renameOptionsVBox = new Gtk.VBox(); renameEntry = new Gtk.Entry(suggestedRename); renameEntry.Changed += renameEntry_Changed; renameUpdateCheck = new Gtk.CheckButton(Catalog.GetString("Update links in referencing notes")); renameOptionsVBox.PackStart(renameEntry); //renameOptionsVBox.PackStart (renameUpdateCheck); // This seems like a superfluous option renameHBox.PackStart(renameRadio); renameHBox.PackStart(renameOptionsVBox); VBox.PackStart(renameHBox); deleteExistingRadio = new Gtk.RadioButton(renameRadio, Catalog.GetString("Overwrite local note")); deleteExistingRadio.Toggled += radio_Toggled; VBox.PackStart(deleteExistingRadio); alwaysDoThisCheck = new Gtk.CheckButton(Catalog.GetString("Always perform this action")); VBox.PackStart(alwaysDoThisCheck); continueButton = (Gtk.Button)AddButton(Gtk.Stock.GoForward, Gtk.ResponseType.Accept); // Set initial dialog text HeaderText = Catalog.GetString("Note conflict detected"); MessageText = string.Format(Catalog.GetString("The server version of \"{0}\" conflicts with your local note." + " What do you want to do with your local note?"), existingNote.Title); ShowAll(); }
public TreeViewExample () { // Create a Window Gtk.Window window = new Gtk.Window ("TreeView Example"); window.SetSizeRequest (500,200); window.DeleteEvent+=delegate {Application.Quit();}; // Create an Entry used to filter the tree filterEntry = new Gtk.Entry (); // Fire off an event when the text in the Entry changes filterEntry.Changed += OnFilterEntryTextChanged; // Create a nice label describing the Entry Gtk.Label filterLabel = new Gtk.Label ("Search:"); // Put them both into a little box so they show up side by side Gtk.HBox filterBox = new Gtk.HBox (); filterBox.PackStart (filterLabel, false, false, 5); filterBox.PackStart (filterEntry, true, true, 5); // Create our TreeView Gtk.TreeView tv = new Gtk.TreeView (); // Create a box to hold the Entry and Tree Gtk.VBox box = new Gtk.VBox (); // Add the widgets to the box box.PackStart (filterBox, false, false, 5); box.PackStart (tv, true, true, 5); window.Add (box); //setting up columns and renderers Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn{Title="Name"}; Gtk.CellRendererText nameCell = new Gtk.CellRendererText (); nameColumn.PackStart (nameCell, true); Gtk.TreeViewColumn emailColumn = new Gtk.TreeViewColumn {Title="Email"}; Gtk.CellRendererText emailCell = new Gtk.CellRendererText (); emailColumn.PackStart (emailCell, true); // Add the columns to the TreeView tv.AppendColumn (nameColumn); tv.AppendColumn (emailColumn); // Tell the Cell Renderers which items in the model to display nameColumn.AddAttribute (nameCell, "text", 0); emailColumn.AddAttribute (emailCell, "text", 1); // Create a model that will hold two strings Gtk.TreeStore contacts = new Gtk.TreeStore (typeof (string), typeof (string)); // Add some hierarchical data Gtk.TreeIter treeiter; //first root treeiter= contacts.AppendValues("testFRIENDS"); // 2 children of first root contacts.AppendValues(treeiter, "testOgre", "*****@*****.**"); contacts.AppendValues(treeiter, "testBee", "*****@*****.**"); // second root treeiter= contacts.AppendValues("RELATIVES"); // 3 children of second root contacts.AppendValues (treeiter,"Mommy","*****@*****.**"); contacts.AppendValues (treeiter,"Daddy", "*****@*****.**"); contacts.AppendValues (treeiter,"tom", "*****@*****.**"); filter = new Gtk.TreeModelFilter (contacts, null); // Specify the function that determines which rows to filter out and which ones to display filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree); // Assign the filter as our treeview's model tv.Model = filter; // Show the window and everything on it window.ShowAll (); }
public static void Main(string[] args) { //start window timeSpan = TimeSpan.FromSeconds(0); Application.Init(); window = new Window("Editor Window"); window.SetPosition(WindowPosition.Center); window.HeightRequest = 600; window.WidthRequest = 900; //new TreeView view = new TreeView(); view.WidthRequest = 900; TreeViewColumn column = new TreeViewColumn(); column.Title = "Please, hire me!!"; //init labels and buttons searchTimeLabel = new Label("Search time: "); searchFileLast = new Label("Last file: ".PadRight(60)); searchFileLast.SetAlignment(0, 0.65f); searchDirCurrent = new Label("Searching dir: ".PadRight(60)); searchDirCurrent.SetAlignment(0.1f, 0.65f); start = new Button("Start"); start.Clicked += new EventHandler(Start); pause = new Button("Pause"); pause.Sensitive = false; pause.Clicked += new EventHandler(Pause); stop = new Button("Stop"); stop.Sensitive = false; stop.Clicked += new EventHandler(Stop); dir = new Entry("enter the directory"); reg = new Entry("enter the regex"); ScrolledWindow scroller = new ScrolledWindow(); scroller.BorderWidth = 5; scroller.ShadowType = ShadowType.In; CellRendererText cell = new CellRendererText(); column.PackStart(cell, true); view.AppendColumn(column); column.AddAttribute(cell, "text", 0); store = new TreeStore(typeof(string)); TreeIter treeIter = store.AppendValues("SearchResult"); view.Model = store; view.ShowExpanders = true; //set labels and buttons hb.PackStart(start, false, false, 5); hb.PackStart(pause, false, false, 5); hb.PackStart(stop, false, false, 5); hb.Add(dir); hb.Add(reg); searchTimeLabel.SetAlignment(0.2f, 0.65f); hb.Add(searchTimeLabel); hbinfo.Add(searchDirCurrent); hbinfo.Add(searchFileLast); vb.PackStart(hb, false, false, 5); vb.PackStart(hbinfo, false, false, 5); scroller.Add(view); vb.Add(scroller); GLib.Timeout.Add(1, updateTimeLabel); GLib.Timeout.Add(1, updateLastFileLabel); GLib.Timeout.Add(1, updateCurrentDir); window.Add(vb); window.Destroyed += new EventHandler(onClosed); window.ShowAll(); //show all items in window Application.Run(); }
public static void UseNativeContextMenus(this Gtk.Entry entry) { #if MAC entry.ButtonPressEvent += EntryButtonPressHandler; #endif }
private Gtk.Widget MakeAppearancePage() { VBox vbox = new VBox(false, 6); vbox.BorderWidth = 10; VBox sectionVBox = new VBox(false, 4); Label l = new Label(); l.Markup = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>", Catalog.GetString("Color Management")); l.UseUnderline = false; l.UseMarkup = true; l.Wrap = false; l.Xalign = 0; l.Show(); sectionVBox.PackStart(l, false, false, 0); HBox hbox = new HBox(false, 6); Label lblTodaysTaskColor = new Label(); lblTodaysTaskColor.Text = Catalog.GetString("Today:"); lblTodaysTaskColor.Xalign = 0; lblTodaysTaskColor.WidthRequest = 75; lblTodaysTaskColor.Show(); Preferences prefs = Application.Preferences; txtTodaysTaskColor = new Entry(); txtTodaysTaskColor.Text = prefs.Get(Preferences.TodayTaskTextColor); txtTodaysTaskColor.Changed += OnTxtTodaysTaskColorChanged; txtTodaysTaskColor.Show(); btnChangeTodaysTaskColor = new ColorButton(); string todayTasksColor = prefs.Get(Preferences.TodayTaskTextColor); Gdk.Color currentColor = new Gdk.Color(); Gdk.Color.Parse(todayTasksColor, ref currentColor); btnChangeTodaysTaskColor.Color = currentColor; btnChangeTodaysTaskColor.ColorSet += OnBtnChangeTodaysTaskColorColorSet; btnChangeTodaysTaskColor.Show(); hbox.PackStart(lblTodaysTaskColor, false, false, 0); hbox.PackStart(txtTodaysTaskColor, false, false, 0); hbox.PackStart(btnChangeTodaysTaskColor, false, false, 0); hbox.Show(); HBox hbox2 = new HBox(false, 6); Label lblOverdueTaskColor = new Label(); lblOverdueTaskColor.Text = Catalog.GetString("Overdue:"); lblOverdueTaskColor.WidthRequest = 75; lblOverdueTaskColor.Xalign = 0; lblOverdueTaskColor.Show(); txtOverdueTaskColor = new Entry(); txtOverdueTaskColor.Text = prefs.Get(Preferences.OverdueTaskTextColor); txtOverdueTaskColor.Changed += OnTxtOverdueTaskColorChanged; txtOverdueTaskColor.Show(); btnChangeOverdueTaskColor = new ColorButton(); string overdueTasksColor = prefs.Get(Preferences.OverdueTaskTextColor); Gdk.Color overdueColor = new Gdk.Color(); Gdk.Color.Parse(overdueTasksColor, ref overdueColor); btnChangeOverdueTaskColor.Color = overdueColor; btnChangeOverdueTaskColor.ColorSet += OnBtnChangeOverdueTaskColorColorSet; btnChangeOverdueTaskColor.Show(); hbox2.PackStart(lblOverdueTaskColor, false, false, 0); hbox2.PackStart(txtOverdueTaskColor, false, false, 0); hbox2.PackStart(btnChangeOverdueTaskColor, false, false, 0); hbox2.Show(); sectionVBox.PackStart(hbox, false, false, 0); sectionVBox.PackStart(hbox2, false, false, 0); sectionVBox.Show(); vbox.PackStart(sectionVBox, false, false, 0); return(vbox); }
private Gtk.CheckButton checkButton; //en terning har en Hold-knap public Terning(Gtk.Entry entry, Gtk.CheckButton checkButton) //en contructor, som kaldes hver gang, der oprettes en terning. Den sikrer, at vi har understående 2 ting. Contructoren har samme navn som klassen og har ingen returtype f.eks int { this.entry = entry; //Vi skal kunne vise antal øjne this.checkButton = checkButton; //Vi skal kunne holde en terning }
public TServers(CInterfaceGateway in_krnGateway, Glade.XML gxml, Gtk.TextView log) /*public TServers (Gtk.TreeView tv, Gtk.TextView log, CInterfaceGateway in_krnGateway, * Gtk.Button btn1,Gtk.Button btn2,Gtk.Entry txt1,Gtk.Entry txt2,Gtk.Entry txt3)*/ { krnGateway = in_krnGateway; krnGateway.OnLogMessage += new LogEvent(m_Log); krnGateway.OnNewServer += new ServerEvent(OnNewServer); //btnAddServer = btn1; btnAddServer = (gxml.GetWidget("btnAddServer") as Button); //btnDownloadServers = btn2; btnDownloadServers = (gxml.GetWidget("btnDownloadServers") as Button); //txtDownloadServers = txt1; txtDownloadServers = (gxml.GetWidget("txtDownloadServers") as Entry); //txtServerIp = txt2; txtServerIp = (gxml.GetWidget("txtServerIp") as Entry); //txtServerPort = txt3; txtServerPort = (gxml.GetWidget("txtServerPort") as Entry); txtServerLog = log; //I don't use gxml due to problems with buffer buffer = txtServerLog.Buffer; /*tvServers = tv;*/ tvServers = (gxml.GetWidget("tvServers") as TreeView); stServers = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); tvServers.Model = stServers; Gtk.TreeViewColumn tvc = new TreeViewColumn("Server Name", new CellRendererText(), "text", 0); tvServers.AppendColumn(tvc); tvc.SortColumnId = 0; tvc.Resizable = true; tvc = new TreeViewColumn("Address", new CellRendererText(), "text", 1); tvServers.AppendColumn(tvc); tvc.SortColumnId = 1; tvc.Resizable = true; tvc = new TreeViewColumn("Failed", new CellRendererText(), "text", 2); tvServers.AppendColumn(tvc); tvc.SortColumnId = 2; tvc.Resizable = true; tvc = new TreeViewColumn("Files", new CellRendererText(), "text", 3); tvServers.AppendColumn(tvc); tvc.SortColumnId = 3; tvc.Resizable = true; tvc = new TreeViewColumn("Users", new CellRendererText(), "text", 4); tvServers.AppendColumn(tvc); tvc.SortColumnId = 4; tvc.Resizable = true; tvc = new TreeViewColumn("Priority", new CellRendererText(), "text", 5); tvServers.AppendColumn(tvc); tvc.SortColumnId = 5; tvc.Resizable = true; menu = new Gtk.Menu(); MenuItem it_Connect = new MenuItem("Connect"); it_Connect.Activated += new EventHandler(ConnectTo); MenuItem it_Copy = new MenuItem("Copy to clipboard"); it_Copy.Activated += new EventHandler(CopyLink); MenuItem it_Delete = new MenuItem("Delete"); it_Delete.Activated += new EventHandler(Delete); menu.Append(it_Connect); menu.Append(it_Copy); menu.Append(it_Delete); tvServers.ButtonPressEvent += new ButtonPressEventHandler(ButtonPressEvent); // tvServers.PopupMenu += new PopupMenuHandler(PopupMenuEvent); loadServers(); }
/// <summary> /// Set up the UI inside the Window /// </summary> private void InitializeWidgets() { this.SetDefaultSize(500, 400); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); VBox dialogBox = new VBox(); dialogBox.Spacing = 10; dialogBox.BorderWidth = 10; this.VBox.PackStart(dialogBox, true, true, 0); Label l = new Label( string.Format("<span size=\"large\" weight=\"bold\">{0}</span>", Util.GS("Add users to this iFolder"))); l.Xalign = 0; l.UseMarkup = true; dialogBox.PackStart(l, false, false, 0); //------------------------------ // Selection Area //------------------------------ HBox selBox = new HBox(false, 10); dialogBox.PackStart(selBox, true, true, 0); //------------------------------ // All Users tree //------------------------------ VBox vbox = new VBox(false, 0); selBox.PackStart(vbox, false, false, 0); //------------------------------ // Find Entry //------------------------------ HBox searchHBox = new HBox(false, 4); vbox.PackStart(searchHBox, false, false, 0); Label findLabel = new Label(Util.GS("_Find:")); searchHBox.PackStart(findLabel, false, false, 0); findLabel.Xalign = 0; SearchEntry = new Entry(); searchHBox.PackStart(SearchEntry, true, true, 0); findLabel.MnemonicWidget = SearchEntry; SearchEntry.SelectRegion(0, -1); SearchEntry.CanFocus = true; SearchEntry.Changed += new EventHandler(OnSearchEntryChanged); Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu); stopImage.SetAlignment(0.5F, 0F); CancelSearchButton = new Button(stopImage); searchHBox.PackEnd(CancelSearchButton, false, false, 0); CancelSearchButton.Relief = ReliefStyle.None; CancelSearchButton.Sensitive = false; CancelSearchButton.Clicked += new EventHandler(OnCancelSearchButton); memberListModel = new MemberListModel(domainID, simws); memberList = new BigList(memberListModel); // FIXME: Fix up the BigList class to support both horizontal and vertical scrolling and then use the scroll adjustments to construct the ScrolledWindow ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.Add(memberList); vbox.PackStart(sw, true, true, 0); memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected); memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated); //------------------------------ // Buttons //------------------------------ VBox btnBox = new VBox(); btnBox.Spacing = 10; selBox.PackStart(btnBox, false, false, 0); Label spacer = new Label(""); btnBox.PackStart(spacer, true, true, 0); HBox buttonHBox = new HBox(false, 4); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); Label buttonLabel = new Label(Util.GS("_Add")); buttonHBox.PackStart(buttonLabel, false, false, 0); Image buttonImage = new Image(Stock.GoForward, IconSize.Button); buttonHBox.PackStart(buttonImage, false, false, 0); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); UserAddButton = new Button(buttonHBox); btnBox.PackStart(UserAddButton, false, true, 0); UserAddButton.Clicked += new EventHandler(OnAddButtonClicked); buttonHBox = new HBox(false, 4); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); buttonImage = new Image(Stock.GoBack, IconSize.Button); buttonHBox.PackStart(buttonImage, false, false, 0); buttonLabel = new Label(Util.GS("_Remove")); buttonHBox.PackStart(buttonLabel, false, false, 0); spacer = new Label(""); buttonHBox.PackStart(spacer, true, true, 0); UserDelButton = new Button(buttonHBox); btnBox.PackStart(UserDelButton, false, true, 0); UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked); spacer = new Label(""); btnBox.PackStart(spacer, true, true, 0); //------------------------------ // Selected Users tree //------------------------------ vbox = new VBox(false, 0); selBox.PackStart(vbox, true, true, 0); l = new Label(Util.GS("_Users to add:")); l.Xalign = 0; vbox.PackStart(l, false, false, 0); SelTreeView = new TreeView(); ScrolledWindow ssw = new ScrolledWindow(); ssw.ShadowType = Gtk.ShadowType.EtchedIn; ssw.Add(SelTreeView); vbox.PackStart(ssw, true, true, 0); ssw.WidthRequest = 200; l.MnemonicWidget = SelTreeView; // Set up the iFolder TreeView SelTreeStore = new ListStore(typeof(MemberInfo)); SelTreeStore.SetSortFunc( 0, new TreeIterCompareFunc(SelTreeStoreSortFunction)); SelTreeStore.SetSortColumnId(0, SortType.Ascending); SelTreeView.Model = SelTreeStore; SelTreeView.HeadersVisible = false; // Set up Pixbuf and Text Rendering for "iFolder Users" column TreeViewColumn selmemberColumn = new TreeViewColumn(); CellRendererText smcrt = new CellRendererText(); selmemberColumn.PackStart(smcrt, false); selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc( UserCellTextDataFunc)); selmemberColumn.Title = Util.GS("Users to Add..."); SelTreeView.AppendColumn(selmemberColumn); SelTreeView.Selection.Mode = SelectionMode.Multiple; SelTreeView.Selection.Changed += new EventHandler( OnSelUserSelectionChanged); this.AddButton(Stock.Cancel, ResponseType.Cancel); this.AddButton(Stock.Ok, ResponseType.Ok); this.AddButton(Stock.Help, ResponseType.Help); SetResponseSensitive(ResponseType.Ok, false); SearchiFolderUsers(); }
public static void CheckWordDialog(object sender, EventArgs e) { var lab = new Gtk.Label("Zadejte slovo: "); var ent = new Gtk.Entry(); var but = new Gtk.Button("OK"); var div = new Gtk.HBox(false, 1); div.PackStart(lab); div.Add(ent); div.PackEnd(but); var checkWin = new Gtk.Window(Gtk.WindowType.Popup); checkWin.Add(div); checkWin.BorderWidth = 0; checkWin.Modal = true; checkWin.CanFocus = true; checkWin.SetPosition(WindowPosition.Mouse); checkWin.ShowAll(); ent.Activated += delegate { but.Click(); }; but.Clicked += delegate { checkWin.HideAll(); if (game.dictionary.Content(ent.Text)) { Gtk.MessageDialog ans = new Gtk.MessageDialog( game.Window, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Close, "Slovo \"" + ent.Text + "\" <b>je</b> ve slovníku" ); ans.Run(); ans.Destroy(); } else { Gtk.MessageDialog ans = new Gtk.MessageDialog( game.Window, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Close, "Slovo \"" + ent.Text + "\" <b>není</b> ve slovníku" ); ans.Run(); ans.Destroy(); } checkWin.Dispose(); checkWin.Destroy(); }; checkWin.KeyPressEvent += delegate(object o, KeyPressEventArgs args) { switch (args.Event.Key) { case Gdk.Key.Escape: checkWin.HideAll(); checkWin.Dispose(); checkWin.Destroy(); break; case Gdk.Key.ISO_Enter: but.Click(); break; } }; }
public void Initialize(EditSession session) { PropertyDescriptor prop = session.Property; if (!prop.PropertyType.IsEnum) { throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType); } Spacing = FlagsEditorCell.CheckSpacing; propType = prop.PropertyType; property = prop.Description; if (property == null || property.Length == 0) { property = prop.Name; } // For small enums, the editor is a list of checkboxes inside a frame // For large enums (>5), use a selector dialog. values = System.Enum.GetValues(prop.PropertyType); if (values.Length < FlagsEditorCell.MaxCheckCount) { Gtk.VBox vbox = new Gtk.VBox(true, FlagsEditorCell.CheckSpacing); flags = new Hashtable(); foreach (object value in values) { ulong uintVal = Convert.ToUInt64(value); Gtk.CheckButton check = new BooleanEditor(); if (uintVal == 0) { check.Active = true; // default for None is always enabled } check.Label = value.ToString(); check.TooltipText = value.ToString(); flags[check] = uintVal; flags[uintVal] = check; check.Toggled += FlagToggled; vbox.PackStart(check, false, false, 3); } Gtk.Frame frame = new Gtk.Frame(); frame.Add(vbox); frame.ShowAll(); PackStart(frame, true, true, 0); } else { flagsLabel = new Gtk.Entry(); flagsLabel.IsEditable = false; flagsLabel.HasFrame = false; flagsLabel.ShowAll(); PackStart(flagsLabel, true, true, 0); Gtk.Button but = new Gtk.Button("..."); but.Clicked += OnSelectFlags; but.ShowAll(); PackStart(but, false, false, 0); } }
protected void OnEntryP1AFocusInEvent(object o, Gtk.FocusInEventArgs args) { entrySelected = (Gtk.Entry)o; }
private Gtk.Widget CreateContents() { Gtk.HBox entryLine = new HBox(false, 4); Gtk.Label words = new Gtk.Label(Catalog.GetString("Search terms:")); entryLine.PackStart(words, false, false, 3); history = new Gtk.ListStore(new Type[] { typeof(string) }); Gtk.EntryCompletion comp = new Gtk.EntryCompletion(); comp.Model = history; comp.TextColumn = 0; entry = new Gtk.Entry(""); entry.Activated += new EventHandler(this.DoSearch); entry.Completion = comp; entryLine.PackStart(entry, true, true, 3); words = new Gtk.Label(""); entryLine.PackStart(words, false, false, 3); Gtk.ComboBox combo = FilterComboBox(); combo.Changed += new EventHandler(this.ChangeType); entryLine.PackStart(combo, false, false, 3); Gtk.HBox buttonContents = new HBox(false, 0); Gtk.Widget buttonImg = Beagle.Images.GetWidget("icon-search.png"); buttonContents.PackStart(buttonImg, false, false, 1); Gtk.Label buttonLabel = new Gtk.Label(Catalog.GetString("Find")); buttonContents.PackStart(buttonLabel, false, false, 1); Gtk.Button button = new Gtk.Button(); button.Add(buttonContents); button.Clicked += new EventHandler(this.DoSearch); entryLine.PackStart(button, false, false, 3); Gtk.Button clearButton = new Gtk.Button(); clearButton.Label = "Clear"; clearButton.Clicked += new EventHandler(this.ClearSearch); entryLine.PackStart(clearButton, false, false, 4); canvas = new TileCanvas(); canvas.Show(); HBox pager = new HBox(); page_label = new Label(); page_label.Show(); pager.PackStart(page_label, false, false, 3); forward_button = StockButton("gtk-go-forward", Catalog.GetString("Show More Results")); forward_button.Show(); forward_button.Clicked += new EventHandler(PageForwardHandler); pager.PackEnd(forward_button, false, false, 3); back_button = StockButton("gtk-go-back", Catalog.GetString("Show Previous Results")); back_button.Show(); back_button.Clicked += new EventHandler(PageBackHandler); pager.PackEnd(back_button, false, false, 3); pager.Show(); VBox contents = new VBox(false, 3); contents.PackStart(entryLine, false, true, 3); contents.PackStart(canvas, true, true, 3); contents.PackStart(pager, false, false, 3); entryLine.ShowAll(); canvas.ShowAll(); return(contents); }
private void build() { this.Title = "New Battlelords Character"; { // page 1 - intro Gtk.TextView tv = new Gtk.TextView(); Gtk.TextBuffer tb; tb = tv.Buffer; //tb.Text = MediaManager.GetHtml("intro.html"); tb.Text = "Welcome to the Battlelords Character Asistant.\n" + "\nThis will guide you thru the initial player character generation. " + "You will be presented with some initial options that can not change " + "once the character is created. " + "\nStep 1" + "\nStep 2" + "\nStep 3" + "\nStep 4" + "\nConculsion"; tv.WrapMode = WrapMode.Word; tv.Editable = false; this.AppendPage(tv); this.SetPageTitle(tv, "Introduction"); this.SetPageType(tv, AssistantPageType.Intro); this.SetPageComplete(tv, true); } { // page 2 - rolling method string method1 = "Percentile dice are rolled and marked down in order of the given visual statistics. " + "Eight rolls are initially made. The player then makes three additional dice rolls. " + "He has the option of replacing any three previously rolled statistics with one of these number. " + "Players may not move rolls around! First roll is Strength, second roll is Manual Dexterity, etc."; Gtk.VBox vb = new Gtk.VBox(); Gtk.HBox hb1 = new Gtk.HBox(); Gtk.Label lb1 = new Gtk.Label("Rolling Method"); string[] entries = { "Method 1", "Method 2", "Method 3", "Fill In" }; Gtk.ComboBox cb1 = new Gtk.ComboBox(entries); hb1.PackStart(lb1, true, false, 0); hb1.PackEnd(cb1, true, false, 0); cb1.Active = 0; Gtk.HBox hb2 = new Gtk.HBox(); Gtk.CheckButton b1 = new Gtk.CheckButton("Max Body Points"); Gtk.CheckButton b2 = new Gtk.CheckButton("Max Starting Money"); b1.Active = true; b2.Active = true; hb2.PackStart(b1, true, false, 1); hb2.PackEnd(b2, true, false, 1); Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow(); Gtk.TextView tv = new Gtk.TextView(); tv.WrapMode = WrapMode.Word; tv.Editable = false; Gtk.TextBuffer tb = tv.Buffer; tb.Text = method1; sw.Add(tv); //vb.PackStart(hb1, false, false, 0); vb.PackStart(hb2, false, false, 0); //vb.PackEnd(sw, true, true, 0); this.AppendPage(vb); this.SetPageTitle(vb, "Rolling Options"); this.SetPageType(vb, AssistantPageType.Content); this.SetPageComplete(vb, true); } { // page 3 - race TreeStore ts = new TreeStore(typeof(string), typeof(string)); foreach (BattlelordsRace r in this.session.Races) { ts.AppendValues(r.Name, r.Name); } TreeView tv = new TreeView(ts); tv.HeadersVisible = true; tv.AppendColumn("Battlelords Race", new CellRendererText(), "text", 0); this.AppendPage(tv); this.SetPageTitle(tv, "Select Race"); this.SetPageType(tv, AssistantPageType.Content); this.SetPageComplete(tv, true); } { // page 4 - Basics page /* * 1 char name * 2 player name * 3 height * 4 weight * 5 body pts * 6 start money */ Gtk.VBox vb2 = new Gtk.VBox(); Gtk.HBox hb1 = new Gtk.HBox(); Gtk.Label lb1 = new Gtk.Label("Player's Name:"); Gtk.Entry en1 = new Gtk.Entry(); hb1.PackStart(lb1, false, false, 0); hb1.PackStart(new Gtk.HSeparator(), true, false, 0); hb1.PackEnd(en1, true, true, 0); Gtk.HBox hb2 = new Gtk.HBox(); Gtk.Label lb2 = new Gtk.Label("Character's Name:"); Gtk.Entry en2 = new Gtk.Entry(); hb2.PackStart(lb2, false, false, 0); hb2.PackStart(new Gtk.HSeparator(), true, false, 0); hb2.PackEnd(en2, true, true, 0); Gtk.HBox hb3 = new Gtk.HBox(); Gtk.Label lb3 = new Gtk.Label("Height (ft):"); Gtk.Entry en3 = new Gtk.Entry(); en3.Sensitive = false; Gtk.Button b3 = new Gtk.Button(); //b3.Label = "roll"; b3.TooltipText = "Click here to roll height."; b3.Image = MediaManager.GetImageFromBaseFile("dice.png"); hb3.PackStart(lb3, false, false, 0); hb3.PackStart(new Gtk.HSeparator(), true, false, 0); hb3.PackStart(en3, true, true, 0); hb3.PackEnd(b3, false, false, 0); Gtk.HBox hb4 = new Gtk.HBox(); Gtk.Label lb4 = new Gtk.Label("Weight (lbs):"); Gtk.Entry en4 = new Gtk.Entry(); en4.Sensitive = false; Gtk.Button b4 = new Gtk.Button(); //b4.Label = "roll"; b4.TooltipText = "Click here to roll for weight."; b4.Image = MediaManager.GetImageFromBaseFile("dice.png"); hb4.PackStart(lb4, false, false, 0); hb4.PackStart(new Gtk.HSeparator(), true, false, 0); hb4.PackStart(en4, true, true, 0); hb4.PackEnd(b4, false, false, 0); Gtk.HBox hb5 = new Gtk.HBox(); Gtk.Label lb5 = new Gtk.Label("Body Points:"); Gtk.Entry en5 = new Gtk.Entry(); en5.Sensitive = false; Gtk.Button b5 = new Gtk.Button(); b5.TooltipText = "Click here to roll for body points."; b5.Image = MediaManager.GetImageFromBaseFile("dice.png"); hb5.PackStart(lb5, false, false, 0); hb5.PackStart(new Gtk.HSeparator(), true, false, 0); hb5.PackStart(en5, true, true, 0); hb5.PackEnd(b5, false, false, 0); Gtk.HBox hb6 = new Gtk.HBox(); Gtk.Label lb6 = new Gtk.Label("Starting Money:"); Gtk.Entry en6 = new Gtk.Entry(); en6.Sensitive = false; Gtk.Button b6 = new Gtk.Button(); b6.TooltipText = "Click here to roll for starting money."; b6.Image = MediaManager.GetImageFromBaseFile("dice.png"); hb6.PackStart(lb6, false, false, 0); hb6.PackStart(new Gtk.HSeparator(), true, false, 0); hb6.PackStart(en6, true, true, 0); hb6.PackEnd(b6, false, false, 0); vb2.PackStart(hb1, false, false, 0); vb2.PackStart(hb2, false, false, 0); vb2.PackStart(hb3, false, false, 0); vb2.PackStart(hb4, false, false, 0); vb2.PackStart(hb5, false, false, 0); vb2.PackStart(hb6, false, false, 0); this.AppendPage(vb2); this.SetPageTitle(vb2, "Enter Basic Information"); this.SetPageType(vb2, AssistantPageType.Content); this.SetPageComplete(vb2, true); } { // page 5 - vitals VBox vb5 = new VBox(); Gtk.Notebook nb = new Gtk.Notebook(); //Battle.Gui.VitalsControl stvc = new Battle.Gui.VitalsControl(this.session); //stvc.Sensitive = false; VitalsControl m1vitals = new VitalsControl(this.session); VitalsControl m2vitals = new VitalsControl(this.session); VitalsControl m3vitals = new VitalsControl(this.session); VitalsControl fillvitals = new VitalsControl(this.session); m1vitals.Enabled = false; m2vitals.Enabled = false; m3vitals.Enabled = false; nb.AppendPage(m1vitals, new Gtk.Label("Method 1")); nb.AppendPage(m2vitals, new Gtk.Label("Method 2")); nb.AppendPage(m3vitals, new Gtk.Label("Method 3")); nb.AppendPage(fillvitals, new Gtk.Label("Fill In")); HButtonBox bb5 = new HButtonBox(); Button rollBtn = new Button(Stock.Execute); rollBtn.Clicked += delegate(object sender, EventArgs e) { Console.WriteLine("{0}", sender.GetType().ToString()); }; rollBtn.Label = "Roll"; Button saveBtn = new Button(Stock.Save); saveBtn.Label = "Save"; bb5.PackStart(rollBtn); bb5.PackEnd(saveBtn); nb.SwitchPage += delegate(object o, SwitchPageArgs args) { if (args.PageNum == 3) { rollBtn.Sensitive = false; } else { rollBtn.Sensitive = true; } }; vb5.Add(nb); vb5.Add(bb5); this.AppendPage(vb5); this.SetPageTitle(vb5, "Enter Vitals"); this.SetPageType(vb5, AssistantPageType.Content); this.SetPageComplete(vb5, true); } { // page 6 - secondaries Gtk.Label not_completed_label = new Gtk.Label("not completed"); Pango.FontDescription d = new Pango.FontDescription(); d.Style = Pango.Style.Italic; not_completed_label.ModifyFont(d); this.AppendPage(not_completed_label); this.SetPageTitle(not_completed_label, "Enter Secondary Attributes"); this.SetPageType(not_completed_label, AssistantPageType.Content); this.SetPageComplete(not_completed_label, true); } { // page 7 - fate Gtk.Label not_completed_label = new Gtk.Label("not completed"); Pango.FontDescription d = new Pango.FontDescription(); d.Style = Pango.Style.Italic; not_completed_label.ModifyFont(d); this.AppendPage(not_completed_label); this.SetPageTitle(not_completed_label, "Determine Fate"); this.SetPageType(not_completed_label, AssistantPageType.Content); this.SetPageComplete(not_completed_label, true); } { // page 8 - social Gtk.Label not_completed_label = new Gtk.Label("not completed"); Pango.FontDescription d = new Pango.FontDescription(); d.Style = Pango.Style.Italic; not_completed_label.ModifyFont(d); this.AppendPage(not_completed_label); this.SetPageTitle(not_completed_label, "Social Status"); this.SetPageType(not_completed_label, AssistantPageType.Content); this.SetPageComplete(not_completed_label, true); } { // page 9 - skills Gtk.Label not_completed_label = new Gtk.Label("not completed"); Pango.FontDescription d = new Pango.FontDescription(); d.Style = Pango.Style.Italic; not_completed_label.ModifyFont(d); this.AppendPage(not_completed_label); this.SetPageTitle(not_completed_label, "Choose Initial Skills"); this.SetPageType(not_completed_label, AssistantPageType.Content); this.SetPageComplete(not_completed_label, true); } { // page 10 - matrixes Gtk.Label not_completed_label = new Gtk.Label("not completed"); Pango.FontDescription d = new Pango.FontDescription(); d.Style = Pango.Style.Italic; not_completed_label.ModifyFont(d); this.AppendPage(not_completed_label); this.SetPageTitle(not_completed_label, "Choose Initial Matrixes"); this.SetPageType(not_completed_label, AssistantPageType.Content); this.SetPageComplete(not_completed_label, true); } { // page 11 - confirm TextView tv11 = new TextView(); TextBuffer b11 = tv11.Buffer; b11.Text = "Confirm this new character."; tv11.Editable = false; this.AppendPage(tv11); this.SetPageTitle(tv11, "Confirm New Character"); this.SetPageType(tv11, AssistantPageType.Confirm); this.SetPageComplete(tv11, true); } this.Close += HandleHandleClose; this.Cancel += HandleHandleCancel; this.ShowAll(); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { /* Set up ghostscript calls for progress update */ m_ghostscript = new GSMONO(); m_ghostscript.ProgressCallBack += new GSMONO.Progress(gsProgress); m_ghostscript.StdIOCallBack += new GSMONO.StdIO(gsIO); m_ghostscript.DLLProblemCallBack += new GSMONO.DLLProblem(gsDLL); DeleteEvent += delegate { Application.Quit(); }; m_currpage = 0; m_gsoutput = new gsOutput(); m_gsoutput.Activate(); m_tempfiles = new List <TempFile>(); m_thumbnails = new List <DocPage>(); m_docPages = new Pages(); m_page_sizes = new List <pagesizes_t>(); m_page_scroll_pos = new List <int>(); m_file_open = false; m_doczoom = 1.0; m_init_done = false; m_busy_render = true; m_firstime = true; m_aa = true; m_aa_change = false; m_zoom_txt = "100"; m_page_txt = "1"; m_ignore_scroll_change = false; /* Set up Vbox in main window */ this.SetDefaultSize(500, 700); this.Title = "GhostPDL Mono GTK Demo"; m_GtkvBoxMain = new VBox(false, 0); this.Add(m_GtkvBoxMain); /* Add Menu Bar to vBox */ Gtk.MenuBar menu_bar = new MenuBar(); Menu filemenu = new Menu(); MenuItem file = new MenuItem("File"); file.Submenu = filemenu; AccelGroup agr = new AccelGroup(); AddAccelGroup(agr); ImageMenuItem openi = new ImageMenuItem(Stock.Open, agr); openi.AddAccelerator("activate", agr, new AccelKey( Gdk.Key.o, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); openi.Activated += OnOpen; filemenu.Append(openi); ImageMenuItem closei = new ImageMenuItem(Stock.Close, agr); closei.AddAccelerator("activate", agr, new AccelKey( Gdk.Key.w, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); closei.Activated += OnClose; filemenu.Append(closei); MenuItem messagesi = new MenuItem("Show Messages"); messagesi.Activated += OnShowMessages; filemenu.Append(messagesi); MenuItem about = new MenuItem("About"); about.Activated += OnAboutClicked; filemenu.Append(about); SeparatorMenuItem sep = new SeparatorMenuItem(); filemenu.Append(sep); ImageMenuItem quiti = new ImageMenuItem(Stock.Quit, agr); quiti.AddAccelerator("activate", agr, new AccelKey( Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible)); filemenu.Append(quiti); quiti.Activated += OnQuit; menu_bar.Append(file); m_GtkvBoxMain.PackStart(menu_bar, false, false, 0); /* Add a hbox with the page information, zoom control, and aa to vbox */ HBox pageBox = new HBox(false, 0); m_GtkpageEntry = new Entry(); m_GtkpageEntry.Activated += PageChanged; m_GtkpageEntry.WidthChars = 4; m_GtkpageTotal = new Label("/0"); pageBox.PackStart(m_GtkpageEntry, false, false, 0); pageBox.PackStart(m_GtkpageTotal, false, false, 0); HBox zoomBox = new HBox(false, 0); m_GtkZoomPlus = new Button(); m_GtkZoomPlus.Label = "+"; m_GtkZoomPlus.Clicked += ZoomIn; m_GtkZoomMinus = new Button(); m_GtkZoomMinus.Label = "–"; m_GtkZoomMinus.Clicked += ZoomOut; m_GtkzoomEntry = new Entry(); m_GtkzoomEntry.WidthChars = 3; m_GtkzoomEntry.Activated += ZoomChanged; Label precentLabel = new Label("%"); zoomBox.PackStart(m_GtkZoomPlus, false, false, 0); zoomBox.PackStart(m_GtkZoomMinus, false, false, 0); zoomBox.PackStart(m_GtkzoomEntry, false, false, 0); zoomBox.PackStart(precentLabel, false, false, 0); HBox hBoxControls = new HBox(false, 0); m_GtkaaCheck = new CheckButton("Enable Antialias:"); m_GtkaaCheck.Active = true; m_GtkaaCheck.Clicked += AaCheck_Clicked; hBoxControls.PackStart(pageBox, false, false, 0); hBoxControls.PackStart(zoomBox, false, false, 20); hBoxControls.PackStart(m_GtkaaCheck, false, false, 0); m_GtkvBoxMain.PackStart(hBoxControls, false, false, 0); /* Tree view containing thumbnail and main images */ HBox hBoxPages = new HBox(false, 0); /* Must be scrollable */ m_GtkthumbScroll = new ScrolledWindow(); m_GtkthumbScroll.BorderWidth = 5; m_GtkthumbScroll.ShadowType = ShadowType.In; m_GtkmainScroll = new ScrolledWindow(); m_GtkmainScroll.BorderWidth = 5; m_GtkmainScroll.ShadowType = ShadowType.In; m_GtkmainScroll.Vadjustment.ValueChanged += Vadjustment_Changed; m_GtkTreeThumb = new Gtk.TreeView(); m_GtkTreeThumb.HeadersVisible = false; m_GtkimageStoreThumb = new Gtk.ListStore(typeof(Gdk.Pixbuf)); m_GtkTreeThumb.AppendColumn("Thumb", new Gtk.CellRendererPixbuf(), "pixbuf", 0); m_GtkTreeThumb.Style.YThickness = 100; m_GtkthumbScroll.Add(m_GtkTreeThumb); m_GtkTreeThumb.RowActivated += M_GtkTreeThumb_RowActivated; m_GtkTreeMain = new Gtk.TreeView(); m_GtkTreeMain.HeadersVisible = false; m_GtkTreeMain.RulesHint = false; m_GtkimageStoreMain = new Gtk.ListStore(typeof(Gdk.Pixbuf)); m_GtkTreeMain.AppendColumn("Main", new Gtk.CellRendererPixbuf(), "pixbuf", 0); m_GtkmainScroll.Add(m_GtkTreeMain); // Separate with gridlines m_GtkTreeMain.EnableGridLines = TreeViewGridLines.Horizontal; //To disable selections, set the selection mode to None: m_GtkTreeMain.Selection.Mode = SelectionMode.None; hBoxPages.PackStart(m_GtkthumbScroll, false, false, 0); hBoxPages.PackStart(m_GtkmainScroll, true, true, 0); m_GtkTreeThumb.Model = m_GtkimageStoreThumb; m_GtkTreeMain.Model = m_GtkimageStoreMain; m_GtkvBoxMain.PackStart(hBoxPages, true, true, 0); /* For case of opening another file */ string[] arguments = Environment.GetCommandLineArgs(); if (arguments.Length > 1) { m_currfile = arguments[1]; ProcessFile(); } }
public WidgetBuilderOptionPanelWidget(Project project) : base(false, 6) { this.project = project as DotNetProject; Gtk.HBox box = new Gtk.HBox(false, 3); Gtk.Label lbl = new Gtk.Label(GettextCatalog.GetString("Target Gtk# version:")); box.PackStart(lbl, false, false, 0); comboVersions = ComboBox.NewText(); ReferenceManager refmgr = new ReferenceManager(project as DotNetProject); foreach (string v in refmgr.SupportedGtkVersions) { comboVersions.AppendText(v); } comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf(refmgr.GtkPackageVersion); refmgr.Dispose(); box.PackStart(comboVersions, false, false, 0); box.ShowAll(); PackStart(box, false, false, 0); HSeparator sep = new HSeparator(); sep.Show(); PackStart(sep, false, false, 0); if (!GtkDesignInfo.HasDesignedObjects(project)) { return; } GtkDesignInfo designInfo = GtkDesignInfo.FromProject(project); checkGettext = new CheckButton(GettextCatalog.GetString("Enable gettext support")); checkGettext.Active = designInfo.GenerateGettext; checkGettext.Show(); PackStart(checkGettext, false, false, 0); box = new Gtk.HBox(false, 3); box.PackStart(new Label(GettextCatalog.GetString("Gettext class:")), false, false, 0); entryGettext = new Gtk.Entry(); entryGettext.Text = designInfo.GettextClass; entryGettext.Sensitive = checkGettext.Active; box.PackStart(entryGettext, false, false, 0); box.ShowAll(); PackStart(box, false, false, 0); box = new Gtk.HBox(false, 3); box.PackStart(new Label(GettextCatalog.GetString("Resource loader class:")), false, false, 0); entryResourceLoader = new Gtk.Entry(); entryResourceLoader.Text = designInfo.ImageResourceLoaderClass; entryResourceLoader.Sensitive = checkGettext.Active; box.PackStart(entryResourceLoader, false, false, 0); box.ShowAll(); PackStart(box, false, false, 0); checkGettext.Clicked += delegate { box.Sensitive = checkGettext.Active; if (checkGettext.Active) { entryGettext.Text = "Mono.Unix.Catalog"; } }; }
private void ConfirmLoadAssembly(string [] selection) { Gtk.Entry e_sPlugin = null; string l_sChoosenPlayer = ""; MessageDialog confirmationDialog = null; foreach (string s in selection) { confirmationDialog = new MessageDialog(this.Window, DialogFlags.Modal | DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.YesNo, "What extension " + Path.GetFileName(s) + " should handle ?"); VBox vbox = confirmationDialog.VBox; HBox hbox = new HBox(false, 4); vbox.PackStart(hbox, true, true, 0); e_sPlugin = new Gtk.Entry(".foobar"); hbox.PackStart(e_sPlugin, false, false, 0); confirmationDialog.ShowAll(); int res = confirmationDialog.Run(); confirmationDialog.Hide(); confirmationDialog.Dispose(); if (res == (int)ResponseType.Yes) { try { FileSelection fs = new FileSelection("Select your favorite player"); fs.HideFileopButtons(); CConfig config = CConfig.Instance; fs.Complete((string)config["Interface/currentPath"]); fs.Resizable = true; fs.Modal = true; int r = fs.Run(); fs.Hide(); fs.Dispose(); if (r == (int)ResponseType.Ok) { l_sChoosenPlayer = fs.Selections[0]; plugins.LoadAssembly((string)((Gtk.Entry)e_sPlugin).Text, s); try { CPluginManager.SetStatic(plugins.GetOwningType((string)((Gtk.Entry)e_sPlugin).Text), "Player", l_sChoosenPlayer); } catch (Exception e) { Console.WriteLine("Player not found"); } PopulatePluginList(); ((Gtk.Button)m_xXML["applyButton"]).Sensitive = true; } else { throw new Exception("Loading aborted by user."); } } catch (Exception e) { Console.WriteLine("Plugin error: " + e.Message); } } } }