Exemplo n.º 1
0
    public Shell()
        : base("Mono Heap Profiler")
    {
        entries = new ActionEntry[] {
            new ActionEntry ("FileMenu", null, "_File", null, null, null),
            new ActionEntry ("OpenAction", Stock.Open, null, "<control>O", "Open a profile...", new EventHandler (OnOpen)),
            new ActionEntry ("QuitAction", Stock.Quit, null, "<control>Q", "Quit the application", delegate { Application.Quit (); }),
        };

        DefaultSize = new Gdk.Size (700, 700);
        DeleteEvent += delegate { Application.Quit (); };

        main_box = new VBox (false, 0);
        Add (main_box);

        shell_commands = new ActionGroup ("TestActions");
        shell_commands.Add (entries);

        uim = new UIManager ();
        uim.AddWidget += delegate (object obj, AddWidgetArgs args) {
            args.Widget.Show ();
            main_box.PackStart (args.Widget, false, true, 0);
        };

        uim.ConnectProxy += OnProxyConnect;
        uim.InsertActionGroup (shell_commands, 0);
        uim.AddUiFromResource ("shell-ui.xml");
        AddAccelGroup (uim.AccelGroup);

        sb = new Statusbar ();
        main_box.PackEnd (sb, false, true, 0);

        pager = new ShellPager (this);
        main_box.PackEnd (pager, true, true, 0);
    }
		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 ();
		}
Exemplo n.º 3
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Application.Init ();

            this.Resize(640,480);
            //menu bar very top
            MenuBar mb = new MenuBar ();
            Menu fileMenu = new Menu ();
            MenuItem menuItem = new MenuItem ("_File");
            menuItem.Submenu = fileMenu;
            mb.Append(menuItem);
            MenuItem menuFileQuit = new MenuItem("Quit");
            fileMenu.Append(menuFileQuit);
            vboxMain.PackStart(mb,false,false,0);

            //toolbar
            Toolbar tbTop = new Toolbar ();
            //toolbutton Staff
            ToolButton tbStaff = new ToolButton (Gtk.Stock.OrientationPortrait);
            tbStaff.Label="Staff";
            tbStaff.IsImportant=true;
            tbStaff.Clicked += HandleTbStaffClicked;
            tbTop.Insert(tbStaff,0);
            //toolbutton Clients
            ToolButton tbClients = new ToolButton (Gtk.Stock.About);
            tbClients.Label="Clients";
            tbClients.IsImportant=true;
            tbClients.Clicked+= HandleTbClientsClicked;
            tbTop.Insert(tbClients,1);
            //media bar
            Label lbMediaTemp = new Label ();
            lbMediaTemp.Text="Media holder";
            lbMediaTemp.Show();
            //pack the toolbar and media bar in the top hbox//
            hbTop.PackStart(tbTop);
            hbTop.PackStart(lbMediaTemp);
            //pack the top hbox in the main vbox
            vboxMain.PackStart(hbTop,false,false,1);
            // horizontal pane
            verticalPane.Position=200;
            verticalPane.Pack1(scrollWindowLeft,false,false);
            verticalPane.Pack2(scrollWindowRight,false,false);
            vboxMain.PackStart(verticalPane);
            scrollWindowLeft.Add(viewPortLeft);

            scrollWindowRight.Add(viewPortRight);
            Label lbMain = new Label ();
            lbMain.Text= "main";
            viewPortRight.Add(lbMain);
            verticalPane.ShowAll();
            //status bar very bottom
            Statusbar sb = new Statusbar ();
            vboxMain.PackStart(sb,false,false,1);

            this.Add(vboxMain);
            //hb1.Add(tbTop);
            this.ShowAll ();
        Build ();
    }
Exemplo n.º 4
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New NyFolder Window
        public Window() : base(Info.Name + " " + Info.Version)
        {
            // Initialize Window
            this.SetDefaultSize(620, 320);
            DefaultIcon       = StockIcons.GetPixbuf("NyFolderIcon");
            this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);

            // Initialize VBox
            this.vboxMain = new Gtk.VBox(false, 2);
            this.Add(this.vboxMain);

            // Initialize Menu Manager
            this.menuManager            = new MenuManager();
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            this.AddAccelGroup(this.menuManager.AccelGroup);

            // Initialize HBox Menu
            this.hboxMenu = new Gtk.HBox(false, 0);
            this.vboxMain.PackStart(hboxMenu, false, false, 0);

            // Initialize MenuBar
            Gtk.MenuBar menuBar = this.MenuBar;
            this.hboxMenu.PackStart(menuBar, false, false, 0);

            // Initialize HBox
            this.hbox = new Gtk.HBox();
            this.vboxMain.PackStart(this.hbox, true, true, 2);

            // Initialize Left VBox
            this.vboxLeft = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vboxLeft, false, false, 2);

            // Initialize User Panel
            this.userPanel = new UserPanel();
            this.vboxLeft.PackStart(this.userPanel, false, false, 2);

            // Initialize Right VBox
            this.vboxRight = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vboxRight, true, true, 2);

            // Initialize ToolBar
            Gtk.Toolbar toolBar = this.ToolBar;
            toolBar.ShowArrow    = true;
            toolBar.IconSize     = Gtk.IconSize.LargeToolbar;
            toolBar.ToolbarStyle = ToolbarStyle.Both;
            this.vboxRight.PackStart(toolBar, false, false, 2);

            // Initialize Notebook Viewer
            this.notebookViewer = new NotebookViewer();
            this.vboxRight.PackStart(this.notebookViewer, true, true, 2);

            // Initialize Status Bar
            this.statusBar = new Gtk.Statusbar();
            this.vboxMain.PackEnd(this.statusBar, false, false, 0);

            // Window Show All
            this.ShowAll();
        }
