Esempio n. 1
0
 ISheet IDesigner.AddSheet(string Label, ISheet sheet)
 {
     if (this.Sheet == null)
     {
         Canvas = new DrawingArea();
         Canvas.AddEvents((int)Gdk.EventMask.ButtonPressMask);
         Canvas.AddEvents((int)Gdk.EventMask.ButtonReleaseMask);
         Canvas.AddEvents((int)Gdk.EventMask.PointerMotionMask);
         //
         Canvas.ButtonPressEvent   += HandleButtonPressEvent;
         Canvas.ButtonReleaseEvent += HandleButtonReleaseEvent;
         Canvas.ExposeEvent        += HandleExposeEvent;
         Canvas.MotionNotifyEvent  += HandleMotionNotifyEvent;
         Gtk.Drag.DestSet(
             Canvas,
             DestDefaults.All, new Gtk.TargetEntry[] { new Gtk.TargetEntry("application/x-solidide.shape", Gtk.TargetFlags.App, 0) },
             Gdk.DragAction.Copy
             );
         Canvas.DragDataReceived += HandleCanvasDragDataReceived;
         //
         noteBook.AppendPage(Canvas, new Gtk.Label(Label));
         noteBook.ShowAll(); //Canvas.Show();
     }
     this.Sheet = sheet as Sheet <Gdk.Event, Cairo.Context, SolidV.MVC.Model>;
     return(sheet);
 }
Esempio n. 2
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            IAssemblyBrowser browser = reflector.GetPlugins().GetService <IAssemblyBrowser>();

            browser.SelectionChanged += OnSelectionChanged;

            ScrolledWindow scrollWindow = new ScrolledWindow();
            Viewport       viewport     = new Viewport();

            scrollWindow.Add(viewport);
            viewport.Add(nb);
            scrollWindow.ShowAll();

            nb.AppendPage(textView, new Gtk.Label("CG Text"));
            nb.AppendPage(drawingArea, new Gtk.Label("CG Visualizer"));
            nb.ShowAll();

            cgVisualizingDock                = mainWindow.DockFrame.AddItem("CGVisualizer");
            cgVisualizingDock.DrawFrame      = true;
            cgVisualizingDock.Label          = "Call Graph Visualizer";
            cgVisualizingDock.Content        = scrollWindow;
            cgVisualizingDock.DefaultVisible = true;
            cgVisualizingDock.Visible        = true;
        }
Esempio n. 3
0
        public WorkbenchView(WorkbenchController controller)
        {
            SplashWindow.Update ("Creating GUI");
            XML gxml = new Glade.XML (null,
                          WorkbenchSingleton.GLADEFILE,
                          "Workbench",
                          null);

            window = (Gtk.Window) gxml["Workbench"];
            Gtk.VPaned splitter = (Gtk.VPaned) gxml["mainPane"];

            editorNotebook = new EditorNotebook ();
            splitter.Pack1 (editorNotebook, true, false);

            ScrolledWindow sw = new ScrolledWindow ();
            console = new TextView ();
            console.Editable = false;
            console.WrapMode = WrapMode.Word;
            sw.Add (console);

            Notebook bottomNotebook = new Notebook ();
            bottomNotebook.AppendPage (sw, new Label ("Console"));
            splitter.Pack2 (bottomNotebook, true, false);

                        window.Icon = icon;
            this.WindowTitle = "";
            gxml.Autoconnect (controller);
            bottomNotebook.ShowAll ();
            editorNotebook.ShowAll ();
            SplashWindow.Update ("Simetron is ready!");
        }
