public LyricsHelp() : base(false, 0) { Label title = new Label (); Label details1 = new Label (); Label details2 = new Label (); title.Markup = "<b><big><big>Lyrics</big></big></b>"; details1.Markup = "This panel displays the lyrics of the currently playing song"; details2.Markup = "You can also search for an artist below which will give you a list of albums and tracks to choose from"; details1.Wrap = true; details2.Wrap = true; VBox box = new VBox (false, 40); box.PackStart (details1, false, false, 0); box.PackStart (details2, false, false, 0); Alignment align = new Alignment (0.5f, 0.5f, 0, 0); align.Add (box); this.PackStart (title, false, false, 0); this.PackStart (new HSeparator (), false, false, 5); this.PackStart (align, true, true, 0); this.PackStart (new Image (null, "lyricwiki-logo.png"), false, false, 0); }
void Install(Gtk.Alignment commandBox, Button installButton, Update update) { if (update.InstallAction == null) { DesktopService.ShowUrl(update.Url); return; } installButton.Hide(); if (installing) { Gtk.Label lab = new Gtk.Label(GettextCatalog.GetString("Waiting")); commandBox.Child.Destroy(); commandBox.Add(lab); lab.Show(); installQueue.Enqueue(delegate { lab.Hide(); RunInstall(commandBox, update); }); return; } RunInstall(commandBox, update); }
public EnableStartupNotesPreference() { IPropertyEditorBool enableStartupNotes_peditor; Gtk.CheckButton enableStartupNotesCheckbox; Gtk.Label enableStartupNotesLabel; // Enable Startup Notes option enableStartupNotesLabel = new Gtk.Label(Catalog.GetString("Enable startup notes")); enableStartupNotesLabel.UseMarkup = true; enableStartupNotesLabel.Justify = Gtk.Justification.Left; enableStartupNotesLabel.SetAlignment(0.0f, 0.5f); enableStartupNotesLabel.Show(); enableStartupNotesCheckbox = new Gtk.CheckButton(); enableStartupNotesCheckbox.Add(enableStartupNotesLabel); enableStartupNotesCheckbox.Show(); enableStartupNotes_peditor = Services.Factory.CreatePropertyEditorToggleButton(Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox); Preferences.Get(enableStartupNotes_peditor.Key); enableStartupNotes_peditor.Setup(); align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f); align.Show(); align.Add(enableStartupNotesCheckbox); }
private void BuildWidget () { HBox box = new HBox (); disk_bar_align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f); disk_bar = new SegmentedBar (); disk_bar.ValueFormatter = DapValueFormatter; disk_bar.AddSegmentRgb (Catalog.GetString ("Audio"), 0, 0x3465a4); disk_bar.AddSegmentRgb (Catalog.GetString ("Video"), 0, 0x73d216); disk_bar.AddSegmentRgb (Catalog.GetString ("Other"), 0, 0xf57900); disk_bar.AddSegment (Catalog.GetString ("Free Space"), 0, disk_bar.RemainderColor, false); UpdateUsage (); disk_bar_align.Add (disk_bar); box.PackStart (disk_bar_align, true, true, 0); disk_bar_align.TopPadding = 6; Add (box); box.ShowAll (); SizeAllocated += delegate (object o, Gtk.SizeAllocatedArgs args) { SetBackground (); disk_bar.HorizontalPadding = (int)(args.Allocation.Width * 0.25); }; }
protected override void InitializeForm() { XML form = FormHelper.LoadGladeXML("Dialogs.UserLogin.glade", "dlgUserLogin"); form.Autoconnect(this); dlgUserLogin.Icon = FormHelper.LoadImage("Icons.User32.png").Pixbuf; btnOK.SetChildImage(FormHelper.LoadImage("Icons.Ok24.png")); btnCancel.SetChildImage(FormHelper.LoadImage("Icons.Cancel24.png")); Image image = FormHelper.LoadImage("Images.Login61.png"); image.Show(); algImage.Add(image); pnlChooseNumber = new ChooseNumberPanel(null, txtPassword, true, false); pnlChooseNumber.Show(); algKeypad.Add(pnlChooseNumber); dlgUserLogin.Realized += dlgLogin_Realized; cboUserName.Changed += cboUserName_Changed; btnChoose.Toggled += btnChoose_Toggled; btnChoose.Active = BusinessDomain.AppConfiguration.LastKeypadOnLoginActive; base.InitializeForm(); InitializeFormStrings(); InitializeEntries(); PresentationDomain.CardRecognized += PresentationDomain_CardRecognized; }
public DemoColorSelection () : base ("Color Selection") { BorderWidth = 8; VBox vbox = new VBox (false,8); vbox.BorderWidth = 8; Add (vbox); // Create the color swatch area Frame frame = new Frame (); frame.ShadowType = ShadowType.In; vbox.PackStart (frame, true, true, 0); drawingArea = new DrawingArea (); // set a minimum size drawingArea.SetSizeRequest (200,200); // set the color color.Red = 0; color.Green = 0; color.Blue = 1; color.Alpha = 1; drawingArea.OverrideBackgroundColor (StateFlags.Normal, color); frame.Add (drawingArea); Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); Button button = new Button ("_Change the above color"); button.Clicked += new EventHandler (ChangeColorCallback); alignment.Add (button); vbox.PackStart (alignment, false, false, 0); ShowAll (); }
private void BuildInterface () { NoShowAll = true; Alignment matchesAlignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f); matchesAlignment.SetPadding (5, 5, 5, 5); matchesAlignment.Add (terms_box); matchesFrame = new Frame (null); matchesFrame.Add (matchesAlignment); matchesFrame.LabelWidget = BuildMatchHeader (); matchesFrame.ShowAll (); terms_entry_box = new HBox (); terms_entry_box.Spacing = 8; terms_entry_box.PackStart (new Label (Catalog.GetString ("Condition:")), false, false, 0); terms_entry = new Entry (); terms_entry_box.PackStart (terms_entry, true, true, 0); limit_box.ShowAll (); PackStart(matchesFrame, true, true, 0); PackStart(terms_entry_box, false, false, 0); PackStart(limit_box, false, false, 0); //ShowAll (); }
protected virtual void Build() { Gui.Initialize (this); // Widget BolPatcher.MenuGameWidget BinContainer.Attach (this); Name = "BolPatcher.MenuGameWidget"; // Container child BolPatcher.MenuGameWidget.Gtk.Container+ContainerChild _frame1 = new Frame (); _frame1.Name = "frame1"; _frame1.ShadowType = 0; // Container child frame1.Gtk.Container+ContainerChild _gtkAlignment = new Alignment (0F, 0F, 1F, 1F); _gtkAlignment.Name = "GtkAlignment"; _gtkAlignment.LeftPadding = 12; // Container child GtkAlignment.Gtk.Container+ContainerChild _button2 = new Button (); _button2.CanFocus = true; _button2.Name = "button2"; _button2.UseUnderline = true; _button2.Label = Catalog.GetString ("GtkButton"); _gtkAlignment.Add (_button2); _frame1.Add (_gtkAlignment); _gtkLabel1 = new Label (); _gtkLabel1.Name = "GtkLabel1"; _gtkLabel1.LabelProp = Catalog.GetString ("<b>GtkFrame</b>"); _gtkLabel1.UseMarkup = true; _frame1.LabelWidget = _gtkLabel1; Add (_frame1); if ((Child != null)) { Child.ShowAll (); } Hide (); }
public NotificationMessage (string t, string m) : base (false, 5) { this.Style = style; BorderWidth = 5; icon = new Image (Stock.DialogInfo, IconSize.Dialog); this.PackStart (icon, false, true, 5); VBox vbox = new VBox (false, 5); this.PackStart (vbox, true, true, 0); title = new Label (); title.SetAlignment (0.0f, 0.5f); this.Title = t; vbox.PackStart (title, false, true, 0); message = new Label (); message.LineWrap = true; message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label message.SetAlignment (0.0f, 0.0f); this.Message = m; vbox.PackStart (message, true, true, 0); action_box = new HBox (false, 3); Button hide_button = new Button (Catalog.GetString ("Hide")); hide_button.Clicked += OnHideClicked; action_box.PackEnd (hide_button, false, true, 0); Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); action_align.Add (action_box); vbox.PackStart (action_align, false, true, 0); }
public DemoColorSelection () : base ("Color Selection") { BorderWidth = 8; VBox vbox = new VBox (false,8); vbox.BorderWidth = 8; Add (vbox); // Create the color swatch area Frame frame = new Frame (); frame.ShadowType = ShadowType.In; vbox.PackStart (frame, true, true, 0); drawingArea = new DrawingArea (); drawingArea.ExposeEvent += new ExposeEventHandler (ExposeEventCallback); // set a minimum size drawingArea.SetSizeRequest (200,200); // set the color color = new Gdk.Color (0, 0, 0xff); drawingArea.ModifyBg (StateType.Normal, color); frame.Add (drawingArea); Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f); Button button = new Button ("_Change the above color"); button.Clicked += new EventHandler (ChangeColorCallback); alignment.Add (button); vbox.PackStart (alignment); ShowAll (); }
public ArtistInfoHelp() : base(false, 0) { Label title = new Label (); Label details1 = new Label (); Label details2 = new Label (); Label details3 = new Label (); title.Markup = "<b><big><big>Artist Info</big></big></b>"; details1.Markup = "This panel displays information about the currently playing artist such as:"; details2.Markup = "<i>Similar Artists\nSimilar Tracks\nTop Albums\nTop Tracks\nAlbum Details</i>"; details3.Markup = "You can also search for an artist below"; details1.Wrap = true; details2.Wrap = true; details3.Wrap = true; VBox details_box = new VBox (false, 0); details_box.PackStart (details1, false, false, 0); details_box.PackStart (details2, false, false, 2); details_box.PackStart (details3, false, false, 40); Alignment align = new Alignment (0.5f, 0.5f, 0, 0); align.Add (details_box); this.PackStart (title, false, false, 0); this.PackStart (new HSeparator (), false, false, 5); this.PackStart (align, true, true, 0); this.PackStart (new Image (null, "audioscrobbler-logo.png"), false, false, 0); }
public MainWindow_2() : base("Allignment") { SetDefaultSize(260, 150); SetPosition(WindowPosition.Center); DeleteEvent += delegate { Application.Quit(); }; VBox vbox = new VBox(false, 5); HBox hbox = new HBox(true, 3); Alignment valign = new Alignment(0, 0.5f, 0, 0); vbox.PackStart(valign); Button ok = new Button("OK"); ok.SetSizeRequest(70, 30); Button close = new Button("Close"); hbox.Add(ok); hbox.Add(close); Alignment halign = new Alignment(0.5f, 0, 0, 0); halign.Add(hbox); vbox.PackStart(halign, false, false, 3); Add(vbox); ShowAll(); }
public void AddMessage (string msg, IconId icon) { if (lastImage != null) { HSeparator sep = new HSeparator (); sep.Show (); msgBox.PackStart (sep, false, false, 0); lastImage.IconSize = Gtk.IconSize.Menu; } HBox box = new HBox (); box.Spacing = 12; Alignment imgBox = new Alignment (0, 0, 0, 0); var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog); imgBox.Add (img); lastImage = img; box.PackStart (imgBox, false, false, 0); Label lab = new Label (msg); lab.UseUnderline = false; lab.Xalign = 0; lab.Yalign = 0; lab.Wrap = true; lab.WidthRequest = 500; box.PackStart (lab, true, true, 0); msgBox.PackStart (box, false, false, 0); box.ShowAll (); }
protected void Construct (Widget buttonWidget, Menu menu, bool showArrow) { WidgetFlags |= WidgetFlags.NoWindow; button_widget = buttonWidget; Menu = menu; toggle_button.Parent = this; toggle_button.FocusOnClick = false; toggle_button.Relief = ReliefStyle.None; toggle_button.Pressed += delegate { ShowMenu (); toggle_button.Active = true; }; toggle_button.Activated += delegate { ShowMenu (); }; box.Parent = this; if (showArrow) { box.PackStart (button_widget, true, true, 0); alignment = new Alignment (0f, 0.5f, 0f, 0f); arrow = new Arrow (ArrowType.Down, ShadowType.None); alignment.Add (arrow); box.PackStart (alignment, false, false, 5); size_widget = box; FocusChain = new Widget[] {toggle_button, box}; alignment.ShowAll (); alignment.NoShowAll = true; } else { toggle_button.Add (button_widget); size_widget = toggle_button; } ShowAll (); }
protected override void BuildContent (Container parent) { LogoImage = Xwt.Drawing.Image.FromResource ("WelcomePage_Logo.png"); TopBorderImage = Xwt.Drawing.Image.FromResource ("WelcomePage_TopBorderRepeat.png"); var mainAlignment = new Gtk.Alignment (0.5f, 0.5f, 0f, 1f); var mainCol = new WelcomePageColumn (); mainAlignment.Add (mainCol); var row1 = new WelcomePageRow (); row1.PackStart (new WelcomePageButtonBar ( new WelcomePageBarButton ("MonoDevelop.com", "http://www.monodevelop.com", "link-cloud.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.go-mono.com/docs", "link-info.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "link-heart.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "link-chat.png") ) ); mainCol.PackStart (row1, false, false, 0); var row2 = new WelcomePageRow ( new WelcomePageColumn ( new WelcomePageRecentProjectsList (GettextCatalog.GetString ("Solutions")) ), new WelcomePageColumn ( new WelcomePageNewsFeed (GettextCatalog.GetString ("Xamarin News"), "http://software.xamarin.com/Service/News", "NewsLinks") ), new WelcomePageColumn ( new WelcomePageTipOfTheDaySection () ) ); mainCol.PackStart (row2, false, false, 0); parent.Add (mainAlignment); }
public EnableStartupNotesPreference () { IPropertyEditorBool enableStartupNotes_peditor; Gtk.CheckButton enableStartupNotesCheckbox; Gtk.Label enableStartupNotesLabel; // Enable Startup Notes option enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes")); enableStartupNotesLabel.UseMarkup = true; enableStartupNotesLabel.Justify = Gtk.Justification.Left; enableStartupNotesLabel.SetAlignment (0.0f, 0.5f); enableStartupNotesLabel.Show (); enableStartupNotesCheckbox = new Gtk.CheckButton (); enableStartupNotesCheckbox.Add (enableStartupNotesLabel); enableStartupNotesCheckbox.Show (); enableStartupNotes_peditor = Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox); Preferences.Get (enableStartupNotes_peditor.Key); enableStartupNotes_peditor.Setup (); align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f); align.Show (); align.Add (enableStartupNotesCheckbox); }
public InfoBar() : base() { // top panel bar Image close = new Image (Stock.Close, IconSize.Menu); close_box.Realized += close_box_realized; close_box.ButtonReleaseEvent += close_box_released; close_box.Add (close); Label title = new Label (); title.Markup = "<small>Information Bar</small>"; title.Angle = 90; VBox left_box = new VBox (false, 0); left_box.PackStart (button_box, false, false, 0); left_box.PackStart (title, true, true, 0); Alignment align = new Alignment (1, 0.5f, 0, 0); align.Add (close_box); HBox panel_header = new HBox (false, 0); panel_header.PackStart (custom_align, true, true, 0); panel_header.PackStart (align, false, false, 0); panel_box.PackStart (panel_header, false, false, 0); panel_frame.Add (panel_box); main_box.PackStart (left_box, false, false, 0); this.PackStart (main_box, true, true, 0); addInfoPanel (new Lyrics (this), "Lyrics"); addInfoPanel (new ArtistInfo (this), "Artist Info"); addInfoPanel (new Profile (this), "Profile"); }
protected override void BuildContent (Container parent) { LogoImage = Xwt.Drawing.Image.FromResource ("WelcomePage_Logo.png"); TopBorderImage = Xwt.Drawing.Image.FromResource ("WelcomePage_TopBorderRepeat.png"); var mainAlignment = new Gtk.Alignment (0.5f, 0.5f, 0f, 1f); var mainCol = new WelcomePageColumn (); mainAlignment.Add (mainCol); var row1 = new WelcomePageRow (); row1.PackStart (new WelcomePageButtonBar ( new WelcomePageBarButton ("Haxe.org", "http://www.haxe.org", "link-cloud.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.http://haxe.org/doc", "link-info.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "https://groups.google.com/forum/#!forum/haxelang", "link-heart.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "https://groups.google.com/forum/#!forum/haxelang", "link-chat.png") ) ); mainCol.PackStart (row1, false, false, 0); var row2 = new WelcomePageRow ( new WelcomePageColumn ( new WelcomePageRecentProjectsList (GettextCatalog.GetString ("Solutions")) ), new WelcomePageColumn ( new WelcomePageNewsFeed (GettextCatalog.GetString ("Haxe News"), "http://software.xamarin.com/Service/News", "NewsLinks") ), new WelcomePageColumn ( new WelcomePageTipOfTheDaySection () ) ); mainCol.PackStart (row2, false, false, 0); parent.Add (mainAlignment); }
public WelcomePageWidget() { logoPixbuf = WelcomePageBranding.GetLogoImage(); bgPixbuf = WelcomePageBranding.GetTopBorderImage(); Gdk.Color color = Gdk.Color.Zero; if (!Gdk.Color.Parse(WelcomePageBranding.BackgroundColor, ref color)) { color = Style.White; } ModifyBg(StateType.Normal, color); var mainAlignment = new Gtk.Alignment(0f, 0f, 1f, 1f); mainAlignment.SetPadding((uint)(WelcomePageBranding.LogoHeight + WelcomePageBranding.Spacing), 0, (uint)WelcomePageBranding.Spacing, 0); this.Add(mainAlignment); colBox = new Gtk.HBox(false, WelcomePageBranding.Spacing); mainAlignment.Add(colBox); BuildContent(); ShowAll(); IdeApp.Workbench.GuiLocked += OnLock; IdeApp.Workbench.GuiUnlocked += OnUnlock; }
public void AddMessage (string msg, string icon) { if (lastImage != null) { HSeparator sep = new HSeparator (); sep.Show (); msgBox.PackStart (sep); lastImage.IconSize = (int) Gtk.IconSize.Button; } HBox box = new HBox (); box.Spacing = 12; Alignment imgBox = new Alignment (0, 0, 0, 0); Image img = new Image (icon, lastImage != null ? Gtk.IconSize.Button : IconSize.Dialog); imgBox.Add (img); lastImage = img; box.PackStart (imgBox, false, false, 0); Label lab = new Label (msg); lab.Xalign = 0; lab.Yalign = 0; lab.Wrap = true; lab.WidthRequest = 500; box.PackStart (lab, true, true, 0); msgBox.PackStart (box, false, false, 0); box.ShowAll (); }
public ThemeTestModule() : base("Theme") { var align = new Alignment (0.0f, 0.0f, 1.0f, 1.0f); var theme_widget = new ThemeTestWidget (); align.Add (theme_widget); Add (align); ShowAll (); int state = 0; uint[,] borders = { {0, 0, 0, 0}, {10, 0, 0, 0}, {0, 10, 0, 0}, {0, 0, 10, 0}, {0, 0, 0, 10}, {10, 10, 0, 0}, {10, 10, 10, 0}, {10, 10, 10, 10}, {10, 0, 0, 10}, {0, 10, 10, 0} }; GLib.Timeout.Add (2000, delegate { Console.WriteLine (state); align.TopPadding = borders[state, 0]; align.RightPadding = borders[state, 1]; align.BottomPadding = borders[state, 2]; align.LeftPadding = borders[state, 3]; if (++state % borders.GetLength (0) == 0) { state = 0; } return true; }); }
public LoginDialog(Window parent, string errorMsg) : base("Login", parent) { XML gxml = new XML(null, "MultiMC.GTKGUI.LoginDialog.glade", "loginTable", null); gxml.Autoconnect(this); labelErrorMsg.Text = errorMsg; Alignment loginAlign = new Alignment(0.5f, 0.5f, 1, 1); loginAlign.Add(loginTable); loginAlign.SetPadding(4, 4, 4, 4); this.VBox.Add(loginAlign); loginAlign.ShowAll(); okButton = this.AddButton("_OK", ResponseType.Ok) as Button; cancelButton = this.AddButton("_Cancel", ResponseType.Cancel) as Button; this.Default = okButton; this.WidthRequest = 420; labelErrorMsg.Visible = !string.IsNullOrEmpty(labelErrorMsg.Text); entryPassword.Visibility = false; }
public override Gtk.Widget GetDisplayWidget() { DrawingArea colorPreview = new DrawingArea (); colorPreview.ModifyBg(StateType.Normal, GetColor ()); colorPreview.WidthRequest = 15; Alignment colorPreviewAlign = new Alignment (0, 0, 0, 1); colorPreviewAlign.SetPadding (2, 2, 2, 2); colorPreviewAlign.Add (colorPreview); string labelText; System.Drawing.Color color = (System.Drawing.Color) parentRow.PropertyValue; //TODO: dropdown known color selector so this does something if (color.IsKnownColor) labelText = color.Name; else if (color.IsEmpty) labelText = "[empty]"; else labelText = String.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B); //we use StringValue as it auto-bolds the text for non-default values Label theLabel = (Label) base.StringValue (labelText); theLabel.Xalign = 0; theLabel.Xpad = 3; HBox hbox = new HBox (); hbox.PackStart (colorPreviewAlign, false, false, 0); hbox.PackStart (theLabel, true, true, 0); return hbox; }
public override bool GetPreferenceTabWidget(PreferencesDialog parent, out string tabLabel, out Gtk.Widget preferenceWidget) { Gtk.Label label; Gtk.SpinButton menuNoteCountSpinner; Gtk.Alignment align; int menuNoteCount; // Addin's tab caption tabLabel = Catalog.GetString("Advanced"); Gtk.VBox opts_list = new Gtk.VBox(false, 12); opts_list.BorderWidth = 12; opts_list.Show(); align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f); align.Show(); opts_list.PackStart(align, false, false, 0); Gtk.Table table = new Gtk.Table(1, 2, false); table.ColumnSpacing = 6; table.RowSpacing = 6; table.Show(); align.Add(table); // Menu Note Count option label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)")); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.SetAlignment(0.0f, 0.5f); label.Show(); table.Attach(label, 0, 1, 0, 1); menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT); // we have a hard limit of 18 set, thus not allowing anything bigger than 18 menuNoteCountSpinner = new Gtk.SpinButton(1, 18, 1); menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18; menuNoteCountSpinner.Show(); table.Attach(menuNoteCountSpinner, 1, 2, 0, 1); menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference; if (opts_list != null) { preferenceWidget = opts_list; return(true); } else { preferenceWidget = null; return(false); } }
public DemoStockBrowser () : base ("Stock Icons and Items") { SetDefaultSize (-1, 500); BorderWidth = 8; HBox hbox = new HBox (false, 8); Add (hbox); ScrolledWindow sw = new ScrolledWindow (); sw.SetPolicy (PolicyType.Never, PolicyType.Automatic); hbox.PackStart (sw, false, false, 0); ListStore model = CreateModel (); TreeView treeview = new TreeView (model); sw.Add (treeview); TreeViewColumn column = new TreeViewColumn (); column.Title = "Name"; CellRenderer renderer = new CellRendererPixbuf (); column.PackStart (renderer, false); column.SetAttributes (renderer, "stock_id", Column.Id); renderer = new CellRendererText (); column.PackStart (renderer, true); column.SetAttributes (renderer, "text", Column.Name); treeview.AppendColumn (column); treeview.AppendColumn ("Label", new CellRendererText (), "text", Column.Label); treeview.AppendColumn ("Accel", new CellRendererText (), "text", Column.Accel); treeview.AppendColumn ("ID", new CellRendererText (), "text", Column.Id); Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f); hbox.PackEnd (align, false, false, 0); Frame frame = new Frame ("Selected Item"); align.Add (frame); VBox vbox = new VBox (false, 8); vbox.BorderWidth = 8; frame.Add (vbox); typeLabel = new Label (); vbox.PackStart (typeLabel, false, false, 0); iconImage = new Gtk.Image (); vbox.PackStart (iconImage, false, false, 0); accelLabel = new Label (); vbox.PackStart (accelLabel, false, false, 0); nameLabel = new Label (); vbox.PackStart (nameLabel, false, false, 0); idLabel = new Label (); vbox.PackStart (idLabel, false, false, 0); treeview.Selection.Mode = Gtk.SelectionMode.Single; treeview.Selection.Changed += new EventHandler (SelectionChanged); ShowAll (); }
public void UpdateTab() { if (box != null) { Remove(box); box.Destroy(); slabel = null; } Gtk.Alignment align = new Gtk.Alignment(0, 0, 0, 0); if (orientation == Gtk.Orientation.Horizontal) { box = new HBox(); align.LeftPadding = ItemPadding; align.RightPadding = ItemPadding; align.TopPadding = BarPadding; align.BottomPadding = BarPadding; } else { box = new VBox(); align.LeftPadding = BarPadding; align.RightPadding = BarPadding; align.TopPadding = ItemPadding; align.BottomPadding = ItemPadding; } align.Add(box); if (!string.IsNullOrEmpty(icon)) { box.PackStart(new Gtk.Image(icon, IconSize.Menu), false, false, 0); } if (!string.IsNullOrEmpty(label)) { string txt = label; // string txt = "<b>" + label + "</b>"; if (running) { txt = "<span foreground='blue'>" + txt + "</span>"; } slabel = new Gtk.Label(txt); UpdateColor(); slabel.UseMarkup = true; if (orientation == Gtk.Orientation.Vertical) { slabel.Angle = 270; } box.PackStart(slabel, true, true, 0); } box.Spacing = 2; align.ShowAll(); Add(align); }
public override bool GetPreferenceTabWidget ( PreferencesDialog parent, out string tabLabel, out Gtk.Widget preferenceWidget) { Gtk.Label label; Gtk.SpinButton menuNoteCountSpinner; Gtk.Alignment align; int menuNoteCount; // Addin's tab caption tabLabel = Catalog.GetString ("Advanced"); Gtk.VBox opts_list = new Gtk.VBox (false, 12); opts_list.BorderWidth = 12; opts_list.Show (); align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f); align.Show (); opts_list.PackStart (align, false, false, 0); Gtk.Table table = new Gtk.Table (1, 2, false); table.ColumnSpacing = 6; table.RowSpacing = 6; table.Show (); align.Add (table); // Menu Note Count option label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)")); label.UseMarkup = true; label.Justify = Gtk.Justification.Left; label.SetAlignment (0.0f, 0.5f); label.Show (); table.Attach (label, 0, 1, 0, 1); menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT); // we have a hard limit of 18 set, thus not allowing anything bigger than 18 menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1); menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18; menuNoteCountSpinner.Show (); table.Attach (menuNoteCountSpinner, 1, 2, 0, 1); menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference; if (opts_list != null) { preferenceWidget = opts_list; return true; } else { preferenceWidget = null; return false; } }
public WelcomePageFeedItem() { var actionHandler = new ActionDelegate(this); actionHandler.PerformPress += PerformPress; Accessible.Description = "A news item that opens the full story in a browser when clicked"; Accessible.Role = Atk.Role.Link; VisibleWindow = false; box = new VBox(); box.Accessible.SetShouldIgnore(true); titleLabel = new Label() { Xalign = 0 }; titleLabel.Accessible.SetShouldIgnore(true); titleLabel.Wrap = false; titleLabel.Ellipsize = Pango.EllipsizeMode.End; titleLabel.LineWrapMode = Pango.WrapMode.Word; box.PackStart(titleLabel, false, false, 0); subtitleLabel = new Label() { Xalign = 0 }; subtitleLabel.Accessible.SetShouldIgnore(true); var align = new Gtk.Alignment(0, 0, 1f, 1f) { TopPadding = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom, BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop }; align.Add(subtitleLabel); align.Accessible.SetShouldIgnore(true); box.PackStart(align, false, false, 0); summaryLabel = new Label() { Xalign = 0 }; summaryLabel.Accessible.SetShouldIgnore(true); summaryLabel.Wrap = true; box.PackStart(summaryLabel, true, true, 0); Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7)); summaryLabel.Attributes = new Pango.AttrList(); summaryLabel.Attributes.Insert(rise); Add(box); Gui.Styles.Changed += UpdateStyle; }
public static void ShowSimOnlyDialog() { if (!SimOnly) { return; } var dialog = new Dialog(); dialog.Title = GettextCatalog.GetString("Evaluation Version"); dialog.VBox.PackStart( new Label("<b><big>Feature Not Available In Evaluation Version</big></b>") { Xalign = 0.5f, UseMarkup = true }, true, false, 12); var align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 }; dialog.VBox.PackStart(align, true, false, 12); align.Add(new Label( "You should upgrade to the full version of MonoTouch to target and deploy\n" + " to the device, and to enable your applications to be distributed.") { Xalign = 0.5f, Justify = Justification.Center }); align = new Gtk.Alignment(0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 }; dialog.VBox.PackStart(align, true, false, 12); var buyButton = new Button( new Label(GettextCatalog.GetString("<big>Buy MonoTouch</big>")) { UseMarkup = true }); buyButton.Clicked += delegate { System.Diagnostics.Process.Start("http://monotouch.net"); dialog.Respond(ResponseType.Accept); }; align.Add(buyButton); dialog.AddButton(GettextCatalog.GetString("Continue evaluation"), ResponseType.Close); dialog.ShowAll(); MessageService.ShowCustomDialog(dialog); }
public HoverImageButton() { Gtk.Alignment al = new Alignment (0.5f, 0.5f, 0f, 0f); al.Show (); CanFocus = true; VisibleWindow = false; image = new ImageView(); image.Show(); al.Add (image); Add(al); }
public ActionField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute) : base(new Gtk.Alignment(0, 0, 1, 1)) { action = (GameAction)property.GetValue(obj); Gtk.Alignment alignment = (Gtk.Alignment)Child; alignment.Add(new Label(action.name)); if (attribute.arg != null) { alignment.BorderWidth = (uint)(int)attribute.arg; } TooltipText = action.description; Sensitive = action.condition(context); Clicked += (o, a) => action.action(context); }
public MenuMinMaxNoteCountPreference() { table = new Gtk.Table(2, 2, false); table.ColumnSpacing = 6; table.RowSpacing = 6; table.Show(); // Menu Min Note Count option menuMinNoteCountLabel = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list")); menuMinNoteCountLabel.UseMarkup = true; menuMinNoteCountLabel.Justify = Gtk.Justification.Left; menuMinNoteCountLabel.SetAlignment(0.0f, 0.5f); menuMinNoteCountLabel.Show(); table.Attach(menuMinNoteCountLabel, 0, 1, 0, 1); menuMinNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT); menuMaxNoteCount = (int)Preferences.Get(Preferences.MENU_MAX_NOTE_COUNT); // This is to avoid having Max bigger than absolute maximum if someone changed the setting // outside of the Tomboy using e.g. gconf menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue); // This is to avoid having Min bigger than Max if someone changed the setting // outside of the Tomboy using e.g. gconf menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount); menuMinNoteCountSpinner = new Gtk.SpinButton(1, menuMaxNoteCount, 1); menuMinNoteCountSpinner.Value = menuMinNoteCount; menuMinNoteCountSpinner.Show(); table.Attach(menuMinNoteCountSpinner, 1, 2, 0, 1); menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference; // Menu Max Note Count option menuMaxNoteCountLabel = new Gtk.Label(Catalog.GetString("Maximum number of notes to show in Recent list")); menuMaxNoteCountLabel.UseMarkup = true; menuMaxNoteCountLabel.Justify = Gtk.Justification.Left; menuMaxNoteCountLabel.SetAlignment(0.0f, 0.5f); menuMaxNoteCountLabel.Show(); table.Attach(menuMaxNoteCountLabel, 0, 1, 1, 2); menuMaxNoteCountSpinner = new Gtk.SpinButton(menuMinNoteCount, int.MaxValue, 1); menuMaxNoteCountSpinner.Value = menuMaxNoteCount; menuMaxNoteCountSpinner.Show(); table.Attach(menuMaxNoteCountSpinner, 1, 2, 1, 2); menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference; align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f); align.Show(); align.Add(table); }
public MenuMinMaxNoteCountPreference () { table = new Gtk.Table (2, 2, false); table.ColumnSpacing = 6; table.RowSpacing = 6; table.Show (); // Menu Min Note Count option menuMinNoteCountLabel = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list")); menuMinNoteCountLabel.UseMarkup = true; menuMinNoteCountLabel.Justify = Gtk.Justification.Left; menuMinNoteCountLabel.SetAlignment (0.0f, 0.5f); menuMinNoteCountLabel.Show (); table.Attach (menuMinNoteCountLabel, 0, 1, 0, 1); menuMinNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT); menuMaxNoteCount = (int) Preferences.Get (Preferences.MENU_MAX_NOTE_COUNT); // This is to avoid having Max bigger than absolute maximum if someone changed the setting // outside of the Tomboy using e.g. gconf menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue); // This is to avoid having Min bigger than Max if someone changed the setting // outside of the Tomboy using e.g. gconf menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount); menuMinNoteCountSpinner = new Gtk.SpinButton (1, menuMaxNoteCount, 1); menuMinNoteCountSpinner.Value = menuMinNoteCount; menuMinNoteCountSpinner.Show (); table.Attach (menuMinNoteCountSpinner, 1, 2, 0, 1); menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference; // Menu Max Note Count option menuMaxNoteCountLabel = new Gtk.Label (Catalog.GetString ("Maximum number of notes to show in Recent list")); menuMaxNoteCountLabel.UseMarkup = true; menuMaxNoteCountLabel.Justify = Gtk.Justification.Left; menuMaxNoteCountLabel.SetAlignment (0.0f, 0.5f); menuMaxNoteCountLabel.Show (); table.Attach (menuMaxNoteCountLabel, 0, 1, 1, 2); menuMaxNoteCountSpinner = new Gtk.SpinButton (menuMinNoteCount, int.MaxValue, 1); menuMaxNoteCountSpinner.Value = menuMaxNoteCount; menuMaxNoteCountSpinner.Show (); table.Attach (menuMaxNoteCountSpinner, 1, 2, 1, 2); menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference; align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f); align.Show (); align.Add (table); }
public DefaultPolicyOptionsDialog (Gtk.Window parentWindow) : base (parentWindow, new PolicySet (), "/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels") { this.Title = GettextCatalog.GetString ("Custom Policies"); editingSet = (PolicySet) DataObject; HBox topBar = new HBox (); topBar.Spacing = 3; topBar.PackStart (new Label (GettextCatalog.GetString ("Editing Policy:")), false, false, 0); policiesCombo = ComboBox.NewText (); topBar.PackStart (policiesCombo, false, false, 0); newButton = new Button (GettextCatalog.GetString ("Add Policy")); topBar.PackEnd (newButton, false, false, 0); deleteButton = new Button (GettextCatalog.GetString ("Delete Policy")); topBar.PackEnd (deleteButton, false, false, 0); Alignment align = new Alignment (0f, 0f, 1f, 1f); align.LeftPadding = 9; align.TopPadding = 9; align.RightPadding = 9; align.BottomPadding = 9; align.Add (topBar); HeaderBox ebox = new HeaderBox (); ebox.GradientBackround = true; ebox.SetMargins (0, 1, 0, 0); ebox.Add (align); ebox.ShowAll (); VBox.PackStart (ebox, false, false, 0); VBox.BorderWidth = 0; Box.BoxChild c = (Box.BoxChild) VBox [ebox]; c.Position = 0; foreach (PolicySet ps in PolicyService.GetUserPolicySets ()) { PolicySet copy = ps.Clone (); originalSets [copy] = ps; sets.Add (copy); } FillPolicySets (); policiesCombo.Changed += HandlePoliciesComboChanged; newButton.Clicked += HandleNewButtonClicked; deleteButton.Clicked += HandleDeleteButtonClicked; }
void RunInstall(Gtk.Alignment commandBox, Update update) { installing = true; ProgressBarMonitor monitorBar = new ProgressBarMonitor(); monitorBar.ShowErrorsDialog = true; monitorBar.Show(); commandBox.Child.Destroy(); commandBox.Add(monitorBar); IAsyncOperation oper = update.InstallAction(monitorBar.CreateProgressMonitor()); oper.Completed += delegate { DispatchService.GuiDispatch(delegate { monitorBar.Hide(); Gtk.Label result = new Gtk.Label(); if (oper.Success) { result.Text = GettextCatalog.GetString("Completed"); } else { result.Text = GettextCatalog.GetString("Failed"); } commandBox.Child.Destroy(); commandBox.Add(result); result.Show(); installing = false; if (installQueue.Count > 0) { installQueue.Dequeue()(); } }); }; }
public SongLyrics() { this.DisplayWidget = box; Alignment align = new Alignment (0, 0, 0, 0); align.Add (lyrics_label); align.BorderWidth = 10; box.PackStart (artist_label, false, false, 0); box.PackStart (title_label, false, false, 3); box.PackStart (new HSeparator (), false, false, 0); box.PackStart (align, true, true, 0); artist_label.Xalign = 0; title_label.Xalign = 0; }
public SampleAssistant () { SetSizeRequest (450, 300); Title = "Gtk.Assistant Sample"; Label lbl = new Label ("Click the forward button to continue."); AppendPage (lbl); SetPageTitle (lbl, "Introduction"); SetPageType (lbl, AssistantPageType.Intro); SetPageComplete (lbl, true); HBox box = new HBox (false, 6); box.PackStart (new Label ("Enter some text: "), false, false, 6); Entry entry = new Entry (); entry.Changed += new EventHandler (EntryChanged); box.PackStart (entry, false, false, 6); AppendPage (box); SetPageTitle (box, "Getting Some Input"); SetPageType (box, AssistantPageType.Content); CheckButton chk = new CheckButton ("I think Gtk# is awesome."); chk.Toggled += new EventHandler (ButtonToggled); AppendPage (chk); SetPageTitle (chk, "Provide Feedback"); SetPageType (chk, AssistantPageType.Content); Alignment al = new Alignment (0.5f, 0.5f, 0.0f, 0.0f); box = new HBox (false, 6); progress_bar = new ProgressBar (); box.PackStart (progress_bar, true, true, 6); Button btn = new Button ("Make progress"); btn.Clicked += new EventHandler (ButtonClicked); box.PackStart (btn, false, false, 6); al.Add (box); AppendPage (al); SetPageTitle (al, "Show Some Progress"); SetPageType (al, AssistantPageType.Progress); lbl = new Label ("In addition to being able to type,\nYou obviously have great taste in software."); AppendPage (lbl); SetPageTitle (lbl, "Congratulations"); SetPageType (lbl, AssistantPageType.Confirm); SetPageComplete (lbl, true); Cancel += new EventHandler (AssistantCancel); Close += new EventHandler (AssistantClose); }
protected override void InitializeForm() { XML form = FormHelper.LoadGladeXML("Dialogs.ReceiptReports.glade", "dlgReceiptReports"); form.Autoconnect(this); dlgReceiptReports.Title = Translator.GetString("Reports"); dlgReceiptReports.Icon = FormHelper.LoadImage("Icons.Report32.png").Pixbuf; btnPrint.SetChildImage(FormHelper.LoadImage("Icons.Print24.png")); btnClose.SetChildImage(FormHelper.LoadImage("Icons.Cancel24.png")); btnClear.SetChildImage(FormHelper.LoadImage("Icons.Clear24.png")); Image img = FormHelper.LoadImage("Icons.Report32.png"); algDialogIcon.Add(img); img.Show(); // If Sylfaen is used then we probably need it to display special characters // for ka and hy locales. In this cases don't modify the font in order to display // everything correctly if (txvPreview.Style.FontDescription.Family != "Sylfaen") { txvPreview.ModifyFont(FontDescription.FromString(FormHelper.DefaultMonospaceFont)); } btnPrint.Sensitive = BusinessDomain.AppConfiguration.CustomerOrdersPrinterEnabled; base.InitializeForm(); InitializeFormStrings(); filterTimer = new Timer { AutoReset = false }; filterTimer.Elapsed += (sender, args) => GLib.Timeout.Add(1, () => { DisplayReport(); return(false); }); debounce = false; rbnSales.Toggle(); debounce = true; }
public MeeGoHeaderBox () { BorderWidth = 5; Spacing = 5; RedrawOnAllocate = true; AppPaintable = true; header = new Alignment (0.0f, 0.5f, 1.0f, 1.0f) { LeftPadding = 10, RightPadding = 10, TopPadding = 5, BottomPadding = 5 }; header_label = new Label () { Xalign = 0.0f }; header.Add (header_label); header.ShowAll (); PackStart (header, false, false, 0); }
public iFolderCreationDialog(iFolderWeb ifolder) : base() { this.Title = ""; this.HasSeparator = false; this.Resizable = false; this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); Gdk.Pixbuf bigiFolder = new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")); Image folderImage = new Image(bigiFolder); VBox vbox = new VBox(); vbox.BorderWidth = 10; vbox.Spacing = 10; HBox h = new HBox(); h.Spacing = 12; folderImage.SetAlignment(0.5F, 0); h.PackStart(folderImage, false, false, 0); VBox vbox2 = new VBox(); vbox2.Spacing = 10; Label l = new Label("<span weight=\"bold\" size=\"larger\">" + Util.GS("iFolder Created") + "</span>"); l.LineWrap = false; l.UseMarkup = true; l.Selectable = false; l.Xalign = 0; l.Yalign = 0; vbox2.PackStart(l, false, false, 0); l = new Label(Util.GS("The folder you selected is now an iFolder. To learn more about using iFolder and sharing iFolders with other users, see \"Managing iFolders\" in iFolder Help.")); l.LineWrap = true; l.Xalign = 0; vbox2.PackStart(l, true, true, 0); h.PackEnd(vbox2, true, true, 0); vbox.PackStart(h); Alignment cbAlignment = new Alignment(1, 1, 1, 0); vbox.PackStart(cbAlignment, true, true, 0); cbutton = new CheckButton(Util.GS("Do not show this message again.")); cbAlignment.Add(cbutton); vbox.ShowAll(); this.VBox.Add(vbox); this.AddButton(Stock.Close, ResponseType.Ok); this.AddButton(Stock.Help, ResponseType.Help); }
private static bool ConfirmUnmap(IUnmapableSource source) { string key = "no_confirm_unmap_" + source.GetType().Name.ToLower(); bool do_not_ask = ConfigurationClient.Get <bool> ("sources", key, false); if (do_not_ask) { return(true); } Hyena.Widgets.HigMessageDialog dialog = new Hyena.Widgets.HigMessageDialog( ServiceManager.Get <GtkElementsService> ().PrimaryWindow, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.Cancel, String.Format(Catalog.GetString("Are you sure you want to delete this {0}?"), source.GenericName.ToLower()), source.Name); dialog.AddButton(Gtk.Stock.Delete, Gtk.ResponseType.Ok, false); Gtk.Alignment alignment = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 0.0f); alignment.TopPadding = 10; Gtk.CheckButton confirm_button = new Gtk.CheckButton(String.Format(Catalog.GetString( "Do not ask me this again"), source.GenericName.ToLower())); confirm_button.Toggled += delegate { do_not_ask = confirm_button.Active; }; alignment.Add(confirm_button); alignment.ShowAll(); dialog.LabelVBox.PackStart(alignment, false, false, 0); try { if (dialog.Run() == (int)Gtk.ResponseType.Ok) { ConfigurationClient.Set <bool> ("sources", key, do_not_ask); return(true); } return(false); } finally { dialog.Destroy(); } }
public WelcomePageFeedItem() { VisibleWindow = false; box = new VBox(); titleLabel = new Label() { Xalign = 0 }; titleLabel.Wrap = false; titleLabel.Ellipsize = Pango.EllipsizeMode.End; titleLabel.LineWrapMode = Pango.WrapMode.Word; box.PackStart(titleLabel, false, false, 0); subtitleLabel = new Label() { Xalign = 0 }; var align = new Gtk.Alignment(0, 0, 1f, 1f) { TopPadding = Styles.WelcomeScreen.Pad.MediumTitleMarginBottom, BottomPadding = Styles.WelcomeScreen.Pad.SummaryParagraphMarginTop }; align.Add(subtitleLabel); box.PackStart(align, false, false, 0); summaryLabel = new Label() { Xalign = 0 }; summaryLabel.Wrap = true; box.PackStart(summaryLabel, true, true, 0); Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7)); summaryLabel.Attributes = new Pango.AttrList(); summaryLabel.Attributes.Insert(rise); Add(box); Gui.Styles.Changed += UpdateStyle; }
public iFolderNetworkDialog() : base() { this.Title = ""; this.HasSeparator = false; this.Resizable = false; this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); Gdk.Pixbuf bigiFolder = new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")); Image folderImage = new Image(bigiFolder); VBox vbox = new VBox(); vbox.BorderWidth = 10; vbox.Spacing = 10; HBox h = new HBox(); h.Spacing = 12; folderImage.SetAlignment(0.5F, 0); h.PackStart(folderImage, false, false, 0); VBox vbox2 = new VBox(); vbox2.Spacing = 10; Label l = new Label("<span weight=\"bold\" size=\"larger\">" + Util.GS("Network Events") + "</span>"); l.LineWrap = false; l.UseMarkup = true; l.Selectable = false; l.Xalign = 0; l.Yalign = 0; vbox2.PackStart(l, false, false, 0); l = new Label(Util.GS("Novell iFolder does not currently support this machine's Network card to detect Network events. DBus failed to initialize for the Network card.")); l.LineWrap = true; l.Xalign = 0; vbox2.PackStart(l, true, true, 0); h.PackEnd(vbox2, true, true, 0); vbox.PackStart(h); Alignment cbAlignment = new Alignment(1, 1, 1, 0); vbox.PackStart(cbAlignment, true, true, 0); cbutton = new CheckButton(Util.GS("Do not show this message again.")); cbAlignment.Add(cbutton); vbox.ShowAll(); this.VBox.Add(vbox); this.AddButton(Stock.Close, ResponseType.Ok); }
void BuildGui() { this.Title = GettextCatalog.GetString("Messages"); var lbl = new Label(this.Title + ":"); var align = new Alignment(0, 0, 0, 0); lbl.Justify = Justification.Left; align.Add(lbl); this.VBox.PackStart(align, false, false, 0); failuresView.WidthRequest = 300; failuresView.HeightRequest = 200; failuresView.AppendColumn("Type", new CellRendererText(), "text", 0); failuresView.AppendColumn("Message", new CellRendererText(), "text", 1); failuresView.HasTooltip = true; failuresView.QueryTooltip += OnQueryTooltip; failuresView.Model = failuresStore; this.VBox.PackStart(failuresView, true, true, 0); this.AddButton(Stock.Ok, ResponseType.Ok); this.ShowAll(); }
protected override void BuildContent(Container parent) { LogoImage = Xwt.Drawing.Image.FromResource("welcome-logo.png"); TopBorderImage = Xwt.Drawing.Image.FromResource("welcome-tile.png"); var mainAlignment = new Gtk.Alignment(0.5f, 0.5f, 0f, 1f); mainAlignment.Accessible.SetShouldIgnore(true); var mainCol = new WelcomePageColumn(); mainCol.Accessible.SetShouldIgnore(true); mainAlignment.Add(mainCol); var row1 = new WelcomePageRow(); row1.PackStart(new WelcomePageButtonBar( new WelcomePageBarButton("MonoDevelop.com", "http://www.monodevelop.com", "welcome-link-md-16.png"), new WelcomePageBarButton(GettextCatalog.GetString("Documentation"), "http://www.go-mono.com/docs", "welcome-link-info-16.png"), new WelcomePageBarButton(GettextCatalog.GetString("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "welcome-link-support-16.png"), new WelcomePageBarButton(GettextCatalog.GetString("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "welcome-link-chat-16.png") ) ); row1.Accessible.SetShouldIgnore(true); mainCol.PackStart(row1, false, false, 0); var row2 = new WelcomePageRow( new WelcomePageColumn( new WelcomePageRecentProjectsList(GettextCatalog.GetString("Solutions")) ), new WelcomePageColumn( new WelcomePageNewsFeed(GettextCatalog.GetString("Xamarin News"), "http://software.xamarin.com/Service/News", "NewsLinks") ), new WelcomePageColumn( new WelcomePageTipOfTheDaySection() ) ); row2.Accessible.SetShouldIgnore(true); mainCol.PackStart(row2, false, false, 0); parent.Add(mainAlignment); }
public override bool GetPreferenceTabWidget(PreferencesDialog parent, out string tabLabel, out Gtk.Widget preferenceWidget) { Gtk.Alignment align; // Addin's tab caption tabLabel = Catalog.GetString("Advanced"); Gtk.VBox opts_list = new Gtk.VBox(false, 12); opts_list.BorderWidth = 12; opts_list.Show(); align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f); align.Show(); opts_list.PackStart(align, false, false, 0); /* * If you want to add new settings to the Advanced tab - follow the steps below: * 1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs); * 2) define property/method for that class that returns the widget you want to place onto the tab; * 3) (similar to the below) instantiate object of your class and add its widget to the "align" widget; */ // Instantiate class for Menu Min/Max Note Count setting MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference(); // Add the widget for this setting to the Advanced tab align.Add(menuNoteCountPref.Widget); if (opts_list != null) { preferenceWidget = opts_list; return(true); } else { preferenceWidget = null; return(false); } }
protected override void BuildContent(Container parent) { LogoImage = Gdk.Pixbuf.LoadFromResource("WelcomePage_Logo.png"); TopBorderImage = Gdk.Pixbuf.LoadFromResource("WelcomePage_TopBorderRepeat.png"); var mainAlignment = new Gtk.Alignment(0.5f, 0.5f, 0f, 1f); var mainCol = new WelcomePageColumn(); mainAlignment.Add(mainCol); var row1 = new WelcomePageRow(); row1.PackStart(new WelcomePageButtonBar( new WelcomePageBarButton("MonoDevelop.com", "http://www.monodevelop.com", "link-cloud.png"), new WelcomePageBarButton(GettextCatalog.GetString("Documentation"), "http://www.go-mono.com/docs", "link-info.png"), new WelcomePageBarButton(GettextCatalog.GetString("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "link-heart.png"), new WelcomePageBarButton(GettextCatalog.GetString("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "link-chat.png") ) ); mainCol.PackStart(row1, false, false, 0); var row2 = new WelcomePageRow( new WelcomePageColumn( new WelcomePageRecentProjectsList(GettextCatalog.GetString("Solutions")) ), new WelcomePageColumn( new WelcomePageNewsFeed(GettextCatalog.GetString("Xamarin News"), "http://software.xamarin.com/Service/News", "NewsLinks") ), new WelcomePageColumn( new WelcomePageTipOfTheDaySection() ) ); mainCol.PackStart(row2, false, false, 0); parent.Add(mainAlignment); }
private void InitComponents() { browser = new LyricsBrowser(); browser.InsertModeAvailable = false; label = new Label(); label.Xalign = 0; Gtk.Alignment label_align = new Gtk.Alignment(0, 0, 0, 0); label_align.TopPadding = 5; label_align.LeftPadding = 10; label_align.Add(label); Gtk.ScrolledWindow scroll_pane = new Gtk.ScrolledWindow(); scroll_pane.HscrollbarPolicy = PolicyType.Automatic; scroll_pane.ShadowType = Gtk.ShadowType.None; scroll_pane.Add(browser); PackStart(label_align, false, true, 0); PackStart(scroll_pane, true, true, 0); this.ShowAll(); }
private void btnChooseMoney_Toggled(object sender, EventArgs e) { if (pnlChooseMoney == null) { pnlChooseMoney = new ChooseMoneyPanel(priceType); pnlChooseMoney.TotalChanged += pnlChooseMoney_TotalChanged; pnlChooseMoney.Show(); algChooseMoney.Add(pnlChooseMoney); } bool chooseMoney = btnChooseMoney.Active; BusinessDomain.AppConfiguration.LastChooseMoneyVisible = chooseMoney; vspMoneySelection.Visible = chooseMoney; pnlChooseMoney.Visible = chooseMoney; if (selectedPayment != null) { RefreshChooseMoneyPanel(); } if (!chooseMoney) { parentWindow.Resize(10, 10); } }
internal MonoDevelopStatusBar() { BorderWidth = 0; Spacing = 0; HasResizeGrip = true; HeaderBox hb = new HeaderBox(1, 0, 0, 0); hb.BorderColor = Styles.DockSeparatorColor; var mainBox = new HBox(); mainBox.PackStart(new Label(""), true, true, 0); hb.Add(mainBox); hb.ShowAll(); PackStart(hb, true, true, 0); // Feedback button if (FeedbackService.Enabled) { CustomFrame fr = new CustomFrame(0, 0, 1, 1); Gdk.Pixbuf px = Gdk.Pixbuf.LoadFromResource("balloon.png"); HBox b = new HBox(false, 3); b.PackStart(new Gtk.Image(px)); b.PackStart(new Gtk.Label("Feedback")); Gtk.Alignment al = new Gtk.Alignment(0f, 0f, 1f, 1f); al.RightPadding = 5; al.LeftPadding = 3; al.Add(b); feedbackButton = new MiniButton(al); //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); fr.Add(feedbackButton); mainBox.PackStart(fr, false, false, 0); feedbackButton.Clicked += HandleFeedbackButtonClicked; feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent; ; feedbackButton.ClickOnRelease = true; FeedbackService.FeedbackPositionGetter = delegate { int x, y; feedbackButton.GdkWindow.GetOrigin(out x, out y); x += feedbackButton.Allocation.Width; y -= 6; return(new Gdk.Point(x, y)); }; } // Dock area DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; var dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.AlignToEnd = true; dockBar.ShowBorder = false; dockBar.NoShowAll = true; mainBox.PackStart(dockBar, false, false, 0); // Resize grip resizeGrip.WidthRequest = ResizeGripWidth; resizeGrip.HeightRequest = 0; mainBox.PackStart(resizeGrip, false, false, 0); // Status panels statusBox = new HBox(false, 0); statusBox.BorderWidth = 0; statusLabel.SetAlignment(0, 0.5f); statusLabel.Wrap = false; int w, h; Gtk.Icon.SizeLookup(IconSize.Menu, out w, out h); statusLabel.HeightRequest = h; statusLabel.SetPadding(0, 0); statusLabel.ShowAll(); messageBox.PackStart(statusLabel, true, true, 0); var eventCaretBox = new EventBox(); var caretStatusBox = new HBox(); modeLabel = new Label(" "); caretStatusBox.PackEnd(modeLabel, false, false, 8); cursorLabel = new CaretStatusLabel(" "); caretStatusBox.PackEnd(cursorLabel, false, false, 0); caretStatusBox.GetSizeRequest(out w, out h); caretStatusBox.WidthRequest = w; caretStatusBox.HeightRequest = h; eventCaretBox.Add(caretStatusBox); statusBox.PackEnd(eventCaretBox, false, false, 0); this.ShowAll(); // // todo: Move this to the CompletionWindowManager when it's possible. // StatusBarContext completionStatus = null; // CompletionWindowManager.WindowShown += delegate { // CompletionListWindow wnd = CompletionWindowManager.Wnd; // if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { // if (completionStatus == null) // completionStatus = CreateContext (); // completionStatus.ShowMessage (string.Format (GettextCatalog.GetString ("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo (Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); // } // }; }
public OptionsDialog(MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections) { buttonCancel = new Gtk.Button(Gtk.Stock.Cancel); AddActionWidget(this.buttonCancel, ResponseType.Cancel); buttonOk = new Gtk.Button(Gtk.Stock.Ok); this.ActionArea.PackStart(buttonOk); buttonOk.Clicked += OnButtonOkClicked; mainHBox = new HBox(); tree = new TreeView(); var sw = new ScrolledWindow(); sw.Add(tree); sw.HscrollbarPolicy = PolicyType.Never; sw.VscrollbarPolicy = PolicyType.Automatic; sw.ShadowType = ShadowType.None; var fboxTree = new HeaderBox(); fboxTree.SetMargins(0, 1, 0, 1); fboxTree.SetPadding(0, 0, 0, 0); fboxTree.BackgroundColor = new Gdk.Color(255, 255, 255); fboxTree.Add(sw); mainHBox.PackStart(fboxTree, false, false, 0); Realized += delegate { fboxTree.BackgroundColor = tree.Style.Base(Gtk.StateType.Normal); }; var vbox = new VBox(); mainHBox.PackStart(vbox, true, true, 0); var headerBox = new HBox(false, 6); labelTitle = new Label(); labelTitle.Xalign = 0; textHeader = new Alignment(0, 0, 1, 1); textHeader.Add(labelTitle); textHeader.BorderWidth = 12; headerBox.PackStart(textHeader, true, true, 0); imageHeader = new OptionsDialogHeader(); imageHeader.Hide(); headerBox.PackStart(imageHeader.ToGtkWidget()); var fboxHeader = new HeaderBox(); fboxHeader.SetMargins(0, 1, 0, 0); fboxHeader.Add(headerBox); // fbox.GradientBackround = true; // fbox.BackgroundColor = new Gdk.Color (255, 255, 255); Realized += delegate { var c = Style.Background(Gtk.StateType.Normal).ToXwtColor(); c.Light += 0.09; fboxHeader.BackgroundColor = c.ToGdkColor(); }; StyleSet += delegate { if (IsRealized) { var c = Style.Background(Gtk.StateType.Normal).ToXwtColor(); c.Light += 0.09; fboxHeader.BackgroundColor = c.ToGdkColor(); } }; vbox.PackStart(fboxHeader, false, false, 0); pageFrame = new HBox(); var fbox = new HeaderBox(); fbox.SetMargins(0, 1, 0, 0); fbox.ShowTopShadow = true; fbox.Add(pageFrame); vbox.PackStart(fbox, true, true, 0); this.VBox.PackStart(mainHBox, true, true, 0); this.removeEmptySections = removeEmptySections; extensionContext = AddinManager.CreateExtensionContext(); this.mainDataObject = dataObject; this.extensionPath = extensionPath; if (parentWindow != null) { TransientFor = parentWindow; } ImageService.EnsureStockIconIsLoaded(emptyCategoryIcon); store = new TreeStore(typeof(OptionsDialogSection)); tree.Model = store; tree.HeadersVisible = false; // Column 0 is used to add some padding at the left of the expander TreeViewColumn col0 = new TreeViewColumn(); col0.MinWidth = 6; tree.AppendColumn(col0); TreeViewColumn col = new TreeViewColumn(); var crp = new CellRendererImage(); col.PackStart(crp, false); col.SetCellDataFunc(crp, PixbufCellDataFunc); var crt = new CellRendererText(); col.PackStart(crt, true); col.SetCellDataFunc(crt, TextCellDataFunc); tree.AppendColumn(col); tree.ExpanderColumn = col; tree.Selection.Changed += OnSelectionChanged; Child.ShowAll(); InitializeContext(extensionContext); FillTree(); ExpandCategories(); RestoreLastPanel(); this.DefaultResponse = Gtk.ResponseType.Ok; buttonOk.CanDefault = true; buttonOk.GrabDefault(); DefaultWidth = 960; DefaultHeight = 680; }
private void SetupWidgets() { histogram_expander = new Expander(Catalog.GetString("Histogram")); histogram_expander.Activated += delegate(object sender, EventArgs e) { ContextSwitchStrategy.SetHistogramVisible(Context, histogram_expander.Expanded); UpdateHistogram(); }; histogram_image = new Gtk.Image(); histogram = new Histogram(); histogram_expander.Add(histogram_image); Window window = MainWindow.Toplevel.Window; Gdk.Color c = window.Style.Backgrounds [(int)Gtk.StateType.Active]; histogram.RedColorHint = (byte)(c.Red / 0xff); histogram.GreenColorHint = (byte)(c.Green / 0xff); histogram.BlueColorHint = (byte)(c.Blue / 0xff); histogram.BackgroundColorHint = 0xff; Add(histogram_expander); info_expander = new Expander(Catalog.GetString("Image Information")); info_expander.Activated += delegate(object sender, EventArgs e) { ContextSwitchStrategy.SetInfoBoxVisible(Context, info_expander.Expanded); }; Table info_table = new Table(7, 2, false); info_table.BorderWidth = 0; string name_pre = "<b>"; string name_post = "</b>"; name_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Name") + name_post); info_table.Attach(name_label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); version_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Version") + name_post); info_table.Attach(version_label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); date_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Date") + name_post + Environment.NewLine); info_table.Attach(date_label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); size_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Size") + name_post); info_table.Attach(size_label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); default_exposure_string = name_pre + Catalog.GetString("Exposure") + name_post; exposure_label = CreateRightAlignedLabel(default_exposure_string); info_table.Attach(exposure_label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); rating_label = CreateRightAlignedLabel(name_pre + Catalog.GetString("Rating") + name_post); info_table.Attach(rating_label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); rating_label.Visible = false; name_value_label = new Label(); name_value_label.Ellipsize = Pango.EllipsizeMode.Middle; name_value_label.Justify = Gtk.Justification.Left; name_value_label.Selectable = true; name_value_label.Xalign = 0; info_table.Attach(name_value_label, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 3, 0); date_value_label = AttachLabel(info_table, 2, name_value_label); size_value_label = AttachLabel(info_table, 3, name_value_label); exposure_value_label = AttachLabel(info_table, 4, name_value_label); version_option_menu = new OptionMenu(); info_table.Attach(version_option_menu, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); date_value_label.Text = Environment.NewLine; exposure_value_label.Text = Environment.NewLine; Gtk.Alignment rating_align = new Gtk.Alignment(0, 0, 0, 0); info_table.Attach(rating_align, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); rating_view = new RatingSmall(); rating_view.Visible = false; rating_view.Changed += HandleRatingChanged; rating_align.Add(rating_view); tag_view = new TagView(MainWindow.ToolTips); info_table.Attach(tag_view, 0, 2, 6, 7, AttachOptions.Fill, AttachOptions.Fill, TABLE_XPADDING, TABLE_YPADDING); tag_view.Show(); info_table.ShowAll(); info_expander.Add(info_table); Add(info_expander); rating_label.Visible = show_rating; rating_view.Visible = show_rating; }
public DockItemContainer(DockFrame frame, DockItem item) { this.frame = frame; this.item = item; ResizeMode = Gtk.ResizeMode.Queue; Spacing = 0; title = new Gtk.Label(); title.Xalign = 0; title.Xpad = 3; title.UseMarkup = true; title.Ellipsize = Pango.EllipsizeMode.End; btnDock = new Button(new Gtk.Image(pixAutoHide)); btnDock.Relief = ReliefStyle.None; btnDock.CanFocus = false; btnDock.WidthRequest = btnDock.HeightRequest = 17; btnDock.Clicked += OnClickDock; btnClose = new Button(new Gtk.Image(pixClose)); btnClose.TooltipText = Catalog.GetString("Hide"); btnClose.Relief = ReliefStyle.None; btnClose.CanFocus = false; btnClose.WidthRequest = btnClose.HeightRequest = 17; btnClose.Clicked += delegate { item.Visible = false; }; HBox box = new HBox(false, 0); box.PackStart(title, true, true, 0); box.PackEnd(btnClose, false, false, 0); box.PackEnd(btnDock, false, false, 0); headerAlign = new Alignment(0.0f, 0.0f, 1.0f, 1.0f); headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 1; headerAlign.Add(box); header = new EventBox(); header.Events |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask; header.ButtonPressEvent += HeaderButtonPress; header.ButtonReleaseEvent += HeaderButtonRelease; header.MotionNotifyEvent += HeaderMotion; header.KeyPressEvent += HeaderKeyPress; header.KeyReleaseEvent += HeaderKeyRelease; header.Add(headerAlign); header.ExposeEvent += HeaderExpose; header.Realized += delegate { header.GdkWindow.Cursor = handCursor; }; foreach (Widget w in new Widget [] { header, btnDock, btnClose }) { w.EnterNotifyEvent += HeaderEnterNotify; w.LeaveNotifyEvent += HeaderLeaveNotify; } PackStart(header, false, false, 0); ShowAll(); PackStart(item.GetToolbar(PositionType.Top).Container, false, false, 0); HBox hbox = new HBox(); hbox.Show(); hbox.PackStart(item.GetToolbar(PositionType.Left).Container, false, false, 0); contentBox = new HBox(); contentBox.Show(); hbox.PackStart(contentBox, true, true, 0); hbox.PackStart(item.GetToolbar(PositionType.Right).Container, false, false, 0); PackStart(hbox, true, true, 0); PackStart(item.GetToolbar(PositionType.Bottom).Container, false, false, 0); UpdateBehavior(); }
internal MonoDevelopStatusBar() { mainContext = new MainStatusBarContextImpl(this); activeContext = mainContext; contexts.Add(mainContext); Frame originalFrame = (Frame)Children[0]; // originalFrame.WidthRequest = 8; // originalFrame.Shadow = ShadowType.In; // originalFrame.BorderWidth = 0; BorderWidth = 0; Spacing = 0; // Feedback button CustomFrame fr = new CustomFrame(0, 0, 1, 1); Gdk.Pixbuf px = Gdk.Pixbuf.LoadFromResource("balloon.png"); HBox b = new HBox(false, 3); b.PackStart(new Gtk.Image(px)); b.PackStart(new Gtk.Label("Feedback")); Gtk.Alignment al = new Gtk.Alignment(0f, 0f, 1f, 1f); al.RightPadding = 5; al.LeftPadding = 3; al.Add(b); feedbackButton = new MiniButton(al); //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); fr.Add(feedbackButton); PackStart(fr, false, false, 0); feedbackButton.Clicked += HandleFeedbackButtonClicked; feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent;; feedbackButton.ClickOnRelease = true; FeedbackService.FeedbackPositionGetter = delegate { int x, y; feedbackButton.GdkWindow.GetOrigin(out x, out y); x += feedbackButton.Allocation.Width; y -= 6; return(new Gdk.Point(x, y)); }; // Dock area DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow; wb.DockFrame.ShadedContainer.Add(this); Gtk.Widget dockBar = wb.DockFrame.ExtractDockBar(PositionType.Bottom); dockBar.NoShowAll = true; PackStart(dockBar, false, false, 0); // Status panels progressBar = new ProgressBar(); progressBar.PulseStep = 0.1; progressBar.SizeRequest(); progressBar.HeightRequest = 1; statusBox = new HBox(false, 0); statusBox.BorderWidth = 0; statusLabel = new Label(); statusLabel.SetAlignment(0, 0.5f); statusLabel.Wrap = false; int w, h; Gtk.Icon.SizeLookup(IconSize.Menu, out w, out h); statusLabel.HeightRequest = h; statusLabel.SetPadding(0, 0); EventBox eventMessageBox = new EventBox(); messageBox = new HBox(); messageBox.PackStart(progressBar, false, false, 0); messageBox.PackStart(statusLabel, true, true, 0); eventMessageBox.Add(messageBox); statusBox.PackStart(eventMessageBox, true, true, 0); eventMessageBox.ButtonPressEvent += HandleEventMessageBoxButtonPressEvent; textStatusBarPanel.BorderWidth = 0; textStatusBarPanel.ShadowType = ShadowType.None; textStatusBarPanel.Add(statusBox); Label fillerLabel = new Label(); fillerLabel.WidthRequest = 8; statusBox.PackEnd(fillerLabel, false, false, 0); modeLabel = new Label(" "); statusBox.PackEnd(modeLabel, false, false, 8); cursorLabel = new Label(" "); statusBox.PackEnd(cursorLabel, false, false, 0); statusIconBox = new HBox(); statusIconBox.BorderWidth = 0; statusIconBox.Spacing = 3; statusBox.PackEnd(statusIconBox, false, false, 4); this.PackStart(textStatusBarPanel, true, true, 0); ShowReady(); Gtk.Box.BoxChild boxChild = (Gtk.Box.BoxChild) this[textStatusBarPanel]; boxChild.Position = 0; boxChild.Expand = boxChild.Fill = true; // boxChild = (Gtk.Box.BoxChild)this[originalFrame]; // boxChild.Padding = 0; // boxChild.Expand = boxChild.Fill = false; this.progressBar.Fraction = 0.0; this.ShowAll(); statusIconBox.HideAll(); originalFrame.HideAll(); progressBar.Visible = false; StatusBarContext completionStatus = null; // todo: Move this to the CompletionWindowManager when it's possible. CompletionWindowManager.WindowShown += delegate { CompletionListWindow wnd = CompletionWindowManager.Wnd; if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) { if (completionStatus == null) { completionStatus = CreateContext(); } completionStatus.ShowMessage(string.Format(GettextCatalog.GetString("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo(Commands.TextEditorCommands.ShowCompletionWindow).AccelKey)); } }; CompletionWindowManager.WindowClosed += delegate { if (completionStatus != null) { completionStatus.Dispose(); completionStatus = null; } }; }
public DashBoard(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Config int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]); var predicate = (Predicate <dynamic>)((dynamic x) => x.ID == "PosBaseWindow"); var themeWindow = GlobalApp.Theme.Theme.Frontoffice.Window.Find(predicate); Color screenBackgroundColor = FrameworkUtils.StringToColor(themeWindow.Globals.ScreenBackgroundColor); Color white = System.Drawing.Color.White; Color black = System.Drawing.Color.Black; //_log.Debug("Theme Background: " + eventBackGround); //Shared error Message string errorMessage = "Node: <Window ID=\"PosBaseWindow\">"; Fixed fix = new Fixed(); HBox hbox = new HBox(); Frame frame = new Frame(); VBox vbox = new VBox(false, 2); VBox vbox2 = new VBox(true, 0); VBox vbox3 = new VBox(false, 5); DateTime datenow = new DateTime(); //Icons dos botões do dashboard String _fileFiscalYearIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_configurations.png"); String _fileInsertFiscalYear = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_fiscal_year.png"); String _fileInsertIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_printer.png"); String _fileTerminalsIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_terminals.png"); String _fileArticlesIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_articles.png"); String _fileCostumersIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_costumers.png"); String _fileEmployeesIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_employees.png"); String _fileOtherTablesIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_other_tables.png"); String _fileDocumentsIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_documents.png"); String _fileNewDocumentIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_documents_new.png"); String _filePayedDocumentsIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_documents_new.png"); String _fileInsertMerchIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_documents_merch.png"); String _fileReportsMenuIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_reports.png"); String _fileReportsTotalIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_reports_sales_report.png"); String _fileReportsClientsIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_reports_sales_client.png"); String _fileReportsDayIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\BackOffice\icon_reports_sales_day.png"); //Tamanho dos Icons e da Font do Texto dos botões Size sizeIcon = new Size(35, 35); string _fontBaseDialogButton = "8"; //uint borderWidth = 5; //Cria o evento por trás da dashboard, tudo será carregado para aqui _eventboxDashboard = new EventBox(); //_eventboxDashboard.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(screenBackgroundColor)); _eventboxDashboard.WidthRequest = GlobalApp.boScreenSize.Width; _eventboxDashboard.HeightRequest = GlobalApp.boScreenSize.Height; Alignment _alignmentWindow = new Alignment(0.0f, 0.0f, 0.0f, 0.0f); _alignmentWindow.Add(_eventboxDashboard); Add(_alignmentWindow); try { //Imagem carregada aqui para o dashboard string fileImageBack = FrameworkUtils.OSSlash(string.Format("{0}Default/Backgrounds/Windows/LogicPOS_WorkFlow_{1}.png", GlobalFramework.Path["themes"], GlobalFramework.Settings["customCultureResourceDefinition"])); System.Drawing.Image pImage = System.Drawing.Image.FromFile(fileImageBack); Gdk.Pixbuf pixbuf = Utils.ImageToPixbuf(pImage); _eventboxDashboard.Style = Utils.GetImageBackgroundDashboard(pixbuf); //Buttons Configuração botao1 = new TouchButtonIconWithText("BACKOFFICE_MAN_CONFIGURATIONPLACETERMINAL_MENU", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_edit_ConfigurationPlaceTerminal_tab1_label"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileTerminalsIcon, sizeIcon, 105, 70); botao2 = new TouchButtonIconWithText("BACKOFFICE_MAN_CONFIGURATIONPREFERENCEPARAMETER_VIEW", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_application_setup"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileFiscalYearIcon, sizeIcon, 105, 70); botao3 = new TouchButtonIconWithText("BACKOFFICE_MAN_DOCUMENTFINANCEYEARS_CREATE", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentfinance_years_short"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileInsertFiscalYear, sizeIcon, 105, 70); botao4 = new TouchButtonIconWithText("BACKOFFICE_MAN_CONFIGURATIONPRINTERS_VIEW", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_printers"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileInsertIcon, sizeIcon, 105, 70); //Buttons Tabelas botao5 = new TouchButtonIconWithText("BACKOFFICE_MAN_ARTICLE_VIEW", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_articles"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileArticlesIcon, sizeIcon, 105, 70); botao6 = new TouchButtonIconWithText("BACKOFFICE_MAN_CUSTOMER_VIEW", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_customers"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileCostumersIcon, sizeIcon, 105, 70); botao7 = new TouchButtonIconWithText("BACKOFFICE_MAN_USERDETAIL_VIEW", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_users"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileEmployeesIcon, sizeIcon, 105, 70); botao8 = new TouchButtonIconWithText("BACKOFFICE_MAN_CONFIGURATIONPLACETABLE_VIEW", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_other_tables"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileOtherTablesIcon, sizeIcon, 105, 70); //Buttons Documentos botao9 = new TouchButtonIconWithText("BACKOFFICE_MAN_DOCUMENTSSHOW_MENU", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_worksession_resume_finance_documents"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileNewDocumentIcon, sizeIcon, 105, 70); botao10 = new TouchButtonIconWithText("BACKOFFICE_MAN_DOCUMENTSNEW_MENU", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "window_title_dialog_new_document"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileDocumentsIcon, sizeIcon, 105, 70); botao11 = new TouchButtonIconWithText("BACKOFFICE_MAN_DOCUMENTSPAYMENTS_MENU", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_button_label_select_payments"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _filePayedDocumentsIcon, sizeIcon, 105, 70); botao12 = new TouchButtonIconWithText("STOCK_MERCHANDISE_ENTRY_ACCESS", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_documentticket_type_title_cs_short"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileInsertMerchIcon, sizeIcon, 105, 70); //Buttons Relatórios botao13 = new TouchButtonIconWithText("REPORT_ACCESS", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_reports"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileReportsMenuIcon, sizeIcon, 105, 70); botao14 = new TouchButtonIconWithText("REPORT_COMPANY_BILLING", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "report_company_billing_short"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileReportsTotalIcon, sizeIcon, 105, 70); botao15 = new TouchButtonIconWithText("REPORT_CUSTOMER_BALANCE_DETAILS", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "report_customer_balance_details_short"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileReportsClientsIcon, sizeIcon, 105, 70); botao16 = new TouchButtonIconWithText("REPORT_SALES_DETAIL_PER_DATE", _colorBaseDialogDefaultButtonBackground, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "report_sales_per_date"), _fontBaseDialogButton, _colorBaseDialogDefaultButtonFont, _fileReportsDayIcon, sizeIcon, 105, 70); PosReportsDialog reportsClicked = new PosReportsDialog(); //Permissões dos botões botao1.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_CONFIGURATIONPLACETERMINAL_MENU"); botao2.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_CONFIGURATIONPREFERENCEPARAMETER_VIEW"); botao3.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_DOCUMENTFINANCEYEARS_CREATE"); botao4.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_CONFIGURATIONPRINTERS_VIEW"); botao5.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_ARTICLE_VIEW"); botao6.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_CUSTOMER_VIEW"); botao7.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_USERDETAIL_VIEW"); botao8.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_CONFIGURATIONPLACETABLE_VIEW"); botao9.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_DOCUMENTFINANCETYPE_MENU"); botao10.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_DOCUMENTFINANCETYPE_CREATE"); botao11.Sensitive = FrameworkUtils.HasPermissionTo("BACKOFFICE_MAN_DOCUMENTFINANCEYEARS_VIEW"); botao12.Sensitive = FrameworkUtils.HasPermissionTo("STOCK_MERCHANDISE_ENTRY_ACCESS"); //Este fica comentado, porque o próprio menu dos reports tem controlo de previlégios //botao13.Sensitive = FrameworkUtils.HasPermissionTo("REPORT_ACCESS"); botao14.Sensitive = FrameworkUtils.HasPermissionTo("REPORT_COMPANY_BILLING"); botao15.Sensitive = FrameworkUtils.HasPermissionTo("REPORT_CUSTOMER_BALANCE_DETAILS"); botao16.Sensitive = FrameworkUtils.HasPermissionTo("REPORT_SALES_DETAIL_PER_DATE"); //Actions Configurações botao1.Clicked += delegate { botao1.Content = Utils.GetGenericTreeViewXPO <TreeViewConfigurationPlaceTerminal>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao1, null); }; botao2.Clicked += delegate { botao2.Content = Utils.GetGenericTreeViewXPO <TreeViewConfigurationPreferenceParameter>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao2, null); }; botao3.Clicked += delegate { botao3.Content = Utils.GetGenericTreeViewXPO <TreeViewDocumentFinanceYears>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao3, null); }; botao4.Clicked += delegate { botao4.Content = Utils.GetGenericTreeViewXPO <TreeViewConfigurationPrinters>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao4, null); }; //Actions Tabelas botao5.Clicked += delegate { botao5.Content = Utils.GetGenericTreeViewXPO <TreeViewArticle>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao5, null); }; botao6.Clicked += delegate { botao6.Content = Utils.GetGenericTreeViewXPO <TreeViewCustomer>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao6, null); }; botao7.Clicked += delegate { botao7.Content = Utils.GetGenericTreeViewXPO <TreeViewUser>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao7, null); }; botao8.Clicked += delegate { botao8.Content = Utils.GetGenericTreeViewXPO <TreeViewConfigurationPlaceTable>(pSourceWindow); GlobalApp.WindowBackOffice._dashboardButton_Clicked(botao8, null); }; //Actions Documents botao9.Clicked += delegate { Utils.startDocumentsMenuFromBackOffice(pSourceWindow, 0); }; botao10.Clicked += delegate { Utils.startNewDocumentFromBackOffice(pSourceWindow); }; botao11.Clicked += delegate { Utils.startDocumentsMenuFromBackOffice(pSourceWindow, 3); }; botao12.Clicked += delegate { Utils.startDocumentsMenuFromBackOffice(pSourceWindow, 6); }; //Actions Reports botao13.Clicked += delegate { Utils.startReportsMenuFromBackOffice(pSourceWindow); }; botao14.Clicked += delegate { reportsClicked.PrintReportRouter (botao14, null); }; botao15.Clicked += delegate { reportsClicked.PrintReportRouter(botao15, null); }; botao16.Clicked += delegate { reportsClicked.PrintReportRouter(botao16, null); }; //Posição dos botões na dashboard fix.Put(botao1, 55, 62); fix.Put(botao2, 55, 155); fix.Put(botao3, 55, 250); fix.Put(botao4, 55, 345); fix.Put(botao5, 245, 62); fix.Put(botao6, 245, 155); fix.Put(botao7, 245, 250); fix.Put(botao8, 245, 345); fix.Put(botao9, 440, 62); fix.Put(botao10, 440, 155); fix.Put(botao11, 440, 250); fix.Put(botao12, 440, 345); fix.Put(botao13, 635, 62); fix.Put(botao14, 635, 155); fix.Put(botao15, 635, 250); fix.Put(botao16, 635, 345); string currency = "Money"; try { string sqlCurrency = "SELECT Value FROM cfg_configurationpreferenceparameter where Token = 'SYSTEM_CURRENCY'"; currency = GlobalFramework.SessionXpo.ExecuteScalar(sqlCurrency).ToString(); } catch { currency = SettingsApp.SaftCurrencyCode; } decimal dailyTotal = 0; decimal MonthlyTotal = 0; decimal annualTotal = 0; ArrayList values = new ArrayList(); values.Add(DateTime.Now.Year.ToString()); try { SortingCollection sortCollection = new SortingCollection(); sortCollection.Add(new SortProperty("Date", SortingDirection.Ascending)); CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(Disabled = 0 OR Disabled IS NULL AND (DocumentType.Oid = '{0}' OR DocumentType.Oid = '{1}' OR DocumentType.Oid = '{2}' OR DocumentType.Oid = '{3}') AND DocumentStatusReason != 'A')", invoiceOid, invoiceAndPaymentOid, simpleInvoiceOid, creditNoteOid)); collectionDocuments = GlobalFramework.SessionXpo.GetObjects(GlobalFramework.SessionXpo.GetClassInfo(typeof(fin_documentfinancemaster)), criteria, sortCollection, int.MaxValue, false, true); datenow = DateTime.Now; foreach (fin_documentfinancemaster item in collectionDocuments) { //Faturação por Dia if (item.Date.Day == datenow.Day && item.Date.Month == datenow.Month && item.Date.Year == datenow.Year) { if (item.DocumentType.Oid.ToString() == creditNoteOid && item.DocumentStatusStatus != "A") { dailyTotal -= Convert.ToDecimal(item.TotalFinal); } else if (item.DocumentStatusStatus != "A" && (item.DocumentType.Oid.ToString() == invoiceOid || item.DocumentType.Oid.ToString() == invoiceAndPaymentOid || item.DocumentType.Oid.ToString() == simpleInvoiceOid)) { dailyTotal += Convert.ToDecimal(item.TotalFinal); } } //Faturação por Mês if (item.Date.Month == datenow.Month && item.Date.Year == datenow.Year) { if (item.DocumentType.Oid.ToString() == creditNoteOid && item.DocumentStatusStatus != "A") { MonthlyTotal -= Convert.ToDecimal(item.TotalFinal); } else if (item.DocumentStatusStatus != "A" && (item.DocumentType.Oid.ToString() == invoiceOid || item.DocumentType.Oid.ToString() == invoiceAndPaymentOid || item.DocumentType.Oid.ToString() == simpleInvoiceOid)) { MonthlyTotal += Convert.ToDecimal(item.TotalFinal); } } //Faturação por Ano if (item.Date.Year == datenow.Year) { if (item.DocumentType.Oid.ToString() == creditNoteOid && item.DocumentStatusStatus != "A") { annualTotal -= Convert.ToDecimal(item.TotalFinal); } else if (item.DocumentStatusStatus != "A" && (item.DocumentType.Oid.ToString() == invoiceOid || item.DocumentType.Oid.ToString() == invoiceAndPaymentOid || item.DocumentType.Oid.ToString() == simpleInvoiceOid)) { annualTotal += Convert.ToDecimal(item.TotalFinal); } } //grava anos que existe faturação if (!values.Contains(item.Date.Year.ToString())) { values.Add(item.Date.Year.ToString()); } } } catch (Exception ex) { _log.Error(ex.Message, ex); } label = new Label(); frame.ShadowType = (ShadowType)0; label.Text = string.Format("{0} {3}\n\n{1} {3}\n\n{2} {3}", Convert.ToInt64(Math.Round(dailyTotal, 0)).ToString(), Convert.ToInt64(Math.Round(MonthlyTotal, 0)).ToString(), Convert.ToInt64(Math.Round(annualTotal, 0)).ToString(), currency.ToString()); label.ModifyFont(FontDescription.FromString("Trebuchet MS 16")); label.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(white)); label.Justify = Justification.Right; frame.Add(label); hbox.PackStart(frame, false, false, 0); vbox.PackStart(hbox, false, false, 0); fix.Put(vbox, 628, 515); //COMBO BOX selecionar os anos do gráfico int w = 1; string[] getYears = new string[values.Count]; getYears[0] = (string)values[0]; for (int i = values.Count - 1; i > 0; i--) { getYears[i] = (string)values[w]; w++; } //w = 1; selAno = new ComboBox(getYears); selAno.ModifyFg(StateType.Selected, Utils.ColorToGdkColor(black)); TreeIter iter; selAno.Model.GetIterFirst(out iter); do { GLib.Value thisRow = new GLib.Value(); selAno.Model.GetValue(iter, 0, ref thisRow); if ((thisRow.Val as string).Equals(getYears[0])) { selAno.SetActiveIter(iter); break; } } while (selAno.Model.IterNext(ref iter)); selAno.Changed += delegate { annualTotal = 0; foreach (fin_documentfinancemaster item in collectionDocuments) { if (item.Date.Year.ToString() == selAno.ActiveText.ToString()) { if (item.DocumentType.Oid.ToString() == creditNoteOid && item.DocumentStatusStatus != "A") { annualTotal -= Convert.ToDecimal(item.TotalFinal); } else if (item.DocumentStatusStatus != "A" && (item.DocumentType.Oid.ToString() == invoiceOid || item.DocumentType.Oid.ToString() == invoiceAndPaymentOid || item.DocumentType.Oid.ToString() == simpleInvoiceOid)) { annualTotal += Convert.ToDecimal(item.TotalFinal); } } } label.Text = string.Format("{0} {3}\n\n{1} {3}\n\n{2} {3}", Convert.ToInt64(Math.Round(dailyTotal, 0)).ToString(), Convert.ToInt64(Math.Round(MonthlyTotal, 0)).ToString(), Convert.ToInt64(Math.Round(annualTotal, 0)).ToString(), currency.ToString()); label.ModifyFont(FontDescription.FromString("Trebuchet MS 16")); label.ModifyFg(StateType.Normal, Utils.ColorToGdkColor(white)); label.Justify = Justification.Right; frame.Add(label); hbox.PackStart(frame, false, false, 0); vbox.PackStart(hbox, false, false, 0); string selectedDate = string.Format("01/01/{0}", (selAno.ActiveText.ToString())); fix.Put(vbox, 640, 515); fix.Put(drawSalesGraphic(DateTime.Parse(selectedDate), true), 55, 485); }; if (Utils.IsLinux) { fix.Put(selAno, 220, 650); } else { fix.Put(selAno, 220, 665); } //GRÁFICO fix.Put(drawSalesGraphic(datenow, false), 55, 485); //Adiciona tudo ao evento principal _eventboxDashboard.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0)); _eventboxDashboard.Add(fix); fix.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0)); } catch (Exception ex) { _log.Error(ex.Message, ex); Utils.ShowMessageTouchErrorRenderTheme(pSourceWindow, string.Format("{1}{0}{0}{2}", Environment.NewLine, errorMessage, ex.Message)); } }
public MainToolbar() { executionTargetsChanged = DispatchService.GuiDispatch(new EventHandler(HandleExecutionTargetsChanged)); IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos(); IdeApp.Workspace.ConfigurationsChanged += (sender, e) => UpdateCombos(); IdeApp.Workspace.SolutionLoaded += (sender, e) => UpdateCombos(); IdeApp.Workspace.SolutionUnloaded += (sender, e) => UpdateCombos(); IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged; WidgetFlags |= Gtk.WidgetFlags.AppPaintable; AddWidget(button); AddSpace(8); configurationCombo = new Gtk.ComboBox(); configurationCombo.Model = configurationStore; var ctx = new Gtk.CellRendererText(); configurationCombo.PackStart(ctx, true); configurationCombo.AddAttribute(ctx, "text", 0); configurationCombosBox = new HBox(false, 8); var configurationComboVBox = new VBox(); configurationComboVBox.PackStart(configurationCombo, true, false, 0); configurationCombosBox.PackStart(configurationComboVBox, false, false, 0); runtimeCombo = new Gtk.ComboBox(); runtimeCombo.Model = runtimeStore; ctx = new Gtk.CellRendererText(); runtimeCombo.PackStart(ctx, true); runtimeCombo.SetCellDataFunc(ctx, RuntimeRenderCell); runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator; var runtimeComboVBox = new VBox(); runtimeComboVBox.PackStart(runtimeCombo, true, false, 0); configurationCombosBox.PackStart(runtimeComboVBox, false, false, 0); AddWidget(configurationCombosBox); buttonBarBox = new Alignment(0.5f, 0.5f, 0, 0); buttonBarBox.LeftPadding = (uint)7; buttonBarBox.Add(buttonBar); buttonBarBox.NoShowAll = true; AddWidget(buttonBarBox); AddSpace(24); statusArea = new StatusArea(); statusArea.ShowMessage(BrandingService.ApplicationName); var statusAreaAlign = new Alignment(0, 0, 1, 1); statusAreaAlign.Add(statusArea); contentBox.PackStart(statusAreaAlign, true, true, 0); AddSpace(24); statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => { Gtk.Widget toplevel = this.Toplevel; if (toplevel == null) { return; } var pixel_scale = GtkWorkarounds.GetPixelScale(); int windowWidth = toplevel.Allocation.Width; int center = windowWidth / 2; int left = Math.Max(center - (int)(300 * pixel_scale), args.Allocation.Left); int right = Math.Min(left + (int)(600 * pixel_scale), args.Allocation.Right); uint left_padding = (uint)(left - args.Allocation.Left); uint right_padding = (uint)(args.Allocation.Right - right); if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding) { statusAreaAlign.SetPadding(0, 0, (uint)left_padding, (uint)right_padding); } }; matchEntry = new SearchEntry(); var searchFiles = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Files")); searchFiles.Activated += delegate { SetSearchCategory("files"); }; var searchTypes = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Types")); searchTypes.Activated += delegate { SetSearchCategory("type"); }; var searchMembers = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Members")); searchMembers.Activated += delegate { SetSearchCategory("member"); }; matchEntry.ForceFilterButtonVisible = true; matchEntry.Entry.FocusOutEvent += delegate { matchEntry.Entry.Text = ""; }; var cmd = IdeApp.CommandService.GetCommand(Commands.NavigateTo); cmd.KeyBindingChanged += delegate { UpdateSearchEntryLabel(); }; UpdateSearchEntryLabel(); matchEntry.Ready = true; matchEntry.Visible = true; matchEntry.IsCheckMenu = true; matchEntry.Entry.ModifyBase(StateType.Normal, Style.White); matchEntry.WidthRequest = 240; if (!Platform.IsMac && !Platform.IsWindows) { matchEntry.Entry.ModifyFont(Pango.FontDescription.FromString("Sans 9")); // TODO: VV: "Segoe UI 9" } matchEntry.RoundedShape = true; matchEntry.Entry.Changed += HandleSearchEntryChanged; matchEntry.Activated += (sender, e) => { var pattern = SearchPopupSearchPattern.ParsePattern(matchEntry.Entry.Text); if (pattern.Pattern == null && pattern.LineNumber > 0) { popup.Destroy(); var doc = IdeApp.Workbench.ActiveDocument; if (doc != null && doc.Editor != null) { doc.Select(); doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation(pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1); doc.Editor.CenterToCaret(); doc.Editor.Parent.StartCaretPulseAnimation(); } return; } if (popup != null) { popup.OpenFile(); } }; matchEntry.Entry.KeyPressEvent += (o, args) => { if (args.Event.Key == Gdk.Key.Escape) { var doc = IdeApp.Workbench.ActiveDocument; if (doc != null) { if (popup != null) { popup.Destroy(); } doc.Select(); } return; } if (popup != null) { args.RetVal = popup.ProcessKey(args.Event.Key, args.Event.State); } }; IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) { if (args.Event is Gdk.EventConfigure) { PositionPopup(); } }; SizeAllocated += delegate { PositionPopup(); }; BuildToolbar(); IdeApp.CommandService.RegisterCommandBar(buttonBar); AddinManager.ExtensionChanged += OnExtensionChanged; contentBox.PackStart(matchEntry, false, false, 0); var align = new Gtk.Alignment(0, 0, 1f, 1f); align.Show(); align.TopPadding = (uint)5; align.LeftPadding = (uint)9; align.RightPadding = (uint)18; align.BottomPadding = (uint)10; align.Add(contentBox); Add(align); SetDefaultSizes(-1, 21); configurationCombo.Changed += HandleConfigurationChanged; runtimeCombo.Changed += HandleRuntimeChanged; UpdateCombos(); button.Clicked += HandleStartButtonClicked; IdeApp.CommandService.RegisterCommandBar(this); IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => { lastCommandTarget = new WeakReference(e.OldActiveWidget); }; this.ShowAll(); this.statusArea.statusIconBox.HideAll(); }
public DialogTextEditableField(PropertyInfo property, object obj, Context context, DisplayableAttribute attribute) : base(false, 2) { this.property = property; this.obj = (IDependable)obj; this.context = context; editable = attribute.EditAuthorized(obj); // Create the label if (!context.compact) { Label label = new Label(attribute.overrideLabel ?? UIFactory.ToReadable(property.Name) + ": "); label.SetAlignment(0, 1); if (attribute.tooltipText != null) { label.HasTooltip = true; label.TooltipMarkup = attribute.tooltipText; } PackStart(label, false, false, 0); } // Create the text body Label val = new Label((string)property.GetValue(obj)); if (val.Text == "") { val.Text = "-"; } val.SetAlignment(0, 0); if (!context.compact) { val.LineWrap = true; val.Justify = Justification.Fill; val.SetSizeRequest(0, -1); val.SizeAllocated += (o, a) => val.SetSizeRequest(a.Allocation.Width, -1); val.LineWrapMode = Pango.WrapMode.WordChar; } //Create the "clickable" functionality ClickableEventBox eventBox = new ClickableEventBox(); eventBox.DoubleClicked += OpenDialog; eventBox.RightClicked += delegate { rightclickMenu.Popup(); rightclickMenu.ShowAll(); }; if (context.compact) { Gtk.Alignment alignment = UIFactory.Align(val, 0, 0, 1, 1); alignment.BorderWidth = 5; if (editable) { eventBox.Add(alignment); PackStart(eventBox); } else { PackStart(alignment); } } else { Gtk.Alignment alignment = new Gtk.Alignment(0, 0, 1, 1); if (editable) { eventBox.Add(val); alignment.Add(eventBox); } else { alignment.Add(val); } alignment.LeftPadding = 10; PackStart(alignment, true, true, 0); } rightclickMenu = new Menu(); MenuItem edit = new MenuItem("Edit"); edit.Activated += OpenDialog; rightclickMenu.Append(edit); }
protected void loadRoom(MatrixRoom room) { this.currentRoom = room; foreach (var widget in chatBox.Children) { chatBox.Remove(widget); } foreach (var message in room.Messages) { Widget messageContents = null; if (message.msgtype == "m.text") { messageContents = new Label(message.body); ((Label)messageContents).Justify = Justification.Left; } if (message.msgtype == "m.image") { messageContents = new VBox(); var imageLabel = new Label(message.body); imageLabel.Justify = Justification.Left; var loader = new AsyncImageLoader((MMessageImage)message, this.client); var imageContents = loader.GetImageWidget(250, 200); ((VBox)messageContents).PackStart(imageLabel); ((VBox)messageContents).PackStart(imageContents); } if (messageContents != null) { var messageContainer = new HBox(); string senderName; senderName = this.users [message.sender].displayname; if (senderName == null) { senderName = message.sender; } var alignmentBox = new Gtk.Alignment(0, -1, 0, 0); if (this.avatars.ContainsKey(message.sender)) { var senderIcon = new System.Drawing.Bitmap(this.avatars [message.sender]); alignmentBox.Add(new Gtk.Image(Utils.bitmapToPixbuf(senderIcon))); } else { var senderIcon = AvatarGenerator.createRoomAvatar(senderName); alignmentBox.Add(new Gtk.Image(senderIcon)); } messageContainer.PackStart(alignmentBox, false, false, 6); messageContainer.PackStart(messageContents, false, false, 6); chatBox.PackStart(messageContainer, false, false, 0); } Console.WriteLine(message.msgtype); } chatBox.ShowAll(); }
public override void Clicked() { Box tmpBox, tmpBox2; Alignment tmpAlign; Box vbox = new Gtk.VBox(); vbox.Spacing = 3; Box hbox = new Gtk.HBox(); hbox.Spacing = 3; Box dungeonVreContainer = new Gtk.VBox(); Box roomVreContainer = new Gtk.VBox(); ValueReferenceEditor dungeonVre = null; ValueReferenceEditor roomVre = null; Alignment frame = new Alignment(0, 0, 0, 0); var dungeonSpinButton = new SpinButton(0, 15, 1); var floorSpinButton = new SpinButton(0, 15, 1); var roomSpinButton = new SpinButtonHexadecimal(0, 255, 1); roomSpinButton.Digits = 2; Minimap minimap = null; System.Action RoomChanged = () => { Dungeon dungeon = minimap.Map as Dungeon; Room room = minimap.GetRoom(); roomSpinButton.Value = room.Index & 0xff; var vrs = new List <ValueReference>(); vrs.Add(new StreamValueReference("Up", room.Index & 0xff, 0, 0, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Right", room.Index & 0xff, 1, 1, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Down", room.Index & 0xff, 2, 2, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Left", room.Index & 0xff, 3, 3, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Key", room.Index & 0xff, 4, 4, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Chest", room.Index & 0xff, 5, 5, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Boss", room.Index & 0xff, 6, 6, DataValueType.ByteBit)); vrs.Add(new StreamValueReference("Dark", room.Index & 0xff, 7, 7, DataValueType.ByteBit)); Stream stream = Project.GetBinaryFile("rooms/" + Project.GameString + "/group" + dungeon.Group + "DungeonProperties.bin"); foreach (StreamValueReference r in vrs) { r.SetStream(stream); } if (roomVre != null) { roomVreContainer.Remove(roomVre); } var vrg = new ValueReferenceGroup(vrs); roomVre = new ValueReferenceEditor(Project, vrg, 4, "Minimap Data"); roomVreContainer.Add(roomVre); }; System.Action DungeonChanged = () => { Dungeon dungeon = Project.GetIndexedDataType <Dungeon>(dungeonSpinButton.ValueAsInt); floorSpinButton.Adjustment.Upper = dungeon.NumFloors - 1; if (floorSpinButton.ValueAsInt >= dungeon.NumFloors) { floorSpinButton.Value = dungeon.NumFloors - 1; } var vrs = new List <ValueReference>(); vrs.Add(new ValueReference("Group", 0, DataValueType.String, false)); vrs.Add(new ValueReference("Wallmaster dest room", 0, DataValueType.Byte)); vrs.Add(new ValueReference("Bottom floor layout", 0, DataValueType.Byte, false)); vrs.Add(new ValueReference("# of floors", 0, DataValueType.Byte, false)); vrs.Add(new ValueReference("Base floor name", 0, DataValueType.Byte)); vrs.Add(new ValueReference("Floors unlocked with compass", 0, DataValueType.Byte)); Data data = dungeon.DataStart; foreach (ValueReference r in vrs) { r.SetData(data); data = data.NextData; } // Remove last ValueReferenceEditor if (dungeonVre != null) { dungeonVreContainer.Remove(dungeonVre); } var vrg = new ValueReferenceGroup(vrs); dungeonVre = new ValueReferenceEditor(Project, vrg, "Base Data"); dungeonVre.AddDataModifiedHandler(() => { floorSpinButton.Adjustment.Upper = dungeon.NumFloors; minimap.GenerateImage(); RoomChanged(); }); // Replace the "group" option with a custom widget for finer // control. SpinButton groupSpinButton = new SpinButton(4, 5, 1); groupSpinButton.Value = dungeon.Group; groupSpinButton.ValueChanged += (c, d) => { vrg.SetValue("Group", ">wGroup" + groupSpinButton.ValueAsInt + "Flags"); }; dungeonVre.ReplaceWidget(0, groupSpinButton); dungeonVre.ShowAll(); // Tooltips dungeonVre.SetTooltip(0, "Also known as the high byte of the room index."); dungeonVre.SetTooltip(1, "The low byte of the room index wallmasters will send you to."); dungeonVre.SetTooltip(2, "The index of the layout for the bottom floor. Subsequent floors will use subsequent indices."); dungeonVre.SetTooltip(4, "Determines what the game will call the bottom floor. For a value of:\n$00: The bottom floor is 'B3'.\n$01: The bottom floor is 'B2'.\n$02: The bottom floor is 'B1'.\n$03: The bottom floor is 'F1'."); dungeonVre.SetTooltip(5, "A bitset of floors that will appear on the map when the compass is obtained.\n\nEg. If this is $05, then floors 0 and 2 will be unlocked (bits 0 and 2 are set)."); dungeonVreContainer.Add(dungeonVre); minimap.SetMap(dungeon); minimap.Floor = floorSpinButton.ValueAsInt; RoomChanged(); }; dungeonSpinButton.ValueChanged += (a, b) => { DungeonChanged(); }; floorSpinButton.ValueChanged += (a, b) => { DungeonChanged(); }; frame.Add(vbox); tmpBox = new Gtk.HBox(); tmpBox.Add(new Gtk.Label("Dungeon ")); tmpBox.Add(dungeonSpinButton); tmpBox.Add(new Gtk.Label("Floor ")); tmpBox.Add(floorSpinButton); tmpAlign = new Alignment(0, 0, 0, 0); tmpAlign.Add(tmpBox); vbox.Add(tmpAlign); vbox.Add(hbox); // Leftmost column tmpBox = new VBox(); tmpBox.Add(dungeonVreContainer); var addFloorButton = new Button("Add Floor"); addFloorButton.Image = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Button); addFloorButton.Clicked += (a, b) => { Dungeon dungeon = minimap.Map as Dungeon; int newFloorIndex = dungeon.FirstLayoutIndex + dungeon.NumFloors; // Shift all subsequent layouts 64 bytes down in the data file Stream layoutFile = Project.GetBinaryFile("rooms/" + Project.GameString + "/dungeonLayouts.bin"); layoutFile.SetLength(layoutFile.Length + 64); for (int i = (int)layoutFile.Length / 64 - 1; i > newFloorIndex; i--) { var buf = new byte[64]; layoutFile.Position = (i - 1) * 64; layoutFile.Read(buf, 0, 64); layoutFile.Write(buf, 0, 64); } // Clear the new floor layoutFile.Position = newFloorIndex * 64; for (int j = 0; j < 64; j++) { layoutFile.WriteByte(0); } // Shift each dungeon's "FirstLayoutIndex" to match the shifted layouts. for (int i = 0; i < Project.GetNumDungeons(); i++) { Dungeon d2 = Project.GetIndexedDataType <Dungeon>(i); if (d2.FirstLayoutIndex >= newFloorIndex) { d2.FirstLayoutIndex++; } } dungeon.NumFloors = dungeon.NumFloors + 1; floorSpinButton.Value = dungeon.NumFloors - 1; DungeonChanged(); }; tmpAlign = new Gtk.Alignment(0.5f, 0, 0, 0); tmpAlign.Add(addFloorButton); tmpBox.Add(tmpAlign); var removeFloorButton = new Button("Remove Top Floor"); removeFloorButton.Image = new Gtk.Image(Gtk.Stock.Remove, Gtk.IconSize.Button); removeFloorButton.Clicked += (a, b) => { Dungeon dungeon = minimap.Map as Dungeon; if (dungeon.NumFloors <= 1) { return; } Gtk.MessageDialog d = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Warning, ButtonsType.YesNo, "Are you quite certain that you wish to delete the top floor of this dungeon?"); var response = (ResponseType)d.Run(); d.Destroy(); if (response == Gtk.ResponseType.Yes) { int deletedFloorIndex = dungeon.FirstLayoutIndex + dungeon.NumFloors - 1; // Shift all subsequent layouts 64 bytes up in the data file Stream layoutFile = Project.GetBinaryFile("rooms/" + Project.GameString + "/dungeonLayouts.bin"); for (int i = deletedFloorIndex; i < layoutFile.Length / 64 - 1; i++) { var buf = new byte[64]; layoutFile.Position = (i + 1) * 64; layoutFile.Read(buf, 0, 64); layoutFile.Position = i * 64; layoutFile.Write(buf, 0, 64); } layoutFile.SetLength(layoutFile.Length - 64); // Shift each dungeon's "FirstLayoutIndex" to match the shifted layouts. for (int i = 0; i < Project.GetNumDungeons(); i++) { Dungeon d2 = Project.GetIndexedDataType <Dungeon>(i); if (d2.FirstLayoutIndex > deletedFloorIndex) { d2.FirstLayoutIndex--; } } dungeon.NumFloors = dungeon.NumFloors - 1; DungeonChanged(); } }; tmpAlign = new Gtk.Alignment(0.5f, 0, 0, 0); tmpAlign.Add(removeFloorButton); tmpBox.Add(tmpAlign); hbox.Add(tmpBox); // Middle column (minimap) minimap = new Minimap(); minimap.TileSelectedEvent += (sender) => { RoomChanged(); }; hbox.Add(minimap); // Rightmost column tmpAlign = new Alignment(0, 0, 0, 0); tmpAlign.Add(roomVreContainer); tmpBox2 = new HBox(); tmpBox2.Add(new Gtk.Label("Room ")); roomSpinButton.ValueChanged += (a, b) => { (minimap.Map as Dungeon).SetRoom(minimap.SelectedX, minimap.SelectedY, minimap.Floor, roomSpinButton.ValueAsInt); minimap.GenerateImage(); RoomChanged(); }; tmpBox2.Add(roomSpinButton); tmpBox = new VBox(); tmpBox.Add(tmpBox2); tmpBox.Add(tmpAlign); hbox.Add(tmpBox); Window w = new Window(null); w.Add(frame); w.ShowAll(); Map map = manager.GetActiveMap(); if (map is Dungeon) { dungeonSpinButton.Value = map.Index; } DungeonChanged(); }
public MainToolbar() { WidgetFlags |= Gtk.WidgetFlags.AppPaintable; AddWidget(button); AddSpace(8); configurationCombo = new Gtk.ComboBox(); configurationCombo.Model = configurationStore; var ctx = new Gtk.CellRendererText(); configurationCombo.PackStart(ctx, true); configurationCombo.AddAttribute(ctx, "text", 0); configurationCombosBox = new HBox(false, 8); var configurationComboVBox = new VBox(); configurationComboVBox.PackStart(configurationCombo, true, false, 0); configurationCombosBox.PackStart(configurationComboVBox, false, false, 0); // bold attributes for running runtime targets / (emulators) boldAttributes.Insert(new Pango.AttrWeight(Pango.Weight.Bold)); runtimeCombo = new Gtk.ComboBox(); runtimeCombo.Model = runtimeStore; ctx = new Gtk.CellRendererText(); if (Platform.IsWindows) { ctx.Ellipsize = Pango.EllipsizeMode.Middle; } runtimeCombo.PackStart(ctx, true); runtimeCombo.SetCellDataFunc(ctx, RuntimeRenderCell); runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator; var runtimeComboVBox = new VBox(); runtimeComboVBox.PackStart(runtimeCombo, true, false, 0); configurationCombosBox.PackStart(runtimeComboVBox, false, false, 0); AddWidget(configurationCombosBox); buttonBarBox = new Alignment(0.5f, 0.5f, 0, 0); buttonBarBox.LeftPadding = (uint)7; buttonBarBox.Add(buttonBar); buttonBarBox.NoShowAll = true; AddWidget(buttonBarBox); AddSpace(24); statusArea = new StatusArea(); statusArea.ShowMessage(BrandingService.ApplicationName); var statusAreaAlign = new Alignment(0, 0, 1, 1); statusAreaAlign.Add(statusArea); contentBox.PackStart(statusAreaAlign, true, true, 0); AddSpace(24); statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => { Gtk.Widget toplevel = this.Toplevel; if (toplevel == null) { return; } var pixel_scale = GtkWorkarounds.GetPixelScale(); int windowWidth = toplevel.Allocation.Width; int center = windowWidth / 2; int left = Math.Max(center - (int)(300 * pixel_scale), args.Allocation.Left); int right = Math.Min(left + (int)(600 * pixel_scale), args.Allocation.Right); uint left_padding = (uint)(left - args.Allocation.Left); uint right_padding = (uint)(args.Allocation.Right - right); if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding) { statusAreaAlign.SetPadding(0, 0, (uint)left_padding, (uint)right_padding); } }; matchEntry = new SearchEntry(); matchEntry.ForceFilterButtonVisible = true; matchEntry.Entry.FocusOutEvent += (o, e) => { if (SearchEntryLostFocus != null) { SearchEntryLostFocus(o, e); } }; matchEntry.Ready = true; matchEntry.Visible = true; matchEntry.IsCheckMenu = true; matchEntry.Entry.ModifyBase(StateType.Normal, Style.White); matchEntry.WidthRequest = 240; if (!Platform.IsMac && !Platform.IsWindows) { matchEntry.Entry.ModifyFont(Pango.FontDescription.FromString("Sans 9")); // TODO: VV: "Segoe UI 9" } matchEntry.RoundedShape = true; matchEntry.Entry.Changed += HandleSearchEntryChanged; matchEntry.Activated += HandleSearchEntryActivated; matchEntry.Entry.KeyPressEvent += HandleSearchEntryKeyPressed; SizeAllocated += (o, e) => { if (SearchEntryResized != null) { SearchEntryResized(o, e); } }; contentBox.PackStart(matchEntry, false, false, 0); var align = new Gtk.Alignment(0, 0, 1f, 1f); align.Show(); align.TopPadding = (uint)5; align.LeftPadding = (uint)9; align.RightPadding = (uint)18; align.BottomPadding = (uint)10; align.Add(contentBox); Add(align); SetDefaultSizes(-1, (int)(21 * GtkWorkarounds.GetPixelScale())); configurationCombo.Changed += (o, e) => { if (ConfigurationChanged != null) { ConfigurationChanged(o, e); } }; runtimeCombo.Changed += (o, e) => { var ea = new HandledEventArgs(); if (RuntimeChanged != null) { RuntimeChanged(o, ea); } TreeIter it; if (runtimeCombo.GetActiveIter(out it)) { if (ea.Handled) { runtimeCombo.SetActiveIter(lastSelection); return; } lastSelection = it; } }; button.Clicked += HandleStartButtonClicked; IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => { lastCommandTarget = new WeakReference(e.OldActiveWidget); }; this.ShowAll(); this.statusArea.statusIconBox.HideAll(); }