Exemplo n.º 5
0
 static void TextPushed_cb(IntPtr inst, uint context_id, IntPtr text)
 {
     try {
         Statusbar __obj = GLib.Object.GetObject(inst, false) as Statusbar;
         __obj.OnTextPushed(context_id, GLib.Marshaller.Utf8PtrToString(text));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Exemplo n.º 6
0
Arquivo: GMan.cs Projeto: pombreda/enh
    public GMan()
    {
        Application.Init();

        window = new Gtk.Window("GMan");
        window.SetDefaultSize(800, 600);
        window.DeleteEvent += new DeleteEventHandler(OnWindowDelete);
        // FIXME: we should remember where we were when we last ran.
        window.WindowPosition = WindowPosition.Center;

        VBox vbox = new VBox(false, 2);

        window.Add(vbox);

        vbox.PackStart(MakeMenuBar(), false, false, 1);

        HBox hbox = new HBox(false, 1);

        Label label = new Label("Search:");

        entry            = new Gtk.Entry("");
        entry.Activated += new EventHandler(OnEntryActivated);

        Button button = new Button("!");

        button.Clicked += new EventHandler(OnButtonClicked);

        Button backButton    = new Button(Stock.GoBack);
        Button forwardButton = new Button(Stock.GoForward);

        hbox.PackStart(backButton, false, false, 1);
        hbox.PackStart(forwardButton, false, false, 1);
        hbox.PackStart(label, false, false, 1);
        hbox.PackStart(entry, true, true, 1);
        hbox.PackStart(button, false, false, 1);

        vbox.PackStart(hbox, false, false, 1);

        ScrolledWindow sw = new ScrolledWindow();

        sw.VscrollbarPolicy = PolicyType.Always;
        sw.HscrollbarPolicy = PolicyType.Always;
        vbox.PackStart(sw, true, true, 1);

        statusBar = new Gtk.Statusbar();
        vbox.PackStart(statusBar, false, false, 1);

        html               = new HTML();
        html.LinkClicked  += new LinkClickedHandler(OnLinkClicked);
        html.OnUrl        += new OnUrlHandler(OnOnUrl);
        html.TitleChanged += new TitleChangedHandler(OnTitleChanged);
        sw.Add(html);

        window.ShowAll();
        entry.GrabFocus();
        Application.Run();
    }
Exemplo n.º 7
0
		public MainWindow (): base (Gtk.WindowType.Toplevel)
		{
			// this window
			this.Title= "Supos";
			this.DeleteEvent += OnDeleteEvent;
			// main vbox
			mainBox = new VBox(false, 0);
			this.Add(mainBox);
			// actiongroup and uimanager stuff (menubar)
			actgroup = new ActionGroup ("TestActions");
			SetUpActionGroup();			
			uim = new UIManager ();
			uim.InsertActionGroup (actgroup, 0);
			this.AddAccelGroup(uim.AccelGroup);
			SetUpUiManager();
			Gtk.Widget menubar = uim.GetWidget("/MenuBar");
			mainBox.PackStart(menubar, false, false, 0);
			actgroup.GetAction("disconnect").Sensitive=false;
			// main panned view
			mainPaned = new HPaned();
			mainPaned.Sensitive = false;
			mainPaned.Name = "toucharea";			
			mainBox.PackStart(mainPaned, true, true, 0);
			// order editing view
			orderview = new ViewOrderEdit();
			mainPaned.Pack2(orderview, false, false);
			// categories product paned view
			HPaned hpan2;
			hpan2 = new HPaned();
			mainPaned.Pack1(hpan2, true, false);
			// categories view	
			catview = new ViewNameIcon();
			catview.DataMember="Categories";
			catview.SelectionChanged += this.OnCatSelectionChanged;
			catview.WidthRequest= 200;
			hpan2.Pack1(catview, false, false);
			// products view
			prodview = new ViewNameIcon();
			prodview.DataMember = "Products";
			prodview.RowActivated += this.OnProdRowActivated;			
			prodview.WidthRequest= 400;
			hpan2.Pack2(prodview, true, false);
			// status bar
			Statusbar statusbar;
			statusbar = new Statusbar();
			mainBox.PackStart(statusbar, false, false, 0);
			// clock
			Clock clock;
			clock = new Clock();
			clock.BorderWidth = 6;			
			statusbar.PackStart(clock, false, false, 0);
			// END build interface
			
			this.ApplyViewPreferences(SettingsHandler.Settings.viewSettings);
			
		}
Exemplo n.º 8
0
 private void LoadPointers()
 {
     window = (Gtk.Window)ui["window1"];
     window.SetDefaultSize(450, 450);
     subject_entry = (Gtk.Entry)ui["subject_entry"];
     textbuffer    = ((Gtk.TextView)ui["textview1"]).Buffer;
     contrib_entry = (Gtk.Entry)ui["contrib_entry"];
     server_entry  = (Gtk.Entry)ui["server_entry"];
     statusbar     = (Gtk.Statusbar)ui["statusbar1"];
 }
Exemplo n.º 9
0
	private void LoadPointers ()
	{
		window = (Gtk.Window) ui["window1"];
		window.SetDefaultSize (450, 450);
		subject_entry = (Gtk.Entry) ui["subject_entry"];
		textbuffer = ((Gtk.TextView) ui["textview1"]).Buffer;
		contrib_entry = (Gtk.Entry) ui["contrib_entry"];
		server_entry = (Gtk.Entry) ui["server_entry"];
		statusbar = (Gtk.Statusbar) ui["statusbar1"];
	}
Exemplo n.º 10
0
        private void build()
        {
            this.SetDefaultSize(1000, 600);

            this.vbox1 = new VBox();

            this.toolbar1 = new Toolbar();
            this.toolbar1.ToolbarStyle     = ToolbarStyle.BothHoriz;
            this.newcharbutton             = new ToolButton(Stock.New);
            this.newcharbutton.Label       = "New";
            this.newcharbutton.TooltipText = "New Character";
            this.newcharbutton.IsImportant = true;
            this.newcharbutton.Clicked    += HandleNewcharbuttonClicked;
            this.toolbar1.Add(this.newcharbutton);
            this.savecharbutton             = new ToolButton(Stock.Save);
            this.savecharbutton.Label       = "Save";
            this.savecharbutton.TooltipText = "Save Character";
            this.savecharbutton.Clicked    += HandleSavecharbuttonClicked;
            this.toolbar1.Add(this.savecharbutton);
            this.printcharbutton             = new ToolButton(Stock.Print);
            this.printcharbutton.Label       = "Print";
            this.printcharbutton.TooltipText = "Print Character";
            this.printcharbutton.Clicked    += HandlePrintcharbuttonClicked;
            this.toolbar1.Add(this.printcharbutton);
            this.toolbar1.Add(new SeparatorToolItem());
            this.rollbutton             = new ToolButton(Stock.Refresh);
            this.rollbutton.Label       = "Roll";
            this.rollbutton.TooltipText = "Roll Characteristics";
            this.rollbutton.IsImportant = true;
            this.rollbutton.Clicked    += HandleRollbuttonClicked;
            this.toolbar1.Add(this.rollbutton);
            this.aboutbutton             = new ToolButton(Stock.About);
            this.aboutbutton.Label       = "About";
            this.aboutbutton.TooltipText = "About Adeptus";
            this.aboutbutton.Clicked    += HandleAboutbuttonClicked;
            SeparatorToolItem sti = new SeparatorToolItem();

            sti.Draw   = false;
            sti.Expand = true;
            this.toolbar1.Add(sti);
            this.toolbar1.Add(this.aboutbutton);

            this.frame1 = new Frame();
            this.frame1.Add(new Image(Gdk.Pixbuf.LoadFromResource("Adeptus.Gui.EmperorVHorus.jpg")));

            this.statusbar1 = new Statusbar();
            this.statusbar1.Push(0, "Ready");

            this.vbox1.PackStart(this.toolbar1, false, true, 0);
            this.vbox1.PackStart(this.frame1, true, true, 0);
            this.vbox1.PackEnd(this.statusbar1, false, true, 0);

            this.Add(this.vbox1);
        }
Exemplo n.º 11
0
        public MainWindow()
            : base(WindowType.Toplevel)
        {
            Console.WriteLine("MainWindow...");
            this.Title = "GefGlue Demo (Gtk#)";
            this.SetSizeRequest(800, 600);

            var vBox = new VBox();
            vBox.Visible = true;
            vBox.Homogeneous = false;

            var hBox = new HBox();
            hBox.Visible = true;

            var backButton = new Button();
            backButton.Visible = true;
            backButton.Label = "Back";

            var forwardButton = new Button();
            forwardButton.Visible = true;
            forwardButton.Label = "Forward";

            Console.WriteLine("new CefWebBrowserWidget()...");
            var browser = new CefGlue.GtkSharp.CefWebBrowserWidget();
            browser.Visible = true;
            Console.WriteLine("new CefWebBrowserWidget()... done");

            var statusBar = new Statusbar();
            statusBar.Visible = true;

            // Layout
            hBox.Add(backButton);
            hBox.Add(forwardButton);
            vBox.Add(hBox);
            vBox.Add(browser);
            vBox.Add(statusBar);
            this.Add(vBox);

            var vw1 = ((Box.BoxChild)(vBox[hBox]));
            vw1.Expand = false;
            vw1.Fill = false;

            var vw3 = ((Box.BoxChild)(vBox[statusBar]));
            vw3.Expand = false;
            vw3.Fill = false;

            //Show Everything
            Console.WriteLine("ShowAll()...");
            // this.ShowAll();
            Console.WriteLine("ShowAll()... done");
        }
Exemplo n.º 12
0
        public void Build()
        {
            this.window = new Window("BattleNames");
            this.window.SetDefaultSize(800, 600);
            this.window.DeleteEvent += HandleWindowDeleteEvent;

            this.vbox = new VBox();
            {
                this.tbar = new Toolbar();
                this.tbar.ToolbarStyle = ToolbarStyle.BothHoriz;
                {
                    this.generatebutton             = new ToolButton(Stock.New);
                    this.generatebutton.TooltipText = "Generate a new battle name";
                    this.generatebutton.Label       = "Generate";
                    this.generatebutton.IsImportant = true;
                    this.generatebutton.Clicked    += HandleGeneratebuttonClicked;
                    this.clearbutton             = new ToolButton(Stock.Clear);
                    this.clearbutton.TooltipText = "Clear output";
                    this.clearbutton.Label       = "Clear";
                    this.clearbutton.Clicked    += HandleClearbuttonClicked;
                }
                this.tbar.Add(this.generatebutton);
                this.tbar.Add(this.clearbutton);

                this.hpaned = new HPaned();
                {
                    this.treescrolledwindow = new ScrolledWindow();
                    this.treeview           = new TreeView();
                    this.treeview.AppendColumn("Name", new CellRendererText(), "text", 0);
                    this.treeview.HeadersVisible = true;
                    this.treeview.Model          = this.treestore;
                    this.treescrolledwindow.Add(this.treeview);

                    this.textscrolledwindow = new ScrolledWindow();
                    this.textview           = new TextView();
                    this.textview.Editable  = false;
                    this.textscrolledwindow.Add(this.textview);
                }
                this.hpaned.Pack1(this.treescrolledwindow, false, true);
                this.hpaned.Pack2(this.textscrolledwindow, true, true);
                this.hpaned.Position = 200;

                this.sbar = new Statusbar();
            }
            this.vbox.PackStart(this.tbar, false, true, 0);
            this.vbox.PackStart(this.hpaned, true, true, 0);
            this.vbox.PackEnd(this.sbar, false, true, 0);

            this.window.Add(this.vbox);
        }
Exemplo n.º 13
0
		public void SetupChildren ()
		{
			VBox l = new VBox (false, 0);
			Add (l);
			
			menubar = CreateMenu ();
			toolbar = CreateToolbar ();
			statusbar = CreateStatusBar ();
			
			friends = CreateFriends ();
			
			l.PackStart (menubar, false, false, 0);
			l.PackStart (toolbar);
			l.PackStart (statusbar);
		}
        private void InitBrowser()
        {
            web = new WebControl("about:blank", "Gecko");
            //win = new Viewport();
            sb = new Statusbar();
            //main = new VBox();
            bot_queue_length = 0;

            sb.TextPushed += new Gtk.TextPushedHandler (StatusbarDisplay);
            sb.Visible = false;
            sb.HasResizeGrip = false;

            web.LinkMsg += new EventHandler (LinkMessage);
            //web.LoadUrl("about:blank");
            this.PackStart(web, true, true, 0);
            this.PackEnd(sb, false, false, 0);
            this.ShowAll();
        }
Exemplo n.º 15
0
    public ExploreView(Driver driver, int stopAfter)
        : base("Explore")
    {
        int x, y, width, height, depth;
        RootWindow.GetGeometry (out x, out y, out width, out height, out depth);
        SetDefaultSize (width - 50, height - 40);

        VBox vBox = new VBox(false, 1);
        Add(vBox);

        HPaned hPaned = new HPaned();
        vBox.Add(hPaned);

        ScrolledWindow scrolledWindow = new ScrolledWindow();
        //scrolledWindow.SetDefaultSize (Convert.ToInt32((width - 50) * 0.4), height -40);
        hPaned.Add1(scrolledWindow);

        repositoryView = new RepositoryView(driver);
        scrolledWindow.Add(repositoryView);

        viewChildren = new Notebook ();

        changesetView = new ChangesetView(driver, stopAfter);
        viewChildren.AppendPage (changesetView, new Label ("Changeset View"));

        directoryView = new DirectoryView(driver);
        viewChildren.AppendPage (directoryView, new Label ("Directory View"));

        fileView = new FileView(driver);
        viewChildren.AppendPage (fileView, new Label ("File View"));

        hPaned.Add2(viewChildren);
        hPaned.Position = (width - 50) / 3;

        // add status bar
        Statusbar sb = new Statusbar ();
        sb.HasResizeGrip = false;
        vBox.PackEnd(sb, false, false, 1);

         		ShowAll();

        repositoryView.Selection.Changed += OnPathSelectionChanged;
        viewChildren.SwitchPage += OnSwitchPage;
    }
Exemplo n.º 16
0
		public Window (ComparisonInfo info) : base ("ilContrast Assembly Comparison Tool") 
		{
			DefaultSize = new Size (450, 450);

			main_vbox = new VBox (false, 0);
			AddActionUI ();
#if USE_GECKO
			browser = new Gecko.WebControl ();
			main_vbox.PackStart (browser, true, true, 0);
#else
			web_view = new WebKit.WebView ();
			ScrolledWindow sw = new ScrolledWindow ();
			sw.Add (web_view);
			main_vbox.PackStart (sw, true, true, 0);
#endif
			statusbar = new Statusbar ();
			main_vbox.PackStart (statusbar, false, false, 0);
			Add (main_vbox);
			main_vbox.ShowAll ();
			first_show = true;
			this.info = info;
		}
Exemplo n.º 17
0
		public static Gtk.Window Create ()
		{
			window = new Window ("Statusbar");
			window.SetDefaultSize (150, 100);

			VBox box1 = new VBox (false, 0);
			window.Add (box1);

			VBox box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, true, true, 0);

			statusbar = new Statusbar ();
			box1.PackEnd (statusbar, true, true, 0);
			statusbar.TextPopped += new TextPoppedHandler (statusbar_popped);

			Button button = new Button ("push");
			box2.PackStart (button, false, false, 0);
			button.Clicked += new EventHandler (statusbar_pushed);

			button = new Button ("pop");
			box2.PackStart (button, false, false, 0);
			button.Clicked += new EventHandler (pop_clicked);

			box1.PackStart (new HSeparator (), false, true, 0);

			box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, false, true, 0);

			Button close_button = new Button (Stock.Close);
			close_button.Clicked += new EventHandler (Close_Button);
			box2.PackStart (close_button, true, true, 0);
			button.CanDefault = true;
			button.GrabDefault ();
			
			window.ShowAll ();
			return window;
		}
Exemplo n.º 18
0
        // }}}
        //MainWindow::MainWindow() {{{
        /// <summary>Constructor</summary>
        /// <returns>void</returns>  
        public MainWindow()
            : base("Ipl Viewer")
        {
            this.Resize(this.pref.mainWindowWidth, this.pref.mainWindowHeight);
            this.WindowPosition = Gtk.WindowPosition.Center;
            this.DeleteEvent += new DeleteEventHandler(onDeleteEvent);

            this._vBox = new VBox(false, 4);
            this._createMenuBar();
            this._createToolBar();

            this.layout = new Pango.Layout(this.PangoContext);

            DrawingArea drawArea = new DrawingArea();
            initDrawingArea(drawArea);
            this._vBox.PackStart(drawArea);

            Statusbar statusbar = new Statusbar();
            this._vBox.PackStart(statusbar, false, true, 0);

            this.Add(this._vBox);
            this.ShowAll();
        }
Exemplo n.º 19
0
        // ========================================
        // PUBLIC Constructors
        // ========================================
        public Window() : base(Info.Name + " " + Info.Version)
        {
            // Initialize Window Properties
            this.SetDefaultSize(500, 300);
            DefaultIcon       = StockIcons.GetPixbuf("NyIVIcon");
            this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);

            // Initialize VBox
            this.vbox = new Gtk.VBox(false, 0);
            this.Add(this.vbox);

            // Initialize Menu & Toolbar
            this.uiMenuManager            = new UiMenuManager();
            this.uiMenuManager.Activated += new EventHandler(OnMenuActivated);
            this.AddAccelGroup(this.uiMenuManager.AccelGroup);

            // Initialize MenuBar
            Gtk.MenuBar menubar = this.MenuBar;
            this.vbox.PackStart(menubar, false, false, 0);

            // Initialize ToolBar
            Gtk.Toolbar toolbar = this.ToolBar;
            toolbar.ToolbarStyle = ToolbarStyle.Both;
            toolbar.IconSize     = IconSize.LargeToolbar;
            this.vbox.PackStart(toolbar, false, false, 0);

            // Initialize Viewer
            this.viewer = new Viewer();
            this.vbox.PackStart(this.viewer, true, true, 2);

            // Initialize StatusBar
            this.statusBar = new Gtk.Statusbar();
            this.vbox.PackEnd(this.statusBar, false, false, 0);

            // Set Sensitive Menu
            SetSensitiveImageMenu(false);
        }
Exemplo n.º 20
0
		protected NoteRecentChanges (NoteManager manager)
: base (Catalog.GetString ("Search All Notes"))
		{
			this.manager = manager;
			this.IconName = "tomboy";
			this.DefaultWidth = 450;
			this.DefaultHeight = 400;
			this.current_matches = new Dictionary<string, int> ();
			this.Resizable = true;

			selected_tags = new Dictionary<Tag, Tag> ();

			AddAccelGroup (Tomboy.ActionManager.UI.AccelGroup);

			menu_bar = CreateMenuBar ();

			Gtk.Label label = new Gtk.Label (Catalog.GetString ("_Search:"));
			label.Xalign = 0.0f;

			find_combo = Gtk.ComboBoxEntry.NewText ();
			label.MnemonicWidget = find_combo;
			find_combo.Changed += OnEntryChanged;
			find_combo.Entry.ActivatesDefault = false;
			find_combo.Entry.Activated += OnEntryActivated;
			find_combo.Entry.FocusInEvent += OnEntryFocusIn;
			if (previous_searches != null) {
				foreach (string prev in previous_searches) {
					find_combo.AppendText (prev);
				}
			}

			clear_search_button = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear,
							      Gtk.IconSize.Menu));
			clear_search_button.Sensitive = false;
			clear_search_button.Clicked += ClearSearchClicked;
			clear_search_button.Show ();

			Gtk.Table table = new Gtk.Table (1, 3, false);
			table.Attach (label, 0, 1, 0, 1,
			              Gtk.AttachOptions.Fill,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              0, 0);
			table.Attach (find_combo, 1, 2, 0, 1,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              0, 0);
			table.Attach (clear_search_button,
				      2, 3, 0, 1,
			              Gtk.AttachOptions.Fill,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              0, 0);
			table.ColumnSpacing = 4;
			table.ShowAll ();

			Gtk.HBox hbox = new Gtk.HBox (false, 0);
			hbox.PackStart (table, true, true, 0);
			hbox.ShowAll ();

			// Notebooks Pane
			Gtk.Widget notebooksPane = MakeNotebooksPane ();
			notebooksPane.Show ();

			MakeRecentTree ();
			tree.Show ();

			status_bar = new Gtk.Statusbar ();
			status_bar.HasResizeGrip = true;
			status_bar.Show ();

			// Update on changes to notes
			manager.NoteDeleted += OnNotesDeleted;
			manager.NoteAdded += OnNotesChanged;
			manager.NoteRenamed += OnNoteRenamed;
			manager.NoteSaved += OnNoteSaved;

			// List all the current notes
			UpdateResults ();

			matches_window = new Gtk.ScrolledWindow ();
			matches_window.ShadowType = Gtk.ShadowType.In;

			matches_window.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			matches_window.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			matches_window.Add (tree);
			matches_window.Show ();

			hpaned = new Gtk.HPaned ();
			hpaned.Position = 150;
			hpaned.Add1 (notebooksPane);
			hpaned.Add2 (matches_window);
			hpaned.Show ();

			RestorePosition ();

			Gtk.VBox vbox = new Gtk.VBox (false, 8);
			vbox.BorderWidth = 6;
			vbox.PackStart (hbox, false, false, 4);
			vbox.PackStart (hpaned, true, true, 0);
			vbox.PackStart (status_bar, false, false, 0);
			vbox.Show ();

			// Use another VBox to place the MenuBar
			// right at thetop of the window.
			content_vbox = new Gtk.VBox (false, 0);
