public Admin(bool real_server) { LoadProviders(); ui = new Glade.XML(null, "admin.glade", "main_window", null); ui.Autoconnect(this); contextid = statusbar.GetContextId(""); main_window.DeleteEvent += new DeleteEventHandler(OnDeleteEvent); d = new Contributions(); if (real_server) { d.Url = "http://www.go-mono.com/docs/server.asmx"; } html = new HTML(); html.LinkClicked += new LinkClickedHandler(LinkClicked); html.Show(); html.SetSizeRequest(700, 500); container.Add(html); html_review = new HTML(); html_review.LinkClicked += new LinkClickedHandler(ReviewLinkClicked); html_review.Show(); review_container.Add(html_review); }
ComparisonInfo RequestComparisonInfo() { uint cid = statusbar.GetContextId("assemblies"); statusbar.Pop(cid); statusbar.Push(cid, "Choosing Base Assembly"); FileChooserDialog d = new FileChooserDialog("Choose Base Assembly", this, FileChooserAction.Open, Stock.Cancel, ResponseType.Cancel, Stock.Open, ResponseType.Accept); FileFilter filter = new FileFilter(); filter.AddPattern("*.dll"); d.Filter = filter; if ((ResponseType)d.Run() == ResponseType.Cancel) { d.Destroy(); return(null); } d.Hide(); string base_path = d.Filename; statusbar.Pop(cid); statusbar.Push(cid, "Choosing Target Assembly"); d.Title = "Choose Target Assembly"; if ((ResponseType)d.Run() == ResponseType.Cancel) { d.Destroy(); return(null); } string target_path = d.Filename; d.Hide(); d.Destroy(); return(new ComparisonInfo(base_path, target_path)); }
public MainWindow() : base(WindowType.Toplevel) { // Setup GUI WindowPosition = WindowPosition.Center; DefaultSize = new Gdk.Size(600, 300); var provider = new CssProvider(); provider.LoadFromData(".blue-background { background-image: none; background-color: rgb(240, 248, 255); }"); Gtk.StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, 1); _sikInterface = new SiKInterface(); _headerBar = new HeaderBar(); _headerBar.ShowCloseButton = true; _headerBar.Title = "SiK Radio Configurator"; _boardIdentifiers = new BoardIdentifierControls(); _dataTableControls = new DataTableControls(); _sikInterface.SiKConfig.PropertyChanged += _boardIdentifiers.SiKConfig_PropertyChanged; _dataTableControls.CreateBindings(_sikInterface.SiKConfig); _pageLabel = new Label(NOT_CONN_LBL); Titlebar = _headerBar; Destroyed += (sender, e) => Application.Quit(); _notebook = new Notebook(); _pageContainer = new Box(Orientation.Vertical, 1); _notebook.AppendPage(_pageContainer, _pageLabel); _notebook.AppendPage(new Box(Orientation.Vertical, 5), new Label("TBD")); Add(_notebook); CreatePortSelLine(); CreateDataTable(); CreateBoardIdLine(); CreateButtonsLine(); // TODO: Fix Statusbar at the bottom _statusBar = new Statusbar(); _pageContainer.Add(_statusBar); _cxt = _statusBar.GetContextId("Main page"); ShowAll(); }
static void statusbar_pushed(object o, EventArgs args) { string content = null; if (counter < 0) { content = String.Empty; } else { content = String.Format("Push #{0}", counter); } Console.WriteLine("Push: " + counter); context_id = statusbar.GetContextId(content); statusbar.Push(context_id, content); counter++; }
private SharpMusique(string [] args) { int i; string strPath; TreeViewColumn tvc; CellRenderer rendr; string [] strColumns = new string[] { "Title", "Artist", "Album", "Time", "Price" }; string [] strCWidths = new string[] { "260", "190", "180", "70", "70" }; if (Environment.OSVersion.ToString().IndexOf("Unix") != -1) { strHomeDir = Environment.GetEnvironmentVariable("HOME"); strSongDir = Path.Combine(strHomeDir, "Music"); strDataDir = Path.Combine(strHomeDir, ".SharpMusique"); } else { strHomeDir = Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData); strSongDir = Environment.GetFolderPath( Environment.SpecialFolder.MyMusic); strDataDir = Path.Combine(strHomeDir, "SharpMusique"); } Utility.CreateDirectory(strDataDir); strPath = Path.Combine(strDataDir, "songdir"); if (File.Exists(strPath)) { StreamReader sr = new StreamReader(strPath); strSongDir = sr.ReadToEnd().Trim(); sr.Close(); } Utility.CreateDirectory(strSongDir); strPath = Path.Combine(strDataDir, "cwidths"); if (File.Exists(strPath)) { StreamReader sr = new StreamReader(strPath); string [] strTmp = sr.ReadToEnd().Split(','); sr.Close(); if (strTmp.Length == strCWidths.Length) { strCWidths = strTmp; } } Application.Init(); Glade.XML gxml = new Glade.XML(null, "SharpMusique.glade", "MainWindow", null); gxml.Autoconnect(this); MainWindow.Icon = new Gdk.Pixbuf(null, "sharpmusique.png"); songls = new ListStore(GType.String, GType.String, GType.String, GType.String, GType.String, GType.Int); songtv.Model = songls; songtv.HeadersClickable = true; songtv.Selection.Changed += new EventHandler(OnTreeViewSelection); for (i = 0; i < strColumns.Length; i++) { tvc = new TreeViewColumn(); rendr = new CellRendererText(); tvc.Title = strColumns[i]; tvc.PackStart(rendr, true); tvc.AddAttribute(rendr, "text", i); tvc.Sizing = TreeViewColumnSizing.Fixed; tvc.FixedWidth = Convert.ToInt32(strCWidths[i]); tvc.Resizable = true; tvc.SortColumnId = i; songtv.AppendColumn(tvc); } strPath = Path.Combine(strDataDir, "country"); if (File.Exists(strPath)) { StreamReader sr = new StreamReader(strPath); strCountry = sr.ReadToEnd().Trim(); sr.Close(); } SList group = new SList(IntPtr.Zero); Menu cmenu = new Menu(); micountry.Submenu = cmenu; string [] countries = FairStore.Countries.AllKeys; for (i = 0; i < countries.Length; i++) { RadioMenuItem rmi = new RadioMenuItem(group, countries[i]); rmi.Toggled += new EventHandler(OnCountrySelect); rmi.Name = countries[i]; if ((((i + 1) == countries.Length) && (strCountry == null)) || countries[i].Equals(strCountry)) { rmi.Active = true; } group = rmi.Group; cmenu.Append(rmi); rmi.Show(); } mipending.Sensitive = false; mipepsicap.Sensitive = false; migiftcert.Sensitive = false; mipreview.Sensitive = false; mipurchase.Sensitive = false; mipurchasealbum.Sensitive = false; miviewalbum.Sensitive = false; cidStatus = sbar.GetContextId("Status"); cidProgress = sbar.GetContextId("Progress"); sbar.Push(cidStatus, "Not Logged In"); mutex = new Mutex(); Application.Run(); }
private Application(string[] args) { selection = new Selection(); Glade.XML.CustomHandler = GladeCustomWidgetHandler; Glade.XML gxml = new Glade.XML("editor.glade", "MainWindow"); gxml.Autoconnect(this); if (MainWindow == null) { throw new Exception("Couldn't resolve all widgets"); } Tileset.LoadEditorImages = true; // Initialize status bar for PrintStatus() printStatusContextID = sbMain.GetContextId("PrintStatus"); printStatusMessageID = sbMain.Push(printStatusContextID, "Welcome to Tuxjunior-Editor."); MainWindow.DeleteEvent += OnDelete; MainWindow.SetSizeRequest(900, 675); MainWindowTitlePrefix = MainWindow.Title; UpdateTitlebar(); UpdateRecentDocuments(); MainWindow.Icon = EditorStock.WindowIcon; //HACK: not a typo, EditorStock adds icons to the stock only when called 2x or more.. MainWindow.Icon = EditorStock.WindowIcon; MainWindow.ShowAll(); // Tool "Select" is selected by default - call its event handler OnToolSelect(null, null); fileChooser = new FileChooserDialog("Choose a Level", MainWindow, FileChooserAction.Open, new object[] {}); if (Settings.Instance.LastDirectoryName == null) { if (Settings.Instance.TuxjuniorData != null) { Settings.Instance.LastDirectoryName = Settings.Instance.TuxjuniorData + "levels" + System.IO.Path.DirectorySeparatorChar; } else { Settings.Instance.LastDirectoryName = Environment.ExpandEnvironmentVariables("%HOME%"); } } fileChooser.SetCurrentFolder(Settings.Instance.LastDirectoryName); fileChooser.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); fileChooser.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok); fileChooser.DefaultResponse = Gtk.ResponseType.Ok; Gtk.FileFilter filter = new Gtk.FileFilter(); filter.Name = "Tuxjunior Levels and Worldmaps"; filter.AddPattern("*.stl"); filter.AddPattern("*.stwm"); fileChooser.AddFilter(filter); Gtk.FileFilter levelfilter = new Gtk.FileFilter(); levelfilter.Name = "Tuxjunior Levels"; levelfilter.AddPattern("*.stl"); fileChooser.AddFilter(levelfilter); Gtk.FileFilter worldmapfilter = new Gtk.FileFilter(); worldmapfilter.Name = "Tuxjunior Worldmaps"; worldmapfilter.AddPattern("*.stwm"); fileChooser.AddFilter(worldmapfilter); Gtk.FileFilter brushfilter = new Gtk.FileFilter(); brushfilter.Name = "Tuxjunior-Editor Brushes"; brushfilter.AddPattern("*.csv"); fileChooser.AddFilter(brushfilter); Gtk.FileFilter all = new Gtk.FileFilter(); all.Name = "All Files"; all.AddPattern("*"); fileChooser.AddFilter(all); if (Settings.Instance.TuxjuniorData != null) { try { fileChooser.AddShortcutFolder(Settings.Instance.TuxjuniorData + System.IO.Path.DirectorySeparatorChar + "levels"); } catch (Exception e) { LogManager.Log(LogLevel.Warning, "Couldn't add tuxjunior level directory to File Chooser: " + e.Message); } } if (args.Length > 0) { Load(args[0]); } UndoManager.OnAddCommand += OnUndoManager; UndoManager.OnRedo += OnUndoManager; UndoManager.OnUndo += OnUndoManager; PrintStatus("Welcome to Tuxjunior-Editor."); }