public static void Main(string[] args) { Gtk.Window window; EventBox eventbox; Label label; Application.Init(); window = new Gtk.Window ("Eventbox"); window.DeleteEvent += new DeleteEventHandler (delete_event); window.BorderWidth = 10; window.Resize(400,300); eventbox = new EventBox (); window.Add (eventbox); eventbox.Show(); label = new Label ("Click here to quit"); eventbox.Add(label); label.Show(); label.SetSizeRequest(110, 20); eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event); eventbox.Realize(); window.Show(); Application.Run(); }
public ExternalWindow() : base(WindowType.Toplevel) { Icon = LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch", IconSize.Menu); box = new EventBox (); box.Name = "lightbackgroundeventbox"; box.KeyPressEvent += (o, args) => { Config.EventsBroker.EmitKeyPressed (this, Keyboard.ParseEvent (args.Event)); }; base.Add (box); box.CanFocus = true; Focus = box; box.Show (); }
public SharpApp() : base("EventBox Example") { SetDefaultSize(230,150); SetPosition(WindowPosition.Center); DeleteEvent += delegate {Application.Quit();}; EventBox ebox = new EventBox(); Add(ebox); ebox.Show(); Label label = new Label("Do Not Touch"); ebox.Add(label); label.Show(); label.SetSizeRequest(110,20); ebox.ButtonPressEvent += delegate{ System.Console.WriteLine("Hello");}; ebox.Realize(); Show(); }
private void Init() { sepBox = null; preview = false; rootAdd = new Gtk.EventBox (); rootAdd.VisibleWindow = false; rootAdd.CanFocus = true; rootAdd.DragMotion += HandleDragMotion; rootAdd.DragDataReceived += HandleDragDataReceived; rootAdd.DragLeave += HandleDragLeave; help = new Gtk.Label ("<i>" + Catalog.GetString ("Drag tags here to search for them") + "</i>"); help.UseMarkup = true; help.Visible = true; rootBox = new HBox(); rootBox.Add (help); rootBox.Show (); rootAdd.Child = rootBox; rootAdd.Show (); Gtk.Drag.DestSet (rootAdd, DestDefaults.All, tag_dest_target_table, DragAction.Copy | DragAction.Move ); PackEnd (rootAdd, true, true, 0); rootTerm = new OrTerm (null, null); }
private void Init() { Logger.Debug("Called Init"); this.Icon = Utilities.GetIcon ("giver-48", 48); // Update the window title this.Title = string.Format ("Giver Preferences"); //this.DefaultSize = new Gdk.Size (300, 500); this.VBox.Spacing = 0; this.VBox.BorderWidth = 0; this.SetDefaultSize (450, 100); this.AddButton(Stock.Close, Gtk.ResponseType.Ok); this.DefaultResponse = ResponseType.Ok; // Start with an event box to paint the background white EventBox eb = new EventBox(); eb.Show(); eb.BorderWidth = 0; eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255)); eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255)); VBox mainVBox = new VBox(); mainVBox.BorderWidth = 10; mainVBox.Spacing = 5; mainVBox.Show (); eb.Add(mainVBox); this.VBox.PackStart(eb); Label label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>"; mainVBox.PackStart(label, true, true, 0); // Name Box at the top of the Widget HBox nameBox = new HBox(); nameBox.Show(); nameEntry = new Entry(); nameEntry.Show(); nameBox.PackStart(nameEntry, true, true, 0); nameBox.Spacing = 10; mainVBox.PackStart(nameBox, false, false, 0); label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>"; mainVBox.PackStart(label, true, true, 0); Gtk.Table table = new Table(4, 3, false); table.Show(); // None Entry noneButton = new RadioButton((Gtk.RadioButton)null); noneButton.Show(); table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); VBox vbox = new VBox(); vbox.Show(); Gtk.Image image = new Image(Utilities.GetIcon("computer", 48)); image.Show(); vbox.PackStart(image, false, false, 0); label = new Label("None"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 0 ,1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); table.Attach(vbox, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); // Local Entry localButton = new RadioButton(noneButton); localButton.Show(); table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); localImage = new Image(Utilities.GetIcon("stock_person", 48)); localImage.Show(); vbox.PackStart(localImage, false, false, 0); label = new Label("File"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 1 ,2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); photoButton = new Button("Change Photo"); photoButton.Show(); table.Attach(photoButton, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0); // Web Entry webButton = new RadioButton(noneButton); webButton.Show(); table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); image = new Image(Utilities.GetIcon("web-browser", 48)); image.Show(); vbox.PackStart(image, false, false, 0); label = new Label("Web Link"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 2 ,3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); webEntry = new Entry(); webEntry.Show(); table.Attach(webEntry, 2,3,2,3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); // Gravatar Entry gravatarButton = new RadioButton(noneButton); gravatarButton.Show(); table.Attach(gravatarButton, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); image = new Image(Utilities.GetIcon("gravatar", 48)); image.Show(); vbox.PackStart(image, false, false, 0); label = new Label("Gravatar"); label.Show(); vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 3 ,4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); gravatarEntry = new Entry(); gravatarEntry.Show(); table.Attach(gravatarEntry, 2,3,3,4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); mainVBox.PackStart(table, true, true, 0); label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Your File Location</span>"; mainVBox.PackStart(label, true, true, 0); fileLocationButton = new FileChooserButton("Select storage location", FileChooserAction.SelectFolder); fileLocationButton.Show(); mainVBox.PackStart(fileLocationButton, true, true, 0); table = new Table(2, 3, false); table.Show(); // Port number section label = new Label(); label.Show(); label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "<span weight=\"bold\" size=\"large\">Port Number</span>"; mainVBox.PackStart(label, true, true, 0); // any port Entry anyPortButton = new RadioButton((Gtk.RadioButton)null); anyPortButton.Show(); table.Attach(anyPortButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); vbox = new VBox(); vbox.Show(); label = new Label (); label.Show (); label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "Any available port"; vbox.PackStart(label, false, false, 0); table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); // fixed port Entry fixedPortButton = new RadioButton(anyPortButton); fixedPortButton.Show(); table.Attach(fixedPortButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); label = new Label (); label.Show (); label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.LineWrap = false; label.UseMarkup = true; label.UseUnderline = false; label.Markup = "Use a fixed port"; table.Attach(label, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); portNumberEntry = new Entry(); portNumberEntry.Show(); table.Attach(portNumberEntry, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); mainVBox.PackStart(table, true, true, 0); DeleteEvent += WindowDeleted; }
void Build () { Title = GettextCatalog.GetString ("Exception Caught"); DefaultWidth = 500; DefaultHeight = 500; HeightRequest = 350; WidthRequest = 350; VBox.Foreach (VBox.Remove); VBox.PackStart (CreateExceptionHeader (), false, true, 0); paned = new VPanedThin (); paned.GrabAreaSize = 10; paned.Pack1 (CreateStackTraceTreeView (), true, false); paned.Pack2 (CreateExceptionValueTreeView (), true, false); paned.Show (); var vbox = new VBox (false, 0); var whiteBackground = new EventBox (); whiteBackground.Show (); whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ()); whiteBackground.Add (vbox); hadInnerException = HasInnerException (); if (hadInnerException) { vbox.PackStart (new VBox (), false, false, 6); vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0); vbox.ShowAll (); } vbox.PackStart (paned, true, true, 0); vbox.Show (); if (hadInnerException) { var box = new HBox (); box.PackStart (CreateInnerExceptionsTree (), false, false, 0); box.PackStart (whiteBackground, true, true, 0); box.Show (); VBox.PackStart (box, true, true, 0); DefaultWidth = 900; DefaultHeight = 700; WidthRequest = 550; HeightRequest = 450; } else { VBox.PackStart (whiteBackground, true, true, 0); } var actionArea = new HBox (false, 0) { BorderWidth = 14 }; OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code.")); OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled; OnlyShowMyCodeCheckbox.Show (); OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly; var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox }; alignment.Show (); actionArea.PackStart (alignment, true, true, 0); actionArea.PackStart (CreateButtonBox (), false, true, 0); actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels actionArea.ShowAll (); VBox.PackStart (actionArea, false, true, 0); }
void DetachPlayer(bool detach) { if (detach == detachedPlayer) return; detachedPlayer = detach; if (detach) { EventBox box; Log.Debug("Detaching player"); playerWindow = new Gtk.Window(Constants.SOFTWARE_NAME); playerWindow.Icon = Stetic.IconLoader.LoadIcon(this, "longomatch", IconSize.Button); playerWindow.DeleteEvent += (o, args) => DetachPlayer(false); box = new EventBox(); box.KeyPressEvent += (o, args) => OnKeyPressEvent(args.Event); playerWindow.Add(box); box.Show(); playerWindow.Show(); player.Reparent(box); buttonswidget.Visible = true; timeline.Visible = true; if (Config.useGameUnits) { guTimeline.Visible = true; gameunitstaggerwidget1.Visible = true; } } else { ToggleAction action; Log.Debug("Attaching player again"); player.Reparent(this.videowidgetsbox); playerWindow.Destroy(); if (ManualTaggingViewAction.Active) action = ManualTaggingViewAction; else if (TimelineViewAction.Active) action = TimelineViewAction; else if (GameUnitsViewAction.Active) action = GameUnitsViewAction; else action = TaggingViewAction; OnViewToggled(action, new EventArgs()); } }
public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences) : base() { if (backend == null) throw new ArgumentNullException ("backend"); if (preferences == null) throw new ArgumentNullException ("preferences"); this.backend = backend; this.preferences = preferences; LoadPreferences (); BorderWidth = 0; // We're using an event box so we can paint the background white EventBox imageEb = new EventBox (); imageEb.BorderWidth = 0; imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255)); imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255)); imageEb.Show (); VBox mainVBox = new VBox(false, 0); mainVBox.BorderWidth = 10; mainVBox.Show(); Add(mainVBox); // Add the rtm logo image = new Gtk.Image (normalPixbuf); image.Show(); //make the dialog box look pretty without hard coding total size and //therefore clipping displays with large fonts. Alignment spacer = new Alignment((float)0.5, 0, 0, 0); spacer.SetPadding(0, 0, 125, 125); spacer.Add(image); spacer.Show(); imageEb.Add (spacer); mainVBox.PackStart(imageEb, true, true, 0); // Status message label statusLabel = new Label(); statusLabel.Justify = Gtk.Justification.Center; statusLabel.Wrap = true; statusLabel.LineWrap = true; statusLabel.Show(); statusLabel.UseMarkup = true; statusLabel.UseUnderline = false; authButton = new LinkButton ( #if GETTEXT Catalog.GetString ("Click Here to Connect")); #elif ANDROID #endif authButton.Clicked += OnAuthButtonClicked; if ( isAuthorized ) { statusLabel.Text = "\n\n" + #if GETTEXT Catalog.GetString ("You are currently connected"); #elif ANDROID #endif string userName = preferences.Get (PreferencesKeys.UserNameKey); if (userName != null && userName.Trim () != string.Empty) statusLabel.Text = "\n\n" + #if GETTEXT Catalog.GetString ("You are currently connected as") + #elif ANDROID #endif "\n" + userName.Trim(); } else { statusLabel.Text = "\n\n" + #if GETTEXT Catalog.GetString ("You are not connected"); #elif ANDROID #endif authButton.Show(); } mainVBox.PackStart(statusLabel, false, false, 0); mainVBox.PackStart(authButton, false, false, 0); Label blankLabel = new Label("\n"); blankLabel.Show(); mainVBox.PackStart(blankLabel, false, false, 0); }
private void CreateStatusbar() { statusBar = new Toolbar(); statusBar.ShowArrow = false; statusBar.ToolbarStyle = ToolbarStyle.BothHoriz; statusBar.ExposeEvent += StatusBarExposeEvent; statusLabel = new Label(); statusLabel.Xalign = 0; statusLabel.Xpad = 6; ToolItem statusLabelItem = new ToolItem(); Alignment statusAlign = new Alignment(0.5f, 0.5f, 1.0f, 1.0f); statusLabelItem.Add(statusLabel); statusLabelItem.Expand = true; statusBar.Insert(statusLabelItem, -1); statusLabelItem.ShowAll(); taskStatusIcon = new Hyena.Widgets.AnimatedImage(); taskStatusIcon.Pixbuf = Gui.LoadIcon(22, "process-working"); taskStatusIcon.FrameHeight = 22; taskStatusIcon.FrameWidth = 22; taskStatusIcon.Load(); EventBox taskStatusIconBox = new EventBox(); taskStatusIconBox.MotionNotifyEvent += delegate { UpdateTaskStatusIcon(); }; taskStatusIconBox.ButtonReleaseEvent += delegate { IndexingStatusWindow.Instance.Show(); }; taskStatusIconBox.SizeAllocated += delegate (object o, SizeAllocatedArgs args) { statusAlign.LeftPadding = (uint)args.Allocation.Width; }; taskStatusIconBox.SetSizeRequest(22, 22); taskStatusIconBox.Add(taskStatusIcon); taskStatusIconBox.Show(); ToolItem taskStatusIconItem = new ToolItem(); taskStatusIconItem.Add(taskStatusIconBox); statusBar.Insert(taskStatusIconItem, -1); taskStatusIconItem.Show(); mainVBox.PackStart(statusBar, false, false, 0); UpdateTaskStatusIcon(); UpdateStatusText(); }
void Build() { Title = GettextCatalog.GetString("Exception Caught"); DefaultWidth = 500; DefaultHeight = 500; HeightRequest = 350; WidthRequest = 350; container.Foreach(container.Remove); container.PackStart(CreateExceptionHeader(), false, true, 0); paned = new VPanedThin(); paned.GrabAreaSize = 10; paned.Pack1(CreateStackTraceTreeView(), true, false); paned.Pack2(CreateExceptionValueTreeView(), true, false); paned.Position = 160; paned.Show(); var vbox = new VBox(false, 0); var whiteBackground = new EventBox(); whiteBackground.Show(); whiteBackground.ModifyBg(StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor()); whiteBackground.Add(vbox); hadInnerException = HasInnerException(); if (hadInnerException) { vbox.PackStart(new VBox(), false, false, 6); vbox.PackStart(CreateInnerExceptionMessage(), false, true, 0); vbox.ShowAll(); } vbox.PackStart(paned, true, true, 0); vbox.Show(); if (hadInnerException) { var box = new HBox(); box.PackStart(CreateInnerExceptionsTree(), false, false, 0); box.PackStart(whiteBackground, true, true, 0); box.Show(); container.PackStart(box, true, true, 0); DefaultWidth = 900; DefaultHeight = 700; WidthRequest = 550; HeightRequest = 450; } else { container.PackStart(whiteBackground, true, true, 0); } var actionArea = new HBox(false, 0) { BorderWidth = 14 }; onlyShowMyCodeCheckbox = new CheckButton(GettextCatalog.GetString("_Only show my code")); onlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled; onlyShowMyCodeCheckbox.Show(); onlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions().ProjectAssembliesOnly; var alignment = new Alignment(0.0f, 0.5f, 0.0f, 0.0f) { Child = onlyShowMyCodeCheckbox }; alignment.Show(); actionArea.PackStart(alignment, true, true, 0); actionArea.PackStart(CreateButtonBox(), false, true, 0); actionArea.PackStart(new VBox(), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels actionArea.ShowAll(); vbox.PackStart(actionArea, false, true, 0); }
protected override void CreateBody() { CreateBody(Translator.GetString("Choose your items")); WrapLabel footer = new WrapLabel { Markup = string.Format(Translator.GetString( "Items are used to describe the goods and services that you purchase and sell. To modify your items later go to:{0}{1}"), Environment.NewLine, new PangoStyle { Italic = true, Bold = true, Text = Translator.GetString("Edit->Items...") }) }; footer.Show(); vboBody.PackStart(footer, false, true, 0); if (setups.Count == 0) { foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/Warehouse/Presentation/SetupAssistant/ItemsSetup")) { object instance = node.CreateInstance(); ItemsSetup setup = instance as ItemsSetup; if (setup != null) { setups.Add(setup); } } setups.Sort((p1, p2) => Math.Max(-1, Math.Min(1, p1.Ordinal - p2.Ordinal))); } nbkMain = new Notebook(); if (setups.Count > 0) { foreach (ItemsSetup setup in setups) { Label lblTab = new Label(setup.Label) { Xpad = 4 }; Widget page = setup.GetPageWidget(); page.Show(); Alignment alg = new Alignment(.5f, .5f, 1f, 1f) { LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4 }; alg.Add(page); alg.Show(); EventBox evb = new EventBox { alg }; evb.Show(); nbkMain.AppendPage(evb, lblTab); } nbkMain.Show(); } vboBody.PackStart(nbkMain, true, true, 10); wlbError = new WrapLabel(); vboBody.PackStart(wlbError, false, true, 0); pgbProgress = new ProgressBar { Fraction = 0.00 }; vboBody.PackEnd(pgbProgress, false, true, 2); lblProgress = new Label(); vboBody.PackEnd(lblProgress, false, true, 4); }
private void SetupInfoWidget() { infoWidget = new CanvasWidget (group); infoWidget.Width = widgetWidth; infoWidget.Height = widgetHeigh; int startingMinute = Task.StartingMinute; string minuteText = startingMinute.ToString (); if (startingMinute <= 9) minuteText = "0" + minuteText; label = new Label (); label.UseMarkup = true; label.Markup = "<b>" + Task.StartingHour.ToString () + ":" + minuteText + "</b>"; EventBox ebox = new EventBox (); ebox.Show (); ebox.Add (label); tooltips.SetTip (ebox, Task.Description, Task.Description); infoWidget.Widget = ebox; label.Show (); infoWidget.Show (); infoWidget.RaiseToTop (); }