Esempio n. 4
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            IAssemblyBrowser browser = reflector.GetPlugins().GetService <IAssemblyBrowser>();

            browser.SelectionChanged += OnSelectionChanged;

            ScrolledWindow cfgDrawingAreaWindow   = new ScrolledWindow();
            Viewport       cfgDrawingAreaViewport = new Viewport();

            cfgDrawingAreaWindow.Add(cfgDrawingAreaViewport);
            cfgDrawingAreaViewport.Add(drawingArea);

            ScrolledWindow cfgTextAreaWindow   = new ScrolledWindow();
            Viewport       cfgTextAreaViewport = new Viewport();

            cfgTextAreaWindow.Add(cfgTextAreaViewport);
            cfgTextAreaViewport.Add(cfgTextView);

            Gtk.Notebook nb = new Gtk.Notebook();
            nb.AppendPage(cfgTextAreaWindow, new Gtk.Label("CFG Text"));
            nb.AppendPage(cfgDrawingAreaWindow, new Gtk.Label("CFG Visualizer"));
            nb.ShowAll();

            cfgVisualizingDock                = mainWindow.DockFrame.AddItem("CFG Visualizer");
            cfgVisualizingDock.Expand         = true;
            cfgVisualizingDock.DrawFrame      = true;
            cfgVisualizingDock.Label          = "CFG Visualizer";
            cfgVisualizingDock.Content        = nb;
            cfgVisualizingDock.DefaultVisible = true;
            cfgVisualizingDock.Visible        = true;

            ScrolledWindow simulationTextViewWindow = new ScrolledWindow();
            VBox           simulationVBox           = new VBox(false, 0);

            simulationTextView = new TextView();
            simulationTextViewWindow.Add(simulationTextView);
            Button simulateButton = new Button("Simulate");

            simulateButton.Clicked += HandleClicked;

            simulationVBox.PackStart(simulateButton, false, false, 0);
            simulationVBox.PackStart(new Label("New CFG: "), false, false, 0);
            simulationVBox.PackStart(simulationTextViewWindow, true, true, 0);
            simulationVBox.PackStart(new Label("Method output: "), false, false, 0);
            simulationVBox.PackEnd(outputTextView, true, true, 0);

            simulationVBox.ShowAll();

            simulationDock                = mainWindow.DockFrame.AddItem("Simulation Visualizer");
            simulationDock.Expand         = true;
            simulationDock.DrawFrame      = true;
            simulationDock.Label          = "Simulation Visualizer";
            simulationDock.Content        = simulationVBox;
            simulationDock.DefaultVisible = true;
            simulationDock.Visible        = true;
        }
Esempio n. 5
0
        private ChatsPage()
        {
            base.FocusGrabbed += base_FocusGrabbed;

            closePixbuf = new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.smallclose.png");

            tabLabelPages = new Dictionary<Widget, ChatSubpageBase>();

            notebook = new Notebook();
            notebook.TabPos = PositionType.Bottom;
            notebook.SwitchPage += notebook_SwitchPage;
            notebook.PageReordered += notebook_PageReordered;

            ScrolledWindow swindow = new ScrolledWindow();
            swindow.HscrollbarPolicy = PolicyType.Automatic;
            swindow.VscrollbarPolicy = PolicyType.Automatic;
            chatList = new TreeView ();
            swindow.Add(chatList);

            chatTreeStore = new NetworkGroupedTreeStore<ChatRoom>(chatList);
            chatList.Model = chatTreeStore;

            TreeViewColumn column;

            column = chatList.AppendColumn("Room Name", new CellRendererText(), new TreeCellDataFunc (NameDataFunc));
            column.Expand = true;
            column.Sizing = TreeViewColumnSizing.Autosize;

            var pixbufCell = new CellRendererPixbuf();
            column.PackStart(pixbufCell, false);
            column.SetCellDataFunc(pixbufCell, new TreeCellDataFunc(RoomSecureDataFunc));

            column = chatList.AppendColumn("Users", new CellRendererText(), new TreeCellDataFunc (RoomUsersDataFunc));
            column.Sizing = TreeViewColumnSizing.Autosize;

            chatList.RowActivated += chatList_RowActivated;
            chatList.ButtonPressEvent += chatList_ButtonPressEvent;

            EventBox box = new EventBox();
            box.Add(new Label("Chatroom List"));
            box.ButtonPressEvent += HandleTabButtonPressEvent;
            box.ShowAll();
            notebook.AppendPage(swindow, box);

            this.PackStart(notebook, true, true, 0);
            notebook.ShowAll();

            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                );
        }
Esempio n. 6
0
        public DatabaseEditor(string filePath)
        {
            fileName = filePath;
            control = new Notebook();

            control.TabPos = PositionType.Bottom;
            control.AppendPage(new StructureDatabaseView(filePath),new Label(MainClass.Languages.Translate("sql_structure")));
            control.AppendPage(new DataDatabaseView(filePath),new Label(MainClass.Languages.Translate("sql_data")));
            control.AppendPage(new SqlDatabaseView(filePath),new Label(MainClass.Languages.Translate("sql_sql")));

            control.SwitchPage += new SwitchPageHandler(OnSwitchPage);

            control.ShowAll();
        }