#if !MAC
			content_vbox.PackStart (menu_bar, false, false, 0);
#endif
			content_vbox.PackStart (vbox, true, true, 0);
			content_vbox.Show ();

			this.Add (content_vbox);
			this.DeleteEvent += OnDelete;
			this.KeyPressEvent += OnKeyPressed; // For Escape

			// Watch when notes are added to notebooks so the search
			// results will be updated immediately instead of waiting
			// until the note's QueueSave () kicks in.
			Notebooks.NotebookManager.NoteAddedToNotebook += OnNoteAddedToNotebook;
			Notebooks.NotebookManager.NoteRemovedFromNotebook += OnNoteRemovedFromNotebook;
			
			// Set the focus chain for the top-most containers Bug #512175
			Gtk.Widget[] vbox_focus = new Gtk.Widget[2];
			vbox_focus[0] = hbox;
			vbox_focus[1] = hpaned;
			vbox.FocusChain = vbox_focus;

			// Set focus chain for sub widgits of first top-most container
			Gtk.Widget[] table_focus = new Gtk.Widget[2];
			table_focus[0] = find_combo;
			table_focus[1] = matches_window;
			hbox.FocusChain = table_focus;
			
			// set focus chain for sub widgits of seconf top-most container
			Gtk.Widget[] hpaned_focus = new Gtk.Widget[2];
			hpaned_focus[0] = matches_window;
			hpaned_focus[1] = notebooksPane;
			hpaned.FocusChain = hpaned_focus;
			
			// get back to the beginning of the focus chain
			Gtk.Widget[] scroll_right = new Gtk.Widget[1];
			scroll_right[0] = tree;
			matches_window.FocusChain = scroll_right;
			
			Tomboy.ExitingEvent += OnExitingEvent;
		}
Exemplo n.º 21
0
        private void build()
        {
            this.vbox1 = new VBox();

            this.toolbar1 = new Toolbar();
            this.aboutbtn1 = new ToolButton(Stock.About);
            this.aboutbtn1.Label = "About";
            this.aboutbtn1.IsImportant = true;
            this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
            this.toolbar1.Add(this.aboutbtn1);
            this.vbox1.PackStart(this.toolbar1, false, true, 0);

            this.treestore1 = this.populateTreeStoreFromSession();
            this.scrollw1 = new ScrolledWindow();
            this.hpaned1 = new HPaned();
            this.treeview1 = new TreeView(this.treestore1);
            this.treeview1.HeadersVisible = true;
            this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0);
            this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1);
            this.treeview1.ExpandAll();
            this.scrollw1.Add(this.treeview1);
            this.iconview1 = new IconView();
            this.hpaned1.Add1(this.scrollw1);
            this.hpaned1.Add2(this.iconview1);
            this.hpaned1.Position = 254;
            this.vbox1.PackStart(this.hpaned1, true, true, 0);

            this.statusbar1 = new Statusbar();
            this.vbox1.PackEnd(this.statusbar1, false, true, 0);

            this.Add(this.vbox1);
            this.SetSizeRequest(800,600);

            this.DeleteEvent += HandleDeleteEvent;
        }
Exemplo n.º 22
0
    public GMan()
    {
        Application.Init();

        window = new Gtk.Window("GMan");
        window.SetDefaultSize(800, 600);
        window.DeleteEvent += new DeleteEventHandler(OnWindowDelete);
        // FIXME: we should remember where we were when we last ran.
        window.WindowPosition = WindowPosition.Center;

        VBox vbox = new VBox(false, 2);
        window.Add(vbox);

        vbox.PackStart(MakeMenuBar(), false, false, 1);

        HBox hbox = new HBox(false, 1);

        Label label = new Label("Search:");

        entry = new Gtk.Entry("");
        entry.Activated += new EventHandler(OnEntryActivated);

        Button button = new Button("!");
        button.Clicked += new EventHandler(OnButtonClicked);

        Button backButton = new Button(Stock.GoBack);
        Button forwardButton = new Button(Stock.GoForward);

        hbox.PackStart(backButton, false, false, 1);
        hbox.PackStart(forwardButton, false, false, 1);
        hbox.PackStart(label, false, false, 1);
        hbox.PackStart(entry, true, true, 1);
        hbox.PackStart(button, false, false, 1);

        vbox.PackStart(hbox, false, false, 1);

        ScrolledWindow sw = new ScrolledWindow();
        sw.VscrollbarPolicy = PolicyType.Always;
        sw.HscrollbarPolicy = PolicyType.Always;
        vbox.PackStart(sw, true, true, 1);

        statusBar = new Gtk.Statusbar();
        vbox.PackStart(statusBar, false, false, 1);

        html = new HTML();
        html.LinkClicked += new LinkClickedHandler(OnLinkClicked);
        html.OnUrl += new OnUrlHandler(OnOnUrl);
        html.TitleChanged += new TitleChangedHandler(OnTitleChanged);
        sw.Add(html);

        window.ShowAll();
        entry.GrabFocus();
        Application.Run();
    }
Exemplo n.º 23
0
        //Contains all of the components which are on the window
        private void setupWindow()
        {
            //Vertical box (3 sections) which is the main container
            VBox MainVBox = new VBox(false, 6);

            /*********************Start of menu bar components*********************/

            //Note: Flow of menus are:
            //Menubar contains MenuItems (e.g. File, Edit, About, etc...)
            //MenuItems contains one Menu (i.e. a Submenu)
            //Menu contains multiple MenuItems (e.g. Save, Save As, Load, etc...)
            MenuBar MainMenuBar = new MenuBar ();

            Menu FileMenu = new Menu ();
            MenuItem File = new MenuItem ("File");
            File.Submenu = FileMenu;

            MenuItem ExitItem = new MenuItem ("Exit");
            ExitItem.Activated += quitProgram;
            FileMenu.Append (ExitItem);

            Menu GestureMenu = new Menu ();
            MenuItem Gesture = new MenuItem ("Gestures");
            Gesture.Submenu = GestureMenu;

            MenuItem LoadGesture = new MenuItem ("Load Gesture");
            LoadGesture.Activated += openGesture;
            GestureMenu.Append (LoadGesture);

            MenuItem SaveGestureItem = new MenuItem ("Save Gesture");
            SaveGestureItem.Activated += createGesture;
            GestureMenu.Append (SaveGestureItem);

            Menu PointsMenu = new Menu ();
            MenuItem Points = new MenuItem ("Data Points");
            Points.Submenu = PointsMenu;

            MenuItem LoadPointsItem = new MenuItem ("Load Points");
            LoadPointsItem.Activated += loadDataPoints;
            PointsMenu.Append (LoadPointsItem);

            MenuItem RecordPointsItem = new MenuItem ("Record Points");
            RecordPointsItem.Activated += recordPoints;
            PointsMenu.Append (RecordPointsItem);

            MenuItem BatchRecognizeItem = new MenuItem ("Batch Recognize");
            BatchRecognizeItem.Activated += batchRecognize;
            PointsMenu.Append (BatchRecognizeItem);

            Menu HelpMenu = new Menu ();
            MenuItem Help = new MenuItem ("Help");
            Help.Submenu = HelpMenu;

            MenuItem AboutMenuItem = new MenuItem("About");
            HelpMenu.Append (AboutMenuItem);

            MainMenuBar.Append (File);
            MainMenuBar.Append (Gesture);
            MainMenuBar.Append (Points);
            MainMenuBar.Append (Help);

            /*********************End of menu bar components*********************/

            //Drawing area which is the core component of the application
            dArea = new DrawingArea ();
            dArea.SetSizeRequest (500, 500);

            //Horizontal box (4 sections) which contains all of the buttons along the
            //bottom of the window
            HBox ButtonHBox = new HBox (false, 6);

            /*********************Start of Buttons*********************/

            Button BtnCreateGesture = new Button ("Create");
            Button BtnRecognizeGesture = new Button ("Recognize");
            Button BtnClearScreen = new Button ("Clear");
            Button BtnRecordPoints = new Button ("Record points");
            Button BtnChangeColour = new Button ("Change colour");

            //Button functions
            BtnCreateGesture.Clicked += new EventHandler (createGesture);
            BtnRecognizeGesture.Clicked += new EventHandler (recognizeGesture);
            BtnClearScreen.Clicked += new EventHandler (clearScreen);
            BtnRecordPoints.Clicked += new EventHandler (recordPoints);
            BtnChangeColour.Clicked += changeColour;

            //Adding buttons to the current horizontal box
            ButtonHBox.PackStart (BtnCreateGesture, true, false, 0);
            ButtonHBox.PackStart (BtnRecognizeGesture, true, false, 0);
            ButtonHBox.PackStart (BtnClearScreen, true, false, 0);
            ButtonHBox.PackStart (BtnRecordPoints, true, false, 0);
            ButtonHBox.PackStart (BtnChangeColour, true, false, 0);
            /*********************End of Buttons*********************/

            //Status bar which shows the score and recognized gesture
            sBar = new Statusbar ();
            sBar.Push (1, "Ready");

            //Entry box for batch function name to be used on the files
            batchFunctionName = new Entry ("Recorded points function name");
            batchFunctionName.AddEvents (
                (int)Gdk.EventMask.ButtonPressMask
            );
            batchFunctionName.ButtonPressEvent += clearTextBox;

            //Adding all components to the Vertical box
            MainVBox.PackStart (MainMenuBar, false, false, 0);
            MainVBox.PackStart (dArea, false, false, 0);
            MainVBox.PackStart (ButtonHBox, false, false, 0);
            MainVBox.PackStart (batchFunctionName, false, false, 0);
            MainVBox.PackStart (sBar, false, false, 0);

            Add (MainVBox);

            ShowAll ();

            //Surface 'pattern' for area to be covered
            surface = new ImageSurface(Format.Argb32, 500, 500);

            //Adding mouse events to the drawing area and assigning functions
            dArea.AddEvents(
                //Mouse Related Events
                (int)Gdk.EventMask.PointerMotionMask
                |(int)Gdk.EventMask.ButtonPressMask
                |(int)Gdk.EventMask.ButtonReleaseMask
            );

            //Repaint the Canvas Internally.
            dArea.ExposeEvent += OnDrawingAreaExposed;
            //Do this on MousePress inside Area
            dArea.ButtonPressEvent += OnMousePress;
            //Do this on MouseReleased inside Area
            dArea.ButtonReleaseEvent += OnMouseRelease;
            //Do this if a Motion Occurs inside the Drawing Area
            dArea.MotionNotifyEvent += OnMouseMotion2;

            //Assigning close function to the window
            DeleteEvent += delegate { Application.Quit(); };

            //Checking to see if bool for using the dot function is true
            //And assigning the required function as the delegate's operation
            //Note: This will always be true, no current way to switch while
            //application is running, has not been needed as of yet
            if (isDot) {
                Painter = new DrawShape (DrawDot);
                myoPainter = new DrawShape (DrawDot);
            } else {
                Painter = new DrawShape (DrawLine);
            }
        }
