public TabLabel (Label label, Gtk.Image icon) : base (false, 0) { this.title = label; this.icon = icon; icon.Xpad = 2; EventBox eventBox = new EventBox (); eventBox.BorderWidth = 0; eventBox.VisibleWindow = false; eventBox.Add (icon); this.PackStart (eventBox, false, true, 0); titleBox = new EventBox (); titleBox.VisibleWindow = false; titleBox.Add (title); this.PackStart (titleBox, true, true, 0); Gtk.Rc.ParseString ("style \"MonoDevelop.TabLabel.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n"); Gtk.Rc.ParseString ("widget \"*.MonoDevelop.TabLabel.CloseButton\" style \"MonoDevelop.TabLabel.CloseButton\"\n"); Button button = new Button (); button.CanDefault = false; var closeIcon = new Xwt.ImageView (closeImage).ToGtkWidget (); button.Image = closeIcon; button.Relief = ReliefStyle.None; button.BorderWidth = 0; button.Clicked += new EventHandler(ButtonClicked); button.Name = "MonoDevelop.TabLabel.CloseButton"; this.PackStart (button, false, true, 0); this.ClearFlag (WidgetFlags.CanFocus); this.BorderWidth = 0; this.ShowAll (); }
private void AllowinternalAccess() { _tvShares = tvShares; _tvArtists = tvArtists; _tvGenres = tvGenres; _tvAlbums = tvAlbums; _tvPlaylist = tvPlaylist; _tvFiles = tvFiles; _MainWindow = MainWindow; _nbLeft = nbLeft; _nbRight = nbRight; _hsVolume = hsVolume; _hsProgress = hsProgress; _iConnectionStatus = iConnectionStatus; _lStatus = lStatus; _tbMute = tbMute; _ibPlay = ibPlay; _bStop = bStop; //Configuration tab _eIpAddress = eIpAddress; _eUsername = eUsername; _ePassword = ePassword; _sbUpdateInterval = sbUpdateInterval; _sbConnectionTimeout = sbConnectionTimeout; _chbShowInTaskbar = chbShowInTaskbar; _chbShowInSystemTray = chbShowInSystemTray; }
/// <summary> /// Constructor. Initialises the widget and will show a world /// map with no markers until <see cref="ShowMap" /> is called. /// </summary> /// <param name="owner">Owner view.</param> public MapView(ViewBase owner) : base(owner) { image = new Gtk.Image(); var container = new Gtk.EventBox(); container.Add(image); VPaned box = new VPaned(); PropertiesGrid = new PropertyView(this); box.Pack1(((ViewBase)PropertiesGrid).MainWidget, true, false); box.Pack2(container, true, true); container.AddEvents( (int)Gdk.EventMask.ButtonPressMask | (int)Gdk.EventMask.ButtonReleaseMask | (int)Gdk.EventMask.ScrollMask); container.ButtonPressEvent += OnButtonPress; container.ButtonReleaseEvent += OnButtonRelease; image.SizeAllocated += OnSizeAllocated; #if NETFRAMEWORK image.ExposeEvent += OnImageExposed; #else image.Drawn += OnImageExposed; #endif container.Destroyed += OnMainWidgetDestroyed; container.ScrollEvent += OnMouseScroll; mainWidget = box; mainWidget.ShowAll(); }
public AppletWidget(AppletStyle style, int? size) { // Tooltips Tooltips = new Tooltips(); Tooltips.SetTip(this, Catalog.GetString("Deskop Drapes, click to switch wallpaper"), null); if (style == AppletStyle.APPLET_PANEL) { height = 22; // for now this always 22 since the gnome-panel lies to us, what an asshole } else { height = 22; } // Create the icon Icon = new Image(Theme.LoadIcon("drapes", height, Gtk.IconLookupFlags.UseBuiltin)); Add(Icon); // Set enabled status Enabled = DrapesApp.Cfg.ShuffleEnabled; // Keep track of what kind of applet we are // if we are a tray icon, then register a notification area widget this.AppletStyle = style; if (this.AppletStyle == AppletStyle.APPLET_TRAY) CreateNotifyIcon(); // What shall we do ButtonPressEvent += ButtonPress; // Show the tray ShowAll(); }
public Tab (string tabName) { if (tabName == null) throw new ArgumentNullException ("tabName"); Label label = new Label (tabName); label.Justify = Justification.Left; label.UseUnderline = false; Gtk.Image image = new Gtk.Image (Stock.Close, IconSize.Menu); image.Xalign = 0.5f; image.Yalign = 0.5f; Button button = new Button (); button.HeightRequest = 20; button.WidthRequest = 20; button.Relief = ReliefStyle.None; button.CanFocus = false; button.Clicked += delegate { if (CloseButtonClicked != null) CloseButtonClicked (this, EventArgs.Empty); }; button.Add (image); this.PackStart (label, true, true, 0); this.PackEnd (button, false, false, 0); this.ShowAll (); }
void AppendFile(MediaFile file) { HBox box; Button delButton; Gtk.Image delImage; VideoFileInfo fileinfo; if (file == null) { return; } Files.Add(file); box = new HBox(); delButton = new Button(); delButton.Relief = ReliefStyle.None; delButton.CanFocus = false; delImage = new Gtk.Image("gtk-remove", IconSize.Button); delButton.Add(delImage); delButton.Clicked += (object sender, EventArgs e) => { filesbox.Remove(box); Files.Remove(file); CheckStatus(); }; fileinfo = new VideoFileInfo(); fileinfo.SetMediaFile(file); box.PackStart(fileinfo, true, true, 0); box.PackStart(delButton, false, false, 0); box.ShowAll(); filesbox.PackStart(box, false, true, 0); }
public ArtworkPopup() : base(Gtk.WindowType.Popup) { VBox vbox = new VBox(); Add(vbox); Decorated = false; BorderWidth = 6; SetPosition(WindowPosition.CenterAlways); image = new Gtk.Image(); label = new Label(String.Empty); label.CanFocus = false; label.Wrap = true; label.ModifyBg(StateType.Normal, new Color(0, 0, 0)); label.ModifyFg(StateType.Normal, new Color(160, 160, 160)); ModifyBg(StateType.Normal, new Color(0, 0, 0)); ModifyFg(StateType.Normal, new Color(160, 160, 160)); vbox.PackStart(image, true, true, 0); vbox.PackStart(label, false, false, 0); vbox.Spacing = 6; vbox.ShowAll(); }
public EmergencyWidget(Gtk.Image imageWidget, Gtk.Label labelWidget) { this.imageWidget = imageWidget; this.labelWidget = labelWidget; LoadRessources(); }
public Gtk.Button CreateButton() { Gtk.VBox vbox = new Gtk.VBox(); Gtk.Image image = new Gtk.Image(); string photoFile = Util.GetPhotoFileName(true, p.UniqueID); if(photoFile != "" && File.Exists(photoFile)) { try { Pixbuf pixbuf = new Pixbuf (photoFile); //from a file image.Pixbuf = pixbuf; image.Visible = true; } catch { LogB.Warning("catched while adding photo"); } } Gtk.Label label_id = new Gtk.Label(p.UniqueID.ToString()); label_id.Visible = false; //hide this to the user Gtk.Label label_name = new Gtk.Label(p.Name); label_name.Visible = true; vbox.PackStart(image); vbox.PackStart(label_id); vbox.PackEnd(label_name, false, false, 1); vbox.Show(); Button b = new Button(vbox); b.WidthRequest=150; return b; }
public WelcomePageBarButton (string title, string href, string iconResource = null) { FontFamily = Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows; HoverColor = Styles.WelcomeScreen.Links.HoverColor; Color = Styles.WelcomeScreen.Links.Color; FontSize = Styles.WelcomeScreen.Links.FontSize; VisibleWindow = false; this.Text = GettextCatalog.GetString (title); this.actionLink = href; if (!string.IsNullOrEmpty (iconResource)) { imageHover = Gdk.Pixbuf.LoadFromResource (iconResource); imageNormal = ImageService.MakeTransparent (imageHover, 0.7); } HBox box = new HBox (); box.Spacing = Styles.WelcomeScreen.Links.IconTextSpacing; image = new Image (); label = new Label (); box.PackStart (image, false, false, 0); if (imageNormal == null) image.NoShowAll = true; box.PackStart (label, false, false, 0); box.ShowAll (); Add (box); Update (); Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask); }
public ModelElementTypeViewer(IBroadcaster hub) { _hub = hub; base.PackStart(new Gtk.Label("Model Element type:"), false, false, 2); _lblType = new Gtk.Label(); base.PackStart(_lblType, false, false, 2); base.PackStart(new Gtk.Label(String.Empty), true, true, 0); // "Up" button Gtk.Image image = new Gtk.Image(); image.Stock = Gtk.Stock.GoUp; _btnGoUp = new Gtk.Button(); _btnGoUp.Add(image); _btnGoUp.Relief = Gtk.ReliefStyle.None; _btnGoUp.Clicked += new EventHandler(OnGoUpButtonClicked); _btnGoUp.Sensitive = false; base.PackStart(_btnGoUp, false, false, 0); // "Delete" button image = new Gtk.Image(); image.Stock = Gtk.Stock.Delete; Gtk.Button btnDelete = new Gtk.Button(); btnDelete.Add(image); btnDelete.Relief = Gtk.ReliefStyle.None; btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked); btnDelete.Sensitive = true; base.PackStart(btnDelete, false, false, 0); }
/// Append Custom Widget public int AppendCustom(Gtk.Widget page, string label, Gtk.Image icon) { int npage; if (this.pagesCustom.IndexOf(page) < 0) { // Initialize Tab Label TabLabel tabLabel = new TabLabel(label, icon); tabLabel.Button.Clicked += new EventHandler(OnCustomCloseTab); // Add TabLabel -> Page this.tabsCustom.Add(tabLabel.Button, page); // Add Page this.pagesCustom.Add(page); // Append Page To Notebook npage = AppendPage(page, tabLabel); } else { npage = PageNum(page); // Set New Page as Current Page CurrentPage = npage; } // Show All (Refresh Notebook Viewer) this.ShowAll(); return(npage); }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { Gtk.Image image5 = new Gtk.Image(); image5.Name = "image5"; //image5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "osiris.jpg")); image5.Pixbuf = new Gdk.Pixbuf("/opt/osiris/bin/OSIRISLogo.jpg"); // en Linux //image5.Pixbuf.ScaleSimple(128, 128, Gdk.InterpType.Bilinear); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf,1,-30); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(145, 50, Gdk.InterpType.Bilinear),1,1); Gdk.CairoHelper.SetSourcePixbuf(cr, image5.Pixbuf, 1, 1); cr.Fill(); //cr.Restore(); cr.Paint(); cr.Restore(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); // cr.Rotate(90) Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; //cr.MoveTo(20*escala_en_linux_windows,10*escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(20*escala_en_linux_windows,20*escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(20*escala_en_linux_windows,30*escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(20*escala_en_linux_windows,70*escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout (cr, layout); // Cambiando el tamaño de la fuente fontSize = 12.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(230 * escala_en_linux_windows, 55 * escala_en_linux_windows); layout.SetText("PROTOCOLO DE ADMISION"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(280 * escala_en_linux_windows, 65 * escala_en_linux_windows); layout.SetText("REGISTRO"); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra Normal fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; }
/// <summary> /// Initialization, takes the Addin this gui is attached to. /// </summary> public TaskManagerGui(TaskManagerNoteAddin addin) { this.addin = addin; utils = new TaskNoteUtilities (addin.Buffer); var duedateImage = new Gtk.Image(null, "Tomboy.TaskManager.Icons.duedate-icon22.png"); add_duedate.Image = duedateImage; var priorityImage = new Gtk.Image(null, "Tomboy.TaskManager.Icons.priority-icon22.png"); add_priority.Image = priorityImage; task_menu.Add (add_duedate); task_menu.Add (add_priority); task_menu.Add (show_priority); if (Tomboy.Debugging) { Gtk.MenuItem print_structure = new Gtk.MenuItem (Catalog.GetString ("Print Structure")); print_structure.Activated += OnPrintStructureActivated; task_menu.Add (print_structure); } var todoImage = new Gtk.Image(null, "Tomboy.TaskManager.Icons.todo-icon24.png"); menu_tool_button = new Gtk.MenuToolButton (todoImage, null); menu_tool_button.TooltipText = Catalog.GetString ("Add a new TaskList"); menu_tool_button.ArrowTooltipText = Catalog.GetString ("Set TaskList properties"); menu_tool_button.Menu = task_menu; task_menu.ShowAll (); menu_tool_button.Show (); addin.AddToolItem (menu_tool_button, -1); }
private void AttachWidgets(TextView textView) { // This is really different from the C version, but the // C versions seems a little pointless. Button button = new Button("Click Me"); button.Clicked += new EventHandler(EasterEggCB); textView.AddChildAtAnchor(button, buttonAnchor); button.ShowAll(); ComboBox combo = ComboBox.NewText(); combo.AppendText("Option 1"); combo.AppendText("Option 2"); combo.AppendText("Option 3"); textView.AddChildAtAnchor(combo, menuAnchor); HScale scale = new HScale(null); scale.SetRange(0, 100); scale.SetSizeRequest(70, -1); textView.AddChildAtAnchor(scale, scaleAnchor); scale.ShowAll(); Gtk.Image image = Gtk.Image.LoadFromResource("floppybuddy.gif"); textView.AddChildAtAnchor(image, animationAnchor); image.ShowAll(); Entry entry = new Entry(); textView.AddChildAtAnchor(entry, entryAnchor); entry.ShowAll(); }
public Catalog(Database db, string name, string table, string shortDescription, string longDescription, string image, int weight) { this.database = db; this.name = name; this.table = table; this.itemCollection = new ItemCollection (db, table, name); itemCollection.OnChanged += ItemCollectionChanged; this.shortDescription = shortDescription; this.longDescription = longDescription; this.weight = weight; this.image = new Gtk.Image(); try { this.image.FromPixbuf = Pixbuf.LoadFromResource (image); } catch { this.image = null; } }
public Tile (Hit hit, Query query) : base () { base.AboveChild = true; base.AppPaintable = true; base.CanFocus = true; this.hit = hit; this.query = query; this.timestamp = hit.Timestamp; this.score = hit.Score; Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Copy | Gdk.DragAction.Move); int pad = (int)StyleGetProperty ("focus-line-width") + (int)StyleGetProperty ("focus-padding") + 1; hbox = new Gtk.HBox (false, 5); hbox.BorderWidth = (uint)(pad + Style.Xthickness); hbox.Show (); icon = new Gtk.Image (); icon.Show (); hbox.PackStart (icon, false, false, 0); Add (hbox); }
public MasterDetailMasterTitleContainer() { _defaultBackgroundColor = Style.Backgrounds[(int)StateType.Normal]; _root = new HBox(); _hamburguerIcon = new Gtk.Image(); try { _hamburguerIcon = new Gtk.Image(HamburgerPixBuf); } catch (Exception ex) { Internals.Log.Warning("MasterDetailPage HamburguerIcon", "Could not load hamburguer icon: {0}", ex); } _hamburguerButton = new ToolButton(_hamburguerIcon, string.Empty); _hamburguerButton.HeightRequest = GtkToolbarConstants.ToolbarItemHeight; _hamburguerButton.WidthRequest = GtkToolbarConstants.ToolbarItemWidth; _hamburguerButton.Clicked += OnHamburguerButtonClicked; _titleLabel = new Gtk.Label(); _defaultTextColor = _titleLabel.Style.Foregrounds[(int)StateType.Normal]; _root.PackStart(_hamburguerButton, false, false, GtkToolbarConstants.ToolbarItemSpacing); _root.PackStart(_titleLabel, false, false, 25); Add(_root); }
public PlayPauseButton(string playXPM, string pauseXPM) { _paused = true; _playImage = new Pixbuf(playXPM); _pauseImage = new Pixbuf(pauseXPM); _image = new Gtk.Image(); _image.Pixbuf = _playImage; Add(_image); _image.Show(); this.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) { if (_paused) _image.Pixbuf = _pauseImage; else _image.Pixbuf = _playImage; _paused = !_paused; if (Clicked != null) Clicked(this, new PlayPauseButtonEventArgs(){ IsPaused = _paused }); }; this.WidthRequest = _image.Pixbuf.Width; }
private void createButton() { Gtk.VBox vbox = new Gtk.VBox(); Gtk.Image image = new Gtk.Image(); addUserPhotoIfExists(image); image.HeightRequest = 150; image.Visible = true; Gtk.Label label_select = new Gtk.Label("Select !"); label_select.Visible = false; //hide this to the user until button is clicked first time Gtk.Label label_id = new Gtk.Label(personID.ToString()); label_id.Visible = false; //hide this to the user Gtk.Viewport viewport = new Gtk.Viewport(); UtilGtk.ViewportColorDefault(viewport); Gtk.Label label_name = new Gtk.Label(personName); label_name.Visible = true; label_name.Show(); viewport.Add(label_name); viewport.Show(); vbox.PackStart(image); //0 vbox.PackStart(label_id); //1 vbox.PackEnd(viewport, false, false, 1); //2 (contains label_name) vbox.Show(); button = new Button(vbox); button.WidthRequest = 150; button.HeightRequest = 170; }
private void createContent(int connectedCount, int unknownCount) { //create top hbox Gtk.HBox hbox = new Gtk.HBox(false, 12); Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_chronopic_connect_big.png"); //hbox image Gtk.Image image = new Gtk.Image(); image.Pixbuf = pixbuf; hbox.Add(image); //hbox label Gtk.Label label = new Gtk.Label(); label.Text = writeLabel(connectedCount, unknownCount); hbox.Add(label); vbox_main.Add(hbox); //table if (connectedCount > 0) { createTable(); Gtk.VBox vboxTV = new Gtk.VBox(false, 10); vboxTV.Add(table_main); vbox_main.Add(vboxTV); } }
public ApplicationMenuItem(OpenWithMenu menu, MimeApplication ma) : base(ma.Name) { this.application = ma; if (!menu.ShowIcons) { return; } if (ma.Icon == null) { return; } Gdk.Pixbuf pixbuf = null; try { if (ma.Icon.StartsWith("/")) { pixbuf = new Gdk.Pixbuf(ma.Icon, 16, 16); } else { pixbuf = IconTheme.Default.LoadIcon(ma.Icon, 16, (IconLookupFlags)0); } } catch { pixbuf = null; } if (pixbuf != null) { Image = new Gtk.Image(pixbuf); } }
/// <summary> /// constructor /// </summary> /// <param name="host">host name or IP address</param> /// <param name="port_number_left">port number for the left camera</param> /// <param name="port_number_right">port number for the right camera</param> /// <param name="broadcast_port">port number on which to broadcast stereo feature data to other applications</param> /// <param name="fps">ideal frames per second</param> public WebcamVisionStereoGtk(string left_camera_device, string right_camera_device, int broadcast_port, float fps) : base (left_camera_device, right_camera_device, broadcast_port, fps) { display_image = new Gtk.Image[2]; }
/// <summary> /// Constructor. Initialises the widget and will show a world /// map with no markers until <see cref="ShowMap" /> is called. /// </summary> /// <param name="owner">Owner view.</param> public MapView(ViewBase owner) : base(owner) { GeometryServiceProvider.Instance = new NtsGeometryServices(); image = new Gtk.Image(); var container = new Gtk.EventBox(); container.Add(image); VPaned box = new VPaned(); Grid = new GridView(this); box.Pack1(((ViewBase)Grid).MainWidget, true, false); box.Pack2(container, true, true); container.AddEvents( (int)Gdk.EventMask.ButtonPressMask | (int)Gdk.EventMask.ButtonReleaseMask | (int)Gdk.EventMask.ScrollMask); container.ButtonPressEvent += OnButtonPress; container.ButtonReleaseEvent += OnButtonRelease; image.SizeAllocated += OnSizeAllocated; image.ExposeEvent += OnImageExposed; container.Destroyed += OnMainWidgetDestroyed; container.ScrollEvent += OnMouseScroll; mainWidget = box; mainWidget.ShowAll(); }
public ImageWindow(string src) : base(src) { Decorated = false; KeepAbove = true; Resize (640, 240); Move (100, 100); //Opacity = 1.0; pixbuf = new Pixbuf (src); Gtk.Image image = new Gtk.Image (); image.Pixbuf = pixbuf; EventBox box = new EventBox (); box.Add (image); box.ButtonPressEvent += new ButtonPressEventHandler (WindowController.OnButtonDragPress); box.ExposeEvent += HandleMyWinExposeEvent; Add (box); WindowController.HandleMyWinScreenChanged(this, null); WindowController.SetWindowShapeFromPixbuf (this, image.Pixbuf); DestroyEvent += new DestroyEventHandler (delegate(object o, DestroyEventArgs args) { if(cr!=null){ ((IDisposable)cr).Dispose(); } }); ShowAll(); }
private Widget GetAddWidget() { Table tblButton = new Table(1, 1, false) { RowSpacing = 2, ColumnSpacing = 4 }; Gtk.Image imgAdd = FormHelper.LoadImage("Icons.Add24.png"); tblButton.Attach(imgAdd, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 2, 0); Label lblName = new Label { Markup = new PangoStyle { Text = Translator.GetString("Add"), Bold = true, Size = PangoStyle.TextSize.Large }, Xalign = 0.5f }; tblButton.Attach(lblName, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0); Button btnAdd = new Button { tblButton }; btnAdd.Clicked += btnAdd_Clicked; return(btnAdd); }
public Tab(string tabName) { if (tabName == null) { throw new ArgumentNullException("tabName"); } Label label = new Label(tabName); label.Justify = Justification.Left; label.UseUnderline = false; Gtk.Image image = new Gtk.Image(Stock.Close, IconSize.Menu); image.Xalign = 0.5f; image.Yalign = 0.5f; Button button = new Button(); button.HeightRequest = 20; button.WidthRequest = 20; button.Relief = ReliefStyle.None; button.CanFocus = false; button.Clicked += delegate { if (CloseButtonClicked != null) { CloseButtonClicked(this, EventArgs.Empty); } }; button.Add(image); this.PackStart(label, true, true, 0); this.PackEnd(button, false, false, 0); this.ShowAll(); }
public ArtworkPopup() : base(Gtk.WindowType.Popup) { VBox vbox = new VBox(); Add(vbox); Decorated = false; BorderWidth = 6; SetPosition(WindowPosition.CenterAlways); image = new Gtk.Image(); label = new Label(String.Empty); label.CanFocus = false; label.Wrap = true; var bg_color = new RGBA (); bg_color.Red = bg_color.Green = bg_color.Blue = 0; var fg_color = new RGBA (); fg_color.Red = bg_color.Green = bg_color.Blue = 160.0 / 255; label.OverrideBackgroundColor (StateFlags.Normal, bg_color); label.OverrideColor (StateFlags.Normal, fg_color); OverrideBackgroundColor (StateFlags.Normal, bg_color); OverrideColor (StateFlags.Normal, fg_color); vbox.PackStart(image, true, true, 0); vbox.PackStart(label, false, false, 0); vbox.Spacing = 6; vbox.ShowAll(); }
internal static Button CreateCustomButton(Pixbuf pixbuf, string label, EventHandler clicked) { Button btn = new Button(); btn.UseUnderline = true; if (clicked != null) { btn.Clicked += clicked; } Alignment algn = new Alignment(0.5f, 0.5f, 0f, 0f); HBox box = new HBox(); box.Spacing = 6; Gtk.Image img = new Gtk.Image(); img.Pixbuf = pixbuf; box.PackStart(img, false, false, 0); if (!string.IsNullOrEmpty(label)) { Label lbl = new Label(); lbl.UseUnderline = true; lbl.LabelProp = label; box.PackStart(lbl, false, false, 0); } algn.Add(box); btn.Add(algn); return(btn); }
public static void LoadIcon(this Gtk.Image image, string iconId, Gtk.IconSize size) { AnimatedImageInfo ainfo = animatedImages.Select(a => (AnimatedImageInfo)a.Target).FirstOrDefault(a => a != null && a.Image == image); if (ainfo != null) { if (ainfo.AnimatedIcon.AnimationSpec == iconId) { return; } UnregisterImageAnimation(ainfo); } if (IsAnimation(iconId, size)) { var anim = GetAnimatedIcon(iconId); ainfo = new AnimatedImageInfo(image, anim); ainfo.Animation = anim.StartAnimation(delegate(Xwt.Drawing.Image pix) { image.Pixbuf = pix.ToPixbuf(); }); animatedImages.Add(new WeakReference(ainfo)); } else { image.SetFromStock(iconId, size); } }
private void ShowField(Field field) { FieldRenderer renderer = new FieldRenderer(field, null); FieldRegion region = new FieldRegion(); Pixbuf pixbuf; region.Left = region.Bottom = 0; region.Top = field.Height - 1; region.Right = field.Width - 1; pixbuf = renderer.RenderToPixbuf(region, null); if (pixbuf.Width > DEFAULT_WIDTH || pixbuf.Height > DEFAULT_HEIGHT) { int w, h; CalculateOptimalDimensions(pixbuf, out w, out h); pixbuf = pixbuf.ScaleSimple(w, h, InterpType.Tiles); } if (image == null) { image = new Gtk.Image(pixbuf); image.Show(); Add(image); } else { image.Pixbuf = pixbuf; } }
public void MarkNowPlayingEntry() { int itemCount = _parent.oXbmc.Playlist.GetLength(); string itemPlaying = _parent.oXbmc.NowPlaying.Get("songno", true); if (itemCount > 0 && Convert.ToInt32(itemPlaying) < itemCount) { Gtk.Image nowPlayingImage = new Gtk.Image(); Pixbuf nowPlayingIcon = nowPlayingImage.RenderIcon(Stock.MediaPlay, IconSize.Menu, ""); Pixbuf emptyIcon = new Pixbuf("images/pixel.gif"); TreeIter tiNowPLaying = new TreeIter(); TreeIter tiPlaylistItem = new TreeIter(); tsPlaylist.GetIterFirst(out tiPlaylistItem); while (tsPlaylist.IterNext(ref tiPlaylistItem)) { _parent._tvPlaylist.Model.SetValue(tiPlaylistItem, 0, emptyIcon); } if (tsPlaylist.GetIter(out tiNowPLaying, new TreePath(itemPlaying)) && !_parent.oXbmc.Status.IsNotPlaying()) { _parent._tvPlaylist.Model.SetValue(tiNowPLaying, 0, nowPlayingIcon); } } }
public static void Main(string[] args) { Application.Init(); // Init CLI Core = new Eddie.Lib.UiWeb.ProcessCore(); Splash = new WindowSplash(); Splash.Show(); m_imageIconNormal = Gtk.Image.LoadFromResource("UI.GtkWeb.Linux.Resources.icon.png"); m_imageIconGray = Gtk.Image.LoadFromResource("UI.GtkWeb.Linux.Resources.icon_gray.png"); Core.ReceiveEvent += OnReceiveEvent; Core.MessageEvent += OnMessageEvent; Core.ShowReadyEvent += OnShowReadyEvent; Core.LaunchCoreEvent += OnLaunchCoreEvent; Core.ExitEvent += OnExitEvent; // Init UI //BuildMainForm(); BuildTray(); Core.Start(); Application.Run(); }
public static Gtk.Image GetImage(string name, Gtk.IconSize size) { var img = new Gtk.Image(); img.LoadIcon(name, size); return(img); }
public DocumentToolButton(string stockId, string label) { button = new Button(); Label = label; Image = new Gtk.Image(stockId, IconSize.Menu); button.Image.Show(); }
ImageContainer() { image = new Gtk.Image(); Add(image); image.SetAlignment(0.5f, 0f); Show(); }
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 BDialog(string aName, Gtk.Window aParent, string aText) : base(aName, aParent, Gtk.DialogFlags.NoSeparator) { // setup dialog this.Modal = true; this.BorderWidth = 6; this.HasSeparator = false; this.Resizable = false; this.VBox.Spacing=12; // graphic items hbox = new Gtk.HBox(); Gtk.VBox labelBox = new VBox(); label = new Gtk.Label(); image = new Gtk.Image(); hbox.Spacing=12; hbox.BorderWidth=6; this.VBox.Add(hbox); // set-up image image.Yalign=0.0F; hbox.Add(image); // set-up label label.Yalign=0.0F; label.Xalign=0.0F; label.UseMarkup=true; label.Wrap=true; label.Markup=aText; // add to dialog labelBox.Add(label); hbox.Add(labelBox); }
///<summary> /// Updates the showing of the removal button. ///</summary> private void UpdateRemoveButton() { if (showRemoveButton) { if (removeButton == null) { Gtk.Image actionImage = new Gtk.Image(Utilities.GetIcon("gtk-stop", 24)); removeButton = new Gtk.Button(); removeButton.BorderWidth = 0; removeButton.Relief = Gtk.ReliefStyle.None; removeButton.CanFocus = false; removeButton.Clicked += OnRemoveClicked; removeButton.Image = actionImage; removeBox.PackStart(removeButton, false, false, 0); removeButton.Show(); toolTips.SetTip(removeButton, Catalog.GetString("Remove this person"), Catalog.GetString("Remove this person")); } // if a remove has been requested already for this user, make the button not sensitive removeButton.Sensitive = !removeRequested; } else { if (removeButton != null) { removeBox.Remove(removeButton); removeButton = null; } } }
void SetTabProps(Widget widget, bool active) { Gdk.Pixbuf icon; Gtk.Image img; img = notebook.GetTabLabel(widget) as Gtk.Image; if (img == null) { img = new Gtk.Image(); img.WidthRequest = StyleConf.NotebookTabSize; img.HeightRequest = StyleConf.NotebookTabSize; notebook.SetTabLabel(widget, img); } if (widget == eventslistwidget) { icon = active ? listActiveIco : listIco; } else if (widget == filtersvbox) { icon = active ? filtersActiveIco : filtersIco; } else if (widget == playlistwidget) { icon = active ? playlistActiveIco : playlistIco; } else { return; } img.Pixbuf = icon; }
private void AddEmailRow(Email newEmail) { datatableEmails.NRows = RowNum + 1; var emailDataCombo = new yListComboBox(); emailDataCombo.WidthRequest = 100; emailDataCombo.SetRenderTextFunc((EmailType x) => x.Name); emailDataCombo.ItemsList = emailTypes; emailDataCombo.Binding.AddBinding(newEmail, e => e.EmailType, w => w.SelectedItem).InitializeFromSource(); datatableEmails.Attach(emailDataCombo, (uint)0, (uint)1, RowNum, RowNum + 1, AttachOptions.Fill | AttachOptions.Expand, (AttachOptions)0, (uint)0, (uint)0); yValidatedEntry emailDataEntry = new yValidatedEntry(); emailDataEntry.ValidationMode = ValidationType.email; emailDataEntry.Tag = newEmail; emailDataEntry.Binding.AddBinding(newEmail, e => e.Address, w => w.Text).InitializeFromSource(); datatableEmails.Attach(emailDataEntry, (uint)1, (uint)2, RowNum, RowNum + 1, AttachOptions.Expand | AttachOptions.Fill, (AttachOptions)0, (uint)0, (uint)0); Gtk.Button deleteButton = new Gtk.Button(); Gtk.Image image = new Gtk.Image(); image.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-delete", global::Gtk.IconSize.Menu); deleteButton.Image = image; deleteButton.Clicked += OnButtonDeleteClicked; datatableEmails.Attach(deleteButton, (uint)2, (uint)3, RowNum, RowNum + 1, (AttachOptions)0, (AttachOptions)0, (uint)0, (uint)0); datatableEmails.ShowAll(); RowNum++; }
public PanelViewContainer() { this.Build(); iconPinned = Gtk.Image.LoadFromResource("Vodovoz.icons.buttons.pin-up.png"); iconUnpinned = Gtk.Image.LoadFromResource("Vodovoz.icons.buttons.pin-down.png"); buttonPin.Toggled += OnButtonPinToggled; }
public void SeleccionarImagen(Gtk.Image imgV, Window win) { FileChooserDialog filechooser = new Gtk.FileChooserDialog("Seleccionar imágen", win, FileChooserAction.Open, "Cancelar", ResponseType.Cancel, "Abrir", ResponseType.Accept); Filtro(filechooser); if (filechooser.Run() == (int)ResponseType.Accept) { FileStream file = File.OpenRead(filechooser.Filename); imgV.Pixbuf = new Gdk.Pixbuf(file, 150, 165); imgV.Pixbuf.ScaleSimple(imgV.Pixbuf.Width, imgV.Pixbuf.Height, 0); file.Close(); } try { this.imagen_telefono = System.Drawing.Image.FromFile(filechooser.Filename); } catch (Exception e) { System.Diagnostics.Debug.Write(e); } filechooser.Destroy(); }
protected void RenderDrawing(Gtk.Image dest, Pixbuf src) { if (dest != null && src != null) { src.CopyArea(0, 0, src.Width, src.Height, dest.Pixbuf, 0, 0); } }
private static void UpdateDialog(string format, params object[] args) { string text = String.Format(format, args); if (dialog == null) { dialog = new Dialog(); dialog.Title = "Loading data from assemblies..."; dialog.AddButton(Stock.Cancel, 1); dialog.Response += new ResponseHandler(ResponseCB); dialog.SetDefaultSize(480, 100); VBox vbox = dialog.VBox; HBox hbox = new HBox(false, 4); vbox.PackStart(hbox, true, true, 0); Gtk.Image icon = new Gtk.Image(Stock.DialogInfo, IconSize.Dialog); hbox.PackStart(icon, false, false, 0); dialog_label = new Label(text); hbox.PackStart(dialog_label, false, false, 0); dialog.ShowAll(); } else { dialog_label.Text = text; while (Application.EventsPending()) { Application.RunIteration(); } } }
public TileRenderer(Gtk.Image draw, int pixelWidth, int pixelHeight) { _renderTo = draw; _tileCache = "null"; _levelPMap = new Pixmap(_renderTo.GdkWindow, pixelWidth, pixelHeight); _graphicsContext = new Gdk.GC(_renderTo.GdkWindow); }
public void SetNewName(string newName) { caption = System.IO.Path.GetFileName(newName).Replace("_","__"); lblDisplay.Text = caption; lblDisplay.TooltipText = newName; string stockIcon = MainClass.Tools.GetIconForExtension( System.IO.Path.GetExtension(caption) ); image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu)); }
public ImageMenuItem CollapseAll() { Gtk.Image img = new Gtk.Image("Interface/Images/collapse_16.gif"); ImageMenuItem collapse = new ImageMenuItem("Collapse All"); collapse.Image = img; collapse.Activated += delegate { _parent.oShareBrowser.CollapseAll(); }; return collapse; }
public ImageMenuItem CollapseAll() { Gtk.Image img = new Gtk.Image(new Pixbuf(_parent.appDir + "/Interface/" + _parent.theme + "/buttons/collapse_16.png")); ImageMenuItem collapse = new ImageMenuItem("Collapse All"); collapse.Image = img; collapse.Activated += delegate { _parent.oShareBrowser.CollapseAll(); }; return collapse; }
public static Gtk.Image create_empty_image(int width, int height) { using (Cairo.ImageSurface surface = new Cairo.ImageSurface(Cairo.Format.ARGB32, width, height)) { surface.WriteToPng(tmp_image_path); Gtk.Image img = new Gtk.Image(tmp_image_path); System.IO.File.Delete(tmp_image_path); return img; } }
public ImageMenuItem CollapseAll() { Gtk.Image img = new Gtk.Image(_parent.oImages.menu.collapse); ImageMenuItem collapse = new ImageMenuItem("Collapse All"); collapse.Image = img; collapse.Activated += delegate { _parent.oShareBrowser.CollapseAll(); }; return collapse; }
public static void ShowPreviewImage(Gdk.Pixbuf image) { // now show window of things. Window win = new Window("Image Preview"); win.SetDefaultSize(image.Width, image.Height); Gtk.Image im = new Gtk.Image(image); win.Add(im); win.ShowAll(); }
public NatWidget() { map = new Pixmap (null, Diameter, Diameter, 24); image = new Gtk.Image (map, null); map.Colormap = Gdk.Colormap.System; PackStart (image); DoubleBuffered = true; Redraw (); }
public static Gtk.Image ImageToGtk(System.Drawing.Image image) { using (var stream = new System.IO.MemoryStream()) { image.Save(stream, System.Drawing.Imaging.ImageFormat.Png); stream.Position = 0; Gtk.Image img = new Gtk.Image(stream); return img; } }
// ======================================== // PUBLIC Constructors // ======================================== public Viewer() { // Initialize Members this.original = null; this.fileInfo = null; // Initialize Image this.image = new Gtk.Image(); AddWithViewport(this.image); }
/// <summary> /// constructor /// </summary> /// <param name="host">host name or IP address</param> /// <param name="port_number_left">port number for the left camera</param> /// <param name="port_number_right">port number for the right camera</param> /// <param name="broadcast_port">port number on which to broadcast stereo feature data to other applications</param> /// <param name="fps">ideal frames per second</param> /// <param name="phase_degrees">frame capture phase offset</param> /// <param name="window">window object</param> public SurveyorVisionStereoGtk(string host, int port_number_left, int port_number_right, int broadcast_port, float fps, Gtk.Window window) : base (host, port_number_left, port_number_right, broadcast_port, fps) { this.window = window; display_image = new Gtk.Image[2]; }
public ImageWidget(Pixbuf pixbuf) { resizingX = resizingY = false; this.CanFocus = true; this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask; this.child = new Gtk.Image (); this.child.Pixbuf = pixbuf; originalPixbuf = pixbuf; Add (child); imageSize = child.Allocation.Size; }
public ActionMenuItem (TileAction action) : base (action.Name) { this.action_delegate = action.Action; if (action.Stock != null) { Gtk.Image image = new Gtk.Image (); image.SetFromStock (action.Stock, IconSize.Menu); image.Show (); this.Image = image; } }
public ImgWindow(string title, string description, string fileName) : base(Gtk.WindowType.Toplevel) { this.Build (); label2.Text = title; Label a = new Label(description); Gtk.Image new_img = new Gtk.Image (fileName); vbox3.PackEnd (a, true, true, 1); vbox3.PackEnd (new_img, true, true, 1); ShowAll (); }