Esempio n. 7
0
        void IPlugin.Init(object context)
        {
            mainApp    = context as ISolidIDE;
            mainWindow = mainApp.GetMainWindow();

            noteBook = new Gtk.Notebook();
            noteBook.AppendPage(new TextView(), new Gtk.Label("TestPlugin Visualizer"));
            noteBook.AppendPage(new DrawingArea(), new Gtk.Label("TestPlugin Visualizer"));
            noteBook.ShowAll();

            dockItem                = mainWindow.DockFrame.AddItem("TestPlugin Visualizer");
            dockItem.Behavior       = DockItemBehavior.Normal;
            dockItem.Expand         = true;
            dockItem.DrawFrame      = true;
            dockItem.Label          = "TestPlugin Visualizer";
            dockItem.Content        = noteBook;
            dockItem.DefaultVisible = true;
            dockItem.Visible        = true;
        }
        public void DataSetChanged()
        {
            // Clear data
            for (uint i = 0; i < tabs; i++)
            {
                tabView.RemovePage(0);
            }
            tabList.Clear();
            tabs = 0;

            foreach (var content in contentList)
            {
                content.tree.Dispose();
            }
            contentList.Clear();

            // Repopulate
            PopulateTabView();
            tabView.ShowAll();
        }
Esempio n. 9
0
        /// <summary>
        /// Tunes the left dock item.
        /// </summary>
        private void TuneLeftDockItem()
        {
            Gtk.VBox vbox = new Gtk.VBox();
            tbLeft.Name = "LeftToolbar";
            vbox.PackStart(tbLeft, true, true, 0);
            tbLeft.Orientation = Gtk.Orientation.Vertical;
            // Show only text on the buttons
            tbLeft.ToolbarStyle = Gtk.ToolbarStyle.Text;

            ScrolledWindow scroll = new ScrolledWindow();

            // Attach the treeView to the scroll bar.
            scroll.AddWithViewport(vbox);

            nbLeftDock.Add(scroll);;

            this.propertyGrid = new SolidV.Gtk.InspectorGrid.InspectorGrid();
            nbLeftDock.AppendPage(propertyGrid, new Gtk.Label("Properties"));
            nbLeftDock.ShowAll();
        }
Esempio n. 10
0
        void IPlugin.Init(object context)
        {
            ISampleTool reflector = context as ISampleTool;

            mainWindow = reflector.GetMainWindow();

            Gtk.Notebook nb = new Gtk.Notebook();
            nb.AppendPage(new TextView(), new Gtk.Label("TestPlugin Visualizer"));
            nb.AppendPage(new DrawingArea(), new Gtk.Label("TestPlugin Visualizer"));
            nb.ShowAll();

            dockItem                = mainWindow.DockFrame.AddItem("TestPlugin Visualizer");
            dockItem.Visible        = true;
            dockItem.Behavior       = DockItemBehavior.Normal;
            dockItem.Expand         = true;
            dockItem.DrawFrame      = true;
            dockItem.Label          = "TestPlugin Visualizer";
            dockItem.Content        = nb;
            dockItem.DefaultVisible = true;
            dockItem.Visible        = true;
        }
Esempio n. 11
0
        /// <summary>
        /// Tunes the middle dock item or the data visualizer.
        /// </summary>
        private void TuneMiddleDockItem()
        {
            // Attach the comboBox first.
            vbMiddle.PackStart(comboBox, false, false, 0);
            ScrolledWindow scroll = new ScrolledWindow();

            // Attach the treeView to the scroll bar.
            scroll.AddWithViewport(treeView);
            // Attach the scrollBar to the box.
            vbMiddle.PackStart(scroll, true, true, 0);

            // Set up DrawingArea.
            drawingArea = new DrawingArea();
            drawingArea.SetSizeRequest(800, 500);
            ScrolledWindow scrollDA = new ScrolledWindow();

            Gtk.VBox vBoxDA     = new Gtk.VBox();
            Viewport viewPortDA = new Viewport();

            viewPortDA.Add(drawingArea);
            scrollDA.Add(viewPortDA);
            vBoxDA.PackStart(scrollDA, true, true, 0);

            // Add Paned container in order to make the two boxes resizable
            Gtk.VPaned splitter = new Gtk.VPaned();
            splitter.Pack1(vBoxDA, true, true);
            splitter.Pack2(vbMiddle, true, true);
            splitter.Position = 400;
            splitter.ShowAll();

            nbMiddleDock.AppendPage(splitter, new Gtk.Label("Schema Visualizer"));
            nbMiddleDock.ShowAll();

            schemaV = new SchemaVisualizer(drawingArea);

            // Get the selected shape.
            SelectionModel selectionModel = schemaV.Selection;

            selectionModel.ModelChanged += HandleSelectionModelChanged;
        }
