public Splash() { Decorated = false; ShowInTaskbar = false; box = new VBox { Margin = -2, }; imageView = new ImageView { Image = Image.FromResource (Resources.Splash), }; progressBar = new ProgressBar { Indeterminate = true, TooltipText = Catalog.GetString ("Loading..."), }; info = new Label { Text = Catalog.GetString ("Loading..."), TextAlignment = Alignment.Center, }; box.PackStart (imageView); box.PackEnd (progressBar); box.PackEnd (info); Content = box; InitialLocation = WindowLocation.CenterScreen; }
/// <summary> /// Constructor /// </summary> /// <param name="parent">Parent Window</param> /// <param name="exception">Exception</param> public iFolderExceptionDialog(Gtk.Window parent, System.Exception exception) : base() { this.Title = Util.GS("iFolder Error"); this.HasSeparator = true; // this.BorderWidth = 10; this.Resizable = false; this.Modal = true; this.ex = exception; if (parent != null) { this.TransientFor = parent; } HBox h = new HBox(); h.BorderWidth = 10; h.Spacing = 10; Image i = new Image(); i.SetFromStock(Gtk.Stock.DialogError, IconSize.Dialog); i.SetAlignment(0.5F, 0); h.PackStart(i, false, false, 0); VBox v = new VBox(); v.BorderWidth = 10; v.Spacing = 10; Label l = new Label("<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(exception.Message) + "</span>"); l.LineWrap = true; l.UseMarkup = true; l.UseUnderline = false; l.Selectable = true; l.Xalign = 0; l.Yalign = 0; v.PackStart(l); dButton = new Button(Util.GS("Show Details")); dButton.Clicked += new EventHandler(ButtonPressed); HBox bhbox = new HBox(); bhbox.PackStart(dButton, false, false, 0); v.PackEnd(bhbox, false, false, 0); details = new Label(Util.GS("Click \"Show Details\" below to get the full message returned with this error")); details.LineWrap = true; details.Selectable = true; details.Xalign = 0; details.Yalign = 0; v.PackEnd(details); h.PackEnd(v); h.ShowAll(); this.VBox.Add(h); this.AddButton(Stock.Close, ResponseType.Ok); }
public SplashScreenForm() : base(Gtk.WindowType.Toplevel) { AppPaintable = true; this.Decorated = false; this.WindowPosition = WindowPosition.Center; this.TypeHint = Gdk.WindowTypeHint.Splashscreen; try { bitmap = new Gdk.Pixbuf(Assembly.GetCallingAssembly(), "SplashScreen.png"); } catch (Exception e) { LoggingService.LogError("Can't load splash screen pixbuf 'SplashScreen.png'.", e); } progress = new ProgressBar(); progress.Fraction = 0.00; progress.HeightRequest = 6; vbox = new VBox(); vbox.BorderWidth = 12; label = new Gtk.Label(); label.UseMarkup = true; label.Xalign = 0; vbox.PackEnd(progress, false, true, 0); vbox.PackEnd(label, false, true, 3); this.Add(vbox); if (bitmap != null) { this.Resize(bitmap.Width, bitmap.Height); } }
public Splash() { Decorated = false; ShowInTaskbar = false; box = new VBox { Margin = -2, }; imageView = new ImageView { Image = Image.FromResource(Resources.Splash), }; progressBar = new ProgressBar { Indeterminate = true, TooltipText = Application.TranslationCatalog.GetString("Loading..."), }; info = new Label { Text = Application.TranslationCatalog.GetString("Loading..."), TextAlignment = Alignment.Center, }; box.PackStart(imageView); box.PackEnd(progressBar); box.PackEnd(info); Content = box; InitialLocation = WindowLocation.CenterScreen; }
//this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar. public SplashScreenForm() : base(Gtk.WindowType.Popup) { AppPaintable = true; this.Decorated = false; this.WindowPosition = WindowPosition.Center; this.TypeHint = Gdk.WindowTypeHint.Splashscreen; this.showVersionInfo = BrandingService.GetBool("SplashScreen", "ShowVersionInfo") ?? true; try { using (var stream = BrandingService.GetStream("SplashScreen.png", true)) bitmap = new Gdk.Pixbuf(stream); } catch (Exception e) { LoggingService.LogError("Can't load splash screen pixbuf 'SplashScreen.png'.", e); } progress = new ProgressBar(); progress.Fraction = 0.00; progress.HeightRequest = 6; vbox = new VBox(); vbox.BorderWidth = 12; label = new Gtk.Label(); label.UseMarkup = true; label.Xalign = 0; vbox.PackEnd(progress, false, true, 0); vbox.PackEnd(label, false, true, 3); this.Add(vbox); if (bitmap != null) { this.Resize(bitmap.Width, bitmap.Height); } }
private SplashScreen(Assembly resourceAssembly) : base(WindowType.Popup) { AppPaintable = true; Decorated = false; WindowPosition = WindowPosition.Center; TypeHint = Gdk.WindowTypeHint.Splashscreen; bitmap = new Gdk.Pixbuf(resourceAssembly, string.Format("{0}.SplashScreen.png", resourceAssembly.GetName().Name)); progress = new ProgressBar { Fraction = 0.00, HeightRequest = 6, WidthRequest = 400 }; HBox hbox = new HBox(); hbox.PackStart(progress, false, true, 0); vbox = new VBox { BorderWidth = 12 }; label = new Label { Xalign = 0 }; vbox.PackEnd(hbox, false, true, 0); vbox.PackEnd(label, false, true, 3); Add(vbox); Resize(bitmap.Width, bitmap.Height); }
public DemoApplicationWindow() : base("Application Window") { SetDefaultSize(200, 200); vbox = new VBox(false, 0); Add(vbox); AddActions(); statusbar = new Statusbar(); UpdateStatus(); vbox.PackEnd(statusbar, false, false, 0); ScrolledWindow sw = new ScrolledWindow(); sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); sw.ShadowType = ShadowType.In; vbox.PackEnd(sw, true, true, 0); TextView textview = new TextView(); textview.Buffer.MarkSet += new MarkSetHandler(MarkSet); sw.Add(textview); textview.GrabFocus(); ShowAll(); }
public TopLevelDialog( ) { vbox = new VBox(); separator = new HSeparator(); buttonBox = new HButtonBox(); vbox.PackEnd(buttonBox, false, false, 0); vbox.PackEnd(separator, false, false, 0); vbox.ShowAll(); Add(vbox); }
private void Construct(WindowPrototype prot) { string errorMessage = null; try { webBrowser = new WebView(); } catch (Exception) { errorMessage = "Failed to create a WebKit.WebView widget.\nMake sure that libwebkitgtk-1.0 is installed."; } //todo: remove windowHandle creation from here WindowHandle handle = new WindowHandle(this, this.webBrowser); this.Destroyed += (o, args) => { prot.OnClose(handle); }; VBox vbox = new VBox(false, 0); this.Add(vbox); if (prot.Menu != null && prot.Menu.Any()) { MenuBar menuBar = CreateMenu(handle, prot.Menu); vbox.PackStart(menuBar, false, false, 0); } if (webBrowser == null) { Label errorLabel = new Label(errorMessage); vbox.PackEnd(errorLabel, true, true, 0); } else { vbox.PackEnd(webBrowser, true, true, 0); webBrowser.TitleChanged += (o, args) => { string title = webBrowser.Title; Application.Invoke(delegate { this.Title = title; }); }; webBrowser.LoadUri(prot.Url); } //todo: bug, window cannot be resized to smaller size (seems related to https://bugs.webkit.org/show_bug.cgi?id=17154) Resize(prot.Width, prot.Height); vbox.ShowAll(); }
public ClockThemeSelector(ClockDockItem dockItem) { DockItem = dockItem; SkipTaskbarHint = true; TypeHint = Gdk.WindowTypeHint.Dialog; WindowPosition = Gtk.WindowPosition.Center; KeepAbove = true; Stick(); Title = Catalog.GetString("Themes"); IconName = Gtk.Stock.Preferences; AddButton(Stock.Close, ResponseType.Close); labelTreeView.Model = labelTreeStore; labelTreeView.HeadersVisible = false; labelTreeView.Selection.Changed += OnLabelSelectionChanged; labelTreeView.AppendColumn(Catalog.GetString("Theme"), new CellRendererText(), "text", 0); ScrolledWindow win = new ScrolledWindow(); win.Add(labelTreeView); win.SetSizeRequest(200, 300); win.Show(); VBox.PackEnd(win); VBox.ShowAll(); UpdateThemeList(); }
private void Build() { _sw.ShadowType = ShadowType.EtchedIn; _sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); _vBox.BorderWidth = 10; // tree columns var i = 0; foreach (var x in Enum.GetNames(typeof(Columns))) { _tree.AppendColumn(x, new CellRendererText(), "text", i); i++; } Add(_vBox); _vBox.PackStart(_label, false, false, 10); _vBox.Add(_sw); _sw.Add(_tree); _tree.RowActivated += OnRowActivated; _buttons.Add(_add); _add.Clicked += OnAddAccount; _buttons.Add(_edit); _edit.Clicked += OnEditClick; _buttons.Add(_rem); _rem.Clicked += OnRemoveClick; _bAlign.Add(_buttons); _vBox.PackEnd(_bAlign, false, false, 0); }
public ListWindow(Gtk.WindowType type) : base(type) { vbox = new VBox(); list = new ListWidget(this); list.SelectionChanged += new EventHandler(OnSelectionChanged); list.ScrollEvent += new ScrollEventHandler(OnScrolled); scrollbar = new MonoDevelop.Components.CompactScrolledWindow(); scrollbar.Name = "CompletionScrolledWindow"; // use a different gtkrc style for GtkScrollBar scrollbar.Child = list; list.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) { if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress) { DoubleClick(); } }; vbox.PackEnd(scrollbar, true, true, 0); var colorBox = new EventBox(); colorBox.Add(vbox); ContentBox.Add(colorBox); this.AutoSelect = true; this.TypeHint = WindowTypeHint.Menu; Theme.CornerRadius = 0; Theme.Padding = 0; UpdateStyle(); Gui.Styles.Changed += HandleThemeChanged; IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged; }
protected void MakeCheckList() { VBox boc = new VBox(true, 5); foreach (string st in allLabs) { CheckButton chk = new CheckButton(st); buttons.Add(chk); if (someLabs.Contains(st)) { chk.Active = true; } else { chk.Active = false; } boc.PackEnd(chk, true, false, 5); } labWindow.AddWithViewport(boc); boc.Show(); foreach (CheckButton buts in buttons) { buts.Show(); } }
public Button AddAction(string stock, ResponseType resp) { Button button = new Button(stock); button.CanDefault = true; button.Show(); if (resp == ResponseType.Help) { d_actionArea.PackEnd(button, false, false, 0); } else { d_actionArea.PackStart(button, false, false, 0); } button.Data["MessageAreaResponse"] = resp; button.Clicked += delegate(object source, EventArgs args) { EmitResponse(resp); }; return(button); }
void Show() { zip = new Zip(File); Application.Init(); // Main window window = new Window("munxap: " + File); window.Resize(600, 600); window.DeleteEvent += delegate(object obj, DeleteEventArgs args) { Close(); }; // Main vbox main = new VBox(false, 10); window.Add(main); // label with the filename of the xap file on top file_label = new Label(File); main.PackStart(file_label, false, true, 0); // the middle consists of a hbox, leftmost column a list of files in the zip file xap = new HBox(false, 10); main.PackStart(xap, true, true, 0); left = new VBox(false, 10); xap.PackStart(left, true, true, 0); // a list of files in the zip file xap_file_store = new ListStore(typeof(String), typeof(String), typeof(ZipContent)); xap_file_view = new TreeView(); xap_file_view.Model = xap_file_store; xap_file_view.HeadersVisible = true; xap_file_view.AppendColumn("Name", new CellRendererText(), "text", 0); xap_file_view.AppendColumn("Type", new CellRendererText(), "text", 1); xap_file_view.CursorChanged += HandleCursorChanged; xap_file_scrollable = new ScrolledWindow(); xap_file_scrollable.Add(xap_file_view); left.PackStart(xap_file_scrollable, true, true, 0); // close button at the bottom close_button = new Button("Close"); close_button.Clicked += delegate(object obj, EventArgs args) { Close(); }; main.PackEnd(close_button, false, true, 0); // Load zip contents foreach (ZipContent f in zip.Files) { xap_file_store.AppendValues(f.Filename, f.Type, f); } window.ShowAll(); Application.Run(); }
/// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary> public SummaryView(ViewBase owner) : base(owner) { captureRules = CreateCaptureRules(); simulationFilter = CreateSimulationFilter(); Widget jumpToLogContainer = CreateJumpToLogContainer(); messageFilters = CreateFilteringWidgets(); // messageSorting = CreateSortingWidgets(); mainControl = new VBox(); mainWidget = mainControl; mainControl.PackStart(captureRules, false, false, 0); mainControl.PackStart(messageFilters, false, false, 0); // mainControl.PackStart(messageSorting, false, false, 0); mainControl.PackStart(simulationFilter, false, false, 0); mainControl.PackStart(jumpToLogContainer, false, false, 0); SummaryDisplay = new MarkdownView(this); ScrolledWindow scroller = new ScrolledWindow(); scroller.Add(((ViewBase)SummaryDisplay).MainWidget); mainControl.PackEnd(scroller, true, true, 0); mainWidget.Destroyed += MainWidgetDestroyed; mainWidget.ShowAll(); }
public LogAgentPanelWidget() { BinContainer.Attach(this); var reportingLabel = GettextCatalog.GetString("Report errors and usage information to help {0} improve my experience.", BrandingService.SuiteName); var value = LoggingService.ReportUsage; chkUsage = new CheckButton(reportingLabel); if (value.HasValue) { chkUsage.Active = value.Value; } chkUsage.Toggled += (sender, e) => reportUsage = chkUsage.Active; container = new Gtk.VBox(); container.PackStart(chkUsage, false, false, 0); var privacyStatement = BrandingService.PrivacyStatement; if (!string.IsNullOrEmpty(privacyStatement)) { var privacyLabel = new Xwt.Label { Markup = privacyStatement, Wrap = Xwt.WrapMode.Word }; container.Add(new HBox()); container.PackEnd(privacyLabel.ToGtkWidget(), false, false, 30); } Add(container); ShowAll(); }
private void InitComponent() { this.chart = new Chart(); #if GTK this.cbxSelector = ComboBox.NewText(); this.cbxSelector.Changed += OnSelectorValueChanged; InitChartCommon(); VBox vb = new VBox(); vb.PackStart(this.cbxSelector, false, true, 0); vb.PackEnd(this.chart, true, true, 0); Add(vb); ShowAll(); #else this.cbxSelector = new ComboBox(); this.SuspendLayout(); this.cbxSelector.Dock = DockStyle.Top; this.cbxSelector.DropDownStyle = ComboBoxStyle.DropDownList; this.cbxSelector.FormattingEnabled = true; this.cbxSelector.TabIndex = 1; this.cbxSelector.SelectedIndexChanged += new EventHandler(OnSelectorValueChanged); this.chart.Dock = DockStyle.Fill; this.chart.AutoScroll = true; this.chart.TabIndex = 0; InitChartCommon(); this.AutoScaleMode = AutoScaleMode.Font; this.Controls.Add(this.chart); this.Controls.Add(this.cbxSelector); this.ResumeLayout(false); #endif }
private static void Setup(Window wnd, string languageID) { VBox box = new VBox(); ScrolledWindow scrolled = new ScrolledWindow(); SourceView view = new SourceView(); view.ShowLineNumber = true; view.HighlightSyntax = true; view.HighlightCurrentLine = true; view.AutoIndent = true; scrolled.Add(view); LanguageManager languageManager = new LanguageManager(); var s = languageManager.GetSearchPath(); s.Add(Environment.CurrentDirectory + "/language-specs"); languageManager.SetSearchPath(s.ToArray()); view.Language = languageManager.GetGuessLanguage(languageID, null); StyleSchemeManager styleSchemeManager = new StyleSchemeManager(); var ss = styleSchemeManager.GetSearchPath(); ss.Add(Environment.CurrentDirectory + "/styles"); styleSchemeManager.SetSearchPath(ss.ToArray()); view.StyleScheme = styleSchemeManager.GetScheme("oblivion"); box.PackEnd(scrolled, true, true, 0); wnd.Add(box); }
private OptionsDialog() { Title = "Options"; activeDialog = this; activeDialog.Closed += HideDialog; configurationData = ConfigurationData.getInstance(); this.Tags = configurationData.Tags; this.Content = VBox; VBox.PackStart(new Label("Tags:")); UpdateTagList(); VBox.PackStart(TagList); // AddTag HBox addTagBox = new HBox(); addTagBox.PackStart(new Label("New Tag:")); addTagBox.PackStart(NewTagEntry); NewTagEntry.WidthRequest = 300; VBox.PackStart(addTagBox); Button addButton = new Button("Add"); addButton.Clicked += AddTag; addTagBox.PackEnd(addButton); // Buttons Button saveButton = new Button("Save"); saveButton.Clicked += SaveAndCloseDialog; VBox.PackEnd(saveButton); }
/// <summary>Crea los elementos de la ventana.</summary> private void CrearComponentes() { Gtk.VBox vbox = new VBox(false, 2); Gtk.VBox menubox = new VBox(false, 0); // Barra de menú. MenuBar mb = CrearMenuBar(); menubox.PackStart(mb, false, false, 0); // Barra de herramientas Gtk.Toolbar toolbar = CrearToolBar(); menubox.PackStart(toolbar, false, false, 0); vbox.PackStart(menubox, false, false, 0); notebook = CrearNotebook(); vbox.PackStart(notebook, true, true, 0); sb = new Statusbar(); vbox.PackEnd(sb, false, false, 0); Add(vbox); }
void AddHelpPane() { VBox desc = new VBox(false, 0); descTitleLabel = new Label(); descTitleLabel.SetAlignment(0, 0); descTitleLabel.SetPadding(5, 2); descTitleLabel.UseMarkup = true; desc.PackStart(descTitleLabel, false, false, 0); ScrolledWindow textScroll = new ScrolledWindow(); textScroll.HscrollbarPolicy = PolicyType.Never; textScroll.VscrollbarPolicy = PolicyType.Automatic; desc.PackEnd(textScroll, true, true, 0); //TODO: Use label, but wrapping seems dodgy. descTextView = new TextView(); descTextView.WrapMode = WrapMode.Word; descTextView.WidthRequest = 1; descTextView.HeightRequest = 70; descTextView.Editable = false; descTextView.LeftMargin = 5; descTextView.RightMargin = 5; descTextView.ModifyFont(IdeServices.FontService.SansFont.CopyModified(Ide.Gui.Styles.FontScale11)); textScroll.Add(descTextView); descFrame = desc; vpaned.Pack2(descFrame, false, true); descFrame.ShowAll(); UpdateHelp(); }
void BuildGui() { ContentName = "SkiaSharp Fiddle"; _headerBox.PackStart(_widthLabel, false, false, 0); _headerBox.PackStart(_widthEntry, false, false, 0); _headerBox.PackStart(_heightLabel, false, false, 0); _headerBox.PackStart(_heightEntry, false, false, 0); _codeBox.PackStart(_codeLabel, false, false, 0); _codeBox.PackEnd(_textEditor, true, true, 0); _codeFrame.Add(_codeBox); _outputBox.PackStart(_outputLabel, false, false, 0); _outputBox.PackEnd(_skWidget, true, true, 0); _outputFrame.Add(_outputBox); _contentBox.Pack1(_codeFrame, true, true); _contentBox.Pack2(_outputFrame, false, false); _messagesBox.PackStart(_messagesLabel, false, false, 0); _messagesBox.PackEnd(_messagesView, true, true, 0); _messagesFrame.Add(_messagesBox); _mainBox.PackStart(_headerBox, false, false, 0); _mainBox.PackStart(_contentBox, true, true, 0); _mainBox.PackStart(_messagesFrame, true, true, 0); _mainBox.ShowAll(); }
public virtual void Factor(ConceptUsecase useCase) { if (AboutWindow == null) { AboutWindow = new Vindow(); } var splitViewBackend = useCase.SplitView.Backend.ToXwt(); StatusLabel = new Label { HeightRequest = 20, Text = "starting...", TextColor = Colors.Black, TextAlignment = Alignment.Start, }; var box = new VBox { Spacing = 2 }; box.PackStart(splitViewBackend, true); box.PackEnd(StatusLabel); (MainWindow.Backend as Window).Content = box; OnShow += () => (splitViewBackend as Paned).PositionFraction = 0.50;// WindowSize.Width / 2; }
private void InitializeComponent(string defaultText) { TextEntry = new Entry(); TextEntry.Text = defaultText; VBox.PackEnd(TextEntry, true, true, 0); ShowAll(); }
public LauncherWindow() { this.Title = "TrueCraft Launcher"; this.Width = 1200; this.Height = 576; this.User = new TrueCraftUser(); MainContainer = new HBox(); WebScrollView = new ScrollView(); WebView = new WebView("http://truecraft.io/updates"); LoginView = new LoginView(this); OptionView = new OptionView(this); MultiplayerView = new MultiplayerView(this); SingleplayerView = new SingleplayerView(this); InteractionBox = new VBox(); using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.svg")) TrueCraftLogoImage = new ImageView(Image.FromStream(stream)); WebScrollView.Content = WebView; MainContainer.PackStart(WebScrollView, true); InteractionBox.PackStart(TrueCraftLogoImage); InteractionBox.PackEnd(LoginView); MainContainer.PackEnd(InteractionBox); this.Content = MainContainer; }
/// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary> public SummaryView(ViewBase owner) : base(owner) { topBox = new HBox(); SummaryCheckBox = new CheckBoxView(this); SummaryCheckBox.TextOfLabel = "Capture summary?"; WarningCheckBox = new CheckBoxView(this); WarningCheckBox.TextOfLabel = "Capture warning messages?"; ErrorCheckBox = new CheckBoxView(this); ErrorCheckBox.TextOfLabel = "Capture error messages?"; topBox.PackStart(SummaryCheckBox.MainWidget, false, false, 10); topBox.PackStart(WarningCheckBox.MainWidget, false, false, 10); topBox.PackStart(ErrorCheckBox.MainWidget, false, false, 10); middleBox = new HBox(); SimulationDropDown = new DropDownView(this); middleBox.PackStart(new Label("Simulation:"), false, false, 10); middleBox.PackStart(SimulationDropDown.MainWidget, true, true, 10); mainControl = new VBox(); mainWidget = mainControl; mainControl.PackStart(topBox, false, false, 0); mainControl.PackStart(middleBox, false, false, 0); HtmlView = new HTMLView(this); mainControl.PackEnd(HtmlView.MainWidget, true, true, 0); mainWidget.Destroyed += MainWidgetDestroyed; }
public GtkMain() : base("Toves") { MenuBar menubar = GtkMenu.Create(this, windowModel); GtkToolbar toolbar = new GtkToolbar(this, windowModel.ToolbarModel); GtkToolbox toolbox = new GtkToolbox(windowModel.ToolboxModel); canvas = new GtkCanvas.GtkCanvas(); canvas.CanvasModel = windowModel.LayoutCanvas; HPaned hbox = new HPaned(); hbox.Add1(toolbox); hbox.Add2(canvas); VBox vbox = new VBox(false, 0); vbox.PackStart(menubar, false, false, 0); vbox.PackStart(toolbar, false, false, 0); vbox.PackEnd(hbox, true, true, 0); this.Add(vbox); this.SetDefaultSize(980, 600); this.ShowAll(); canvas.GrabFocus(); }
public LoginWindow(GTKClientCtrl ctrl) : base("Chat XYZ Login") { this.ctrl = ctrl; SetDefaultSize(300, 300); SetPosition(WindowPosition.Center); DeleteEvent += CloseWindow; VBox vbox = new VBox(false, 2); Table table = new Table(4, 4, false); table.Attach(new Label("Chat XYZ"), 0, 4, 0, 1); table.Attach(new Label("Username"), 0, 2, 1, 2); table.Attach(username = new Entry(), 2, 4, 1, 2); table.Attach(new Label("Password"), 0, 2, 2, 3); table.Attach(password = new Entry(), 2, 4, 2, 3); password.Visibility = false; table.Attach(cancel = new Button("Clear"), 0, 2, 3, 4); table.Attach(login = new Button("Login"), 2, 4, 3, 4); login.Clicked += loginButtonPressed; cancel.Clicked += cancelButtonPressed; vbox.PackEnd(table, true, true, 0); Add(vbox); }
public LauncherWindow() { this.Title = "TrueCraft Launcher"; this.Width = 1200; this.Height = 576; this.User = new TrueCraftUser(); MainContainer = new HBox(); WebScrollView = new ScrollView(); WebView = new WebView("https://truecraft.io/updates"); LoginView = new LoginView(this); OptionView = new OptionView(this); MultiplayerView = new MultiplayerView(this); SingleplayerView = new SingleplayerView(this); InteractionBox = new VBox(); using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.png")) TrueCraftLogoImage = new ImageView(Image.FromStream(stream).WithBoxSize(350, 75)); WebScrollView.Content = WebView; MainContainer.PackStart(WebScrollView, true); InteractionBox.PackStart(TrueCraftLogoImage); InteractionBox.PackEnd(LoginView); MainContainer.PackEnd(InteractionBox); this.Content = MainContainer; }
public void Clear() { if (contentBox != null) { contentBox.Destroy(); } noContentLabel = new Label(); noContentLabel.Text = noContentMessage; noContentLabel.Xalign = 0F; noContentLabel.Justify = Justification.Left; noContentLabel.SetPadding(6, 6); addButton = new Button(); addButton.Label = addMessage; // addButton.Relief = ReliefStyle.None; addButton.Clicked += delegate { OnCreateNew(EventArgs.Empty); }; contentBox = new VBox(); contentBox.PackStart(this.noContentLabel, true, true, 6); var hbox = new HBox(); hbox.PackStart(addButton, false, false, 0); contentBox.PackEnd(hbox, false, false, 0); PackStart(contentBox, true, true, 6); ShowAll(); }
/// <summary>A scroll bars to the sheet widget.</summary> private void Initialise() { //// Remove existing child. //if (sheet.Children.Length > 0) // sheet.Remove(sheet.Children[0]); var horizontalAdjustment = new Adjustment(1, 0, 100, 1, 1, 1); horizontalScrollbar = new HScrollbar(horizontalAdjustment); horizontalScrollbar.Value = 0; horizontalScrollbar.ValueChanged += OnHorizontalScrollbarChanged; //horizontalScrollbar.SetSizeRequest(sheet.Width, ScrollBarWidth); var verticalAdjustment = new Adjustment(1, 0, 100, 1, 1, 1); verticalScrollbar = new VScrollbar(verticalAdjustment); verticalScrollbar.Value = 0; verticalScrollbar.ValueChanged += OnVerticalScrollbarChanged; //verticalScrollbar.SetSizeRequest(ScrollBarWidth, sheet.Height); var hbox = new HBox(); var vbox = new VBox(); hbox.PackEnd(verticalScrollbar, false, true, 0); hbox.PackStart(sheet, true, true, 0); vbox.PackEnd(horizontalScrollbar, false, true, 0); vbox.PackStart(hbox, true, true, 0); MainWidget = vbox; }
public override void InitializeBackend(object frontend, ApplicationContext context) { base.InitializeBackend (frontend, context); mainBox = new VBox () { Spacing = 0, Margin = 0 }; buttonBox = new HBox () { Spacing = 0, Margin = 0 }; mainBox.PackEnd (buttonBox); base.SetChild ((IWidgetBackend) Toolkit.GetBackend (mainBox)); }
public LicenseAcceptanceDialog (LicenseAcceptanceViewModel viewModel) { Height = 350; Resizable = false; Padding = 0; Title = GettextCatalog.GetString ("License Acceptance"); this.viewModel = viewModel; this.imageLoader = new ImageLoader (); this.imageLoader.Loaded += HandleImageLoaded; var titleLabel = new Label (); titleLabel.Text = GettextCatalog.GetPluralString ( "The following package requires that you accept its license terms before installing:", "The following packages require that you accept their license terms before installing:", viewModel.HasMultiplePackages ? 2 : 1); var descriptionLabel = new Label (); descriptionLabel.Wrap = WrapMode.Word; descriptionLabel.Markup = GettextCatalog.GetString ("By clicking <b>Accept</b> you agree to the license terms for the packages listed above.\n" + "If you do not agree to the license terms click <b>Decline</b>."); packagesList = new VBox (); packagesList.Spacing = 0; scroll = new ScrollView (packagesList); scroll.HorizontalScrollPolicy = ScrollPolicy.Never; scroll.VerticalScrollPolicy = ScrollPolicy.Automatic; scroll.BorderVisible = false; scroll.BackgroundColor = Ide.Gui.Styles.BackgroundColor; var container = new VBox (); container.MarginTop = container.MarginLeft = container.MarginRight = 15; container.PackStart (titleLabel); container.PackStart (scroll, true, true); container.PackEnd (descriptionLabel); Content = container; var declineButton = new DialogButton (GettextCatalog.GetString ("Decline"), Command.Cancel); var acceptButton = new DialogButton (GettextCatalog.GetString ("Accept"), Command.Ok); Buttons.Add (declineButton); Buttons.Add (acceptButton); AddPackages (); }
public Images() { ImageView img = new ImageView (); img.Image = Image.FromResource (GetType (), "cow.jpg"); PackStart (img); var stockIcons = typeof (StockIcons).GetFields (BindingFlags.Public | BindingFlags.Static); var perRow = 6; HBox row = null; for (var i = 0; i < stockIcons.Length; i++) { if (stockIcons [i].FieldType != typeof (string)) continue; if ((i % perRow) == 0) { if (row != null) PackStart (row); row = new HBox (); } var vbox = new VBox (); var stockId = (string)stockIcons [i].GetValue (null); var imageView = new ImageView (); var label = new Label (stockId); try { var icon = Image.FromIcon (stockId, IconSize.Medium); if (icon != null) imageView.Image = icon; } catch { } vbox.PackStart (imageView); vbox.PackEnd (label); row.PackStart (vbox); } if (row != null) PackStart (row); }
public HelpWindow() { VBox mainContent = new VBox (); _messageDisplay = new RichTextView { WidthRequest = 500 }; ScrollView scroller = new ScrollView (_messageDisplay) { VerticalScrollPolicy = ScrollPolicy.Automatic, HorizontalScrollPolicy = ScrollPolicy.Never, HeightRequest = 500 }; mainContent.PackStart (scroller); HBox buttonRow = new HBox (); Button ok = new Button { Label = I18N._ ("Close"), Image = Icons.Ok }; ok.Clicked += (sender, args) => Close (); buttonRow.PackEnd (ok); mainContent.PackEnd (buttonRow); Content = mainContent; Width = 400; }
void BuildContent(string license) { double textWidth = 480; double textHeight = 480; VBox mainContent = new VBox (); RichTextView textView = new RichTextView (); textView.LoadText (license, TextFormat.Markdown); textView.MinWidth = textWidth; ScrollView scroller = new ScrollView (textView); scroller.HorizontalScrollPolicy = ScrollPolicy.Never; scroller.VerticalScrollPolicy = ScrollPolicy.Automatic; scroller.MinHeight = textHeight; scroller.MinWidth = textWidth + textView.MarginLeft + textView.MarginRight + 20; mainContent.PackStart (scroller); HBox buttonRow = new HBox (); Button ok = new Button { Label = I18N._ ("Close"), Image = Icons.Ok }; ok.Clicked += (sender, args) => Close (); buttonRow.PackEnd (ok); mainContent.PackEnd (buttonRow); Content = mainContent; }
void SetLayout () { var vbox = new VBox (); vbox.MinWidth = 450; vbox.PackStart (new Label (GettextCatalog.GetString ("Breakpoint Action")) { Font = vbox.Font.WithWeight (FontWeight.Bold) }); var breakpointActionGroup = new VBox { MarginLeft = 12 }; breakpointActionGroup.PackStart (breakpointActionPause); breakpointActionGroup.PackStart (breakpointActionPrint); var printExpressionGroup = new HBox { MarginLeft = 18 }; printExpressionGroup.PackStart (entryPrintExpression, true); printExpressionGroup.PackStart (warningPrintExpression); breakpointActionGroup.PackStart (printExpressionGroup); breakpointActionGroup.PackEnd (printMessageTip); vbox.PackStart (breakpointActionGroup); vbox.PackStart (new Label (GettextCatalog.GetString ("When to Take Action")) { Font = vbox.Font.WithWeight (FontWeight.Bold) }); var whenToTakeActionRadioGroup = new VBox { MarginLeft = 12 }; // Function group { whenToTakeActionRadioGroup.PackStart (stopOnFunction); hboxFunction.PackStart (entryFunctionName, true); hboxFunction.PackEnd (warningFunction); whenToTakeActionRadioGroup.PackStart (hboxFunction); } // Exception group { whenToTakeActionRadioGroup.PackStart (stopOnException); hboxException = new HBox (); hboxException.PackStart (entryExceptionType, true); hboxException.PackEnd (warningException); vboxException.PackStart (hboxException); vboxException.PackStart (checkIncludeSubclass); whenToTakeActionRadioGroup.PackStart (vboxException); } // Location group { whenToTakeActionRadioGroup.PackStart (stopOnLocation); hboxLocation.PackStart (entryLocationFile, true); hboxLocation.PackStart (warningLocation); vboxLocation.PackEnd (hboxLocation); whenToTakeActionRadioGroup.PackStart (vboxLocation); } vbox.PackStart (whenToTakeActionRadioGroup); vbox.PackStart (new Label (GettextCatalog.GetString ("Advanced Conditions")) { Font = vbox.Font.WithWeight (FontWeight.Bold) }); var vboxAdvancedConditions = new VBox { MarginLeft = 30 }; var hboxHitCount = new HBox (); hboxHitCount.PackStart (ignoreHitType, true); hboxHitCount.PackStart (ignoreHitCount); vboxAdvancedConditions.PackStart (hboxHitCount); vboxAdvancedConditions.PackStart (conditionalHitType); hboxCondition = new HBox (); hboxCondition.PackStart (entryConditionalExpression, true); hboxCondition.PackStart (warningCondition); vboxAdvancedConditions.PackStart (hboxCondition); vboxAdvancedConditions.PackEnd (conditionalExpressionTip); vbox.PackStart (vboxAdvancedConditions); Buttons.Add (new DialogButton (Command.Cancel)); Buttons.Add (buttonOk); Content = vbox; if (IdeApp.Workbench != null) { Gtk.Widget parent = ((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget (vbox)).Parent; while (parent != null && !(parent is Gtk.Window)) parent = parent.Parent; if (parent is Gtk.Window) ((Gtk.Window)parent).TransientFor = IdeApp.Workbench.RootWindow; } OnUpdateControls (null, null); }
/// <summary> /// Initializes the user inferface /// </summary> private void InitializeUI() { // restore last window size and location Location = new Point( Settings.Default.WindowLocationX, Settings.Default.WindowLocationY ); Size = new Size( Settings.Default.WindowSizeWidth, Settings.Default.WindowSizeHeight ); // set window preference Title = "BAIMP"; // file menu var fileMenu = new MenuItem("_File"); fileMenu.SubMenu = new Menu(); MenuItem menuNew = new MenuItem("_New..."); menuNew.Clicked += (object sender, EventArgs e) => project.NewDialog(); fileMenu.SubMenu.Items.Add(menuNew); MenuItem menuOpen = new MenuItem("_Open..."); menuOpen.Clicked += delegate { if (!project.OpenDialog() && !string.IsNullOrEmpty(project.ErrorMessage)) { MessageDialog.ShowMessage ("Error while opening the file", project.ErrorMessage); project.ErrorMessage = null; } }; fileMenu.SubMenu.Items.Add(menuOpen); if (Settings.Default.LastOpenedProjects != null) { MenuItem menuLastOpened = new MenuItem("Recently opened"); menuLastOpened.SubMenu = new Menu(); fileMenu.SubMenu.Items.Add(menuLastOpened); for (int i = Settings.Default.LastOpenedProjects.Count-1; i >= 0; i--) { string path = Settings.Default.LastOpenedProjects[i]; MenuItem menuLastOpenedi = new MenuItem(path); menuLastOpenedi.Clicked += delegate(object sender, EventArgs e) { if (!project.Open(path) && !string.IsNullOrEmpty(project.ErrorMessage)) { MessageDialog.ShowMessage ("Error while opening the file", project.ErrorMessage); project.ErrorMessage = null; } }; menuLastOpened.SubMenu.Items.Add(menuLastOpenedi); } } fileMenu.SubMenu.Items.Add(new SeparatorMenuItem()); MenuItem menuImport = new MenuItem("_Import..."); menuImport.Clicked += (object sender, EventArgs e) => project.ImportDialog(); fileMenu.SubMenu.Items.Add(menuImport); MenuItem menuSave = new MenuItem("_Save"); menuSave.Clicked += (object sender, EventArgs e) => SaveAll(); fileMenu.SubMenu.Items.Add(menuSave); fileMenu.SubMenu.Items.Add(new SeparatorMenuItem()); MenuItem menuClose = new MenuItem("_Exit"); menuClose.Clicked += (object sender, EventArgs e) => Close(); fileMenu.SubMenu.Items.Add(menuClose); // View menu MenuItem viewMenu = new MenuItem("_View"); viewMenu.SubMenu = new Menu(); RadioButtonMenuItemGroup viewRadioGroup = new RadioButtonMenuItemGroup(); RadioButtonMenuItem menuViewOverview = new RadioButtonMenuItem("Overview"); menuViewOverview.Checked = true; menuViewOverview.Group = viewRadioGroup; viewMenu.SubMenu.Items.Add(menuViewOverview); RadioButtonMenuItem menuViewPipeline = new RadioButtonMenuItem("Pipeline"); menuViewPipeline.Group = menuViewOverview.Group; viewMenu.SubMenu.Items.Add(menuViewPipeline); menuViewOverview.Clicked += delegate { splitMain_Status.Remove(pipelineShelf); splitScan_Pipeline.Panel2.Content = pipelineShelf; splitMain_Status.PackStart(splitScan_Pipeline, true, true); }; menuViewPipeline.Clicked += delegate { splitScan_Pipeline.Panel2.Content = null; splitMain_Status.Remove(splitScan_Pipeline); splitMain_Status.PackStart(pipelineShelf, true, true); }; // Edit menu MenuItem editMenu = new MenuItem("_Edit"); editMenu.SubMenu = new Menu(); MenuItem menuWorksheetRename = new MenuItem("_Rename worksheet..."); editMenu.SubMenu.Items.Add(menuWorksheetRename); menuWorksheetRename.Clicked += (object sender, EventArgs e) => pipelineController.RenameCurrentWorksheetDialog(); // Pipeline menu MenuItem pipelineMenu = new MenuItem("_Pipeline"); pipelineMenu.SubMenu = new Menu(); MenuItem menuExecute = new MenuItem("_Execute"); menuExecute.Clicked += (object sender, EventArgs e) => pipelineController.CurrentPipeline.Execute(project); pipelineMenu.SubMenu.Items.Add(menuExecute); pipelineMenu.SubMenu.Items.Add(new SeparatorMenuItem()); MenuItem menuExport = new MenuItem("Export"); menuExport.SubMenu = new Menu(); pipelineMenu.SubMenu.Items.Add(menuExport); Type exporterType = typeof(BaseExporter); IEnumerable<Type> exporter = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(s => s.GetTypes()) .Where(t => t.BaseType == exporterType); foreach (Type export in exporter) { MenuItem ni = new MenuItem(string.Format("As {0}...", export.Name)); ni.Tag = export.Name; menuExport.SubMenu.Items.Add(ni); var lExport = export; ni.Clicked += delegate(object sender, EventArgs e) { MenuItem s = sender as MenuItem; if (s != null) { if (exporterList.ContainsKey(s.Tag.ToString())) { exporterList[s.Tag.ToString()].ShowDialog(pipelineController.CurrentPipeline.Nodes); } else { BaseExporter instance = Activator.CreateInstance(lExport, pipelineController.CurrentPipeline.PipelineName) as BaseExporter; if (instance != null) { exporterList[s.Tag.ToString()] = instance; instance.ShowDialog(pipelineController.CurrentPipeline.Nodes); } } } }; } // Extras menu MenuItem extrasMenu = new MenuItem("E_xtras"); extrasMenu.SubMenu = new Menu(); MenuItem menuResetAllMasks = new MenuItem("_Reset all masks"); menuResetAllMasks.Clicked += delegate { foreach (BaseScan scan in project.scanCollection) { scan.Mask.ResetMask(); } }; MenuItem menuExportLog = new MenuItem("Export _logs"); menuExportLog.Clicked += delegate { SaveFileDialog d = new SaveFileDialog("Export logs"); if (d.Run()) { string filename = d.FileName; if (!string.IsNullOrEmpty(filename)) { System.IO.File.WriteAllText(filename, Log.ToText()); } } d.Dispose(); }; extrasMenu.SubMenu.Items.Add(menuResetAllMasks); extrasMenu.SubMenu.Items.Add(menuExportLog); // main menu Menu menu = new Menu(); menu.Items.Add(fileMenu); menu.Items.Add(viewMenu); menu.Items.Add(editMenu); menu.Items.Add(pipelineMenu); menu.Items.Add(extrasMenu); MainMenu = menu; // initialize preview widget preview = new Preview(); // load tree view with all available files fileTree = new FileTreeView(); VBox splitFileTreeSearch_FileTree = new VBox(); splitFileTreeSearch_FileTree.PackStart(new FileTreeFilter(fileTree)); splitFileTreeSearch_FileTree.PackStart(fileTree, true); // load pipeline controller pipelineShelf = new VBox(); pipelineController = new PipelineController(project, pipelineShelf); splitFiletree_Preview = new HPaned(); splitFiletree_Preview.Panel1.Content = splitFileTreeSearch_FileTree; splitFiletree_Preview.Panel1.Shrink = true; fileTree.HorizontalScrollPolicy = ScrollPolicy.Never; splitFiletree_Preview.Panel2.Content = preview; splitFiletree_Preview.Panel2.Resize = true; splitController_Preview = new VBox(); //splitController_Preview.PackStart(controllbarShelf, false, false); splitController_Preview.PackEnd(splitFiletree_Preview, true, true); splitScan_Pipeline = new VPaned(); splitScan_Pipeline.Panel1.Content = splitController_Preview; splitScan_Pipeline.Panel2.Content = pipelineShelf; splitScan_Pipeline.Panel2.Resize = true; splitMain_Status = new VBox(); splitMain_Status.PackStart(splitScan_Pipeline, true, true); splitMain_Status.PackEnd(new StatusBar()); Content = splitMain_Status; }
void BuildWidget() { VBox vbox = new VBox { ExpandVertical = true, ExpandHorizontal = true }; HBox buttonBox = new HBox (); _connectButton = new Button (Icons.Connect, I18N._ ("Connect")); buttonBox.PackStart (_connectButton); _disconnectButton = new Button (Icons.Disconnect, I18N._ ("Disconnect")); buttonBox.PackStart (_disconnectButton); vbox.PackStart (buttonBox); _inTreeView = new ConnectableTreeView (); _outTreeView = new ConnectableTreeView (); _connectionArea = new ConnectionArea (_outTreeView, _inTreeView) { MinWidth = 200, MinHeight = 200, ExpandVertical = true, ExpandHorizontal = true }; HBox connectionBox = new HBox { ExpandVertical = true, ExpandHorizontal = true }; connectionBox.PackStart (_outTreeView, false, false); connectionBox.PackStart (_connectionArea, true, true); connectionBox.PackStart (_inTreeView, false, false); vbox.PackStart (connectionBox, true, true); _messageDisplay = new RichTextView (); _messageContainer = new ScrollView (_messageDisplay) { HorizontalScrollPolicy = ScrollPolicy.Never, VerticalScrollPolicy = ScrollPolicy.Automatic, HeightRequest = 40, BorderVisible = true, Margin = 2 }; _messageContainer.Hide (); vbox.PackEnd (_messageContainer); Content = vbox; ExpandHorizontal = true; ExpandVertical = true; }
void BuildContent() { _configTable = new Table { MinWidth = 300 }; ScrollView scrollView = new ScrollView (_configTable) { ExpandHorizontal = true, ExpandVertical = true, HorizontalScrollPolicy = ScrollPolicy.Never, MinHeight = 300, MinWidth = 300 }; HBox buttonBox = new HBox (); _addButton = new Button (I18N._ ("Add")) { Image = Icons.Add }; _okButton = new Button (I18N._ ("Save")) { Image = Icons.Ok }; _cancelButton = new Button (I18N._ ("Cancel")) { Image = Icons.Cancel, Style = ButtonStyle.Flat }; _undoButton = new Button (I18N._ ("Undo")) { Image = Icons.Undo, Style = ButtonStyle.Flat, Visible = false }; buttonBox.PackEnd (_okButton); buttonBox.PackEnd (_addButton); buttonBox.PackStart (_cancelButton); buttonBox.PackStart (_undoButton); VBox box = new VBox (); box.PackStart (scrollView, true, true); box.PackEnd (buttonBox); Content = box; }
/// <summary> /// Opens the option window. /// </summary> /// <param name="pNode">Pipeline node for which the option should be shown.</param> void OpenOptionWindow(PipelineNode pNode) { Dialog d = new Dialog(); d.Title = String.Format("Option for \"{0}\"", pNode.algorithm); Table table = new Table(); VBox contentBox = new VBox(); int i = 0; Widget[] entries = new Widget[pNode.algorithm.Options.Count]; foreach (BaseOption option in pNode.algorithm.Options) { table.Add(new Label(option.Name), 0, i); Widget entry = option.ToWidget(); entries[i] = entry; table.Add(entry, 1, i); i++; } TextEntry commentEntry = new TextEntry(); commentEntry.PlaceholderText = "Comments..."; commentEntry.MultiLine = true; commentEntry.Text = pNode.userComment; contentBox.PackStart(table); contentBox.PackEnd(commentEntry); d.Content = contentBox; d.Buttons.Add(new DialogButton(Command.Cancel)); d.Buttons.Add(new DialogButton(Command.Apply)); var r = d.Run(this.ParentWindow); if (r != null && r.Id == Command.Apply.Id) { i = 0; foreach (BaseOption option in pNode.algorithm.Options) { object value = option.ExtractValueFrom(entries[i]); if (value != null) { option.Value = value; } i++; } pNode.userComment = commentEntry.Text; } d.Dispose(); }
public static void Main(string [] args) { Application.Init(); Window win = new Window("EFL# Demo App"); win.Resize(640, 480); Application.EE.ResizeEvent += AppResizeHandler; /* integrate this code in the Window class */ Edje win_bg = new Edje(Application.EE.Get()); win_bg.FileSet(DataConfig.DATADIR + "/data/eblocks/themes/e17.edj","window"); win_bg.Resize(640, 480); win_bg.Move(0, 0); win_bg.Lower(); win_bg.Show(); MenuItem item; MenuItem entry; MenuBar mb = new MenuBar(); mb.Move(0, 0); mb.Resize(640, 35); mb.Spacing = 15; item = new MenuItem("_File"); Menu file_menu = new Menu(); entry = new MenuItem(file_menu.Canvas, "_Open"); file_menu.Append(entry); entry = new MenuItem(file_menu.Canvas, "_Close"); file_menu.Append(entry); entry = new MenuItem(file_menu.Canvas, "_Save"); file_menu.Append(entry); item.SubMenu = file_menu; mb.Append(item); item = new MenuItem("_Edit"); Menu edit_menu = new Menu(); entry = new MenuItem(edit_menu.Canvas, "_Copy"); edit_menu.Append(entry); entry = new MenuItem(edit_menu.Canvas, "_Cut"); edit_menu.Append(entry); entry = new MenuItem(edit_menu.Canvas, "_Paste"); edit_menu.Append(entry); item.SubMenu = edit_menu; mb.Append(item); item = new MenuItem("_About"); //item.SubMenu = about_menu; mb.Append(item); mb.Show(); Button button; HBox box_left = new HBox(); box_left.Move(0, 37); box_left.Resize(70, 480 - 37); VBox box_icons = new VBox(); box_icons.Spacing = 0; box_icons.Resize(64, 480 - 37); button = new Button("Tile"); button.Resize(64, 64); box_icons.PackEnd(button); button = new Button("Stretch"); button.Resize(64, 64); box_icons.PackEnd(button); button = new Button("Rotate"); button.Resize(64, 64); box_icons.PackEnd(button); button = new Button("Flip"); button.Resize(64, 64); box_icons.PackEnd(button); button = new Button("Quit"); button.MouseUpEvent += new Enlightenment.Evas.Item.EventHandler(AppQuitButtonHandler); button.Resize(64, 64); box_icons.PackEnd(button); box_left.PackEnd(box_icons); Enlightenment.Eblocks.Line vline = new Enlightenment.Eblocks.Line(Application.EE.Get()); vline.Vertical = true; vline.Resize(6, 480 - 37); box_left.PackEnd(vline); box_left.Show(); dir = args[0]; imageTable = new Table(Application.EE.Get(), items); HBox box_images = new HBox(); box_images.Move(70, 37); box_images.Spacing = 0; box_images.Resize(640 - 70 - 2, 480 - 37 - 2); box_images.PackStart(imageTable); Application.EE.DataSet("box_images", box_images); Application.EE.DataSet("box_left", box_left); Application.EE.DataSet("box_icons", box_icons); Application.EE.DataSet("win_bg", win_bg); Application.EE.DataSet("vline", vline); Application.EE.DataSet("mb", mb); WaitCallback callback = new WaitCallback(Callback); ThreadPool.QueueUserWorkItem(callback); win.ShowAll(); Application.Run(); }
/// <summary> /// Initializes the widgets. /// </summary> void InitializeUI() { endBox = new VBox(); endBox.PackEnd(threadLabel); logBox = new HBox(); logLevelChooser = new LogLevelChooser(currentLogLevel); logLevelChooser.MarginRight = 10; logLevelChooser.LogLevelChanged += delegate { CurrentLogLevel = logLevelChooser.SelectedLogLevel; }; logLevelChooser.MenuShow += delegate { AutoCollapse = false; }; logLevelChooser.MenuHide += delegate { AutoCollapse = true; }; logBox.PackStart(logEntry, true); logBox.PackEnd(logLevelChooser); logFrame.Content = logBox; PackStart(logFrame, true, true); PackEnd(endBox); int completionPortThreads; ThreadPool.GetMaxThreads(out maxThreads, out completionPortThreads); }
/// <summary> /// builds window content /// </summary> void BuildContent() { Title = "MonoMultiJack"; _connectionNotebook = new Notebook { ExpandHorizontal = true, ExpandVertical = true }; _appButtonBox = new VBox { ExpandVertical = true }; HBox mainContent = new HBox { ExpandHorizontal = true, ExpandVertical = true }; mainContent.PackStart (_appButtonBox); mainContent.PackStart (_connectionNotebook, true, true); VBox container = new VBox { Margin = new WidgetSpacing (0), }; container.PackStart (mainContent, true, true); _statusbar = new Label { Margin = new WidgetSpacing (0), }; _statusbar.Font = _statusbar.Font.WithScaledSize (0.8); _statusbar.TextAlignment = Alignment.End; PaddingBottom = PaddingBottom / 2; container.PackEnd (_statusbar); Content = container; ((IMainWindow)this).JackdIsRunning = false; }
void BuildContent() { VBox mainContent = new VBox (); _programName = new Label (); _programName.Font = _programName.Font.WithScaledSize (1.5).WithWeight (FontWeight.Bold); mainContent.PackStart (_programName); _comments = new Label (); _comments.Wrap = WrapMode.Word; mainContent.PackStart (_comments); _copyright = new Label (); _copyright.Font = _copyright.Font.WithScaledSize (0.8); mainContent.PackStart (_copyright); _website = new LinkLabel (); _website.Font = _website.Font.WithScaledSize (0.8); mainContent.PackStart (_website); HBox buttonRow = new HBox (); Button authors = new Button { Label = I18N._ ("Authors"), Image = Icons.Info }; authors.Clicked += (sender, args) => ShowAuthors (); buttonRow.PackStart (authors); Button license = new Button { Label = I18N._ ("License"), Image = Icons.Info }; license.Clicked += (sender, args) => ShowLicense (); buttonRow.PackStart (license); Button ok = new Button { Label = I18N._ ("Close"), Image = Icons.Ok }; ok.Clicked += (sender, args) => Close (); buttonRow.PackEnd (ok); mainContent.PackEnd (buttonRow); Content = mainContent; }
public override Widget Options() { if (main != null) { main.Dispose(); } main = new VBox(); // filename HBox file = new HBox(); filenameEntry = new TextEntry(); filenameEntry.Text = Filename; filenameEntry.ReadOnly = true; filenameEntry.ShowFrame = false; filenameEntry.BackgroundColor = Color.FromBytes(232, 232, 232); Button browseButton = new Button("Browse..."); browseButton.SetFocus(); browseButton.Clicked += Browse; // print to std out HBox exportToStdOutBox = new HBox(); CheckBox exportTSCheck = new CheckBox(); exportToStdOutBox.PackStart(new Label("Export to standard out?")); exportToStdOutBox.PackEnd(exportTSCheck); exportTSCheck.Toggled += delegate { if (exportTSCheck.Active) { browseButton.Style = ButtonStyle.Flat; browseButton.Clicked -= Browse; exportToStdOut = true; } else { browseButton.Style = ButtonStyle.Normal; browseButton.Clicked += Browse; exportToStdOut = false; } }; file.PackStart(filenameEntry, true); file.PackEnd(browseButton); main.PackEnd(file, true); main.PackEnd(exportToStdOutBox, true); return main; }
/// <summary> /// builds dialog window /// </summary> void BuildContent() { Table table = new Table (); _jackdPathEntry = BuildRow (table, 0, I18N._ ("Jackd Startup Path"), I18N._ ("e.g. /usr/bin/jackd")); _jackdPathEntry.FileSelector (); _jackdGeneralOptionsEntry = BuildRow (table, 1, I18N._ ("General Options"), I18N._ ("optional")); _jackdDriverEntry = BuildRow (table, 2, I18N._ ("Driver Infrastructure"), I18N._ ("e.g. alsa")); _jackdDriverOptionsEntry = BuildRow (table, 3, I18N._ ("Driver Options"), I18N._ ("optional")); HBox buttonBox = new HBox (); _okButton = new Button (I18N._ ("Save")) { Image = Icons.Ok }; _cancelButton = new Button (I18N._ ("Cancel")) { Image = Icons.Cancel, Style = ButtonStyle.Flat }; buttonBox.PackStart (_cancelButton); buttonBox.PackEnd (_okButton); VBox box = new VBox (); box.PackStart (table); box.PackEnd (buttonBox); Content = box; }
public WizardDialog (IWizardDialogController controller) { Controller = controller; Dialog = new Dialog (); Dialog.Name = "wizard_dialog"; Dialog.Resizable = false; Dialog.Padding = 0; if (string.IsNullOrEmpty (controller.Title)) Dialog.Title = BrandingService.ApplicationName; else Dialog.Title = controller.Title; // FIXME: Gtk dialogs don't support ThemedImage //if (controller.Image != null) // Dialog.Icon = controller.Image.WithSize (IconSize.Large); Dialog.ShowInTaskbar = false; Dialog.Shown += HandleDialogShown; Dialog.CloseRequested += HandleDialogCloseRequested; container = new VBox (); container.Spacing = 0; header = new MonoDevelop.Components.ExtendedHeaderBox (controller.Title, null, controller.Icon); header.BackgroundColor = Styles.Wizard.BannerBackgroundColor; header.TitleColor = Styles.Wizard.BannerForegroundColor; header.SubtitleColor = Styles.Wizard.BannerSecondaryForegroundColor; header.BorderColor = Styles.Wizard.BannerShadowColor; buttonBox = new HBox (); var buttonFrame = new FrameBox (buttonBox); buttonFrame.Padding = 20; buttonFrame.PaddingRight = 0; cancelButton = new Button (GettextCatalog.GetString ("Cancel")); cancelButton.Clicked += HandleCancelButtonClicked; backButton = new Button (GettextCatalog.GetString ("Back")); backButton.Clicked += HandleBackButtonClicked; nextButton = new Button (GettextCatalog.GetString ("Next")); nextButton.Clicked += HandleNextButtonClicked; statusImage = new ImageView (ImageService.GetIcon ("md-empty", Gtk.IconSize.Button)); if (Toolkit.CurrentEngine.Type == ToolkitType.XamMac) { var s = cancelButton.Surface.GetPreferredSize (); cancelButton.MinWidth = Math.Max (s.Width + 16, 100); s = backButton.Surface.GetPreferredSize (); backButton.MinWidth = Math.Max (s.Width + 16, 100); s = nextButton.Surface.GetPreferredSize (); nextButton.MinWidth = Math.Max (s.Width + 16, 100); buttonBox.Spacing = 0; statusImage.MarginRight = 6; #if MAC var nativeNext = nextButton.Surface.NativeWidget as AppKit.NSButton; nativeNext.KeyEquivalent = "\r"; #endif } else { cancelButton.MinWidth = 70; backButton.MinWidth = 70; nextButton.MinWidth = 70; statusImage.MarginRight = 3; } if (ImageService.IsAnimation ("md-spinner-18", Gtk.IconSize.Button)) { animatedStatusIcon = ImageService.GetAnimatedIcon ("md-spinner-18", Gtk.IconSize.Button); } buttonBox.PackStart (cancelButton, false, false); buttonBox.PackEnd (statusImage, false, false); buttonBox.PackEnd (nextButton, false, false); buttonBox.PackEnd (backButton, false, false); statusImage.VerticalPlacement = cancelButton.VerticalPlacement = nextButton.VerticalPlacement = backButton.VerticalPlacement = WidgetPlacement.Center; container.PackStart (header); var contentHBox = new HBox (); contentHBox.Spacing = 0; currentPageFrame = new FrameBox (); currentPageFrame.BackgroundColor = Styles.Wizard.PageBackgroundColor; contentHBox.PackStart (currentPageFrame, true, true); rightSideFrame = new FrameBox () { Visible = false }; //rightSideFrame.BorderColor = Styles.Wizard.ContentSeparatorColor; //rightSideFrame.BorderWidthLeft = 1; rightSideFrame.WidthRequest = RightSideWidgetWidth; rightSideFrame.BackgroundColor = Styles.Wizard.RightSideBackgroundColor; contentHBox.PackEnd (rightSideFrame, false, true); rightSideFrame.VerticalPlacement = rightSideFrame.HorizontalPlacement = WidgetPlacement.Fill; var contentFrame = new FrameBox (contentHBox); contentFrame.Padding = 0; contentFrame.BorderColor = Styles.Wizard.ContentShadowColor; contentFrame.BorderWidth = 0; contentFrame.BorderWidthBottom = 1; container.PackStart (contentFrame, true, true); container.PackEnd (buttonFrame); Dialog.Content = container; if (Toolkit.CurrentEngine.Type == ToolkitType.Gtk) { var nativeNext = nextButton.Surface.NativeWidget as Gtk.Button; nativeNext.CanDefault = true; nativeNext.GrabDefault (); } CurrentPage = controller.CurrentPage; controller.PropertyChanged += HandleControllerPropertyChanged; controller.Completed += HandleControllerCompleted; }