Exemplo n.º 24
0
        private void CreateWindow(uint chrome)
        {
            // Increment Window count
              win_count += 1;

              // Put actualchrome in
              actualchrome = chrome;

              // Init chrome
              toolBarOn = false;
              statusBarOn = false;

              if (chrome == (uint)ChromeFlags.Defaultchrome)
              	actualchrome = (uint)ChromeFlags.Allchrome;

              if ((actualchrome & (uint)ChromeFlags.Toolbaron) == (uint)ChromeFlags.Toolbaron) {
            toolBarOn = true;
              }

              if ((actualchrome & (uint)ChromeFlags.Statusbaron) == (uint)ChromeFlags.Statusbaron) {
            statusBarOn = true;
              }

              win = new Window ("Gecko Tester");
              win.DeleteEvent += new DeleteEventHandler (Window_Delete);

              vbox = new VBox (false, 0);
              win.Add (vbox);

              hbox = new HBox (false, 0);
              vbox.PackStart (hbox, false, false, 0);

              Toolbar toolbar = new Toolbar();
              toolbar.ToolbarStyle = ToolbarStyle.Both;
              toolbar.Orientation = Orientation.Horizontal;
              toolbar.ShowArrow = false;
              hbox.PackStart(toolbar, false, false, 0);

              ToolButton backButton = new ToolButton("Go Back");
              backButton.Clicked += new EventHandler (back_clicked_cb);
              backButton.Label = "Go Back";
              toolbar.Insert(backButton, -1);

              ToolButton stopButton = new ToolButton("Stop");
              stopButton.Clicked += new EventHandler (stop_clicked_cb);
              stopButton.Label = "Stop";
              toolbar.Insert(stopButton, -1);

              ToolButton forwardButton = new ToolButton("Forward");
              forwardButton.Clicked += new EventHandler (forward_clicked_cb);
              forwardButton.Label = "Forward";
              toolbar.Insert(forwardButton, -1);

              ToolButton reloadButton = new ToolButton("Reload");
              reloadButton.Clicked += new EventHandler (reload_clicked_cb);
              reloadButton.Label = "Reload";
              toolbar.Insert(reloadButton, -1);

              editbox = new Entry();
              editbox.Activated += new EventHandler(entry_act);
              hbox.PackStart (editbox, true, true, 0);

              if (initialized < 1)
            throw new Exception();

              // Now, if we are initialized, we need to set the profile
              // and set initialized state to 2
              if (initialized != 2) {
            moz = new WebControl(path, pname);
            initialized = 2;
              } else {
            Console.WriteLine("Calling EmbedWidget()");
            moz = new WebControl();
            Console.WriteLine("Done calling EmbedWidget()");
              }

              vbox.PackStart (moz, true, true, 0);

              // Ok, we have a LOT of GtkMozEmbed signals...
              moz.LocChange += new EventHandler(moz_location_cb);
              moz.TitleChange += new EventHandler(moz_title_cb);
              moz.NetStart += new EventHandler(moz_netstart_cb);
              moz.NetStop += new EventHandler(moz_netstop_cb);
              moz.DestroyBrowser += new EventHandler(moz_destroybrsr_cb);
              //moz.LinkMessage += new EventHandler(moz_linkmessage_cb);
              //moz.JsStatus += new EventHandler(moz_jsstatus_cb);

              // Now the ones with args!
              moz.NewWindow += new NewWindowHandler(moz_new_win_cb);
              //moz.Progress += new ProgressHandler(moz_progress_cb);
              //moz.ProgressAll += new ProgressAllHandler(moz_progressall_cb);
              //moz.NetState += new NetStateHandler(moz_netstate_cb);
              //moz.NetStateAll += new NetStateAllHandler(moz_netstateall_cb);
              moz.Visibility += new VisibilityHandler(moz_visibility_cb);
              //moz.OpenUri += new OpenUriHandler(moz_openuri_cb);
              //moz.SizeTo += new SizeToHandler(moz_sizeto_cb);

              hbox2 = new HBox (false, 0);
              vbox.PackStart (hbox2, false, false, 0);

              pbar = new ProgressBar();
              hbox2.PackStart (pbar, false, false, 0);

              Alignment salign = new Alignment (0, 0, 1, 1);
              // usize here
              sbar = new Statusbar();

              salign.Add (sbar);
              hbox2.PackStart(salign, true, true, 0);

              moz.LoadUrl("http://www.go-mono.com");

              set_moz_visibility(true);
        }
Exemplo n.º 25
0
Arquivo: GUI.cs Projeto: vggonz/csgbe
        /// <summary>Inicializa los objectos de la interfaz grafica</summary>
        private void iniciarGUI()
        {
            // Pantalla de 144x160 pixeles y zoom por defecto de 2
            _pantalla = new Pantalla(144, 160, 2);

            VBox vbox = new VBox(false, 0);
            Gtk.Window window = new Gtk.Window ("CSGBE: C# GameBoy Emulator");
            window.Icon = Gdk.Pixbuf.LoadFromResource("gb_icon");
            window.DeleteEvent += new DeleteEventHandler (Window_Delete);
            window.KeyPressEvent += new KeyPressEventHandler(Key_Pressed);
            window.KeyReleaseEvent += new KeyReleaseEventHandler(Key_Released);

            statusBar = new Statusbar();
            vbox.PackStart(crearMenu(), false, false, 0);
            VBox pantallaBox = new VBox();
            pantallaBox.PackStart(_pantalla);
            vbox.PackStart(pantallaBox, false, false, 0);
            vbox.PackStart(statusBar, false, false, 0);
            window.Add(vbox);
            window.Resizable = false;
            window.ShowAll();
        }
Exemplo n.º 26
0
        public hashgen()
        {
            self = Assembly.GetExecutingAssembly ();

            Stream ico = self.GetManifestResourceStream ("HashGenerator.icon.png");
            icon = new Pixbuf (ico);

            // Window
            Gtk.Window window = new Gtk.Window ((self.GetCustomAttributes (typeof(AssemblyTitleAttribute), false) [0] as AssemblyTitleAttribute).Title);
            window.SetDefaultSize (600, 500);
            window.DeleteEvent += OnDelete;
            window.Icon = icon;

            #region [Widgets]
            Box topBox = new VBox ();
            topBox.Homogeneous = false;

            // Toolbar
            Toolbar tb = new Toolbar ();

            // Toolbar New Button
            ToolButton tb_New = new ToolButton (Stock.New);
            tb_New.Clicked += OnToolbarNew_Clicked;
            tb.Add (tb_New);

            // Toolbar Open Button
            ToolButton tb_Open = new ToolButton (Stock.Open);
            tb_Open.Clicked += OnToolbarOpen_Clicked;
            tb.Add (tb_Open);

            // Toolbar Save Button
            ToolButton tb_Save = new ToolButton (Stock.Save);
            tb_Save.Clicked += OnToolbarSave_Clicked;
            tb.Add (tb_Save);

            tb.Add (new SeparatorToolItem ());

            // Toolbar About Button
            ToolButton tb_About = new ToolButton (Stock.About);
            tb_About.Clicked += new EventHandler (OnToolbarAbout_Clicked);
            tb.Add (tb_About);

            tb.ShowAll ();
            topBox.PackStart (tb, false, true, 0);

            Box mbox = new VBox ();
            topBox.PackStart (mbox, false, true, 0);

            Box mhbx = new HBox ();
            mbox.PackStart (mhbx, false, true, 0);

            entry = new Entry ();
            mhbx.PackStart (entry, true, true, 0);

            Button btnFile = new Button ();
            btnFile.Image = Gtk.Image.NewFromIconName (Stock.File, IconSize.Button);
            btnFile.Clicked += OnBtnFile_Clicked;
            mhbx.PackStart (btnFile, false, true, 0);

            string[] htype = { "MD5", "SHA128", "SHA256", "SHA512", "CRC32" };
            cboType = new ComboBox (htype);
            cboType.Active = 0;
            mhbx.PackStart (cboType, false, false, 0);

            Button btnHash = new Button ("Generate");
            btnHash.Clicked += OnBtnHash_Clicked;
            mhbx.PackStart (btnHash, false, false, 0);

            // Tree
            ScrolledWindow sw = new ScrolledWindow ();
            topBox.PackStart (sw, true, true, 0);
            TreeView tree = new TreeView ();
            sw.Add (tree);

            TreeViewColumn inColu = new TreeViewColumn ();
            inColu.Title = "Input";
            CellRendererText inCell = new CellRendererText ();
            inColu.PackStart (inCell, true);

            TreeViewColumn typeColu = new TreeViewColumn ();
            typeColu.Title = "Type";
            CellRendererText typeCell = new CellRendererText ();
            typeColu.PackStart (typeCell, true);

            TreeViewColumn hashColu = new TreeViewColumn ();
            hashColu.Title = "Hash";
            CellRendererText hashCell = new CellRendererText ();
            hashCell.Editable = true;
            hashColu.PackStart (hashCell, true);

            tree.AppendColumn (inColu);
            tree.AppendColumn (typeColu);
            tree.AppendColumn (hashColu);

            inColu.AddAttribute (inCell, "text", 0);
            typeColu.AddAttribute (typeCell, "text", 1);
            hashColu.AddAttribute (hashCell, "text", 2);
            hashStore = new ListStore (typeof(string), typeof(string), typeof(string));

            // Search Filter
            filter = new TreeModelFilter (hashStore, null);
            filter.VisibleFunc = SearchTree;

            tree.Model = filter;

            // StatusBar
            Statusbar sb = new Statusbar ();
            topBox.PackStart (sb, false, true, 0);

            sb.Add (new Label ("Search:"));
            search = new Entry ();
            search.Changed += OnSearch;
            sb.Add (search);

            #endregion
            window.Add (topBox);
            window.ShowAll ();
        }
Exemplo n.º 27
0
    void CreateComponents()
    {
        fullViewVBox = new VBox(false, 0);
        rootWidget   = fullViewVBox;

        CreateMenuBar();

        CreateToolBar();

        // Create the docking widget and add it to the window.
        dock                   = new DockFrame();
        dock.Homogeneous       = false;
        dock.DefaultItemHeight = 100;
        dock.DefaultItemWidth  = 100;
        //dock.CompactGuiLevel = 1;

        toolbarFrame.AddContent(dock);

        // Create the notebook for the various documents.
        tabControl            = new DragNotebook(); //(dock.ShadedContainer);
        tabControl.Scrollable = true;
        tabControl.AppendPage(new Label("Other page"), new Label("Favorite Page  "));
        tabControl.AppendPage(new Label("What page"), new Label("Welcome/Start Page  "));
        tabControl.AppendPage(new TextView(), new Image("gtk-new", IconSize.Menu));
        tabControl.ShowAll();

        // The main document area
        documentDockItem                 = dock.AddItem("Documents");
        documentDockItem.Behavior        = DockItemBehavior.Locked;
        documentDockItem.Status          = DockItemStatus.AutoHide;
        documentDockItem.DefaultHeight   = 100;
        documentDockItem.DefaultWidth    = 100;
        documentDockItem.DefaultStatus   = DockItemStatus.AutoHide;
        documentDockItem.DefaultLocation = "Document/Right";
        documentDockItem.Expand          = true;
        documentDockItem.DrawFrame       = true;
        documentDockItem.Label           = "Documents";
        documentDockItem.Content         = tabControl;
        documentDockItem.DefaultVisible  = true;
        documentDockItem.Visible         = true;


        DockItem dit = dock.AddItem("left");

        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "left";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Left";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        DockItemToolbar tb = dit.GetToolbar(PositionType.Top);
        ToolButton      b  = new ToolButton(null, "Hello");

        tb.Add(b, false);
        tb.Visible = true;
        tb.ShowAll();

        dit                 = dock.AddItem("right");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Right";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Right";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        //dit.Icon = Gdk.Pixbuf.LoadFromResource("Cage.Shell.Docking.stock-close-12.png");

        dit                 = dock.AddItem("top");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Top";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Top";
        dit.DefaultVisible  = true;
        dit.Visible         = true;

        dit                 = dock.AddItem("bottom");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Bottom";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Bottom";
        dit.DefaultVisible  = true;
        dit.Visible         = true;



        if (File.Exists("toolbar.status"))
        {
            toolbarFrame.LoadStatus("toolbar.status");
        }

        if (File.Exists("config.layout"))
        {
            dock.LoadLayouts("config.layout");
        }
        else
        {
            dock.CreateLayout("test", true);
        }


        dock.CurrentLayout = "test";
        dock.HandlePadding = 0;
        dock.HandleSize    = 10;

        dock.SaveLayouts("config.layout");
        toolbarFrame.SaveStatus("toolbar.status");

        Add(fullViewVBox);
        fullViewVBox.ShowAll();

        statusBar = new Gtk.Statusbar();
        fullViewVBox.PackEnd(statusBar, false, true, 0);
    }
Exemplo n.º 28
0
 private Widget CreateNormalPage()
 {
     VBox vbox = new VBox (false, 0);
        MenuBar menubar = CreateNormalMenu ();
        vbox.PackStart (menubar, false, false, 0);
        vbox.PackStart(CreateiFolderContentArea(), true, true, 0);
        MainStatusBar = new Statusbar ();
        UpdateStatus(Util.GS("Idle..."));
        vbox.PackStart (MainStatusBar, false, false, 0);
        NewMenuItem.Sensitive = true;
        DownloadMenuItem.Sensitive = false;
        DeleteMenuItem.Sensitive = false;
        RemoveMenuItem.Sensitive = false;
        RemoveMenuItem.Visible = false;
        ShareMenuItem.Sensitive = false;
        OpenMenuItem.Sensitive = false;
        SyncNowMenuItem.Sensitive = false;
        ConflictMenuItem.Sensitive = false;
        RevertMenuItem.Sensitive = false;
        PropMenuItem.Sensitive = false;
        return vbox;
 }