Esempio n. 12
0
        /// <summary>
        /// Adds the tab from file.
        /// </summary>
        /// <param name='_nb'>
        /// The notebook.
        /// </param>
        public static void AddTabFromFile(Notebook _nb)
        {
            try {
                string FileNameNew;
                FileNameNew = ShowOpenDialog ();
                if (g_files.Contains (FileNameNew) == false) {
                    if (System.IO.File.Exists (FileNameNew)) {
                        libTerminus.cRegex newregex = new cRegex (FileNameNew);
                        _nb.AppendPage (newregex, new Label (new FileInfo (FileNameNew).Name, ref _nb, newregex));
                        _nb.ShowAll ();
                        _nb.Page = _nb.NPages - 1;
                        g_files.Add (FileNameNew);
                    }
                } else {
                    _nb.Page = g_files.IndexOf (FileNameNew);
                }

            } catch (Exception ex) {
                MessageBox.Show (ex.Message, cTerminus.g_programName, ButtonsType.Close, MessageType.Error);
            }
        }
 private Widget CreateNotebook()
 {
     Notebook notebook = new Notebook();
        notebook.AppendPage(CreateServerPage(), new Label(Util.GS("Server")));
        notebook.AppendPage(CreateIdentityPage(), new Label(Util.GS("Identity")));
        notebook.AppendPage(CreateDiskSpacePage(), new Label(Util.GS("Disk Space")));
        notebook.ShowAll();
        return notebook;
 }
Esempio n. 14
0
		public SelectReferenceDialog ()
		{
			Build ();

			combinedBox = new CombinedBox ();
			combinedBox.Show ();
			mainBook = new Notebook ();
			combinedBox.Add (mainBook);
			alignment1.Add (combinedBox);
			mainBook.ShowAll ();

			filterEntry = combinedBox.FilterEntry;

			boxRefs.WidthRequest = 200;
			
			refTreeStore = new ListStore (typeof (string), typeof(string), typeof(string), typeof(ProjectReference), typeof(Xwt.Drawing.Image));
			ReferencesTreeView.Model = refTreeStore;

			TreeViewColumn col = new TreeViewColumn ();
			col.Title = GettextCatalog.GetString("Reference");
			CellRendererImage crp = new CellRendererImage ();
			crp.Yalign = 0f;
			col.PackStart (crp, false);
			col.AddAttribute (crp, "image", IconColumn);
			CellRendererText text_render = new CellRendererText ();
			col.PackStart (text_render, true);
			col.AddAttribute (text_render, "markup", NameColumn);
			text_render.Ellipsize = Pango.EllipsizeMode.End;
			
			ReferencesTreeView.AppendColumn (col);
//			ReferencesTreeView.AppendColumn (GettextCatalog.GetString ("Type"), new CellRendererText (), "text", TypeNameColumn);
//			ReferencesTreeView.AppendColumn (GettextCatalog.GetString ("Location"), new CellRendererText (), "text", LocationColumn);
			
			projectRefPanel = new ProjectReferencePanel (this);
			packageRefPanel = new PackageReferencePanel (this, false);
			allRefPanel = new PackageReferencePanel (this, true);
			assemblyRefPanel = new AssemblyReferencePanel (this);
			panels.Add (allRefPanel);
			panels.Add (packageRefPanel);
			panels.Add (projectRefPanel);
			panels.Add (assemblyRefPanel);
			
			//mainBook.RemovePage (mainBook.CurrentPage);
			
			HBox tab = new HBox (false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Reference, IconSize.Menu)), false, false, 0);
			tab.PackStart (new Label (GettextCatalog.GetString ("_All")), true, true, 0);
			tab.BorderWidth = 3;
			tab.ShowAll ();
			mainBook.AppendPage (allRefPanel, tab);
			
			tab = new HBox (false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Package, IconSize.Menu)), false, false, 0);
			tab.PackStart (new Label (GettextCatalog.GetString ("_Packages")), true, true, 0);
			tab.BorderWidth = 3;
			tab.ShowAll ();
			mainBook.AppendPage (packageRefPanel, tab);
			
			tab = new HBox (false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Project, IconSize.Menu)), false, false, 0);
			tab.PackStart (new Label (GettextCatalog.GetString ("Pro_jects")), true, true, 0);
			tab.BorderWidth = 3;
			tab.ShowAll ();
			mainBook.AppendPage (projectRefPanel, tab);
			
			tab = new HBox (false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu)), false, false, 0);
			tab.PackStart (new Label (GettextCatalog.GetString (".Net A_ssembly")), true, true, 0);
			tab.BorderWidth = 3;
			tab.ShowAll ();
			mainBook.AppendPage (assemblyRefPanel, tab);
			
			mainBook.Page = 0;
			
			var w = selectedHeader.Child;
			selectedHeader.Remove (w);
			HeaderBox header = new HeaderBox (1, 0, 1, 1);
			header.SetPadding (6, 6, 6, 6);
			header.GradientBackround = true;
			header.Add (w);
			selectedHeader.Add (header);
			
			RemoveReferenceButton.CanFocus = false;
			ReferencesTreeView.Selection.Changed += new EventHandler (OnChanged);
			Child.ShowAll ();
			OnChanged (null, null);
			InsertFilterEntry ();
		}
