public BasePage(Driver driver) { Driver = driver; Header = new HeaderBar(driver); HeaderBar = new HeaderBar(driver); SearchBar = new SearchBar(driver); }
void Start() { control = (Control)FindObjectOfType(typeof(Control)); grid = (Grid)FindObjectOfType(typeof(Grid)); NetworkInterface netIf = (NetworkInterface)FindObjectOfType(typeof(NetworkInterface)); buttonRow = new ButtonRow(control); header = new HeaderBar(control, netIf); }
private static void LoadDebugEnvironment() { var hb = new HeaderBar { ShowCloseButton = true, Title = "Core-Chip8 - DEBUG MODE" }; emulatorWindow.KeyPressEvent += new KeyPressEventHandler(DebugKeyPressEventHandler); var gfxDumpBtn = new Button { Label = "Gfx" }; gfxDumpBtn.Clicked += delegate(object obj, EventArgs ars) { if (graphicsDumpWindow == null || !graphicsDumpWindow.Visible) { graphicsDumpWindow = new Windows.GraphicsDumpWindow("Graphics Buffer Dump"); graphicsDumpWindow.SetGraphics(graphics.Screen); graphicsDumpWindow.ShowAll(); } }; hb.PackEnd(gfxDumpBtn); var hexDumpBtn = new Button { Label = "Hex" }; hexDumpBtn.Clicked += delegate(object obj, EventArgs ars) { if (memoryDumpWindow == null || !memoryDumpWindow.Visible) { memoryDumpWindow = new Windows.MemoryDumpWindow("Memory Dump Window"); memoryDumpWindow.SetMemory(chp8.Memory); memoryDumpWindow.ShowAll(); } }; hb.PackEnd(hexDumpBtn); var debuggerBtn = new Button { Label = "Debug" }; debuggerBtn.Clicked += delegate(object obj, EventArgs ars) { if (debuggerWindow == null || !debuggerWindow.Visible) { debuggerWindow = new Windows.DebuggerWindow("Debugger Window"); debuggerWindow.SetMemory(chp8.Memory); debuggerWindow.ShowAll(); } }; hb.PackEnd(debuggerBtn); emulatorWindow.Titlebar = hb; }
private void BuildUi() { const string menuTemplate = @" <interface> <menu id='app_menu'> <submenu> <attribute name='label'>_File</attribute> <item> <attribute name='label'>_Quit</attribute> <attribute name='action'>app.quit</attribute> <attribute name='accel'><Primary>q</attribute> </item> </submenu> </menu> </interface> "; var menuBuilder = new Builder(); menuBuilder.AddFromString(menuTemplate); var menuModel = new MenuModel(menuBuilder.GetObject("app_menu").Handle); const string windowTitle = "Gtk on Windows"; var headerBar = new HeaderBar { Title = windowTitle, Subtitle = "With GtkSharp", ShowCloseButton = true }; _mainWindow = new MainWindow(this) { Title = windowTitle, IconName = "applications-development", ShowMenubar = false }; if (PrefersAppMenu()) { AppMenu = menuModel; _mainWindow.Titlebar = headerBar; } else { Menubar = menuModel; _mainWindow.ShowMenubar = true; } _mainWindow.ShowAll(); }
Grid _Statusbar() { _header = new HeaderBar { Title = Title, ShowCloseButton = true }; this.SetTitlebar(_header); _main_bar = new Toolbar(); _main_bar.ToolbarStyle = ToolbarStyle.Icons; _main_bar.IconSize = IconSize.SmallToolbar; _main_bar.Halign = Align.Start; var menu_button = new MainMenuButton(); var menu_item = new ToolItem { Child = menu_button }; _main_bar.Insert(menu_item, 0); _source_bar = (Toolbar)ActionService.UIManager.GetWidget("/SourceToolbar"); _source_bar.ToolbarStyle = ToolbarStyle.Icons; _source_bar.IconSize = IconSize.SmallToolbar; _source_bar.Halign = Align.End; _status_label = new Label(); var grid = new Grid { ColumnHomogeneous = true }; grid.Attach(_status_label, 1, 0, 1, 1); _ready.Add(() => { menu_button.Show(); menu_item.Show(); _main_bar.Show(); _status_label.Show(); _source_bar.Show(); _header.Show(); }); return(grid); }
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(); }
public void AppSignOut() { //Starting Extent report ReportHelpers.test = ReportHelpers.extent.StartTest("SignOut from the application"); //Created object to interact with HomePage and SignInPage classes and their methods HomePage HomePageObj = new HomePage(); SignInPage SignInPageObj = new SignInPage(); //Called objects to run methods of these classes HomePageObj.Open(); HomePageObj.OpenLoginForm(); SignInPageObj.LogInSteps(); //Created object to interact with HeaderBar class and its methods HeaderBar HeaderBarObj = new HeaderBar(); HeaderBarObj.DoSignOut(); }
private void InitializeComponent() { this.components = (IContainer) new Container(); this._mainMenu = new MenuStrip(); this.fileToolStripMenuItem1 = new ToolStripMenuItem(); this.exitToolStripMenuItem = new ToolStripMenuItem(); this.goToolStripMenuItem = new ToolStripMenuItem(); this.homeScreenToolStripMenuItem = new ToolStripMenuItem(); this.toolStripSeparator1 = new ToolStripSeparator(); this.nextScreenToolStripMenuItem = new ToolStripMenuItem(); this.previousScreenToolStripMenuItem = new ToolStripMenuItem(); this.helpToolStripMenuItem1 = new ToolStripMenuItem(); this.helpDocumentationToolStripMenuItem = new ToolStripMenuItem(); this.toolStripMenuItem2 = new ToolStripSeparator(); this.aboutToolStripMenuItem = new ToolStripMenuItem(); this.shortcutToolBar = new ToolStrip(); this._mainSplitContainer = new SplitContainer(); this._mainExplorerBar = new NavBarControl(); this.PanePanel = new Panel(); this.headerBar = new HeaderBar(this.components); this.actionToolbar = new ToolStrip(); this._mainMenu.SuspendLayout(); this._mainSplitContainer.Panel1.SuspendLayout(); this._mainSplitContainer.Panel2.SuspendLayout(); this._mainSplitContainer.SuspendLayout(); this._mainExplorerBar.BeginInit(); this.SuspendLayout(); this._mainMenu.Items.AddRange(new ToolStripItem[3] { (ToolStripItem)this.fileToolStripMenuItem1, (ToolStripItem)this.goToolStripMenuItem, (ToolStripItem)this.helpToolStripMenuItem1 }); this._mainMenu.Location = new Point(0, 0); this._mainMenu.Name = "_mainMenu"; this._mainMenu.Size = new Size(731, 24); this._mainMenu.TabIndex = 10; this.fileToolStripMenuItem1.DropDownItems.AddRange(new ToolStripItem[1] { (ToolStripItem)this.exitToolStripMenuItem }); this.fileToolStripMenuItem1.Name = "fileToolStripMenuItem1"; this.fileToolStripMenuItem1.Size = new Size(37, 20); this.fileToolStripMenuItem1.Text = "&File"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new Size(152, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new EventHandler(this.exitToolStripMenuItem_Click); this.goToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[4] { (ToolStripItem)this.homeScreenToolStripMenuItem, (ToolStripItem)this.toolStripSeparator1, (ToolStripItem)this.nextScreenToolStripMenuItem, (ToolStripItem)this.previousScreenToolStripMenuItem }); this.goToolStripMenuItem.Name = "goToolStripMenuItem"; this.goToolStripMenuItem.Size = new Size(34, 20); this.goToolStripMenuItem.Text = "&Go"; this.homeScreenToolStripMenuItem.Name = "homeScreenToolStripMenuItem"; this.homeScreenToolStripMenuItem.ShortcutKeys = Keys.H | Keys.Control; this.homeScreenToolStripMenuItem.Size = new Size(243, 22); this.homeScreenToolStripMenuItem.Text = "&Home Screen"; this.homeScreenToolStripMenuItem.Click += new EventHandler(this.ShowHomePane); this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(240, 6); this.nextScreenToolStripMenuItem.Name = "nextScreenToolStripMenuItem"; this.nextScreenToolStripMenuItem.ShortcutKeys = Keys.Tab | Keys.Control; this.nextScreenToolStripMenuItem.Size = new Size(243, 22); this.nextScreenToolStripMenuItem.Text = "&Next Screen"; this.nextScreenToolStripMenuItem.Click += new EventHandler(this.nextScreenToolStripMenuItem_Click); this.previousScreenToolStripMenuItem.Name = "previousScreenToolStripMenuItem"; this.previousScreenToolStripMenuItem.ShortcutKeys = Keys.Tab | Keys.Shift | Keys.Control; this.previousScreenToolStripMenuItem.Size = new Size(243, 22); this.previousScreenToolStripMenuItem.Text = "&Previous Screen"; this.previousScreenToolStripMenuItem.Click += new EventHandler(this.previousScreenToolStripMenuItem_Click); this.helpToolStripMenuItem1.DropDownItems.AddRange(new ToolStripItem[3] { (ToolStripItem)this.helpDocumentationToolStripMenuItem, (ToolStripItem)this.toolStripMenuItem2, (ToolStripItem)this.aboutToolStripMenuItem }); this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; this.helpToolStripMenuItem1.Size = new Size(44, 20); this.helpToolStripMenuItem1.Text = "&Help"; this.helpToolStripMenuItem1.Visible = false; this.helpDocumentationToolStripMenuItem.Name = "helpDocumentationToolStripMenuItem"; this.helpDocumentationToolStripMenuItem.ShortcutKeys = Keys.F1; this.helpDocumentationToolStripMenuItem.Size = new Size(204, 22); this.helpDocumentationToolStripMenuItem.Text = "&Help Documentation"; this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new Size(201, 6); this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Size = new Size(204, 22); this.aboutToolStripMenuItem.Text = "&About"; this.shortcutToolBar.GripStyle = ToolStripGripStyle.Hidden; this.shortcutToolBar.Location = new Point(0, 24); this.shortcutToolBar.Name = "shortcutToolBar"; this.shortcutToolBar.Padding = new Padding(5, 0, 1, 0); this.shortcutToolBar.ShowItemToolTips = false; this.shortcutToolBar.Size = new Size(731, 25); this.shortcutToolBar.TabIndex = 11; this.shortcutToolBar.Text = "toolStrip1"; this._mainSplitContainer.Dock = DockStyle.Fill; this._mainSplitContainer.Location = new Point(0, 49); this._mainSplitContainer.Name = "_mainSplitContainer"; this._mainSplitContainer.Panel1.Controls.Add((Control)this._mainExplorerBar); this._mainSplitContainer.Panel2.Controls.Add((Control)this.PanePanel); this._mainSplitContainer.Panel2.Controls.Add((Control)this.headerBar); this._mainSplitContainer.Panel2.Controls.Add((Control)this.actionToolbar); this._mainSplitContainer.Size = new Size(731, 456); this._mainSplitContainer.SplitterDistance = 191; this._mainSplitContainer.TabIndex = 15; this._mainExplorerBar.ActiveGroup = (NavBarGroup)null; this._mainExplorerBar.AllowSelectedLink = true; this._mainExplorerBar.Appearance.NavigationPaneHeader.BackColor = SystemColors.ControlDark; this._mainExplorerBar.Appearance.NavigationPaneHeader.ForeColor = Color.White; this._mainExplorerBar.Appearance.NavigationPaneHeader.Options.UseBackColor = true; this._mainExplorerBar.Appearance.NavigationPaneHeader.Options.UseForeColor = true; this._mainExplorerBar.ContentButtonHint = (string)null; this._mainExplorerBar.Dock = DockStyle.Fill; this._mainExplorerBar.Location = new Point(0, 0); this._mainExplorerBar.Name = "_mainExplorerBar"; this._mainExplorerBar.OptionsNavPane.ExpandedWidth = 191; this._mainExplorerBar.OptionsNavPane.ShowExpandButton = false; this._mainExplorerBar.Size = new Size(191, 456); this._mainExplorerBar.TabIndex = 1; this._mainExplorerBar.Text = "ExplorerBar"; this._mainExplorerBar.View = (BaseViewInfoRegistrator) new NavigationPaneViewInfoRegistrator(); this.PanePanel.Dock = DockStyle.Fill; this.PanePanel.Location = new Point(0, 40); this.PanePanel.Name = "PanePanel"; this.PanePanel.Padding = new Padding(5); this.PanePanel.Size = new Size(536, 380); this.PanePanel.TabIndex = 14; this.headerBar.Dock = DockStyle.Top; this.headerBar.Font = new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point, (byte)0); this.headerBar.ForeColor = SystemColors.Window; this.headerBar.Image = (Image)null; this.headerBar.Location = new Point(0, 0); this.headerBar.Name = "headerBar"; this.headerBar.Padding = new Padding(2, 0, 0, 0); this.headerBar.Size = new Size(536, 40); this.headerBar.TabIndex = 15; this.actionToolbar.AutoSize = false; this.actionToolbar.Dock = DockStyle.Bottom; this.actionToolbar.GripStyle = ToolStripGripStyle.Hidden; this.actionToolbar.ImageScalingSize = new Size(24, 24); this.actionToolbar.Location = new Point(0, 420); this.actionToolbar.Name = "actionToolbar"; this.actionToolbar.Padding = new Padding(10, 0, 1, 0); this.actionToolbar.Size = new Size(536, 36); this.actionToolbar.TabIndex = 13; this.actionToolbar.Text = "toolStrip1"; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new Size(731, 505); this.Controls.Add((Control)this._mainSplitContainer); this.Controls.Add((Control)this.shortcutToolBar); this.Controls.Add((Control)this._mainMenu); this.Name = "CommonMainForm"; this.Text = "Form1"; this.FormClosed += new FormClosedEventHandler(this.CommonMainForm_FormClosed); this.FormClosing += new FormClosingEventHandler(this.CommonMainForm_FormClosing); this._mainMenu.ResumeLayout(false); this._mainMenu.PerformLayout(); this._mainSplitContainer.Panel1.ResumeLayout(false); this._mainSplitContainer.Panel2.ResumeLayout(false); this._mainSplitContainer.ResumeLayout(false); this._mainExplorerBar.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
public Program(string title) : base(title) { SetDefaultSize(500, 500); BashHandler bashHandler = BashHandler.Instance; try { SetIconFromFile("/usr/share/icons/Gtk-Theme-Manager-icon.png"); } catch (Exception e) { Console.WriteLine(e); } // Box box = new Box(Orientation.Vertical,6); DeleteEvent += delegate { Gtk.Application.Quit(); }; HeaderBar headerBar = new HeaderBar(); headerBar.Title = title; headerBar.ShowCloseButton = true; headerBar.Visible = true; Button menuButton = new Button(); menuButton.Image = Gtk.Image.NewFromIconName("view-refresh-symbolic", IconSize.LargeToolbar); menuButton.Visible = true; Image image = new Image(); image.File = "/usr/share/icons/Gtk-Theme-Manager-icon.png"; image.Visible = true; headerBar.PackStart(image); headerBar.PackEnd(menuButton); Titlebar = headerBar; StackSidebar stackSidebar = new StackSidebar(); HBox hBox = new HBox(); hBox.PackStart(stackSidebar, false, true, 0); stackSidebar.WidthRequest = 120; Stack stack = new Stack(); stackSidebar.Stack = stack; stack.TransitionType = StackTransitionType.SlideUpDown; stack.TransitionDuration = (1000); ThemeUI GtkTheme = new ThemeUI(ThemeMode.GtkTheme); ThemeUI IconTheme = new ThemeUI(ThemeMode.IconTheme); ThemeUI ShellTheme = new ThemeUI(ThemeMode.ShellTheme); ThemeUI CursorTheme = new ThemeUI(ThemeMode.CursorTheme); stack.RedrawOnAllocate = true; menuButton.Clicked += (sender, args) => { bashHandler.Reload(); GtkTheme.Reload(); IconTheme.Reload(); CursorTheme.Reload(); ShellTheme.Reload(); }; stack.AddTitled(GtkTheme, "Themes", "Themes"); stack.AddTitled(IconTheme, "IconTheme", "Icons"); stack.AddTitled(ShellTheme, "ShellTheme", "Shells"); stack.AddTitled(CursorTheme, "CursorTheme", "Cursors"); stack.ShowAll(); hBox.PackStart(new Separator(Orientation.Vertical), false, false, 0); hBox.PackStart(stack, true, true, 0); hBox.ShowAll(); Add(hBox); Show(); // Add(box); // ListBox listBox=new ListBox(); // ListBoxRow themeRow=new ListBoxRow(); // themeRow.Child= (new Label // { // Text = "Theme", // // // }); // ListBoxRow iconRow=new ListBoxRow(); // iconRow.Child= (new Label("Icons")); // ListBoxRow shellRow=new ListBoxRow(); // shellRow.Child =new Label("Shell"); // listBox.Add(themeRow); // listBox.Add(iconRow); // listBox.Add(shellRow); // listBox.ShowAll(); // Add(listBox); // HBox hBox=new HBox(); // hBox.Add(new ThemeUi(ThemeMode.GtkTheme)); // hBox.Add(new ThemeUi(ThemeMode.IconTheme)); // hBox.Add(new ThemeUi(ThemeMode.ShellTheme)); // ListBox listBox= new ListBox(); // listBox.Hexpand = true; // ListBoxRow listBoxRow = new ListBoxRow(); // listBox.Add(listBoxRow); // HBox hBox = new HBox(); // hBox.PackStart(new Label("hi"),true,true,0); // listBoxRow.Add(hBox); // box.Add(listBox); // Gtk.ListStore themeListStore = new Gtk.ListStore (typeof (string)); // // // // // CellAreaBox area = new CellAreaBox(); // // EntryCompletion themeBoxcompletion = new EntryCompletion(); // themeBoxcompletion.TextColumn = 0; // themeBoxcompletion.Model = themeListStore; // // // Label themeBoxLabel = new Label("Application Theme"); // themeBoxLabel.Halign = Align.Start; // // ComboBoxText themeBox = new Gtk.ComboBoxText(); // // themeBox.Entry.Completion = themeBoxcompletion; // // // CellRendererText renderer = new CellRendererText(); // // // area.PackStart(renderer,true,true,true); // // themeBox.EntryTextColumn = 0; // themeBox.WrapWidth = 5; // // themeBox.Entry.Completion = themeBoxcompletion; // // for (int i = 0; i < bashHandler.ThemeList.Count; i++) // { // themeListStore.AppendValues(bashHandler.ThemeList[i]); // // listBox.Add(new Label(spltOutput[i])); // themeBox.AppendText(bashHandler.ThemeList[i]); // } // // for (int i = 0; i < bashHandler.ThemeList.Count; i++) // { // // if (bashHandler.ThemeList[i].Equals(bashHandler.GetTheme())) // { // themeBox.Active = i; // break; // } // } // // themeBox.Changed += (e,s) => // { // // ComboBoxText cb = (ComboBoxText) e; // bashHandler.ChangeTheme(cb.ActiveText); // }; // // // themeBox.Changed += (e, s) => // // { // // // // TreeIter iter; // // GLib.Value row = new GLib.Value(); // // var cb = (ComboBox) e; // // cb.Model.GetIterFirst(out iter); // // cb.Model.GetValue(iter,5 , ref row); // // Console.WriteLine(e); // // // // // // }; // // // // // // Gtk.ListStore iconListStore = new Gtk.ListStore (typeof (string)); // // EntryCompletion iconCompletion = new EntryCompletion(); // iconCompletion.TextColumn = 0; // iconCompletion.Model = iconListStore; // // Label iconBoxLabel = new Label("Icon Theme"); // iconBoxLabel.Halign = Align.Start; // ComboBoxText iconThemeBox = new ComboBoxText(); // // // CellRendererText renderer = new CellRendererText(); // // // area.PackStart(renderer,true,true,true); // // iconThemeBox.EntryTextColumn = 0; // iconThemeBox.WrapWidth = 5; // // for (int i = 0; i < bashHandler.IconList.Count; i++) // { // iconListStore.AppendValues(bashHandler.IconList[i]); // // listBox.Add(new Label(spltOutput[i])); // iconThemeBox.AppendText(bashHandler.IconList[i]); // } // // for (int i = 0; i < bashHandler.IconList.Count; i++) // { // if (bashHandler.IconList[i].Equals(bashHandler.GetIconTheme())) // { // iconThemeBox.Active = i; // break; // } // } // // iconThemeBox.Changed += (e, s) => // { // var cb = (ComboBoxText) e; // bashHandler.ChangeIcon(cb.ActiveText); // }; // // Gtk.ListStore shellListStore = new Gtk.ListStore (typeof (string)); // // Label shellBoxLabel = new Label("Shell Theme"); // shellBoxLabel.Halign = Align.Start; // // ComboBoxText shellThemeBox = new ComboBoxText(); // // // CellRendererText renderer = new CellRendererText(); // // // area.PackStart(renderer,true,true,true); // // shellThemeBox.EntryTextColumn = 0; // shellThemeBox.WrapWidth = 5; // // for (int i = 0; i < bashHandler.ShellList.Count; i++) // { // shellListStore.AppendValues(bashHandler.ShellList[i]); // // listBox.Add(new Label(spltOutput[i])); // shellThemeBox.AppendText(bashHandler.ShellList[i]); // } // // for (int i = 0; i < bashHandler.ShellList.Count; i++) // { // if (bashHandler.ShellList[i].Equals(bashHandler.GetShellTheme())) // { // shellThemeBox.Active = i; // break; // } // } // // shellThemeBox.Changed += (e, s) => // { // var cb = (ComboBoxText) e; // bashHandler.ChangeShell(cb.ActiveText); // }; // // // // iconThemeBox.Entry.Completion = iconCompletion; // // // // // ListBox listBox = new ListBox(); // // VBox vBox = new VBox(); // // vBox.Add(listBox); // // var swin =new Gtk.ScrolledWindow(); // // vBox.ShowAll(); // // swin.Add(vBox); // // swin.Vexpand = true; // // // // // // // // // // TreeView view = new TreeView(listStore); // // // // CellRendererText rendererText = new CellRendererText(); // // TreeViewColumn viewColumn = new TreeViewColumn("Text", rendererText, 0); // // view.AppendColumn(viewColumn); // // // // // themeBox.WrapWidth = 5; // // themeBox. // // // themeBox. // // // // // box.Add(themeBoxLabel); // box.Add(themeBox); // box.Add(iconBoxLabel); // box.Add(iconThemeBox); // box.Add(shellBoxLabel); // box.Add(shellThemeBox); // // box.Add(view); // // box.Add(swin); // // box.Add(listBox); // box.ShowAll(); // Add(box); // ShowAll(); }
static int Main() { var app = Application.New("de.uriegel.test"); if (Environment.CurrentDirectory.Contains("netcoreapp")) { Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, "../../../"); } Application.AddActions(app, new [] { new GtkAction("destroy", () => Application.Quit(app), "<Ctrl>Q"), new GtkAction("menuopen", () => { var dialog = Dialog.NewFileChooser("Datei öffnen", window, Dialog.FileChooserAction.Open, "_Abbrechen", Dialog.ResponseId.Cancel, "_Öffnen", Dialog.ResponseId.Ok, IntPtr.Zero); var res = Dialog.Run(dialog); if (res == Dialog.ResponseId.Ok) { var ptr = Dialog.FileChooserGetFileName(dialog); string file = Marshal.PtrToStringUTF8(ptr); Console.WriteLine(file); GObject.Free(ptr); } Widget.Destroy(dialog); }), new GtkAction("test", () => Console.WriteLine("Ein Test"), "F6"), new GtkAction("test2", () => Console.WriteLine("Ein Test 2")), new GtkAction("test3", () => HeaderBar.SetSubtitle(headerBar, "Das ist der neue Subtitle"), "F5"), new GtkAction("showhidden", true, (a, s) => { var state = GtkAction.HandleBoolState(a, s); Console.WriteLine(state); }, "<Ctrl>H"), new GtkAction("theme", "yaru", (a, s) => { var state = GtkAction.HandleStringState(a, s); Console.WriteLine(state); }) }); var ret = Application.Run(app, () => { var type = Gtk.GuessContentType("/home/uwe/Dokumente/hypovereinsbank.pdf"); var type1 = Gtk.GuessContentType("x.fs"); var type2 = Gtk.GuessContentType("x.cs"); type = Gtk.GuessContentType("x.pdf"); var icon = Icon.Get(type); var theme = Theme.GetDefault(); var names = Icon.GetNames(icon); // GTK_ICON_LOOKUP_FORCE_SVG var iconInfo = Theme.ChooseIcon(theme, names, 48, IconInfo.Flags.ForceSvg); var filename = IconInfo.GetFileName(iconInfo); var text = Marshal.PtrToStringUTF8(filename); GObject.Unref(icon); var builder = Builder.New(); var res = Builder.AddFromFile(builder, "glade", IntPtr.Zero); window = Builder.GetObject(builder, "window"); headerBar = Builder.GetObject(builder, "headerbar"); Builder.ConnectSignals(builder, (IntPtr builder, IntPtr obj, string signal, string handleName, IntPtr connectObj, int flags) => { switch (handleName) { case "app.delete": Gtk.SignalConnectObject <BoolFunc>(obj, signal, () => { return(false); }, connectObj); break; } }); GObject.Unref(builder); Application.AddWindow(app, window); Window.SetTitle(window, "Web View 😎😎👌"); Window.SetDefaultSize(window, 300, 300); Widget.SetSizeRequest(window, 200, 100); Window.Move(window, 2900, 456); var webView = WebKit.New(); var settings = WebKit.GetSettings(webView); GObject.SetBool(settings, "enable-developer-extras", true); Container.Add(window, webView); var target = TargetEntry.New("text/plain", TargetEntry.Flags.OtherApp, 0); DragDrop.UnSet(webView); DragDrop.SetDestination(window, DragDrop.DefaultDestination.Drop | DragDrop.DefaultDestination.Highlight | DragDrop.DefaultDestination.Motion, target, 1, DragDrop.DragActions.Move); TargetEntry.Free(target); Gtk.SignalConnect <DragDataReceivedFunc>(window, "drag-data-received", (w, context, x, y, data) => { var text = SelectionData.GetText(data); Console.WriteLine(text); } ); Gtk.SignalConnect <DragMotionFunc>(window, "drag-motion", (w, context, x, y) => { Console.WriteLine("motion"); } ); Gtk.SignalConnect <BoolFunc>(window, "delete_event", () => false);// true cancels the destroy request! Gtk.SignalConnect <ConfigureEventFunc>(window, "configure_event", (w, e) => { var evt = Marshal.PtrToStructure <ConfigureEvent>(e); Console.WriteLine("Configure " + evt.Width.ToString() + " " + evt.Height.ToString()); Window.GetSize(window, out var ww, out var hh); Console.WriteLine("Configure- " + ww.ToString() + " " + hh.ToString()); return(false); }); ScriptDialogFunc scripDialogFunc = (_, dialog) => { var ptr = WebKit.ScriptDialogGetMessage(dialog); var text = Marshal.PtrToStringUTF8(ptr); switch (text) { case "anfang": WebKit.RunJavascript(webView, "var affe = 'Ein Äffchen'"); break; case "devTools": var inspector = WebKit.GetInspector(webView); WebKit.InspectorShow(inspector); break; default: Console.WriteLine($"---ALERT--- {text}"); break; } return(true); }; Gtk.SignalConnect(webView, "script-dialog", scripDialogFunc); Gtk.SignalConnect <BoolFunc>(webView, "context-menu", () => true); Widget.ShowAll(window); //WebKit.LoadUri(webView, "https://google.de"); WebKit.LoadUri(webView, "http://localhost:3000/"); // WebKit.LoadUri(webView, $"file://{System.IO.Directory.GetCurrentDirectory()}/../webroot/index.html"); });
protected void Connect(HeaderBar header) { this.header = header; header.Connect(this); }
public ConfigForm() : base(WindowType.Toplevel) { // Setup GUI WindowPosition = WindowPosition.Center; DefaultSize = new Gdk.Size(500, 350); _headerBar = new HeaderBar(); _headerBar.ShowCloseButton = true; _headerBar.Title = "SwitchCam"; var btnClickMe = new Gtk.Button(); btnClickMe.AlwaysShowImage = true; btnClickMe.Image = Image.NewFromIconName("document-new-symbolic", IconSize.Button); _headerBar.PackStart(btnClickMe); Titlebar = _headerBar; var vpanned1 = new VPaned(); vpanned1.Position = 300; var hpanned = new HPaned(); hpanned.Position = 100; _treeView = new TreeView(); _treeView.HeadersVisible = false; hpanned.Pack1(_treeView, false, true); _notebook = new Notebook(); var scroll1 = new ScrolledWindow(); var vpanned = new VPaned(); vpanned.Position = 300; _boxContent = new Box(Orientation.Vertical, 0); _boxContent.Margin = 8; vpanned.Pack1(_boxContent, false, false); scroll1.Child = vpanned; _notebook.AppendPage(scroll1, new Label { Text = "Data", Expand = true }); hpanned.Pack2(_notebook, false, true); vpanned1.Pack1(hpanned, false, true); var box = new Box(Orientation.Horizontal, 0); box.Margin = 8; vpanned1.Pack2(box, false, true); var grid = new Grid { RowSpacing = 2, ColumnSpacing = 2 }; box.PackStart(grid, false, false, 0); var btn = new Gtk.Button("Take Picture"); btn.Clicked += TakePicture; grid.Attach(btn, 0, 0, 1, 1); Child = vpanned1; // Fill up data FillUpTreeView(); // Connect events _treeView.Selection.Changed += Selection_Changed; Destroyed += OnDestroy; try { ConfigureButton(); } catch (Exception e) { MMALLog.Logger.Debug($"Something went wrong while configuring the button. {e.Message} {e.StackTrace}"); } }
protected override void Initialize() { //this.IsMouseVisible = true; this.graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; this.graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; //graphics.ToggleFullScreen(); whiteSquare = Content.Load <Texture2D>("WhiteSquare"); font = Content.Load <SpriteFont>("text"); inputHandler = InputHandler.Instance; mouseTexture = whiteSquare; inputHandler.mouseTexture = mouseTexture; hoverPlanetErrorText = whiteSquare; hoverPlanetSuccessText = whiteSquare; human = new Player(hoverPlanetErrorText, hoverPlanetSuccessText); Globals.screenHeight = GraphicsDevice.Viewport.Height; Globals.screenWidth = GraphicsDevice.Viewport.Width; Globals.camera = new Camera(GraphicsDevice.Viewport); Globals.camera.CenterOn(new Vector2(Globals.screenWidth / 2, Globals.screenHeight / 2)); for (int i = 0; i < planetNum; i++) { Color randColor = new Color(random.Next(256), random.Next(256), random.Next(256)); Planet planet = new Planet(whiteSquare, random.Next(-Globals.screenWidth / 2, Globals.screenWidth * 3 / 2 - planetSize), //+30 for height of HeaderBar random.Next(-Globals.screenHeight / 2 + 30, Globals.screenHeight * 3 / 2 - planetSize), planetSize, planetSize, randColor, i.ToString()); planets.Add(planet); } if (shouldShowFourCornerPlanets) { Planet topLeft = new Planet(whiteSquare, -Globals.screenWidth / 2, //+30 for height of HeaderBar -Globals.screenHeight / 2 + 30, planetSize, planetSize, Color.Black, "Top Left"); Planet topRight = new Planet(whiteSquare, Globals.screenWidth * 3 / 2 - planetSize, //+30 for height of HeaderBar -Globals.screenHeight / 2 + 30, planetSize, planetSize, Color.Black, "Top Right"); Planet bottomLeft = new Planet(whiteSquare, -Globals.screenWidth / 2, Globals.screenHeight * 3 / 2 - planetSize, planetSize, planetSize, Color.Black, "Bottom Left"); Planet bottomRight = new Planet(whiteSquare, Globals.screenWidth * 3 / 2 - planetSize, Globals.screenHeight * 3 / 2 - planetSize, planetSize, planetSize, Color.Black, "Bottom Right"); planets.Add(topLeft); planets.Add(topRight); planets.Add(bottomLeft); planets.Add(bottomRight); } ModalUtil.init(); PlanetUtil.init(ref planets); DrawUtil.init(whiteSquare); HeaderBar.init(human, whiteSquare, font); headerBar = HeaderBar.Instance; BaseInfo.init(whiteSquare, font); base.Initialize(); }
/* Private helper method to display menus and breadcrumbs */ private HeaderVM getHeaderInfo(List <string> bc, List <string> bcl, string title, string subTitle) { HeaderVM h = new HeaderVM(); /* Page specifics - using parameters taken in */ Breadcrumbs b = new Breadcrumbs(); b.breadcrumbs = bc; b.breadcrumbsLink = bcl; h.brdcrm = b; HeadingLine hln = new HeadingLine(); hln.GraphATitle = "Active Projects"; hln.GraphBTitle = "Tasks Completed"; List <int> l = new List <int> { 3, 7, 4, 6, 10, 12, 12, 12 }; hln.GraphA = l; List <int> l2 = new List <int> { 16, 18, 13, 9, 12, 18, 19, 17, 3, 16, 12 }; hln.GraphB = l2; hln.PageSubtitle = subTitle; hln.PageTitle = title; h.hl = hln; /* Generate sidebar menu */ /* This probably needs to be database generated using the users access rights */ SideBarMenu s = new SideBarMenu(); MenuItem m = new MenuItem("icol-house", "/Home/Index", "Home"); s.addMenuItem(m); MenuItem m8 = new MenuItem("icol-clipboard-text", "/Home/EDI", "EDI Rejections"); s.addMenuItem(m8); MenuItem m2 = new MenuItem("icol-lock-unlock", "/Home/heldOrders", "Held Orders"); s.addMenuItem(m2); MenuItem m7 = new MenuItem("icol-user", "/Home/PPO", "PPO Req Authorisation"); s.addMenuItem(m7);//page-paste MenuItem m3 = new MenuItem("icol-alarm", "/Home/BackOrders", "Back Orders"); s.addMenuItem(m3); MenuItem m4 = new MenuItem("icol-clipboard-text", "/Home/SOE", "Sales Order Enquiry"); //s.addMenuItem(m4); MenuItem m9 = new MenuItem("icol-clipboard-text", "/Home/POE", "Purchase Order Enquiry"); //s.addMenuItem(m9); MenuItem m5 = new MenuItem("icol-cog", "", "Administration"); m5.addMenuSubItem(new MenuSubItem("icol-chart-organisation", "/Home/CSTeams", "CS Teams")); //m5.addMenuSubItem(new MenuSubItem("icol-award-star-gold", "", "Status")); //m5.addMenuSubItem(new MenuSubItem("icol-user-business-boss", "", "User")); s.addMenuItem(m5); MenuItem m6 = new MenuItem("icol-key", "", "Log Out"); //s.addMenuItem(m6); h.sbm = s; HeaderBar hdr = new HeaderBar(); h.Hdr = hdr; return(h); }
/// <summary> /// Sets the inheritance parent. /// </summary> /// <param name="inheritHeaderGroup">Source for inheriting.</param> public void SetInherit(PaletteNavigatorHeaderGroup inheritHeaderGroup) { base.SetInherit(inheritHeaderGroup); HeaderBar.SetInherit(inheritHeaderGroup.HeaderBar); HeaderOverflow.SetInherit(inheritHeaderGroup.HeaderOverflow); }
private HeaderVM getHeaderInfo(List <string> bc, List <string> bcl, string title, string subTitle) { HeaderVM h = new HeaderVM(); /* Page specifics - using parameters taken in */ Breadcrumbs b = new Breadcrumbs(); b.breadcrumbs = bc; b.breadcrumbsLink = bcl; h.brdcrm = b; HeadingLine hln = new HeadingLine(); hln.GraphATitle = "Active Projects"; hln.GraphBTitle = "Tasks Completed"; List <int> l = new List <int> { 3, 7, 4, 6, 10, 12, 12, 12 }; hln.GraphA = l; List <int> l2 = new List <int> { 16, 18, 13, 9, 12, 18, 19, 17, 3, 16, 12 }; hln.GraphB = l2; hln.PageSubtitle = subTitle; hln.PageTitle = title; h.hl = hln; /* Generate sidebar menu */ /* This probably needs to be database generated using the users access rights */ SideBarMenu s = new SideBarMenu(); MenuItem m = new MenuItem("icol-chart-bar", "", "Dashboard"); s.addMenuItem(m); MenuItem m8 = new MenuItem("icol-clipboard-text", "/Home/Index", "Knowledge base"); //s.addMenuItem(m8); MenuItem m2 = new MenuItem("icol-page-paste", "/Home/RaiseCall", "Raise Call"); //s.addMenuItem(m2); MenuItem m7 = new MenuItem("icol-clipboard-text", "/Home/Index", "Asset Register"); //s.addMenuItem(m7); MenuItem m3 = new MenuItem("icol-page-paste", "/Home/ChangeRequest", "Change Request"); s.addMenuItem(m3); MenuItem m4 = new MenuItem("icol-clipboard-text", "/Home/Index", "Projects"); s.addMenuItem(m4); MenuItem m9 = new MenuItem("icol-clipboard-text", "/Home/Index", "Help Desk"); //s.addMenuItem(m9); MenuItem m5 = new MenuItem("icol-cog", "", "Administration"); m5.addMenuSubItem(new MenuSubItem("icol-chart-organisation", "", "Department")); m5.addMenuSubItem(new MenuSubItem("icol-award-star-gold", "", "Status")); m5.addMenuSubItem(new MenuSubItem("icol-user-business-boss", "", "User")); s.addMenuItem(m5); //MenuItem m14 = new MenuItem("icol-chart-bar", "", "Support"); //s.addMenuItem(m14); MenuItem m6 = new MenuItem("icol-key", "", "Log Out"); s.addMenuItem(m6); h.sbm = s; HeaderBar hdr = new HeaderBar(); hdr.User = "******"; hdr.AlertQty = 3; hdr.PendingTaskQty = 12; hdr.MessageQty = 2; h.Hdr = hdr; return(h); }
// private MenuButton languageSelectorButton; public RoboPad(WindowType type, String[] args) : base(type) { noOfWindows++; SetDefaultSize(500, 500); Maximize(); DeleteEvent += (sender, s) => { if (!isChangeSaved) { MessageDialog dialog = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Warning, ButtonsType.OkCancel, "Changes Unsaved Are You Sure You Want To Exit "); // Dialog dialog=new Dialog() var response = dialog.Run(); noOfWindows--; if (response == (int)Gtk.ResponseType.Ok) { if (noOfWindows <= 0) { Gtk.Application.Quit(); } } else { s.RetVal = true; } dialog.Dispose(); } else { noOfWindows--; if (noOfWindows <= 0) { Gtk.Application.Quit(); } } }; VBox vBox = new VBox(); List <String> newTextList = new(); var lm = LanguageManager.Default; sourceView = new(); sourceView.Buffer.HighlightSyntax = true; sourceView.WrapMode = WrapMode.Word; sourceView.AutoIndent = true; sourceView.ShowLineNumbers = true; StyleSchemeManager schemeManager = StyleSchemeManager.Default; // StyleScheme styleScheme = schemeManager.GetScheme("pop-light"); // sourceView.Buffer.StyleScheme = styleScheme; sourceView.KeyPressEvent += (o, eventArgs) => { if (Keyval.Name(eventArgs.Event.KeyValue) == "s") { saveFile(o, eventArgs); } else if (Keyval.Name(eventArgs.Event.KeyValue) == "S") { saveAsFile(o, eventArgs); } else if (Keyval.Name(eventArgs.Event.KeyValue) == "o") { openFile(o, eventArgs); } }; headerBar = new HeaderBar(); ScrolledWindow scrolledWindow = new ScrolledWindow(); scrolledWindow.Add(sourceView); headerBar.ShowCloseButton = true; headerBar.Title = "RoboPad"; headerBarOringalText = headerBar.Title; sourceView.Buffer.Changed += (sender, eventArgs) => { headerBar.Title = "*" + headerBarOringalText; if (sourceView.Buffer.Text != previousText) { isChangeSaved = false; } else { isChangeSaved = true; headerBar.Title = headerBarOringalText; } }; ToolButtonHandler toolbar = new ToolButtonHandler(this, sourceView); // Menu menu = new Menu(); // MenuItem openItem = new RadioMenuItem("test"); // menu.Add(openItem); // // menu.ShowAll(); // PopOverMenuHandler popoverMenu = new(this); MenuButton menuButton = new MenuButton(); menuButton.Popover = popoverMenu; Image image = Gtk.Image.NewFromIconName("view-more-symbolic", IconSize.LargeToolbar); menuButton.Image = image; headerBar.PackEnd(menuButton); Statusbar statusbar = new Statusbar(); statusBarLabel = new(""); statusbar.PackStart(statusBarLabel, false, false, 5); languageSelectorButton = new LanguageSelectorButton(sourceView); statusbar.PackEnd(languageSelectorButton, false, false, 5); // Box box = new Box(Gtk.Orientation.Vertical,2); Titlebar = headerBar; vBox.PackStart(toolbar, false, false, 0); vBox.PackStart(scrolledWindow, true, true, 0); vBox.PackStart(statusbar, false, false, 0); Add(vBox); ShowAll(); Show(); if (args != null) { if (args.Length >= 1) { if (!String.IsNullOrWhiteSpace(args[0])) { openFileWithArgs(args[0]); } } } }