Exemplo n.º 29
0
        private void Build()
        {
            this.Title = "Sqlite browser";

            mainVbox         = new Gtk.VBox();
            mainVbox.Spacing = 4;

            this.Add(mainVbox);

            // Main menu
            mainMenu = new MainMenu();

            mainVbox.Add(mainMenu);

            var mainMenuBox = (Gtk.Box.BoxChild)mainVbox [mainMenu];

//			mainMenuBox.Position = 0;
            mainMenuBox.Expand = false;
            mainMenuBox.Fill   = false;

            mainMenu.NewSqliteDbActivated        += OnNewSqliteDb;
            mainMenu.OpenSqliteDbActivated       += OnOpenSqliteDb;
            mainMenu.ExitActivated               += OnExit;
            mainMenu.NewSqlEditorWindowActivated += OnNewSqlTab;

            // toolbar
            toolbar = new MainToolbar();
            mainVbox.Add(toolbar);
            var toolbarBox = (Gtk.Box.BoxChild)mainVbox [toolbar];

            toolbarBox.Expand = false;

            // left paned
            leftPaned          = new Gtk.HPaned();
            leftPaned.CanFocus = true;
            mainVbox.Add(leftPaned);
            var objectBrowserScrolledWindow = new Gtk.ScrolledWindow();

            objectBrowserScrolledWindow.ShadowType   = ShadowType.EtchedIn;
            objectBrowserScrolledWindow.WidthRequest = 300;
            leftPaned.Add1(objectBrowserScrolledWindow);

            objectBrowserTreeView = new TreeView();
            objectBrowserScrolledWindow.Add(objectBrowserTreeView);

            objectBrowserTreeStore      = new TreeStore(typeof(Gdk.Pixbuf), typeof(IFeature));
            objectBrowserTreeView.Model = objectBrowserTreeStore;

            // main tabbed area
            tabbedArea = new Notebook();
            leftPaned.Add2(tabbedArea);

            // status bar
            statusBar = new Statusbar();
            mainVbox.Add(statusBar);
            var statusBarBox = (Gtk.Box.BoxChild)mainVbox [statusBar];

            statusBarBox.Expand = false;
            statusBarBox.Fill   = false;

            global::Gtk.Label currentDbLabel = new Label();
            ApplicationState.Instance.CurrentConnectionChanged += (sender, e) => currentDbLabel.Text = e.DbServerConnection.Name;
            statusBar.Add(currentDbLabel);

            this.ShowAll(  );

            this.DeleteEvent += OnExit;
        }
Exemplo n.º 30
0
        /// <summary>
        /// Initializes all GUI components.
        /// </summary>
        /// <history>
        /// [Curtis_Beard]      11/03/2006  Created
        /// </history>
        private void InitializeComponent()
        {
            this.SetDefaultSize (Core.GeneralSettings.WindowWidth, Core.GeneralSettings.WindowHeight);
             if (Core.GeneralSettings.WindowLeft == -1 && Core.GeneralSettings.WindowTop == -1)
            this.SetPosition(WindowPosition.Center);
             else
            this.Move(Core.GeneralSettings.WindowLeft, Core.GeneralSettings.WindowTop);

             this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);
             this.Title = Constants.ProductName;
             this.Icon = Images.GetPixbuf("AstroGrep_Icon.ico");

             MainTooltips = new Tooltips();

             VBox vbox = new VBox();
             vbox.BorderWidth = 0;

             Frame leftFrame = new Frame();
             leftFrame.Shadow = ShadowType.In;
             leftFrame.WidthRequest = 200;

             VBox searchBox = new VBox();
             VBox searchOptionsBox = new VBox();
             searchBox.BorderWidth = 3;
             searchOptionsBox.BorderWidth = 3;
             lblSearchStart = new Label("Search Path");
             lblSearchStart.SetAlignment(0,0);

             btnBrowse = new Button();
             btnBrowse.SetSizeRequest(32, 20);
             Gtk.Image img = new Image();
             img.Pixbuf = Images.GetPixbuf("folder-open.png");
             VBox browseBox = new VBox();
             browseBox.PackStart(img, false, false, 0);
             MainTooltips.SetTip(btnBrowse, "Select the folder to start the search", "");
             btnBrowse.Clicked += new EventHandler(btnBrowse_Clicked);
             btnBrowse.Add(browseBox);

             cboSearchStart = ComboBoxEntry.NewText();
             cboSearchFilter = ComboBoxEntry.NewText();
             cboSearchText = ComboBoxEntry.NewText();

             LoadComboBoxEntry(cboSearchStart, Core.GeneralSettings.SearchStarts, true);
             LoadComboBoxEntry(cboSearchFilter, Core.GeneralSettings.SearchFilters, false);
             LoadComboBoxEntry(cboSearchText, Core.GeneralSettings.SearchTexts, false);

             cboSearchStart.Changed += new EventHandler(cboSearchStart_Changed);
             lblSearchFilter = new Label("File Types");
             lblSearchFilter.SetAlignment(0,0);
             lblSearchText = new Label("Search Text");
             lblSearchText.SetAlignment(0,0);

             // search path
             VBox startVBox = new VBox();
             startVBox.BorderWidth = 0;
             cboSearchStart.WidthRequest = 100;
             SetActiveComboBoxEntry(cboSearchStart);

             HBox startHBox = new HBox();
             startHBox.BorderWidth = 0;
             startHBox.PackStart(cboSearchStart, true, true, 0);
             startHBox.PackEnd(btnBrowse, false, false, 0);

             startVBox.PackStart(lblSearchStart, false, false, 0);
             startVBox.PackStart(startHBox, true, false, 0);
             searchBox.PackStart(startVBox, true, false, 0);

             // search filter
             VBox filterVBox = new VBox();
             cboSearchFilter.Active = 0;
             filterVBox.BorderWidth = 0;
             filterVBox.PackStart(lblSearchFilter, false, false, 0);
             filterVBox.PackStart(cboSearchFilter, true, false, 0);
             searchBox.PackStart(filterVBox, true, false, 0);

             // search text
             VBox textVBox = new VBox();
             cboSearchText.Active = 0;
             textVBox.BorderWidth = 0;
             textVBox.PackStart(lblSearchText, false, false, 0);
             textVBox.PackStart(cboSearchText, true, false, 0);
             searchBox.PackStart(textVBox, true, false, 0);

             // Search/Cancel buttons
             searchBox.PackStart(CreateButtons(), false, false, 0);

             // Search Options
             chkRegularExpressions = new CheckButton("Regular Expressions");
             chkCaseSensitive = new CheckButton("Case Sensitive");
             chkWholeWord = new CheckButton("Whole Word");
             chkRecurse = new CheckButton("Recurse");
             chkFileNamesOnly = new CheckButton("Show File Names Only");
             chkFileNamesOnly.Clicked += new EventHandler(chkFileNamesOnly_Clicked);
             chkNegation = new CheckButton("Negation");
             chkNegation.Clicked += new EventHandler(chkNegation_Clicked);
             chkLineNumbers = new CheckButton("Line Numbers");
             cboContextLines = ComboBox.NewText();
             cboContextLines.WidthRequest = 100;
             cboContextLines.WrapWidth = 3;
             for (int i = 0; i <= Constants.MAX_CONTEXT_LINES; i++)
            cboContextLines.AppendText(i.ToString());
             lblContextLines = new Label("Context Lines");
             HBox cxtBox = new HBox();
             cxtBox.BorderWidth = 0;
             cxtBox.PackStart(cboContextLines, false, false, 3);
             cxtBox.PackStart(lblContextLines, false, false, 3);

             searchOptionsBox.PackStart(chkRegularExpressions, true, false, 0);
             searchOptionsBox.PackStart(chkCaseSensitive, true, false, 0);
             searchOptionsBox.PackStart(chkWholeWord, true, false, 0);
             searchOptionsBox.PackStart(chkRecurse, true, false, 0);
             searchOptionsBox.PackStart(chkFileNamesOnly, true, false, 0);
             searchOptionsBox.PackStart(chkNegation, true, false, 0);
             searchOptionsBox.PackStart(chkLineNumbers, true, false, 0);
             searchOptionsBox.PackStart(cxtBox, true, false, 0);
             searchBox.PackEnd(searchOptionsBox, true, true, 0);

             leftFrame.Add(searchBox);

             panelLeft = new HPaned();
             panelLeft.BorderWidth = 0;
             panelRight = new VPaned();
             panelRight.BorderWidth = 0;

             // File List
             Gtk.Frame treeFrame = new Gtk.Frame();
             treeFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow treeWin = new Gtk.ScrolledWindow();
             tvFiles = new Gtk.TreeView ();
             SetColumnsText();

             tvFiles.Model = new ListStore(typeof (string), typeof (string), typeof (string), typeof (string), typeof (int));
             (tvFiles.Model as ListStore).DefaultSortFunc = new TreeIterCompareFunc(DefaultTreeIterCompareFunc);
             tvFiles.Selection.Changed += new EventHandler(Tree_OnSelectionChanged);
             tvFiles.RowActivated += new RowActivatedHandler(tvFiles_RowActivated);

             tvFiles.RulesHint = true;
             tvFiles.HeadersClickable = true;
             tvFiles.HeadersVisible = true;
             tvFiles.Selection.Mode = SelectionMode.Multiple;

             SetSortingFunctions();

             treeWin.Add(tvFiles);
             treeFrame.BorderWidth = 0;
             treeFrame.Add(treeWin);

             // txtHits
             Gtk.Frame ScrolledWindowFrm = new Gtk.Frame();
             ScrolledWindowFrm.Shadow = ShadowType.In;
             Gtk.ScrolledWindow TxtViewWin = new Gtk.ScrolledWindow();
             txtViewer = new Gtk.TextView();
             txtViewer.Buffer.Text = "";
             txtViewer.Editable = false;
             TxtViewWin.Add(txtViewer);
             ScrolledWindowFrm.BorderWidth = 0;
             ScrolledWindowFrm.Add(TxtViewWin);

             // Add file list and txtHits to right panel
             panelRight.Pack1(treeFrame, true, true);
             panelRight.Pack2(ScrolledWindowFrm, true, true);

            // TLW

            //Notebook notebook = new Notebook();
            //    Table table = new Table(3, 6);

            // Create a new notebook, place the position of the tabs
              //  table.attach(notebook, 0, 6, 0, 1);

             // Status Bar
             sbStatus = new Statusbar();

             #region Menu bar

             agMenuAccel = new AccelGroup();
             this.AddAccelGroup(agMenuAccel);

             mbMain = new Gtk.MenuBar();

             // File menu
             mnuFile = new Menu();
             MenuItem mnuFileItem = new MenuItem("_File");
             mnuFileItem.Submenu = mnuFile;
             mnuFile.AccelGroup = agMenuAccel;
             mnuFile.Shown += new EventHandler(mnuFile_Shown);

             // Edit menu
             mnuEdit = new Menu();
             MenuItem mnuEditItem = new MenuItem("_Edit");
             mnuEditItem.Submenu = mnuEdit;
             mnuEdit.AccelGroup = agMenuAccel;
             mnuEdit.Shown += new EventHandler(mnuEdit_Shown);

             // Tools menu
             mnuTools = new Menu();
             MenuItem mnuToolsItem = new MenuItem("_Tools");
             mnuToolsItem.Submenu = mnuTools;
             mnuTools.AccelGroup = agMenuAccel;

             // Help menu
             mnuHelp = new Menu();
             MenuItem mnuHelpItem = new MenuItem("_Help");
             mnuHelpItem.Submenu = mnuHelp;
             mnuHelp.AccelGroup = agMenuAccel;

             // File Save menu item
             SaveMenuItem = new ImageMenuItem(Stock.Save, agMenuAccel);
             SaveMenuItem.Activated += new EventHandler(SaveMenuItem_Activated);
             mnuFile.Append(SaveMenuItem);

             // File Print menu item
             PrintMenuItem = new ImageMenuItem(Stock.Print, agMenuAccel);
             PrintMenuItem.Activated += new EventHandler(PrintMenuItem_Activated);
             mnuFile.Append(PrintMenuItem);

             // File Separator menu item
             SeparatorMenuItem Separator1MenuItem = new SeparatorMenuItem();
             mnuFile.Append(Separator1MenuItem);

             // File Exit menu item
             ExitMenuItem = new ImageMenuItem(Stock.Quit, agMenuAccel);
             ExitMenuItem.Activated += new EventHandler(ExitMenuItem_Activated);
             mnuFile.Append(ExitMenuItem);

             // Edit Select All menu item
             SelectAllMenuItem = new ImageMenuItem("_Select All Files", agMenuAccel);
             SelectAllMenuItem.Activated += new EventHandler(SelectAllMenuItem_Activated);
             mnuEdit.Append(SelectAllMenuItem);

             // Edit Open Selected menu item
             OpenSelectedMenuItem = new ImageMenuItem("_Open Selected Files", agMenuAccel);
             OpenSelectedMenuItem.Activated += new EventHandler(OpenSelectedMenuItem_Activated);
             mnuEdit.Append(OpenSelectedMenuItem);

             // Create preferences for every other os except windows
             if (!Common.IsWindows)
             {
            Separator1MenuItem = new SeparatorMenuItem();
            mnuEdit.Append(Separator1MenuItem);

            // Preferences
            Gtk.ImageMenuItem OptionsMenuItem = new ImageMenuItem(Stock.Preferences, agMenuAccel);
            OptionsMenuItem.Activated += new EventHandler(OptionsMenuItem_Activated);
            mnuEdit.Append(OptionsMenuItem);
             }

             // Clear MRU List
             Gtk.ImageMenuItem ClearMRUsMenuItem = new ImageMenuItem("_Clear Most Recently Used Lists", agMenuAccel);
             ClearMRUsMenuItem.Activated += new EventHandler(ClearMRUsMenuItem_Activated);
             mnuTools.Append(ClearMRUsMenuItem);

             Separator1MenuItem = new SeparatorMenuItem();
             mnuTools.Append(Separator1MenuItem);

             // Save Search Options
             Gtk.ImageMenuItem SaveOptionsMenuItem = new ImageMenuItem("_Save Search Options", agMenuAccel);
             SaveOptionsMenuItem.Activated += new EventHandler(SaveOptionsMenuItem_Activated);
             mnuTools.Append(SaveOptionsMenuItem);

             // Create Options menu for windows
             if (Common.IsWindows)
             {
            // Options menu item
            Gtk.ImageMenuItem OptionsMenuItem = new ImageMenuItem("_Options...", agMenuAccel);
            OptionsMenuItem.Activated += new EventHandler(OptionsMenuItem_Activated);
            OptionsMenuItem.Image = new Gtk.Image(Stock.Preferences, IconSize.Menu);
            mnuTools.Append(OptionsMenuItem);
             }

             // Help About menu item
             MenuItem AboutMenuItem = new ImageMenuItem(Stock.About, agMenuAccel);
             AboutMenuItem.Activated += new EventHandler(AboutMenuItem_Activated);
             mnuHelp.Append(AboutMenuItem);

             // Add the menus to the menubar
             mbMain.Append(mnuFileItem);
             mbMain.Append(mnuEditItem);
             mbMain.Append(mnuToolsItem);
             mbMain.Append(mnuHelpItem);

             // Add the menubar to the Menu panel
             vbox.PackStart(mbMain, false, false, 0);

             #endregion

             // add items to container
             panelLeft.Pack1(leftFrame, true, false);

             // TLW
             //panelLeft.Pack2(tabControl, true, false);
             panelLeft.Pack2(panelRight, true, false);

             // set starting position of splitter
             panelLeft.Position = Core.GeneralSettings.WindowSearchPanelWidth;
             panelRight.Position = Core.GeneralSettings.WindowFilePanelHeight;

             vbox.PackStart(panelLeft, true, true, 0);
             vbox.PackEnd(sbStatus, false, true, 3);

             this.Add (vbox);

             this.ShowAll ();
        }