Esempio n. 15
0
 /// <summary>
 /// Show GtkWindow object
 /// </summary>
 public void Show()
 {
     tabInfo.ShowAll();
     AboutDialog.Show();
 }
        public void Initialize(IPadWindow window)
        {
            InitPopupMenu();

            // The breakpoint list
            localStore = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(string), typeof(string));
            localTree = CreateTree (localStore);

            globalStore = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(string), typeof(string));
            globalTree = CreateTree (globalStore);

            allStore = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(string), typeof(string));
            allTree = CreateTree (allStore);

            notebook = new Notebook ();
            notebook.TabPos = PositionType.Top;

            var localControl = new ScrolledWindow ();
            localControl.ShadowType = ShadowType.None;
            localControl.Add (localTree);

            var globalControl = new ScrolledWindow ();
            globalControl.ShadowType = ShadowType.None;
            globalControl.Add (globalTree);

            var allControl = new ScrolledWindow ();
            allControl.ShadowType = ShadowType.None;
            allControl.Add (allTree);

            Label localLabel = new Label ("Local bookmarks");
            notebook.AppendPage (localControl, localLabel);

            Label globalLabel = new Label ("Global bookmarks");
            notebook.AppendPage (globalControl, globalLabel);

            Label allLabel = new Label ("All bookmarks");
            notebook.AppendPage (allControl, allLabel);

            notebook.ShowAll ();

            UpdateDisplay ();

            onBookmarksChanged = DispatchService.GuiDispatch<System.Action> (OnBookmarksChanged);
            BookmarkService.Instance.OnBookmarksChange += onBookmarksChanged;

            onFileChanged = DispatchService.GuiDispatch<System.Action>(OnFileChanged);
            BookmarkService.Instance.OnFileChage += onFileChanged;

            notebook.SwitchPage += (o, args) => { UpdateDisplay(); };
        }
Esempio n. 17
0
        public MainWindow()
            : base("This is a window test")
        {
            DeleteEvent += onDeleteEvent;
            SetSizeRequest( 800, 600 );

            df = new DockFrame();
            df.DefaultItemHeight = 100;
            df.DefaultItemWidth = 100;
            //df.Homogeneous = false;

            Add( df );

            DockItem doc_item = df.AddItem( "Document" );
            doc_item.Behavior = DockItemBehavior.CantClose;
            doc_item.Expand = true;
            doc_item.DrawFrame = true;
            doc_item.Label = "Documentos";
            Gtk.Notebook nb = new Notebook();
            nb.AppendPage( new Label( "Other page" ), new Label( "The label" ) );
            nb.AppendPage( new TextView(), new Image( "gtk-new", IconSize.Menu ) );
            nb.ShowAll();
            doc_item.Content = nb;
            doc_item.DefaultVisible = true;
            doc_item.Visible = true;

            DockItem left = df.AddItem( "left" );
            left.Behavior = DockItemBehavior.NeverHorizontal;
            left.DefaultLocation = "Document/Left";
            left.DefaultVisible = true;
            left.Visible = true;
            left.Label = "Left";
            left.DrawFrame = true;
            left.Content = new Label( "This is a test" );

            DockItem right = df.AddItem( "right" );
            right.Behavior = DockItemBehavior.CantClose;
            right.DefaultLocation = "Document/Right";
            right.DefaultVisible = true;
            right.Visible = true;
            right.Label = "Right";
            right.DrawFrame = true;
            right.Content = new Label( "CONTENT" );
            //right.Icon = "gtk-close";

            DockItem rb = df.AddItem( "right_bottom" );
            rb.Behavior = DockItemBehavior.CantClose;
            rb.DefaultLocation = "right/Bottom";
            rb.DefaultVisible = true;
            rb.Visible = true;
            rb.Label = "Right bottom";
            rb.DrawFrame = true;
            rb.Content = new Button( "A BUTTON!" );
            rb.Behavior = DockItemBehavior.CantClose;
            //rb.Icon = "gtk-new";

            if ( File.Exists( "config.layout" ) )
            {
                df.LoadLayouts( "config.layout" );
            }
            else
            {
                df.CreateLayout( "test", true );
            }
            df.CurrentLayout = "test";
            df.HandlePadding = 0;
            df.HandleSize = 10;

            ShowAll();
        }
 private Widget CreateNotebook()
 {
     Notebook notebook = new Notebook();
        notebook.AppendPage(CreateAccountPage(), new Label(Util.GS("Account")));
        notebook.ShowAll();
        return notebook;
 }
