Gtk.Widget ClockControls() { var vbox = new Gtk.VBox { Spacing = 6 }; this.clock = new AnalogClock(); this.clock.SetSizeRequest(130, 130); vbox.PackStart(this.clock, true, true, 0); var spinners = new Gtk.HBox { Spacing = 6 }; spinners.PackStart(new Gtk.Label("Hour"), false, false, 0); hourSpin = CreateSpinner(24, 1, null); spinners.PackStart(hourSpin, false, false, 0); spinners.PackStart(new Gtk.Label("Min"), false, false, 0); minutesSpin = CreateSpinner(60, 10, hourSpin); spinners.PackStart(minutesSpin, false, false, 0); spinners.PackStart(new Gtk.Label("Sec"), false, false, 0); secondsSpin = CreateSpinner(60, 10, minutesSpin); spinners.PackStart(secondsSpin, false, false, 0); vbox.PackEnd(spinners, false, false, 0); return(vbox); }
public override void Initialize(OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); config = (RunConfigInfo)dataObject; editor = RunConfigurationService.CreateEditorForConfiguration(config.EditedConfig); box = new Gtk.VBox(); box.Spacing = 12; userConf = new Gtk.CheckButton(GettextCatalog.GetString("User-specific configuration")); box.PackEnd(userConf, false, false, 0); box.PackEnd(new Gtk.HSeparator(), false, false, 0); box.ShowAll(); editor.Changed += Editor_Changed; }
public void createGui() { basedir_section = new Section("cuesheets-basedir", "CueSheet Music Directory:", 20); source_page.Add(basedir_section); string dir = _source.getCueSheetDir(); Gtk.Label lbl = new Gtk.Label("CueSheet Music Directory:"); Gtk.FileChooserButton btn = new Gtk.FileChooserButton("CueSheet Music Directory:", Gtk.FileChooserAction.SelectFolder); if (dir != null) { btn.SelectFilename(dir); } Gtk.HBox box = new Gtk.HBox(); box.Add(lbl); box.Add(btn); box.ShowAll(); btn.CurrentFolderChanged += delegate(object sender, EventArgs args) { string dir1 = btn.Filename; Hyena.Log.Information("Folder changed to = " + dir1); }; btn.FileSet += delegate(object sender, EventArgs args) { string dir1 = btn.Filename; Hyena.Log.Information("Base directory changed to = " + dir1); _source.setCueSheetDir(dir1); }; Console.WriteLine(_source); Gtk.VBox vb = new Gtk.VBox(); vb.PackStart(box, false, false, 0); Gtk.Image icn_about = new Gtk.Image(Gtk.Stock.About, Gtk.IconSize.Button); Gtk.Button about = new Gtk.Button(icn_about); about.Clicked += new EventHandler(handleAbout); Gtk.HBox hb = new Gtk.HBox(); Gtk.Label _about = new Gtk.Label("About the CueSheet extension"); hb.PackEnd(about, false, false, 0); hb.PackEnd(_about, false, false, 5); vb.PackStart(hb, false, false, 0); Gtk.HBox hb1 = new Gtk.HBox(); Gtk.Label _info = new Gtk.Label("How to use the Cuesheet extension (opens browser)"); Gtk.Image icn_info = new Gtk.Image(Gtk.Stock.Info, Gtk.IconSize.Button); Gtk.Button btn_info = new Gtk.Button(icn_info); btn_info.Clicked += new EventHandler(handleInfo); hb1.PackEnd(btn_info, false, false, 0); hb1.PackEnd(_info, false, false, 5); vb.PackStart(hb1, false, false, 0); Gtk.HBox hbX = new Gtk.HBox(); vb.PackEnd(hbX, true, true, 0); vb.ShowAll(); source_page.DisplayWidget = vb; }
public void CreateGui() { Gtk.Image icn_reload = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Button); _reload = new Gtk.Button(icn_reload); _reload.Clicked += OnReload; _performer = new Gtk.Entry(200); _title = new Gtk.Entry(200); _title.WidthChars = 60; _performer.WidthChars = 60; _subtitle = new Gtk.Entry(300); _subtitle.WidthChars = 60; _composer = new Gtk.Entry(200); _composer.WidthChars = 60; _year = new Gtk.Entry(20); _year.WidthChars = 20; _image = new Gtk.Image(); _image.SetSizeRequest(100, 100); _imagefile = new Gtk.FileChooserButton("Choose image file", Gtk.FileChooserAction.Open); _imagefile.FileSet += new EventHandler(EvtImageSet); Gtk.Image icn_add_track = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Button); _add_track = new Gtk.Button(icn_add_track); _add_track.Clicked += OnAddTrack; Gtk.Image icn_del_track = new Gtk.Image(Gtk.Stock.Delete, Gtk.IconSize.Button); _del_track = new Gtk.Button(icn_del_track); _del_track.Clicked += OnDelTrack; Gtk.Image icn_save = new Gtk.Image(Gtk.Stock.Save, Gtk.IconSize.Button); _save = new Gtk.Button(icn_save); _save.Clicked += OnSave; _store = new Gtk.ListStore(typeof(int), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); _tracks = new Gtk.TreeView(); { Gtk.CellRendererText cr0 = new Gtk.CellRendererText(); cr0.Scale = 0.8; _tracks.AppendColumn("Nr.", cr0, "text", 0); Gtk.CellRendererText cr_title = new Gtk.CellRendererText(); cr_title.Scale = 0.8; cr_title.Editable = true; cr_title.Edited += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) { setCell(1, args.NewText, new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn("Title", cr_title, "text", 1); Gtk.CellRendererText cr_artist = new Gtk.CellRendererText(); cr_artist.Editable = true; cr_artist.Scale = 0.8; cr_artist.Edited += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) { setCell(2, args.NewText, new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn("Artist", cr_artist, "text", 2); Gtk.CellRendererText cr_composer = new Gtk.CellRendererText(); cr_composer.Editable = true; cr_composer.Scale = 0.8; cr_composer.Edited += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) { setCell(3, args.NewText, new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn("Composer", cr_composer, "text", 3); Gtk.CellRendererText cr_piece = new Gtk.CellRendererText(); cr_piece.Editable = true; cr_piece.Scale = 0.8; cr_piece.Edited += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) { setCell(4, args.NewText, new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn("Piece", cr_piece, "text", 4); Gtk.CellRendererText cr_time = new Gtk.CellRendererText(); cr_time.Editable = true; cr_time.Scale = 0.8; cr_time.Edited += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) { setCell(5, args.NewText, new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn("Offset", cr_time, "text", 5); } _tracks.Model = _store; Gtk.Table tbl = new Gtk.Table(2, 5, false); tbl.Attach(new Gtk.Label("Album:"), 0, 1, 0, 1); tbl.Attach(_title, 1, 2, 0, 1); tbl.Attach(new Gtk.Label("Artist:"), 0, 1, 1, 2); tbl.Attach(_performer, 1, 2, 1, 2); tbl.Attach(new Gtk.Label("Composer:"), 0, 1, 2, 3); tbl.Attach(_composer, 1, 2, 2, 3); tbl.Attach(new Gtk.Label("Subtitle:"), 0, 1, 3, 4); tbl.Attach(_subtitle, 1, 2, 3, 4); tbl.Attach(new Gtk.Label("year:"), 0, 1, 4, 5); tbl.Attach(_year, 1, 2, 4, 5); Gtk.Frame frm = new Gtk.Frame(); frm.Add(tbl); Gtk.HBox hb2 = new Gtk.HBox(); hb2.PackEnd(_reload, false, false, 1); hb2.PackEnd(_del_track, false, false, 1); hb2.PackEnd(_add_track, false, false, 1); hb2.PackEnd(_save, false, false, 1); Gtk.HBox hb = new Gtk.HBox(); Gtk.VBox vb1 = new Gtk.VBox(); vb1.PackStart(frm, false, false, 0); vb1.PackStart(hb2, true, true, 0); hb.PackStart(vb1, false, false, 0); Gtk.Frame frm2 = new Gtk.Frame(); frm2.Add(_image); Gtk.VBox vbi = new Gtk.VBox(); Gtk.HBox bb = new Gtk.HBox(); bb.PackStart(new Gtk.VBox(), true, true, 0); bb.PackStart(frm2, false, false, 0); bb.PackEnd(new Gtk.VBox(), true, true, 0); vbi.PackStart(bb, true, true, 2); vbi.PackEnd(_imagefile, false, false, 2); hb.PackEnd(vbi, true, true, 2); Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow(); scroll.Add(_tracks); scroll.SetSizeRequest(800, 300); base.VBox.PackStart(hb, false, false, 4); base.VBox.PackStart(scroll, true, true, 0); base.VBox.ShowAll(); base.AddButton("Close", 0); }
public CueSheetsView(CueSheetsSource ms) { MySource=ms; basedir=MySource.getCueSheetDir (); store = new CS_TrackListModel(); view = new CS_TrackListView(this); { ColumnController colc=view.ColumnController; int i,N; for(i=0,N=colc.Count;i<N;i++) { CS_Column col=(CS_Column) colc[i]; col.WidthChanged+=delegate(object sender,EventArgs args) { Hyena.Log.Information ("set-column-sizes="+_set_column_sizes); if (_set_column_sizes<=0) { _set_column_sizes=0; MySource.setColumnWidth (col.id(),MySource.getSheet ().id (),col.Width); } else { _set_column_sizes-=1; } }; } } view.SetModel(store); this.setColumnSizes(null); Hyena.Log.Information("New albumlist"); aview=new CS_AlbumListView(this); aaview=new CS_ArtistListView(); ccview=new CS_ComposerListView(); gview=new CS_GenreListView(); try { plsview=new CS_PlayListsView(this); } catch (System.Exception ex) { Hyena.Log.Error (ex.ToString ()); } Hyena.Log.Information("init models"); aview.SetModel (MySource.getAlbumModel ()); aaview.SetModel (MySource.getArtistModel ()); gview.SetModel (MySource.getGenreModel ()); ccview.SetModel (MySource.getComposerModel()); plsview.SetModel(MySource.getPlayListsModel()); plsadmin=new CS_PlayListAdmin(plsview,MySource.getPlayListsModel(),MySource.getPlayListCollection()); MySource.getGenreModel(); Hyena.Log.Information("model albumlist"); Hyena.Log.Information("albumlist initialized"); aview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<AlbumInfo>(EvtRowActivated); aview.Selection.Changed += HandleAviewSelectionChanged; gview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_GenreInfo>(EvtGenreActivated); aaview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<ArtistInfo>(EvtArtistActivated); ccview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_ComposerInfo>(EvtComposerActivated); plsview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_PlayList>(EvtPlayListActivated); view.RowActivated+=new RowActivatedHandler<CueSheetEntry>(EvtTrackRowActivated); bar=new Gtk.Toolbar(); if (basedir==null) { Hyena.Log.Information("basedir="+basedir); Gtk.Label lbl=new Gtk.Label(); lbl.Markup="<b>You need to configure the CueSheets music directory first, using the right mouse button on the extension</b>"; bar.Add (lbl); } filling=new Gtk.Label(); bar.Add (filling); ascroll=new Gtk.ScrolledWindow(); ascroll.Add (aview); aascroll=new Gtk.ScrolledWindow(); aascroll.Add (aaview); tscroll=new Gtk.ScrolledWindow(); tscroll.Add (view); gscroll=new Gtk.ScrolledWindow(); gscroll.Add (gview); ccscroll=new Gtk.ScrolledWindow(); ccscroll.Add(ccview); bool view_artist=true; Gtk.VBox vac=new Gtk.VBox(); Gtk.Button vab=new Gtk.Button("Artists"); vab.Clicked+=delegate(object sender,EventArgs args) { if (view_artist) { view_artist=false; vab.Label="Composers"; vac.Remove (aascroll); vac.PackEnd (ccscroll); ccscroll.ShowAll (); } else { view_artist=true; vab.Label="Artists"; vac.Remove (ccscroll); vac.PackEnd (aascroll); aascroll.ShowAll (); } }; vac.PackStart (vab,false,false,0); vac.PackEnd (aascroll); hb=new Gtk.HPaned(); hb.Add(gscroll); hb.Add (vac); hb1=new Gtk.HPaned(); hb1.Add (hb); hb1.Add (ascroll); vp=new Gtk.VPaned(); vp.Add (hb1); vp.Add (tscroll); Gtk.HPaned hppls=new Gtk.HPaned(); hppls.Add1 (vp); hppls.Add2 (plsadmin); hbpls=hppls; { int hb_pls,hb_p,hb1_p,vp_p; MySource.getPositions (out hb_pls,out hb_p,out hb1_p,out vp_p); hppls.Position=hb_pls; hb.Position=hb_p; hb1.Position=hb1_p; vp.Position=vp_p; } box = new Gtk.VBox(); box.PackStart (bar,false,true,0); box.PackStart (hppls); box.ShowAll(); GLib.Timeout.Add ((uint) 1000,(GLib.TimeoutHandler) GardDividers); GLib.Timeout.Add ((uint) timeout,(GLib.TimeoutHandler) PositionDisplay); fill (); }
public void createGui() { basedir_section=new Section("cuesheets-basedir","CueSheet Music Directory:",20); source_page.Add (basedir_section); string dir=_source.getCueSheetDir(); Gtk.Label lbl=new Gtk.Label("CueSheet Music Directory:"); Gtk.FileChooserButton btn=new Gtk.FileChooserButton("CueSheet Music Directory:",Gtk.FileChooserAction.SelectFolder); if (dir!=null) { btn.SelectFilename (dir); } Gtk.HBox box=new Gtk.HBox(); box.Add (lbl); box.Add (btn); box.ShowAll (); btn.CurrentFolderChanged+=delegate(object sender,EventArgs args) { string dir1=btn.Filename; Hyena.Log.Information ("Folder changed to = "+dir1); }; btn.FileSet+=delegate(object sender,EventArgs args) { string dir1=btn.Filename; Hyena.Log.Information ("Base directory changed to = "+dir1); _source.setCueSheetDir(dir1); }; Console.WriteLine (_source); Gtk.VBox vb=new Gtk.VBox(); vb.PackStart (box,false,false,0); Gtk.Image icn_about=new Gtk.Image(Gtk.Stock.About,Gtk.IconSize.Button); Gtk.Button about=new Gtk.Button(icn_about); about.Clicked+=new EventHandler(handleAbout); Gtk.HBox hb=new Gtk.HBox(); Gtk.Label _about=new Gtk.Label("About the CueSheet extension"); hb.PackEnd (about,false,false,0); hb.PackEnd (_about,false,false,5); vb.PackStart (hb,false,false,0); Gtk.HBox hb1=new Gtk.HBox(); Gtk.Label _info=new Gtk.Label("How to use the Cuesheet extension (opens browser)"); Gtk.Image icn_info=new Gtk.Image(Gtk.Stock.Info,Gtk.IconSize.Button); Gtk.Button btn_info=new Gtk.Button(icn_info); btn_info.Clicked+=new EventHandler(handleInfo); hb1.PackEnd(btn_info,false,false,0); hb1.PackEnd(_info,false,false,5); vb.PackStart (hb1,false,false,0); Gtk.HBox hbX=new Gtk.HBox(); vb.PackEnd (hbX,true,true,0); vb.ShowAll (); source_page.DisplayWidget = vb; }
public void CreateGui() { Gtk.Image icn_reload=new Gtk.Image(Gtk.Stock.Refresh,Gtk.IconSize.Button); _reload=new Gtk.Button(icn_reload); _reload.Clicked+=OnReload; _performer=new Gtk.Entry(200); _title=new Gtk.Entry(200); _title.WidthChars=60; _performer.WidthChars=60; _subtitle=new Gtk.Entry(300); _subtitle.WidthChars=60; _composer=new Gtk.Entry(200); _composer.WidthChars=60; _year=new Gtk.Entry(20); _year.WidthChars=20; _image=new Gtk.Image(); _image.SetSizeRequest (100,100); _imagefile=new Gtk.FileChooserButton("Choose image file",Gtk.FileChooserAction.Open); _imagefile.FileSet+=new EventHandler(EvtImageSet); Gtk.Image icn_add_track=new Gtk.Image(Gtk.Stock.Add,Gtk.IconSize.Button); _add_track=new Gtk.Button(icn_add_track); _add_track.Clicked+=OnAddTrack; Gtk.Image icn_del_track=new Gtk.Image(Gtk.Stock.Delete,Gtk.IconSize.Button); _del_track=new Gtk.Button(icn_del_track); _del_track.Clicked+=OnDelTrack; Gtk.Image icn_save=new Gtk.Image(Gtk.Stock.Save,Gtk.IconSize.Button); _save=new Gtk.Button(icn_save); _save.Clicked+=OnSave; _store=new Gtk.ListStore(typeof(int),typeof(string),typeof(string),typeof(string),typeof(string),typeof(string)); _tracks=new Gtk.TreeView(); { Gtk.CellRendererText cr0=new Gtk.CellRendererText(); cr0.Scale=0.8; _tracks.AppendColumn ("Nr.", cr0, "text", 0); Gtk.CellRendererText cr_title=new Gtk.CellRendererText(); cr_title.Scale=0.8; cr_title.Editable=true; cr_title.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) { setCell(1,args.NewText,new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn ("Title", cr_title, "text", 1); Gtk.CellRendererText cr_artist=new Gtk.CellRendererText(); cr_artist.Editable=true; cr_artist.Scale=0.8; cr_artist.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) { setCell(2,args.NewText,new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn ("Artist", cr_artist, "text", 2); Gtk.CellRendererText cr_composer=new Gtk.CellRendererText(); cr_composer.Editable=true; cr_composer.Scale=0.8; cr_composer.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) { setCell(3,args.NewText,new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn ("Composer", cr_composer, "text", 3); Gtk.CellRendererText cr_piece=new Gtk.CellRendererText(); cr_piece.Editable=true; cr_piece.Scale=0.8; cr_piece.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) { setCell(4,args.NewText,new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn ("Piece", cr_piece, "text", 4); Gtk.CellRendererText cr_time=new Gtk.CellRendererText(); cr_time.Editable=true; cr_time.Scale=0.8; cr_time.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) { setCell (5,args.NewText,new Gtk.TreePath(args.Path)); }); _tracks.AppendColumn ("Offset", cr_time, "text", 5); } _tracks.Model = _store; Gtk.Table tbl=new Gtk.Table(2,5,false); tbl.Attach (new Gtk.Label("Album:"),0,1,0,1); tbl.Attach (_title,1,2,0,1); tbl.Attach (new Gtk.Label("Artist:"),0,1,1,2); tbl.Attach (_performer,1,2,1,2); tbl.Attach (new Gtk.Label("Composer:"),0,1,2,3); tbl.Attach (_composer,1,2,2,3); tbl.Attach (new Gtk.Label("Subtitle:"),0,1,3,4); tbl.Attach (_subtitle,1,2,3,4); tbl.Attach (new Gtk.Label("year:"),0,1,4,5); tbl.Attach (_year,1,2,4,5); Gtk.Frame frm=new Gtk.Frame(); frm.Add (tbl); Gtk.HBox hb2=new Gtk.HBox(); hb2.PackEnd (_reload,false,false,1); hb2.PackEnd (_del_track,false,false,1); hb2.PackEnd (_add_track,false,false,1); hb2.PackEnd (_save,false,false,1); Gtk.HBox hb=new Gtk.HBox(); Gtk.VBox vb1=new Gtk.VBox(); vb1.PackStart (frm,false,false,0); vb1.PackStart (hb2,true,true,0); hb.PackStart (vb1,false,false,0); Gtk.Frame frm2=new Gtk.Frame(); frm2.Add (_image); Gtk.VBox vbi=new Gtk.VBox(); Gtk.HBox bb=new Gtk.HBox(); bb.PackStart(new Gtk.VBox(),true,true,0); bb.PackStart(frm2,false,false,0); bb.PackEnd (new Gtk.VBox(),true,true,0); vbi.PackStart (bb,true,true,2); vbi.PackEnd (_imagefile,false,false,2); hb.PackEnd (vbi,true,true,2); Gtk.ScrolledWindow scroll=new Gtk.ScrolledWindow(); scroll.Add (_tracks); scroll.SetSizeRequest (800,300); base.VBox.PackStart(hb,false,false,4); base.VBox.PackStart(scroll,true,true,0); base.VBox.ShowAll (); base.AddButton ("Close",0); }
public CueSheetsView(CueSheetsSource ms) { MySource = ms; basedir = MySource.getCueSheetDir(); store = new CS_TrackListModel(); view = new CS_TrackListView(this); { ColumnController colc = view.ColumnController; int i, N; for (i = 0, N = colc.Count; i < N; i++) { CS_Column col = (CS_Column)colc[i]; col.WidthChanged += delegate(object sender, EventArgs args) { Hyena.Log.Information("set-column-sizes=" + _set_column_sizes); if (_set_column_sizes <= 0) { _set_column_sizes = 0; MySource.setColumnWidth(col.id(), MySource.getSheet().id(), col.Width); } else { _set_column_sizes -= 1; } }; } } view.SetModel(store); this.setColumnSizes(null); Hyena.Log.Information("New albumlist"); aview = new CS_AlbumListView(this); aaview = new CS_ArtistListView(); ccview = new CS_ComposerListView(); gview = new CS_GenreListView(); try { plsview = new CS_PlayListsView(this); } catch (System.Exception ex) { Hyena.Log.Error(ex.ToString()); } Hyena.Log.Information("init models"); aview.SetModel(MySource.getAlbumModel()); aaview.SetModel(MySource.getArtistModel()); gview.SetModel(MySource.getGenreModel()); ccview.SetModel(MySource.getComposerModel()); plsview.SetModel(MySource.getPlayListsModel()); plsadmin = new CS_PlayListAdmin(plsview, MySource.getPlayListsModel(), MySource.getPlayListCollection()); MySource.getGenreModel(); Hyena.Log.Information("model albumlist"); Hyena.Log.Information("albumlist initialized"); aview.RowActivated += new Hyena.Data.Gui.RowActivatedHandler <AlbumInfo>(EvtRowActivated); aview.Selection.Changed += HandleAviewSelectionChanged; gview.RowActivated += new Hyena.Data.Gui.RowActivatedHandler <CS_GenreInfo>(EvtGenreActivated); aaview.RowActivated += new Hyena.Data.Gui.RowActivatedHandler <ArtistInfo>(EvtArtistActivated); ccview.RowActivated += new Hyena.Data.Gui.RowActivatedHandler <CS_ComposerInfo>(EvtComposerActivated); plsview.RowActivated += new Hyena.Data.Gui.RowActivatedHandler <CS_PlayList>(EvtPlayListActivated); view.RowActivated += new RowActivatedHandler <CueSheetEntry>(EvtTrackRowActivated); bar = new Gtk.Toolbar(); if (basedir == null) { Hyena.Log.Information("basedir=" + basedir); Gtk.Label lbl = new Gtk.Label(); lbl.Markup = "<b>You need to configure the CueSheets music directory first, using the right mouse button on the extension</b>"; bar.Add(lbl); } filling = new Gtk.Label(); bar.Add(filling); ascroll = new Gtk.ScrolledWindow(); ascroll.Add(aview); aascroll = new Gtk.ScrolledWindow(); aascroll.Add(aaview); tscroll = new Gtk.ScrolledWindow(); tscroll.Add(view); gscroll = new Gtk.ScrolledWindow(); gscroll.Add(gview); ccscroll = new Gtk.ScrolledWindow(); ccscroll.Add(ccview); bool view_artist = true; Gtk.VBox vac = new Gtk.VBox(); Gtk.Button vab = new Gtk.Button("Artists"); vab.Clicked += delegate(object sender, EventArgs args) { if (view_artist) { view_artist = false; vab.Label = "Composers"; vac.Remove(aascroll); vac.PackEnd(ccscroll); ccscroll.ShowAll(); } else { view_artist = true; vab.Label = "Artists"; vac.Remove(ccscroll); vac.PackEnd(aascroll); aascroll.ShowAll(); } }; vac.PackStart(vab, false, false, 0); vac.PackEnd(aascroll); hb = new Gtk.HPaned(); hb.Add(gscroll); hb.Add(vac); hb1 = new Gtk.HPaned(); hb1.Add(hb); hb1.Add(ascroll); vp = new Gtk.VPaned(); vp.Add(hb1); vp.Add(tscroll); Gtk.HPaned hppls = new Gtk.HPaned(); hppls.Add1(vp); hppls.Add2(plsadmin); hbpls = hppls; { int hb_pls, hb_p, hb1_p, vp_p; MySource.getPositions(out hb_pls, out hb_p, out hb1_p, out vp_p); hppls.Position = hb_pls; hb.Position = hb_p; hb1.Position = hb1_p; vp.Position = vp_p; } box = new Gtk.VBox(); box.PackStart(bar, false, true, 0); box.PackStart(hppls); box.ShowAll(); GLib.Timeout.Add((uint)1000, (GLib.TimeoutHandler)GardDividers); GLib.Timeout.Add((uint)timeout, (GLib.TimeoutHandler)PositionDisplay); fill(); }
Gtk.Widget ClockControls () { var vbox = new Gtk.VBox { Spacing = 6 }; this.clock = new AnalogClock (); this.clock.SetSizeRequest (130, 130); vbox.PackStart (this.clock, true, true, 0); var spinners = new Gtk.HBox { Spacing = 6 }; spinners.PackStart (new Gtk.Label ("Hour"), false, false, 0); hourSpin = CreateSpinner (24, 1, null); spinners.PackStart (hourSpin, false, false, 0); spinners.PackStart (new Gtk.Label ("Min"), false, false, 0); minutesSpin = CreateSpinner (60, 10, hourSpin); spinners.PackStart (minutesSpin, false, false, 0); spinners.PackStart (new Gtk.Label ("Sec"), false, false, 0); secondsSpin = CreateSpinner (60, 10, minutesSpin); spinners.PackStart (secondsSpin, false, false, 0); vbox.PackEnd (spinners, false, false, 0); return vbox; }
// Page 3 // Extension Preferences public Gtk.Widget MakeAddinsPane () { Gtk.VBox vbox = new Gtk.VBox (false, 6); vbox.BorderWidth = 6; Gtk.Label l = new Gtk.Label (Catalog.GetString ( "The following add-ins are installed")); l.Xalign = 0; l.Show (); vbox.PackStart (l, false, false, 0); Gtk.HBox hbox = new Gtk.HBox (false, 6); // TreeView of Add-ins Gtk.TreeView tree = new Gtk.TreeView (); addin_tree = new Mono.Addins.Gui.AddinTreeWidget (tree); tree.Show (); Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow (); sw.HscrollbarPolicy = Gtk.PolicyType.Automatic; sw.VscrollbarPolicy = Gtk.PolicyType.Automatic; sw.ShadowType = Gtk.ShadowType.In; sw.Add (tree); sw.Show (); Gtk.LinkButton get_more_link = new Gtk.LinkButton ("http://live.gnome.org/Tomboy/PluginList", Catalog.GetString ("Get More Add-Ins...")); get_more_link.Show (); Gtk.VBox tree_box = new Gtk.VBox (false, 0); tree_box.Add (sw); tree_box.PackEnd (get_more_link, false, false, 5); tree_box.Show (); hbox.PackStart (tree_box, true, true, 0); // Action Buttons (right of TreeView) Gtk.VButtonBox button_box = new Gtk.VButtonBox (); button_box.Spacing = 4; button_box.Layout = Gtk.ButtonBoxStyle.Start; // TODO: In a future version, add in an "Install Add-ins..." button // TODO: In a future version, add in a "Repositories..." button enable_addin_button = new Gtk.Button (Catalog.GetString ("_Enable")); enable_addin_button.Sensitive = false; enable_addin_button.Clicked += OnEnableAddinButton; enable_addin_button.Show (); disable_addin_button = new Gtk.Button (Catalog.GetString ("_Disable")); disable_addin_button.Sensitive = false; disable_addin_button.Clicked += OnDisableAddinButton; disable_addin_button.Show (); addin_prefs_button = new Gtk.Button (Gtk.Stock.Preferences); addin_prefs_button.Sensitive = false; addin_prefs_button.Clicked += OnAddinPrefsButton; addin_prefs_button.Show (); addin_info_button = new Gtk.Button (Gtk.Stock.Info); addin_info_button.Sensitive = false; addin_info_button.Clicked += OnAddinInfoButton; addin_info_button.Show (); button_box.PackStart (enable_addin_button); button_box.PackStart (disable_addin_button); button_box.PackStart (addin_prefs_button); button_box.PackStart (addin_info_button); button_box.Show (); hbox.PackStart (button_box, false, false, 0); hbox.Show (); vbox.PackStart (hbox, true, true, 0); vbox.Show (); tree.Selection.Changed += OnAddinTreeSelectionChanged; LoadAddins (); return vbox; }
void SetImagePosition() { if (Control.Child != null) { Control.Remove(Control.Child); } (label.Parent as Gtk.Container)?.Remove(label); (gtkimage?.Parent as Gtk.Container)?.Remove(gtkimage); Gtk.Widget child = null; var showImage = Image != null; var showLabel = !string.IsNullOrEmpty(label.Text); if (showImage && showLabel) { Gtk.VBox vbox; Gtk.HBox hbox; switch (ImagePosition) { case ButtonImagePosition.Above: child = vbox = new Gtk.VBox(false, 2); vbox.PackStart(gtkimage, true, true, 0); vbox.PackEnd(label, false, true, 0); break; case ButtonImagePosition.Below: child = vbox = new Gtk.VBox(false, 2); vbox.PackStart(label, false, true, 0); vbox.PackEnd(gtkimage, true, true, 0); break; case ButtonImagePosition.Left: child = hbox = new Gtk.HBox(false, 2); hbox.PackStart(gtkimage, false, true, 0); hbox.PackStart(label, true, true, 0); break; case ButtonImagePosition.Right: child = hbox = new Gtk.HBox(false, 2); hbox.PackStart(label, true, true, 0); hbox.PackEnd(gtkimage, false, true, 0); break; case ButtonImagePosition.Overlay: #if GTK2 var table = new Gtk.Table(1, 1, false); child = table; table.Attach(label, 0, 0, 1, 1, Gtk.AttachOptions.Expand, Gtk.AttachOptions.Expand, 0, 0); table.Attach(gtkimage, 0, 0, 1, 1, Gtk.AttachOptions.Expand, Gtk.AttachOptions.Expand, 0, 0); #else var grid = new Gtk.Grid(); child = grid; label.Hexpand = label.Vexpand = true; gtkimage.Hexpand = gtkimage.Vexpand = true; grid.Attach(label, 0, 0, 1, 1); grid.Attach(gtkimage, 0, 0, 1, 1); #endif break; default: throw new NotSupportedException(); } } else if (showLabel) { child = label; } else if (showImage) { child = gtkimage; } if (child != null) { child.Show(); Control.Child = child; } Control.QueueResize(); }
private void ConstructVBoxMain() { Debug.WriteLine("ConstructVBoxMain"); ConstructMenuBarMain(); ConstructToolbarMain(); ConstructFilesNotebookFiles(); ConstructStatusbarMain(); vBoxMain = new Gtk.VBox(false, 0) { Name = "vBoxMain", Visible = true, }; vBoxMain.PackStart(menuBarMain, false, true, 0); vBoxMain.PackStart(toolbarMain, false, true, 0); vBoxMain.PackStart(filesNotebookFiles, true, true, 0); vBoxMain.PackEnd(statusbarMain, false, false, 0); }