Exemplo n.º 31
0
        internal Client(bool loadFiles)
        {
            app_count++;

            Window = new Gtk.Window(Gtk.WindowType.Toplevel)
            {
                Title = Catalog.GetString("PDF Mod")
            };
            Window.SetSizeRequest(640, 480);
            Window.DeleteEvent += delegate(object o, DeleteEventArgs args) {
                Quit();
                args.RetVal = true;
            };

            // PDF Icon View
            IconView = new DocumentIconView(this);
            var iconview_sw = new Gtk.ScrolledWindow();

            iconview_sw.AddWithViewport(IconView);

            query_box = new QueryBox(this)
            {
                NoShowAll = true
            };
            query_box.Hide();

            // ActionManager
            ActionManager = new Hyena.Gui.ActionManager();
            Window.AddAccelGroup(ActionManager.UIManager.AccelGroup);
            Actions = new Actions(this, ActionManager);

            // Status bar
            StatusBar = new Gtk.Statusbar()
            {
                HasResizeGrip = true
            };
            status_label = new Label()
            {
                Xalign = 0.0f
            };
            StatusBar.PackStart(status_label, true, true, 6);
            StatusBar.ReorderChild(status_label, 0);

            var zoom_slider = new ZoomSlider(this);

            StatusBar.PackEnd(zoom_slider, false, false, 0);
            StatusBar.ReorderChild(zoom_slider, 1);

            // Properties editor box
            EditorBox = new MetadataEditorBox(this)
            {
                NoShowAll = true
            };
            EditorBox.Hide();

            // Menubar
            menu_bar = ActionManager.UIManager.GetWidget("/MainMenu") as MenuBar;

            // Toolbar
            HeaderToolbar              = ActionManager.UIManager.GetWidget("/HeaderToolbar") as Gtk.Toolbar;
            HeaderToolbar.ShowArrow    = false;
            HeaderToolbar.ToolbarStyle = ToolbarStyle.Icons;
            HeaderToolbar.Tooltips     = true;
            HeaderToolbar.NoShowAll    = true;
            HeaderToolbar.Visible      = Configuration.ShowToolbar;

            // BookmarksView
            BookmarkView           = new BookmarkView(this);
            BookmarkView.NoShowAll = true;
            BookmarkView.Visible   = false;

            var vbox = new VBox();

            vbox.PackStart(menu_bar, false, false, 0);
            vbox.PackStart(HeaderToolbar, false, false, 0);
            vbox.PackStart(EditorBox, false, false, 0);
            vbox.PackStart(query_box, false, false, 0);

            var hbox = new HPaned();

            hbox.Add1(BookmarkView);
            hbox.Add2(iconview_sw);
            vbox.PackStart(hbox, true, true, 0);

            vbox.PackStart(StatusBar, false, true, 0);
            Window.Add(vbox);

            Window.ShowAll();

            if (loadFiles)
            {
                RunIdle(LoadFiles);
                Application.Run();
            }
        }
Exemplo n.º 32
0
 private void CreateStatusBar()
 {
     statusbar = new Gtk.Statusbar ();
 }
Exemplo n.º 33
0
        internal Client (bool loadFiles)
        {
            app_count++;

            Window = new Gtk.Window (Gtk.WindowType.Toplevel) { Title = Catalog.GetString ("PDF Mod") };
            Window.SetSizeRequest (640, 480);
            Window.DeleteEvent += delegate (object o, DeleteEventArgs args) {
                Quit ();
                args.RetVal = true;
            };

            // PDF Icon View
            IconView = new DocumentIconView (this);
            var iconview_sw = new Gtk.ScrolledWindow ();
            iconview_sw.AddWithViewport (IconView);

            query_box = new QueryBox (this) { NoShowAll = true };
            query_box.Hide ();

            // ActionManager
            ActionManager = new Hyena.Gui.ActionManager ();
            Window.AddAccelGroup (ActionManager.UIManager.AccelGroup);
            Actions = new Actions (this, ActionManager);

            // Status bar
            StatusBar = new Gtk.Statusbar () { HasResizeGrip = true };
            status_label = new Label () { Xalign = 0.0f };
            StatusBar.PackStart (status_label, true, true, 6);
            StatusBar.ReorderChild (status_label, 0);

            var zoom_slider = new ZoomSlider (this);
            StatusBar.PackEnd (zoom_slider, false, false, 0);
            StatusBar.ReorderChild (zoom_slider, 1);

            // Properties editor box
            EditorBox = new MetadataEditorBox (this) { NoShowAll = true };
            EditorBox.Hide ();

            // Menubar
            menu_bar = ActionManager.UIManager.GetWidget ("/MainMenu") as MenuBar;

            // Toolbar
            HeaderToolbar = ActionManager.UIManager.GetWidget ("/HeaderToolbar") as Gtk.Toolbar;
            HeaderToolbar.ShowArrow = false;
            HeaderToolbar.ToolbarStyle = ToolbarStyle.Icons;
            HeaderToolbar.Tooltips = true;
            HeaderToolbar.NoShowAll = true;
            HeaderToolbar.Visible = Configuration.ShowToolbar;

            // BookmarksView
            BookmarkView = new BookmarkView (this);
            BookmarkView.NoShowAll = true;
            BookmarkView.Visible = false;

            var vbox = new VBox ();
            vbox.PackStart (menu_bar, false, false, 0);
            vbox.PackStart (HeaderToolbar, false, false, 0);
            vbox.PackStart (EditorBox, false, false, 0);
            vbox.PackStart (query_box, false, false, 0);

            var hbox = new HPaned ();
            hbox.Add1 (BookmarkView);
            hbox.Add2 (iconview_sw);
            vbox.PackStart (hbox, true, true, 0);

            vbox.PackStart (StatusBar, false, true, 0);
            Window.Add (vbox);

            Window.ShowAll ();

            if (loadFiles) {
                RunIdle (LoadFiles);
                Application.Run ();
            }
        }
Exemplo n.º 34
0
		public static int Main3 (string[] args)
		{
			Application.Init ();
			Window win = new Window ("Action Demo");
			win.DefaultSize = new Gdk.Size (200, 150);
			win.DeleteEvent += new DeleteEventHandler (OnWindowDelete);
			
			box = new VBox (false, 0);
			win.Add (box);
			
			group = new ActionGroup ("TestActions");
			group.Add (entries);
			group.Add (toggleEntries);
			group.Add (radioEntries, (int)Justify.Left, new ChangedHandler (OnRadio));
			group.Add (toolbarEntries, (int)ToolbarStyle.BothHoriz, new ChangedHandler (OnToolbarStyle));
			
			uim = new UIManager ();
			uim.AddWidget += new AddWidgetHandler (OnWidgetAdd);
			uim.ConnectProxy += new ConnectProxyHandler (OnProxyConnect);
			uim.InsertActionGroup (group, 0);
			uim.AddUiFromString (ui_info);
			
			statusbar = new Statusbar ();
			box.PackEnd (statusbar, false, true, 0);

			VBox vbox = new VBox (false, 5);
			Button button = new Button ("Blah");
			vbox.PackEnd (button, true, true, 0);
			HBox hbox = new HBox (false, 5);
			spin = new SpinButton (new Adjustment (100, 100, 10000, 1, 100, 100), 100, 0);
			hbox.PackStart (spin, true, true, 0);
			button = new Button ("Remove");
			button.Clicked += new EventHandler (OnDynamicRemove);
			hbox.PackEnd (button, false, false, 0);
			button = new Button ("Add");
			button.Clicked += new EventHandler (OnDynamicAdd);
			hbox.PackEnd (button, false, false, 0);
			vbox.PackEnd (hbox, false, false, 0);
			box.PackEnd (vbox, true, true, 0);

			win.ShowAll ();
			Application.Run ();
			return 0;
		}
Exemplo n.º 35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.StartWindow"/> class.
        /// </summary>
        public StartWindow() : base(Gtk.WindowType.Toplevel)
        {
            #region Basic window properties
            // Basic window properties
            this.Title        = "Scrabble - Základní nastavení";
            this.Name         = "ConfigWindow";
            this.DeleteEvent += OnDeleteEvent;
            this.SetPosition(WindowPosition.Center);
            this.DefaultWidth  = 410;
            this.DefaultHeight = 280;
            this.Icon          = Scrabble.Game.InitialConfig.icon;
            #endregion

            this.numberOfPlayers = 2;

            // Own thread for loading dictionary
            this.statusb = new Gtk.Statusbar();
            this.statusb.Push(statusb.GetContextId("Slovník"), "Načítám slovník");
            this.tdic = new Thread(LoadDictionary);
            this.tdic.Start();

            // infoText (top)
            this.infoText = new Gtk.Label("Základní nastavení hry.\n" +
                                          "Nastavte prosím počet hráčů, jejich jména a určete zda za ně bude hrát umělá inteligence. " +
                                          "Také můžete nastavit, kteří hráči se připojují vzdáleně.");
            this.infoText.Wrap = true;

            // First config line (number of players, client)
            this.upperHbox = new HBox(false, 5);
            this.l1        = new Label("Počet hráčů");
            this.upperHbox.PackStart(l1);
            this.l2                = new Label(", nebo:");
            this.entryNum          = new SpinButton(2, 5, 1);
            this.entryNum.Changed += OnNumberOfPlayerChange;
            client             = new CheckButton();
            client.Clicked    += IamClient;
            client.Label       = "připojit se ke vzdálené hře";
            client.TooltipText = "Pokud zaškrnete, tak se program bude chovat pouze jako client a připojí se k hře vedené na jiném PC.";
            upperHbox.Add(entryNum);
            upperHbox.Add(l2);
            upperHbox.PackEnd(client);
            upperHbox.BorderWidth  = 10;
            upperHbox.WidthRequest = 20;

            // Table with config for each player (dynamic size)
            table = new Gtk.Table(5, 7, false);
            table.Attach(new Gtk.Label("Jméno hráče:"), 1, 2, 0, 1);
            table.Attach(new Gtk.Label("CPU"), 2, 3, 0, 1);
            table.Attach(new Gtk.Label("Network"), 3, 4, 0, 1);
            ipLabel = new Gtk.Label("IP");
            table.Attach(ipLabel, 4, 5, 0, 1);

            labels    = new Gtk.Label[5];
            entryes   = new Gtk.Entry[5];
            CPUchecks = new Gtk.CheckButton[5];
            MPchecks  = new Gtk.CheckButton[5];
            IPs       = new Gtk.Entry[5];
            for (int i = 0; i < 5; i++)
            {
                labels [i]      = new Gtk.Label((i + 1).ToString());
                labels [i].Name = string.Format("l {0}", i);
                table.Attach(labels [i], 0, 1, (uint)i + 1, (uint)i + 2);
                entryes [i]             = new Gtk.Entry(12);
                entryes [i].Text        = "Hráč " + (i + 1).ToString();
                entryes [i].TooltipText = "Vložte jméno hráče.";
                table.Attach(entryes [i], 1, 2, (uint)i + 1, (uint)i + 2);
                CPUchecks [i]             = new Gtk.CheckButton();
                CPUchecks [i].Name        = string.Format("c {0}", i);
                CPUchecks [i].TooltipText = "Pokud je zaškrtnuto, tak za hráče bude hrát počítač.";
                ((Gtk.CheckButton)CPUchecks [i]).Clicked += OnCpuChange;
                table.Attach(CPUchecks [i], 2, 3, (uint)i + 1, (uint)i + 2);
                MPchecks [i]             = new Gtk.CheckButton();
                MPchecks [i].Name        = string.Format("n {0}", i);
                MPchecks [i].TooltipText = "Pokud je zaškrtnuto, tak se počítá s tím, že se tento hráč připojí vzdáleně. ";
                ((Gtk.CheckButton)MPchecks [i]).Clicked += OnNetChange;
                table.Attach(MPchecks [i], 3, 4, (uint)i + 1, (uint)i + 2);
                IPs [i]            = new Gtk.Entry(15);
                IPs [i].Text       = "192.168.0.X";
                IPs [i].WidthChars = 15;
                IPs [i].Sensitive  = false;
                table.Attach(IPs [i], 4, 5, (uint)i + 1, (uint)i + 2);
            }
            this.CPUchecks[0].Hide();

            ok             = new Button("Hotovo");
            ok.Clicked    += Done;
            ok.BorderWidth = 5;
            ok.TooltipText = "Potvrzením začne hra. Může se stát, že program bude ještě chvíli načítat slovník.";
            table.Attach(ok, 0, 5, 6, 7);

            // Main vbox (where all is)
            this.mainVbox = new Gtk.VBox(false, 5);

            this.mainVbox.PackStart(infoText);
            this.mainVbox.Add(upperHbox);
            this.mainVbox.Spacing = 5;
            this.mainVbox.Add(table);
            this.mainVbox.PackEnd(statusb);

            this.mainVbox.BorderWidth = 9;
            this.Add(mainVbox);
            this.mainVbox.ShowAll();

            for (int i = 2; i < numberOfPlayers + 3; i++)
            {
                labels [i].Hide();
                entryes [i].Hide();
                CPUchecks [i].Hide();
                MPchecks [i].Hide();
                IPs [i].Hide();
            }
            ipLabel.Hide();

            foreach (Gtk.Entry e in IPs)
            {
                e.Hide();
            }

            this.CPUchecks[0].Hide();
            this.MPchecks[0].Hide();
        }