Esempio n. 19
0
        public MainWindow()
        {
            ToolItem        spacerItem;
            FileSearchEntry searchEntry;
            ToolItem        searchEntryItem;
            Alignment       searchEntryBox;

            object[] attrs= Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), true);
            AssemblyTitleAttribute attr = (AssemblyTitleAttribute)attrs[0];
            AssemblyName asmName = Assembly.GetExecutingAssembly().GetName();

            string title = String.Format ("{0} (BETA) {1} (Protocol Version: {2})",
                                      attr.Title, asmName.Version,
                                      Core.ProtocolVersion);

            // Create the interface
            window = new Window (title);
            window.SetDefaultSize (850, 550);
            window.DeleteEvent += on_win_delete;
            window.ConfigureEvent += on_MainWindow_configure_event;
            window.FocusInEvent += window_FocusInEvent;

            ((ToggleAction)Runtime.BuiltinActions["ToggleMainToolbar"]).Active = Gui.Settings.ShowToolbar;
            Runtime.BuiltinActions["ToggleMainToolbar"].Activated += ToggleMainToolbar_Activated;

            ((ToggleAction)Runtime.BuiltinActions["ToggleMainStatusbar"]).Active = Gui.Settings.ShowStatusBar;
            Runtime.BuiltinActions["ToggleMainStatusbar"].Activated += ToggleMainStatusbar_Activated;
            window.AddAccelGroup (Runtime.UIManager.AccelGroup);

            mainVBox = new VBox ();
            window.Add (mainVBox);
            mainVBox.Show ();

            if (Common.OSName == "Darwin") {
                MenuBar menubar = (MenuBar) Runtime.UIManager.GetWidget ("/OSXAppMenu");

                Imendio.MacIntegration.Menu.SetMenuBar(menubar);

                MenuItem preferencesItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/Preferences");
                MenuItem aboutItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/About");

                IntPtr group = Imendio.MacIntegration.Menu.AddAppMenuGroup();

                Imendio.MacIntegration.Menu.AddAppMenuItem(group, aboutItem, "About Meshwork");

                group = Imendio.MacIntegration.Menu.AddAppMenuGroup();

                Imendio.MacIntegration.Menu.AddAppMenuItem(group, preferencesItem, "Preferences");

                MenuItem quitItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/Quit");
                Imendio.MacIntegration.Menu.SetQuitMenuItem(quitItem);
            } else {
                MenuBar menubar = (MenuBar) Runtime.UIManager.GetWidget ("/MainWindowMenuBar");
                mainVBox.PackStart (menubar, false, false, 0);
                menubar.Show ();
            }

            toolbar = (Toolbar) Runtime.UIManager.GetWidget ("/MainWindowToolbar");
            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            toolbar.IconSize = IconSize.LargeToolbar;

            spacerItem = new ToolItem();
            spacerItem.Expand = true;
            toolbar.Insert(spacerItem, -1);
            spacerItem.Show();

            searchEntry = new FileSearchEntry();

            searchEntryBox = new Alignment(0.5f, 0.5f, 0, 0);
            searchEntryBox.LeftPadding = 4;
            searchEntryBox.RightPadding = 1;
            searchEntryBox.Add(searchEntry);

            searchEntryItem = new ToolItem();
            searchEntryItem.Add(searchEntryBox);

            toolbar.Insert(searchEntryItem, -1);
            searchEntryItem.ShowAll();

            mainVBox.PackStart (toolbar, false, false, 0);

            mainPaned = new HPaned();
            mainPaned.Mapped += delegate (object sender, EventArgs args) {
                // XXX: Remember the user's last setting instead
                mainPaned.Position = 190;

                // Set some colors
                //infoBoxSeparator.ModifyBg(StateType.Normal, GtkHelper.DarkenColor (mainbar.Style.Background(StateType.Normal), 2));
                //infoSwitcherTree.ModifyBase(StateType.Normal, infoSwitcherTree.Style.Base(StateType.Active));
                //infoSwitcherTree.ModifyBase(StateType.Active, infoBoxSeparator.Style.Base(StateType.Selected));
            };
            mainPaned.Show();
            mainVBox.PackStart (mainPaned, true, true, 0);

            // Create page notebook
            pageNotebook = new Notebook();
            pageNotebook.ShowTabs = false;
            pageNotebook.ShowBorder = false;
            mainPaned.Pack2(pageNotebook, true, true);
            pageNotebook.ShowAll();

            // Create sidebar
            sidebar = new MainSidebar();
            sidebar.ItemAdded += sidebar_ItemAdded;
            sidebar.SelectedItemChanged += sidebar_SelectedItemChanged;
            sidebar.AddBuiltinItems();

            mainPaned.Pack1(sidebar, false, false);
            sidebar.ShowAll();

            CreateStatusbar ();

            // Apply "view" settings
            toolbar.Visible = Gui.Settings.ShowToolbar;
            statusBar.Visible = Gui.Settings.ShowStatusBar;

            // Hook up Core events
            Core.ShareBuilder.StartedIndexing  += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_StartedIndexing));
            Core.ShareBuilder.FinishedIndexing += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_FinishedIndexing));
            Core.ShareBuilder.StoppedIndexing  += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_StoppedIndexing));
            Core.ShareBuilder.ErrorIndexing    += (ErrorEventHandler)DispatchService.GuiDispatch(new ErrorEventHandler(sb_ErrorIndexing));
            Core.ShareHasher.StartedHashingFile += (ShareHasherTaskEventHandler)DispatchService.GuiDispatch(new ShareHasherTaskEventHandler(sh_StartedFinished));
            Core.ShareHasher.FinishedHashingFile += (ShareHasherTaskEventHandler)DispatchService.GuiDispatch(new ShareHasherTaskEventHandler(sh_StartedFinished));
            Core.ShareHasher.QueueChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sh_QueueChanged));

            Core.FileSearchManager.SearchAdded   += (FileSearchEventHandler)DispatchService.GuiDispatch(new FileSearchEventHandler(FileSearchManager_SearchAdded));
            Core.FileSearchManager.SearchRemoved += (FileSearchEventHandler)DispatchService.GuiDispatch(new FileSearchEventHandler(FileSearchManager_SearchRemoved));

            window.Resize (Gui.Settings.WindowSize.Width, Gui.Settings.WindowSize.Height);
            window.Move (Gui.Settings.WindowPosition.X, Gui.Settings.WindowPosition.Y);

            SelectedPage = NetworkOverviewPage.Instance;
        }
