Exemplo n.º 1
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.º 2
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.º 3
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.º 4
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);
		}