Exemplo n.º 36
0
    public CompareWindow()
        : base("Mono GuiCompare")
    {
        SetDefaultSize (500, 400);

            vbox = new Gtk.VBox ();
            tree = new Gtk.TreeView ();

            treeStore = new Gtk.TreeStore (typeof (string), typeof (Gdk.Pixbuf), typeof (Gdk.Pixbuf),
                               typeof (Gdk.Pixbuf), typeof (string),
                               typeof (Gdk.Pixbuf), typeof (string),
                               typeof (Gdk.Pixbuf), typeof (string));

            tree.Model = treeStore;

            // Create a column for the node name
            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
            nameColumn.Title = "Name";
            nameColumn.Resizable = true;

            Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();
            Gtk.CellRendererPixbuf typeCell = new Gtk.CellRendererPixbuf ();
            Gtk.CellRendererPixbuf statusCell = new Gtk.CellRendererPixbuf ();

            nameColumn.PackStart (statusCell, false);
            nameColumn.PackStart (typeCell, false);
            nameColumn.PackStart (nameCell, true);

            tree.AppendColumn (nameColumn);

            nameColumn.AddAttribute (nameCell, "text", 0);
            nameColumn.AddAttribute (typeCell, "pixbuf", 1);
            nameColumn.AddAttribute (statusCell, "pixbuf", 2);

            // Create a column for the status counts
            Gtk.TreeViewColumn countsColumn = new Gtk.TreeViewColumn ();
            countsColumn.Title = "Counts";
            countsColumn.Resizable = true;

            Gtk.CellRendererPixbuf missingPixbufCell = new Gtk.CellRendererPixbuf ();
            Gtk.CellRendererText missingTextCell = new Gtk.CellRendererText ();
            Gtk.CellRendererPixbuf extraPixbufCell = new Gtk.CellRendererPixbuf ();
            Gtk.CellRendererText extraTextCell = new Gtk.CellRendererText ();
            Gtk.CellRendererPixbuf errorPixbufCell = new Gtk.CellRendererPixbuf ();
            Gtk.CellRendererText errorTextCell = new Gtk.CellRendererText ();

            countsColumn.PackStart (missingPixbufCell, false);
            countsColumn.PackStart (missingTextCell, false);
            countsColumn.PackStart (extraPixbufCell, false);
            countsColumn.PackStart (extraTextCell, false);
            countsColumn.PackStart (errorPixbufCell, false);
            countsColumn.PackStart (errorTextCell, false);

            tree.AppendColumn (countsColumn);

            countsColumn.AddAttribute (missingPixbufCell, "pixbuf", 3);
            countsColumn.AddAttribute (missingTextCell, "text", 4);
            countsColumn.AddAttribute (extraPixbufCell, "pixbuf", 5);
            countsColumn.AddAttribute (extraTextCell, "text", 6);
            countsColumn.AddAttribute (errorPixbufCell, "pixbuf", 7);
            countsColumn.AddAttribute (errorTextCell, "text", 8);

            scroll = new Gtk.ScrolledWindow ();

            scroll.HscrollbarPolicy = scroll.VscrollbarPolicy = PolicyType.Automatic;
            scroll.Add (tree);

            vbox.PackStart (scroll, true, true, 0);

            status = new Gtk.Statusbar ();

            vbox.PackEnd (status, false, false, 0);

            progressbar = new Gtk.ProgressBar ();

            status.PackEnd (progressbar, false, false, 0);

            Add (vbox);
    }
Exemplo n.º 37
0
		private Statusbar CreateStatusBar ()
		{
			Statusbar statusbar = new Statusbar ();
			
			
			return statusbar;
		}
Exemplo n.º 38
0
		public CompareWindow ()
			: base ("Mono GuiCompare")
		{
			SetDefaultSize (500, 400);

			vbox = new Gtk.VBox ();
			tree = new Gtk.TreeView ();

			treeStore = new Gtk.TreeStore (typeof (string), typeof (Gdk.Pixbuf), typeof (Gdk.Pixbuf),
						       typeof (Gdk.Pixbuf), typeof (string),
						       typeof (Gdk.Pixbuf), typeof (string),
						       typeof (Gdk.Pixbuf), typeof (string));

			tree.Model = treeStore;

			// Create a column for the node name
			Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
			nameColumn.Title = "Name";
			nameColumn.Resizable = true;

			Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();
			Gtk.CellRendererPixbuf typeCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererPixbuf statusCell = new Gtk.CellRendererPixbuf ();

			nameColumn.PackStart (statusCell, false);
			nameColumn.PackStart (typeCell, false);
			nameColumn.PackStart (nameCell, true);

			tree.AppendColumn (nameColumn);

			nameColumn.AddAttribute (nameCell, "text", 0);
			nameColumn.AddAttribute (typeCell, "pixbuf", 1);
			nameColumn.AddAttribute (statusCell, "pixbuf", 2);

			// Create a column for the status counts
			Gtk.TreeViewColumn countsColumn = new Gtk.TreeViewColumn ();
			countsColumn.Title = "Counts";
			countsColumn.Resizable = true;

			Gtk.CellRendererPixbuf missingPixbufCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererText missingTextCell = new Gtk.CellRendererText ();
			Gtk.CellRendererPixbuf extraPixbufCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererText extraTextCell = new Gtk.CellRendererText ();
			Gtk.CellRendererPixbuf errorPixbufCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererText errorTextCell = new Gtk.CellRendererText ();

			countsColumn.PackStart (missingPixbufCell, false);
			countsColumn.PackStart (missingTextCell, false);
			countsColumn.PackStart (extraPixbufCell, false);
			countsColumn.PackStart (extraTextCell, false);
			countsColumn.PackStart (errorPixbufCell, false);
			countsColumn.PackStart (errorTextCell, false);

			tree.AppendColumn (countsColumn);

			countsColumn.AddAttribute (missingPixbufCell, "pixbuf", 3);
			countsColumn.AddAttribute (missingTextCell, "text", 4);
			countsColumn.AddAttribute (extraPixbufCell, "pixbuf", 5);
			countsColumn.AddAttribute (extraTextCell, "text", 6);
			countsColumn.AddAttribute (errorPixbufCell, "pixbuf", 7);
			countsColumn.AddAttribute (errorTextCell, "text", 8);

			
			scroll = new Gtk.ScrolledWindow ();

			scroll.HscrollbarPolicy = scroll.VscrollbarPolicy = PolicyType.Automatic;
			scroll.Add (tree);

			vbox.PackStart (scroll, true, true, 0);

			status = new Gtk.Statusbar ();

			vbox.PackEnd (status, false, false, 0);

			progressbar = new Gtk.ProgressBar ();

			status.PackEnd (progressbar, false, false, 0);

			Add (vbox);
		}
Exemplo n.º 39
0
        public SearchWindow(ISearch search) : base(WindowType.Toplevel)
        {
            this.search = search;

            base.Title         = Catalog.GetString("Desktop Search");
            base.Icon          = WidgetFu.LoadThemeIcon("system-search", 16);
            base.DefaultWidth  = 700;
            base.DefaultHeight = 550;
            base.DeleteEvent  += OnWindowDelete;

            VBox vbox = new VBox();

            vbox.Spacing = 3;

            uim = new UIManager(this);
            uim.DomainChanged += OnDomainChanged;
            uim.SortChanged   += OnSortChanged;
            uim.ToggleDetails += OnToggleDetails;
            uim.ShowQuickTips += OnShowQuickTips;
            uim.ShowIndexInfo += OnShowIndexInfo;
            uim.StartDaemon   += OnStartDaemon;
            uim.StopDaemon    += OnStopDaemon;
            vbox.PackStart(uim.MenuBar, false, false, 0);

            HBox hbox = new HBox(false, 6);

            Label label = new Label(Catalog.GetString("_Find in:"));

            hbox.PackStart(label, false, false, 0);

            scope_list = ComboBox.NewText();
            foreach (ScopeMapping mapping in scope_mappings)
            {
                scope_list.AppendText(mapping.label);
            }
            scope_list.Active = 0;

            scope_list.Changed += new EventHandler(delegate(object o, EventArgs args) {
                ComboBox combo = o as ComboBox;
                if (o == null)
                {
                    return;
                }
                int active = combo.Active;
                Log.Debug("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping);
                Query(true);
            });
            hbox.PackStart(scope_list, false, false, 0);

            entry            = new Entry();
            entry.Activated += OnEntryActivated;
            hbox.PackStart(entry, true, true, 0);

            label.MnemonicWidget  = entry;
            uim.FocusSearchEntry += delegate() { entry.GrabFocus(); };

            // The auto search after timeout feauture is now optional
            // and can be disabled.

            if (Conf.BeagleSearch.GetOption(Conf.Names.BeagleSearchAutoSearch, true))
            {
                entry.Changed    += OnEntryResetTimeout;
                entry.MoveCursor += OnEntryResetTimeout;
            }

            button = new Gtk.Button();
            Gtk.HBox  button_hbox = new Gtk.HBox(false, 2);
            Gtk.Image icon        = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Button);
            button_hbox.PackStart(icon, false, false, 0);
            label = new Gtk.Label(Catalog.GetString("Find Now"));
            button_hbox.PackStart(label, false, false, 0);
            button.Add(button_hbox);
            button.Clicked += OnButtonClicked;

            Gtk.VBox buttonVBox = new Gtk.VBox(false, 0);
            buttonVBox.PackStart(button, true, false, 0);
            hbox.PackStart(buttonVBox, false, false, 0);

            spinner = new Spinner();
            hbox.PackStart(spinner, false, false, 0);

            HBox padding_hbox = new HBox();

            padding_hbox.PackStart(hbox, true, true, 9);
            vbox.PackStart(padding_hbox, false, true, 6);

            VBox view_box = new VBox(false, 3);

            vbox.PackStart(view_box, true, true, 0);

            HBox na_padding = new HBox();

            view_box.PackStart(na_padding, false, true, 0);

            notification_area = new NotificationArea();
            na_padding.PackStart(notification_area, true, true, 3);

            pages             = new Gtk.Notebook();
            pages.ShowTabs    = false;
            pages.ShowBorder  = false;
            pages.BorderWidth = 3;
            view_box.PackStart(pages, true, true, 0);

            quicktips = new Pages.QuickTips();
            quicktips.Show();
            pages.Add(quicktips);

            indexinfo = new Pages.IndexInfo();
            indexinfo.Show();
            pages.Add(indexinfo);

            rootuser = new Pages.RootUser();
            rootuser.Show();
            pages.Add(rootuser);

            startdaemon = new Pages.StartDaemon();
            startdaemon.DaemonStarted += OnDaemonStarted;
            startdaemon.Show();
            pages.Add(startdaemon);

            panes = new Beagle.Search.Panes();
            panes.Show();
            pages.Add(panes);

            view = new GroupView();
            view.TileSelected += ShowInformation;
            panes.MainContents = view;

            this.statusbar = new Gtk.Statusbar();
            vbox.PackEnd(this.statusbar, false, false, 0);

            Add(vbox);

            tips = new Gtk.Tooltips();
            tips.SetTip(entry, Catalog.GetString("Type in search terms"), "");
            tips.SetTip(button, Catalog.GetString("Start searching"), "");
            tips.Enable();

            if (Environment.UserName == "root" && !Conf.Daemon.GetOption(Conf.Names.AllowRoot, false))
            {
                pages.CurrentPage = pages.PageNum(rootuser);
                entry.Sensitive   = button.Sensitive = uim.Sensitive = false;
            }
            else
            {
                pages.CurrentPage = pages.PageNum(quicktips);
            }

            entry.GrabFocus();
            StartCheckingIndexingStatus();
        }