Esempio n. 20
0
 /// <summary>
 /// Adds the tab from file. Use this method only if you want to save a file to a new filename.
 /// </summary>
 /// <param name='_nb'>
 /// The notebook.
 /// </param>
 /// <param name='_fileNameNew'>
 /// The new Filename
 /// </param>
 /// <param name='_pageindex'>
 /// The index of the page.
 /// </param>
 public static void AddTabFromFile(Notebook _nb, string _fileNameNew, int _pageindex)
 {
     try {
         if (System.IO.File.Exists (_fileNameNew)) {
             //FileName = FileNameNew;	//Fixme: If nothing happens, change this comment.
             libTerminus.cRegex newregex;
             if (g_tmp != null) {
                 newregex = g_tmp;
                 g_tmp = null;
             } else {
                 newregex = new cRegex (_fileNameNew);
             }
             _nb.InsertPage (newregex, new Label (new FileInfo (_fileNameNew).Name, ref _nb, newregex), _pageindex);
             _nb.ShowAll ();
             g_files.Add (_fileNameNew);
         } else {
             libTerminus.cRegex newregex = new cRegex (_fileNameNew);
             _nb.InsertPage (newregex, new Label (Catalog.GetString ("New Phrase"), ref _nb, newregex), _pageindex);
             _nb.ShowAll ();
             g_files.Add (_fileNameNew);
         }
     } catch (Exception ex) {
         MessageBox.Show ("error: " + ex.Message, cTerminus.g_programName, ButtonsType.Close, MessageType.Error);
     }
 }
Esempio n. 21
0
        //public static bool enableDataBase;
        /// <summary>
        /// Adds a new tab to the given notebook
        /// </summary>
        /// <param name='_nb'>
        /// The notebook.
        /// </param>
        /// <param name='_filename'>
        /// The filename. If you have a filename, use it. If you don't have a filename, use "" instead.
        /// </param>
        public static void AddTab(Notebook _nb, string _filename)
        {
            try {
                string FileName;
                if (System.IO.File.Exists (_filename))
                    FileName = new System.IO.FileInfo (_filename).Name;
                else
                    FileName = "";

                libTerminus.cRegex newregex = new cRegex (_filename);
                newregex.Saved = true;
                _nb.AppendPage (newregex, new Label (Catalog.GetString ("New Phrase"), ref _nb, newregex));
                _nb.ShowAll ();
                _nb.Page = _nb.NPages - 1;
                g_files.Add (_filename);
            } catch (Exception ex) {
                MessageBox.Show (ex.Message, cTerminus.g_programName, ButtonsType.Close, MessageType.Error);
            }
        }