Exemplo n.º 40
0
        public Gui()
        {
            dlayer = new DataLayer ();

              window_addtag.SetSizeRequest (100, 100);
              window.Icon = new Gdk.Pixbuf ("lipsticktower.jpg");  //Kalle, Andreas :: Call for Icon!
              Gtk.Entry tagEntry = new Gtk.Entry ();
              Gtk.VBox tagbox = new Gtk.VBox (false, 0);
              tagbox.PackStart (tagEntry, true, true, 0);
              window_addtag.Add (tagbox);
              window_addtag.ShowAll ();

              window.SetSizeRequest (300, 500);
              window.DeleteEvent += DeleteEvent;
              window.Icon = new Gdk.Pixbuf ("lipsticktower.jpg");  //Kalle, Andreas :: Call for Icon!

              Gtk.VBox box = new Gtk.VBox (false, 0);
              Gtk.HBox top = new Gtk.HBox (false, 0);
              //Gtk.ComboBox selector = new Gtk.ComboBox ();
              Gtk.ComboBox selector = ComboBox.NewText ();
              ScrolledWindow scroll = new ScrolledWindow ();
              filterEntry = new Gtk.Entry ();
              filterEntry.MaxLength = 1;
              filterEntry.Changed += OnFilterEntryTextChanged;

              //Gtk.TreeView tree = new Gtk.TreeView ();
              tree.HeadersVisible = false;
              tree.Reorderable = true;
              tree.EnableSearch = false;
              tree.RowActivated += OnRowActivate;

              Gtk.TreeViewColumn iconCol = new Gtk.TreeViewColumn ( );
              iconCol.Title = "Icon";
              Gtk.CellRendererPixbuf iconCell = new Gtk.CellRendererPixbuf ();
              iconCol.PackStart (iconCell, true);
              iconCol.SetCellDataFunc (iconCell, new Gtk.TreeCellDataFunc (RenderIcon));

              Gtk.TreeViewColumn primCol = new Gtk.TreeViewColumn ( );
              primCol.Title = "Primary Info";
              Gtk.CellRendererText primInfoCell = new Gtk.CellRendererText ();
              primCol.PackStart (primInfoCell, true);
              primCol.SetCellDataFunc (primInfoCell, new Gtk.TreeCellDataFunc (RenderPrimary));

              Gtk.TreeViewColumn secCol = new Gtk.TreeViewColumn ( );
              secCol.Title = "Secondary Info";
              Gtk.CellRendererText secInfoCell = new Gtk.CellRendererText ();
              secCol.PackStart (secInfoCell, true);
              secCol.SetCellDataFunc (secInfoCell, new Gtk.TreeCellDataFunc (RenderSecondary));

              projects = DataLayer.GetProjectNames ();
              foreach (string project in projects)
              {
            Console.WriteLine (project);
              	selector.AppendText (project);
              }
              selector.Changed += new EventHandler (OnSelectorChanged);

              //Store AssetStore = dlayer.GetAssets (projID);
              /*filter = new Gtk.TreeModelFilter (AssetStore, null);
              filter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTree);
              tree.Model = filter;*/
              //tree.Model = dlayer.GetAssets (projID);

              tree.AppendColumn (iconCol);
              tree.AppendColumn (primCol);
              tree.AppendColumn (secCol);

              MenuBar menu = new MenuBar ();
              Menu fileMenu = new Menu();
              MenuItem menuItem = new MenuItem("_File");
              menuItem.Submenu = fileMenu;
              menu.Append(menuItem);

              Statusbar status = new Statusbar ();
              Toolbar tool = new Toolbar ();

              ToolButton plus = new ToolButton (Gtk.Stock.Add);
              plus.Clicked +=  OnAddClicked;
              ToolButton minus = new ToolButton (Gtk.Stock.Remove);
              minus.Clicked +=  OnMinusClicked;

              box.PackStart (menu, false, true, 0);
              box.PackStart (tool, false, true, 0);
              tool.Insert(minus, 0);
              tool.Insert(plus, 0);
              top.PackStart (filterEntry, true, true, 0);
              top.PackStart (selector, true, true, 0);
              box.PackStart (top, false, true, 0);
              scroll.Add (tree);
              box.PackStart (scroll, true, true, 0);
              box.PackStart (status, false, true, 0);
              window.Add (box);
              window.ShowAll ();
        }
Exemplo n.º 41
0
        private void Build()
        {
            this.Title = "Sqlite browser";

            mainVbox = new Gtk.VBox ();
            mainVbox.Spacing = 4;

            this.Add (mainVbox);

            // Main menu
            mainMenu = new MainMenu ();

            mainVbox.Add (mainMenu);

            var mainMenuBox = (Gtk.Box.BoxChild)mainVbox [mainMenu];

            //			mainMenuBox.Position = 0;
            mainMenuBox.Expand = false;
            mainMenuBox.Fill = false;

            mainMenu.NewSqliteDbActivated += OnNewSqliteDb;
            mainMenu.OpenSqliteDbActivated += OnOpenSqliteDb;
            mainMenu.ExitActivated += OnExit;
            mainMenu.NewSqlEditorWindowActivated += OnNewSqlTab;

            // toolbar
            toolbar = new MainToolbar();
            mainVbox.Add (toolbar);
            var toolbarBox = (Gtk.Box.BoxChild)mainVbox [toolbar];
            toolbarBox.Expand = false;

            // left paned
            leftPaned = new Gtk.HPaned();
            leftPaned.CanFocus = true;
            mainVbox.Add (leftPaned);
            var objectBrowserScrolledWindow = new Gtk.ScrolledWindow ();
            objectBrowserScrolledWindow.ShadowType = ShadowType.EtchedIn;
            objectBrowserScrolledWindow.WidthRequest = 300;
            leftPaned.Add1 (objectBrowserScrolledWindow);

            objectBrowserTreeView = new TreeView ();
            objectBrowserScrolledWindow.Add (objectBrowserTreeView);

            objectBrowserTreeStore = new TreeStore (typeof(Gdk.Pixbuf), typeof(IFeature));
            objectBrowserTreeView.Model = objectBrowserTreeStore;

            // main tabbed area
            tabbedArea = new Notebook();
            leftPaned.Add2 (tabbedArea);

            // status bar
            statusBar = new Statusbar();
            mainVbox.Add (statusBar);
            var statusBarBox = (Gtk.Box.BoxChild)mainVbox [statusBar];
            statusBarBox.Expand = false;
            statusBarBox.Fill = false;

            global::Gtk.Label currentDbLabel = new Label ();
            ApplicationState.Instance.CurrentConnectionChanged += (sender, e) => currentDbLabel.Text = e.DbServerConnection.Name;
            statusBar.Add (currentDbLabel);

            this.ShowAll (	);

            this.DeleteEvent += OnExit;
        }
Exemplo n.º 42
0
 private Widget CreateGuiStatusbar()
 {
     var statusbar = new Statusbar();
     return statusbar;
 }
Exemplo n.º 43
0
        // ========================================
        // PUBLIC Constructors
        // ========================================
        public Window()
            : base(Info.Name + " " + Info.Version)
        {
            // Initialize Window Properties
            this.SetDefaultSize(500, 300);
            DefaultIcon = StockIcons.GetPixbuf("NyIVIcon");
            this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);

            // Initialize VBox
            this.vbox = new Gtk.VBox(false, 0);
            this.Add(this.vbox);

            // Initialize Menu & Toolbar
            this.uiMenuManager = new UiMenuManager();
            this.uiMenuManager.Activated += new EventHandler(OnMenuActivated);
            this.AddAccelGroup(this.uiMenuManager.AccelGroup);

            // Initialize MenuBar
            Gtk.MenuBar menubar = this.MenuBar;
            this.vbox.PackStart(menubar, false, false, 0);

            // Initialize ToolBar
            Gtk.Toolbar toolbar = this.ToolBar;
            toolbar.ToolbarStyle = ToolbarStyle.Both;
            toolbar.IconSize = IconSize.LargeToolbar;
            this.vbox.PackStart(toolbar, false, false, 0);

            // Initialize Viewer
            this.viewer = new Viewer();
            this.vbox.PackStart(this.viewer, true, true, 2);

            // Initialize StatusBar
            this.statusBar = new Gtk.Statusbar();
            this.vbox.PackEnd(this.statusBar, false, false, 0);

            // Set Sensitive Menu
            SetSensitiveImageMenu(false);
        }
Exemplo n.º 44
0
 private void CreateStatusBar()
 {
     statusbar = new Gtk.Statusbar();
 }
Exemplo n.º 45
0
        private void build()
        {
            this.vbox1    = new Gtk.VBox();
            this.toolbar1 = new Gtk.Toolbar();
            this.toolbar1.ToolbarStyle      = ToolbarStyle.BothHoriz;
            this.new_toolbutton             = new ToolButton(Stock.New);
            this.new_toolbutton.IsImportant = true;
            this.new_toolbutton.Label       = "New Character";
            this.new_toolbutton.Clicked    += HandleNew_toolbuttonhandleClicked;
            this.toolbar1.Add(this.new_toolbutton);
            this.pref_toolbutton             = new ToolButton(Stock.Preferences);
            this.pref_toolbutton.IsImportant = true;
            this.pref_toolbutton.Label       = "Preferences";
            this.pref_toolbutton.Clicked    += HandlePref_toolbuttonhandleClicked;
            this.toolbar1.Add(this.pref_toolbutton);
            this.quit_toolbutton             = new ToolButton(Stock.Quit);
            this.quit_toolbutton.IsImportant = true;
            this.quit_toolbutton.Label       = "Quit";
            this.quit_toolbutton.Clicked    += HandleQuit_toolbuttonhandleClicked;
            this.toolbar1.Add(this.quit_toolbutton);
            this.about_toolbutton             = new ToolButton(Stock.About);
            this.about_toolbutton.IsImportant = true;
            this.about_toolbutton.Label       = "About";
            this.about_toolbutton.Clicked    += HandleAbout_toolbuttonhandleClicked;
            SeparatorToolItem sti = new SeparatorToolItem();

            sti.Draw   = false;
            sti.Expand = true;
            this.toolbar1.Add(sti);
            this.toolbar1.Add(this.about_toolbutton);
            this.statusbar1 = new Gtk.Statusbar();
            this.image1     = new Image(MediaManager.GetPixbufFromBaseFile("BLLogo.jpg").ScaleSimple(296, 149, Gdk.InterpType.Bilinear));
            Gtk.VBox vbox2 = new Gtk.VBox();

            Gtk.ScrolledWindow sw1 = new Gtk.ScrolledWindow();
            TreeStore          ts1 = new TreeStore(typeof(string), typeof(string));

            ts1.AppendValues("Player Characters", DateTime.Now.ToString());
            ts1.AppendValues("Non-Player Characters", DateTime.Now.ToString());
            ts1.AppendValues("Database", DateTime.Now.ToString());
            TreeView tv1 = new TreeView();

            tv1.Model          = ts1;
            tv1.HeadersVisible = true;
            tv1.AppendColumn("Source", new CellRendererText(), "text", 0);
            tv1.AppendColumn("Last Update", new CellRendererText(), "text", 1);
            sw1.Add(tv1);



            vbox2.PackStart(this.image1, false, true, 0);
            vbox2.PackEnd(sw1, true, true, 0);
            this.vbox1.PackStart(this.toolbar1, false, true, 0);
            this.vbox1.PackStart(vbox2, true, true, 0);
            this.vbox1.PackStart(this.statusbar1, false, true, 0);
            this.Add(this.vbox1);
            //this.SetSizeRequest(640, Screen.Height - 100);
            this.SetSizeRequest(480, 640);
            this.Icon = Battle.Gui.MediaManager.GetPixbufFromBaseFile("LSIMMS.png");
            this.statusbar1.Push(0, string.Format("{0} started @ {1}",
                                                  this.session.GetType().ToString(),
                                                  this.session.StartTime.ToString()));
            this.Maximize();
        }