Esempio n. 22
0
        /// <summary>
        /// Adds the library tab.
        /// </summary>
        /// <param name='_nb'>
        /// Nb.
        /// </param>
        public static void addLibraryTab(Notebook _nb)
        {
            try {
                if (isLibTabOpen != true) {
                    cPool lib = new libTerminus.cPool (ref _nb);
                    _nb.AppendPage (lib, new Label (Catalog.GetString ("Library"), ref _nb, lib));
                    _nb.ShowAll ();
                    _nb.Page = _nb.NPages - 1;
                    LibTabIndex = _nb.Page;
                } else {
                    //BUGGY: _nb.Page = LibTabIndex;

                }
            } catch (Exception ex) {
                MessageBox.Show (ex.Message, cTerminus.g_programName, ButtonsType.Close, MessageType.Error);
            }
        }
Esempio n. 23
0
 /// <summary>
 /// Adds the config tab.
 /// </summary>
 /// <param name='_nb'>
 /// Nb.
 /// </param>
 public static void addConfigTab(Notebook _nb)
 {
     try {
         if (isConfigTabOpen != true) {
             libTerminus.cConfig config = new libTerminus.cConfig (Configuration);
             _nb.AppendPage (config, new Label (Catalog.GetString ("Preferences"), ref _nb, config));
             _nb.ShowAll ();
             _nb.Page = _nb.NPages - 1;
             ConfigTabIndex = _nb.Page;
         } else {
             //BUGGY:_nb.Page = ConfigTabIndex;
         }
     } catch (Exception ex) {
         MessageBox.Show (ex.Message, cTerminus.g_programName, ButtonsType.Close, MessageType.Error);
     }
 }
Esempio n. 24
0
		public EditorTab NewEditorTab () 
		{
			EditorTab tab = new EditorTab();		
			editorTabs.Add(tab);
			
			currentEditorTab = tab;

			// top pane - sql editor

			SqlEditorSharp editor;
			editor = new SqlEditorSharp ();
			editor.Tab = tab;
			editor.UseSyntaxHiLighting = false;
			editor.View.Show ();
			editor.View.KeyPressEvent +=
				new Gtk.KeyPressEventHandler(OnKeyPressEventKey);

			lastUnknownFile ++;
			string unknownFile = "Unknown" + 
				lastUnknownFile.ToString() + ".sql";
			Label label = new Label(unknownFile);
			label.Show();

			// bottom pane - output results
			Notebook resultsNotebook = new Notebook();
			tab.resultsNotebook = resultsNotebook;
			resultsNotebook.TabPos = PositionType.Bottom;
			resultsNotebook.SwitchPage += new 
				Gtk.SwitchPageHandler(OnResultsNotebookSwitched);
			
			DataGrid grid = CreateOutputResultsDataGrid ();
			grid.View.Selection.Mode = SelectionMode.Multiple;
			tab.grid = grid;
			grid.Show();
			Label label2 = new Label("Grid");
			label2.Show();
			
			ScrolledWindow swin = CreateOutputResultsTextView (tab);
			swin.Show();

			tab.editor = editor;
			tab.label = label;
			tab.filename = "";
			tab.basefilename = unknownFile;

			Label label3 = new Label("Log");
			label3.Show();

			// finish the notebooks

			tab.frame = new Frame();
			tab.frame.ShadowType = ShadowType.None;
			tab.frame.Add (grid);
			tab.GridPage = resultsNotebook.AppendPage(tab.frame, label2);
			tab.LogPage = resultsNotebook.AppendPage(swin, label3);

			resultsNotebook.ShowAll ();
			resultsNotebook.ResizeChildren ();

			if (outputResults == OutputResults.TextView)
				resultsNotebook.CurrentPage = 1;
			else if (outputResults == OutputResults.DataGrid)
				resultsNotebook.CurrentPage = 0;

			tab.Add1 (editor);
			tab.Add2 (resultsNotebook);

			sourceFileNotebook.AppendPage(tab, label);

			sourceFileNotebook.ShowAll ();
			sourceFileNotebook.ResizeChildren ();

			sourceFileNotebook.CurrentPage = -1;

			tab.page = sourceFileNotebook.CurrentPage;
			UpdateTitleBar(tab);

			SetFocusToEditor ();

			return tab;
		}