Exemplo n.º 1
0
		public DemoMain ()
		{
			SetupDefaultIcon ();
		   	window = new Gtk.Window ("Gtk# Code Demos");
		   	window.SetDefaultSize (600, 400);
			window.DeleteEvent += new DeleteEventHandler (WindowDelete);

			HBox hbox = new HBox (false, 0);
			window.Add (hbox);

			treeView = CreateTree ();
			hbox.PackStart (treeView, false, false, 0);

			Notebook notebook = new Notebook ();
			hbox.PackStart (notebook, true, true, 0);

			notebook.AppendPage (CreateText (infoBuffer, false), new Label ("_Info"));
			TextTag heading = new TextTag ("heading");
			heading.Font = "Sans 18";
			infoBuffer.TagTable.Add (heading);

			notebook.AppendPage (CreateText (sourceBuffer, true), new Label ("_Source"));

			window.ShowAll ();
		}
Exemplo n.º 2
0
        public ListPage(Notebook notebook, ModulesTreeInfo module)
        {
            this.notebook = notebook;
            this.module = module;

            headerbox = new HBox();
            headerlabel = new Label(module.Text);
            headerbox.PackStart(headerlabel);
            //Image img = new Image("gtk-close", IconSize.Menu);
            close_img = ImageManager.GetImage("Images.close-button.png");
            //close_img = new Image("gtk-close", IconSize.Menu);
            btnCloseTab = new Button(close_img);
            btnCloseTab.BorderWidth = 0;
            btnCloseTab.Relief = ReliefStyle.None;
            //btnCloseTab.WidthRequest = 19;
            //btnCloseTab.HeightRequest = 19;
            btnCloseTab.Clicked += delegate { this.Dispose(); };
            headerbox.PackStart(btnCloseTab);
            headerbox.ShowAll();

            tableview = new DataTableView(module);
            this.Add(tableview);
            this.ShowAll();

            notebook.AppendPage(this, headerbox);
            notebook.SetTabReorderable(this, true);
        }
Exemplo n.º 3
0
        protected AbstractListView() : base()
        {
            // Init Window and references
            this.SetPolicy(Gtk.PolicyType.Automatic, Gtk.PolicyType.Never);
            dbAdapter        = DatabaseAdapter.GetInstance();
            editFrameAdapter = EditFrameAdapter.GetInstance();
            tabView          = new Gtk.Notebook();
            // template init methods
            PopulateTabView();
            AddWithViewport(tabView);

            // Set TabHead Behavior: only active tab has a visible button
            tabView.SwitchPage += delegate
            {
                int i = 0;
                foreach (var head in tabList)
                {
                    if (i == tabView.CurrentPage)
                    {
                        head.button.Show();
                    }
                    else
                    {
                        head.button.Hide();
                    }
                    i++;
                }
            };
        }
Exemplo n.º 4
0
        public PageComboBox (IList<Page> pages, Notebook notebook)
        {
            this.pages = pages;
            this.notebook = notebook;

            // icon, name, order, Page object itself
            model = new ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(int), typeof(Page));
            model.SetSortColumnId (2, SortType.Ascending);
            Model = model;

            CellRendererPixbuf icon = new CellRendererPixbuf ();
            PackStart (icon, false);
            AddAttribute (icon, "pixbuf", 0);

            CellRendererText name = new CellRendererText ();
            PackStart (name, true);
            AddAttribute (name, "markup", 1);

            foreach (Page page in pages) {
                model.AppendValues (
                    Banshee.Gui.IconThemeUtils.LoadIcon (page.IconName, 22),
                    String.Format ("<b>{0}</b>", page.Name),
                    page.Order,
                    page
                );
            }

            Active = 0;
            Show ();
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="libTerminus.Label"/> class.
 /// </summary>
 /// <param name='_text'>
 /// _text.
 /// </param>
 /// <param name='_nb'>
 /// _nb.
 /// </param>
 public Label(string _text,ref Notebook _nb,Widget _widg)
 {
     this.Build ();
     label1.Text = _text;
     gnb = _nb;
     widg = _widg;
 }
Exemplo n.º 6
0
        public ViewGui()
            : base("")
        {
            string fullName = "MainView.gui.glade";

            Assembly a = Assembly.GetAssembly(this.GetType());
            Console.WriteLine(a.CodeBase);

            if (!System.IO.File.Exists(a.CodeBase + "/" + fullName))
                fullName = "gui.glade";

            glade = new XML (Assembly.GetCallingAssembly (), fullName, "ViewGui", null);
            glade.Autoconnect (this);

            Window win = (Window) glade ["ViewGui"];
            win.Maximize();

            //Initialisation du menu principal
            MainUIManager uim = new MainUIManager (this);

            vboxMain.PackStart (uim.MenuBar, false, false, 0);
            ((Gtk.Box.BoxChild)(vboxMain[uim.MenuBar])).Position = 0;

            //Pagecontrol des vues
            notebookViews = new Notebook ();
            hpanedMain.Pack2 (notebookViews, true, false);
            notebookViews.Show ();
            //notebookViews.RemovePage(0);
        }
Exemplo n.º 7
0
	public unsafe MphotoToplevel (IImageRepository _repo, string[] args, params object[] props)
		: base ("Mphoto", "0.0", Modules.UI, args, props)
	{
		cwh = new Glade.XMLCustomWidgetHandler (GladeCustomWidgetHandler);
		Glade.XML.SetCustomHandler (cwh);
		gxml = new Glade.XML (null, "mphoto.glade", null, null);

		Console.WriteLine ("Autoconnect");
		gxml.Autoconnect (this);

//        CreateCustomWidget ("browser_icon_list");
//        CreateCustomWidget ("collections_tree_view");
//        CreateCustomWidget ("imageinfo_tree_view");
//        CreateCustomWidget ("eog_image_view");
//        CreateCustomWidget ("keywords_widget");

		this.leftside_notebook = (Gtk.Notebook) gxml["browser_left_notebook"];
		this.top_level_notebook = (Gtk.Notebook) gxml["top_level_notebook"];

		this.toplevel = gxml["mphoto_browser"];
		this.label_zoom_value = (Gtk.Label) gxml["label_zoom_value"];
		this.search_dialog = (Gtk.Window) gxml["search_dialog"];

		this.Repository = _repo;

		// initialize the tree views to the side
		imageinfo_tree_view.IconList = icon_list;
		keywords_widget.IconList = icon_list;

		collections_tree_view.RowActivated += new RowActivatedHandler (CollectionsTreeViewActivateHandler);
		icon_list.Activated += new EventHandler (IconlistActivated);

		GlobalMphotoToplevel = this;
	}
Exemplo n.º 8
0
        private void CreateContextNotebook()
        {
            notebook = new Notebook()
            {
                ShowBorder = false,
                ShowTabs   = false
            };

            // 'No active track' and 'Loading' widgets
            no_active = new RoundedFrame();
            no_active.Add(new Label()
            {
                Markup = String.Format("<b>{0}</b>", Catalog.GetString("Waiting for playback to begin..."))
            });
            no_active.ShowAll();
            notebook.Add(no_active);

            loading = new RoundedFrame();
            loading.Add(new Label()
            {
                Markup = String.Format("<b>{0}</b>", Catalog.GetString("Loading..."))
            });
            loading.ShowAll();
            notebook.Add(loading);

            PackStart(notebook, true, true, 0);
            notebook.Show();
        }
        public FeedPropertiesDialog(ISource f)
            : base(WindowType.Toplevel)
        {
            feed = f;

            Title = "\""+feed.Name+"\" Properties";
            Icon = feed.Favicon;
            BorderWidth = 5;
            DeleteEvent += OnClose;

            vbox = new VBox();
            vbox.Spacing = 6;
            Add(vbox);

            notebook = new Notebook();
            vbox.PackStart(notebook, false, false, 0);

            bbox = new HButtonBox();
            bbox.Layout = ButtonBoxStyle.End;
            vbox.PackStart(bbox, false, false, 0);

            AddGeneralTab();
            AddTagsTab();
            AddCloseButton();
        }
Exemplo n.º 10
0
        public AboutDialog()
            : base(string.Empty, PintaCore.Chrome.MainWindow, DialogFlags.Modal)
        {
            Title = Catalog.GetString ("About Pinta");
            //TransientFor = IdeApp.Workbench.RootWindow;
            AllowGrow = false;
            HasSeparator = false;
            Icon = PintaCore.Resources.GetIcon ("Pinta.png");

            VBox.BorderWidth = 0;

            aboutPictureScrollBox = new ScrollBox ();

            VBox.PackStart (aboutPictureScrollBox, false, false, 0);
            imageSep = PintaCore.Resources.GetIcon ("About.ImageSep.png");

            VBox.PackStart (new Gtk.Image (imageSep), false, false, 0);

            Notebook notebook = new Notebook ();
            notebook.BorderWidth = 6;
            notebook.AppendPage (new AboutPintaTabPage (), new Label (Title));
            notebook.AppendPage (new VersionInformationTabPage (), new Label (Catalog.GetString ("Version Info")));

            VBox.PackStart (notebook, true, true, 4);

            AddButton (Gtk.Stock.Close, (int)ResponseType.Close);

            ShowAll ();
        }
Exemplo n.º 11
0
        /// <summary>Crea los elementos de la ventana.</summary>

        private void CrearComponentes()
        {
            Gtk.VBox vbox    = new VBox(false, 2);
            Gtk.VBox menubox = new VBox(false, 0);

            // Barra de menú.
            MenuBar mb = CrearMenuBar();

            menubox.PackStart(mb, false, false, 0);

            // Barra de herramientas
            Gtk.Toolbar toolbar = CrearToolBar();
            menubox.PackStart(toolbar, false, false, 0);


            vbox.PackStart(menubox, false, false, 0);

            notebook = CrearNotebook();
            vbox.PackStart(notebook, true, true, 0);

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

            Add(vbox);
        }
Exemplo n.º 12
0
		public SdiWorkspaceWindow (DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base ()
		{
			this.workbench = workbench;
			this.tabControl = tabControl;
			this.content = content;
			this.tabLabel = tabLabel;
			this.tabPage = content.Control;
			
			content.WorkbenchWindow = this;
			
			content.ContentNameChanged += new EventHandler(SetTitleEvent);
			content.DirtyChanged       += new EventHandler(SetTitleEvent);
			content.BeforeSave         += new EventHandler(BeforeSave);
			content.ContentChanged     += new EventHandler (OnContentChanged);
			
			ShadowType = ShadowType.None;
			box = new VBox ();
			box.PackStart (content.Control);
			Add (box);
			box.Show ();
			
			SetTitleEvent(null, null);
			
			commandHandler = new ViewCommandHandlers (this);
			Show ();
		}
Exemplo n.º 13
0
        public MySqlCreateDatabaseDialog(IDbFactory factory) : base(factory)
        {
            createDBWidget = new MySqlCreateDatabaseWidget();
            Notebook.AppendPage(createDBWidget,
                                new Label(AddinCatalog.GetString("Database Properties")));
            Notebook.ShowTabs = true;
            Gtk.Notebook nb = Notebook;

            nb.SwitchPage += delegate(object o, SwitchPageArgs args) {
                if (nb.CurrentPage == 1)
                {
                    if (!connectionWidget.ValidateFields())
                    {
                        nb.CurrentPage = 0;
                        MessageService.ShowError(this,
                                                 AddinCatalog.GetString("Set the connection properties before the database properties."));
                    }
                    else
                    {
                        Initialize(factory);
                        if (DatabaseConnection.ConnectionPool.HasErrors)
                        {
                            MessageService.ShowError(DatabaseConnection.ConnectionPool.Error);
                            nb.CurrentPage = 0;
                            return;
                        }
                        createDBWidget.Initialize((MySqlSchemaProvider)DatabaseConnection.SchemaProvider);
                    }
                }
            };

            Notebook.ShowAll();
        }
Exemplo n.º 14
0
        public Toolbox()
        {
            _notebook=new Notebook();
            _notebook.TabPos=Gtk.PositionType.Bottom;
            _notebook.TabBorder=0;
            _notebook.ShowTabs=false;
            _notebook.TabVborder=Sugar.Style.TOOLBOX_TAB_VBORDER;
            _notebook.TabHborder=Sugar.Style.TOOLBOX_TAB_VBORDER;
            PackStart(_notebook);
            _notebook.Show();

            // TODO:
            // Creare il package hippo e importare questa routine.
            /*
            # FIXME improve gtk.Notebook and do this in the theme
            self._separator = hippo.Canvas()
            box = hippo.CanvasBox(
                    border_color=style.COLOR_BUTTON_GREY.get_int(),
                    background_color=style.COLOR_PANEL_GREY.get_int(),
                    box_height=style.TOOLBOX_SEPARATOR_HEIGHT,
                    border_bottom=style.LINE_WIDTH)
            self._separator.set_root(box)
            self.pack_start(self._separator, False)

            self._notebook.connect('notify::page', self._notify_page_cb)
            */
        }
Exemplo n.º 15
0
        private void build()
        {
            VBox vb = new VBox();



            //ScrolledWindow sw = new ScrolledWindow();
            TreeStore ts = new TreeStore(typeof(string), typeof(string));

            foreach (BattlelordsRace r in this.session.Races)
            {
                ts.AppendValues(r.Name, r.Name);
            }
            TreeView tv = new TreeView(ts);

            tv.HeadersVisible = true;
            tv.AppendColumn("Race", new CellRendererText(), "text", 0);
            //sw.Add(tv);
            //this.Add(sw);


            Gtk.Notebook nb = new Gtk.Notebook();
            nb.AppendPage(tv, new Label("Race"));
            vb.PackStart(nb);
            //vb.PackEnd();


            this.ShowAll();
        }
Exemplo n.º 16
0
		public ViewEditorDialog (ISchemaProvider schemaProvider, bool create, ViewEditorSettings settings)
		{
			if (schemaProvider == null)
				throw new ArgumentNullException ("schemaProvider");
			
			
			this.schemaProvider = schemaProvider;
			this.action = create ? SchemaActions.Create : SchemaActions.Alter;
			
			this.Build();
			
			if (create)
				Title = AddinCatalog.GetString ("Create View");
			else
				Title = AddinCatalog.GetString ("Alter View");
			
			notebook = new Notebook ();

			sqlEditor = new SqlEditorWidget ();
			sqlEditor.TextChanged += new EventHandler (SqlChanged);
			notebook.AppendPage (sqlEditor, new Label (AddinCatalog.GetString ("Definition")));
			
			if (settings.ShowComment) {
				commentEditor = new CommentEditorWidget ();
				notebook.AppendPage (commentEditor, new Label (AddinCatalog.GetString ("Comment")));
			}

			notebook.Page = 0;

			entryName.Text = view.Name;

			vboxContent.PackStart (notebook, true, true, 0);
			vboxContent.ShowAll ();
			SetWarning (null);
		}
Exemplo n.º 17
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!");
        }
Exemplo n.º 18
0
		public SdiWorkspaceWindow (DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base ()
		{
			this.workbench = workbench;
			this.tabControl = tabControl;
			this.content = content;
			this.tabLabel = tabLabel;
			this.tabPage = content.Control;
			
			ShadowType = ShadowType.None;
			box = new VBox ();
			Add (box);
			box.PackStart (content.Control);
			
			fileTypeCondition.SetFileName (content.ContentName ?? content.UntitledName);
			extensionContext = AddinManager.CreateExtensionContext ();
			extensionContext.RegisterCondition ("FileType", fileTypeCondition);
			
			content.WorkbenchWindow = this;
			
			content.ContentNameChanged += new EventHandler(SetTitleEvent);
			content.DirtyChanged       += new EventHandler(SetTitleEvent);
			content.BeforeSave         += new EventHandler(BeforeSave);
			content.ContentChanged     += new EventHandler (OnContentChanged);
			
			box.Show ();
			
			SetTitleEvent(null, null);
			
			commandHandler = new ViewCommandHandlers (this);
			Show ();
		}
Exemplo n.º 19
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

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

            browser.SelectionChanged += OnSelectionChanged;

            Gtk.Notebook nb = new Gtk.Notebook();
            nb.AppendPage(textView, new Gtk.Label("TAC Text"));
            nb.ShowAll();

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

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

            tacVisualizingDock                = mainWindow.DockFrame.AddItem("TACVisualizer");
            tacVisualizingDock.DrawFrame      = true;
            tacVisualizingDock.Label          = "TAC Visualizer";
            tacVisualizingDock.Content        = scrollWindow;
            tacVisualizingDock.DefaultVisible = true;
            tacVisualizingDock.Visible        = true;
        }
Exemplo n.º 20
0
        //------------------------------------------------------------------------------
        public UnitForm(string file_name)
        {
            instance = new Notebook ();

            UnitEditor.RenderablesList renderables_list = new UnitEditor.RenderablesList (file_name);
            instance.AppendPage (renderables_list, new Label("Renderables"));
        }
Exemplo n.º 21
0
		public TabbedSkin(BasilProject project, ITaskBuilder taskBuilder)
		{
			_project = project;
			_tabsToTools = new System.Collections.Hashtable();

			window = new Gtk.Window ("WeSay");
			window.SetDefaultSize (600, 400);
			window.DeleteEvent += new DeleteEventHandler (WindowDelete);

			HBox hbox = new HBox (false, 0);
			window.Add (hbox);

			Notebook notebook = new Notebook ();
			notebook.SwitchPage += new SwitchPageHandler(OnNotebookSwitchPage);
			hbox.PackStart(notebook, true, true, 0);
			foreach (ITask t in taskBuilder.Tasks)
			{
				VBox container = new VBox();
				t.Container = container;
				int i = notebook.AppendPage(container, new Label(t.Label));
				_tabsToTools.Add(i, t);
			}

			window.ShowAll ();
		}
Exemplo n.º 22
0
        private void Build()
        {
            this.titleLabel = new Label("");
            var fontDescription = new Pango.FontDescription();

            fontDescription.Size = Convert.ToInt32(17 * Pango.Scale.PangoScale);
            this.titleLabel.ModifyFont(fontDescription);
            this.PackStart(this.titleLabel, false, true, 10);

            this.dayNotesComponent     = new DayNotes();
            this.dayExercisesComponent = new DayExercises();

            var nbLibro = new Gtk.Notebook();

            nbLibro.AppendPage(
                this.dayNotesComponent,
                new Gtk.Label("Notes")
                );

            nbLibro.AppendPage(
                this.dayExercisesComponent,
                new Gtk.Label("Exercises")
                );


            this.Add(nbLibro);

            //Update state and render
            this.OnViewBuilt();
        }
Exemplo n.º 23
0
        public CommonAboutDialog()
        {
            Title = MainClass.Languages.Translate("moscrif_ide_title_f1");
            TransientFor = MainClass.MainWindow;
            AllowGrow = false;
            HasSeparator = false;
            Modal = true;

            VBox.BorderWidth = 0;

            aboutPictureScrollBox = new ScrollBox();

            VBox.PackStart(aboutPictureScrollBox, false, false, 0);

            Notebook notebook = new Notebook();
            notebook.BorderWidth = 6;
            notebook.AppendPage(new AboutTabPage(), new Label(Title));
            notebook.AppendPage(new VersionInformationTabPage(), new Label(MainClass.Languages.Translate("components")));
            var buildInfo = LoadBuildInfo();
            if (buildInfo != null)
                notebook.AppendPage(buildInfo, new Label(MainClass.Languages.Translate("components")));
            VBox.PackStart(notebook, true, true, 4);

            AddButton (Stock.Close, ResponseType.Close);

            //ShowAll();
        }
Exemplo n.º 24
0
    public unsafe MphotoToplevel(IImageRepository _repo, string[] args, params object[] props)
        : base("Mphoto", "0.0", Modules.UI, args, props)
    {
        cwh = new Glade.XMLCustomWidgetHandler(GladeCustomWidgetHandler);
        Glade.XML.SetCustomHandler(cwh);
        gxml = new Glade.XML(null, "mphoto.glade", null, null);

        Console.WriteLine("Autoconnect");
        gxml.Autoconnect(this);

//        CreateCustomWidget ("browser_icon_list");
//        CreateCustomWidget ("collections_tree_view");
//        CreateCustomWidget ("imageinfo_tree_view");
//        CreateCustomWidget ("eog_image_view");
//        CreateCustomWidget ("keywords_widget");

        this.leftside_notebook  = (Gtk.Notebook)gxml["browser_left_notebook"];
        this.top_level_notebook = (Gtk.Notebook)gxml["top_level_notebook"];

        this.toplevel         = gxml["mphoto_browser"];
        this.label_zoom_value = (Gtk.Label)gxml["label_zoom_value"];
        this.search_dialog    = (Gtk.Window)gxml["search_dialog"];

        this.Repository = _repo;

        // initialize the tree views to the side
        imageinfo_tree_view.IconList = icon_list;
        keywords_widget.IconList     = icon_list;

        collections_tree_view.RowActivated += new RowActivatedHandler(CollectionsTreeViewActivateHandler);
        icon_list.Activated += new EventHandler(IconlistActivated);

        GlobalMphotoToplevel = this;
    }
Exemplo n.º 25
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;
        }
Exemplo n.º 26
0
        /// <summary>
        /// Constructs a demo object with the appropriate gui.
        /// </summary>
        public DemoWindow()
            : base("Moonfire Games' Gtk Demo")
        {
            // Create a window
            SetDefaultSize(1000, 800);
            DeleteEvent += OnWindowDelete;

            demoComponents = new DemoComponents();

            // Create a user action manager.
            var actionManager = new ActionManager(this);
            actionManager.Add(GetType().Assembly);

            demoConfiguratorsTab = new DemoConfiguratorsTab(this);

            actionManager.Add(demoConfiguratorsTab);

            demoActions = new DemoActions(actionManager);

            // Load the layout from the file system.
            layout = new ActionLayout(new FileInfo("ActionLayout1.xml"));
            actionManager.SetLayout(layout);

            // Load the keybinding from a file.
            keybindings = new ActionKeybindings(new FileInfo("ActionKeybindings1.xml"));
            actionManager.SetKeybindings(keybindings);

            // Create the window frame
            var box = new VBox();
            Add(box);

            // Create the components we need before the menu.
            notebook = new Notebook();

            actionManager.Add(new SwitchPageAction(notebook, 0, "Components"));
            actionManager.Add(new SwitchPageAction(notebook, 1, "Text Editor"));
            actionManager.Add(new SwitchPageAction(notebook, 2, "Actions"));
            actionManager.Add(new SwitchPageAction(notebook, 3, "Configurators"));

            // Create a notebook
            notebook.BorderWidth = 5;

            notebook.AppendPage(demoComponents, new Label("Components"));
            notebook.AppendPage(demoActions, new Label("Actions"));
            notebook.AppendPage(demoConfiguratorsTab, new Label("Configurators"));

            // Add the status bar
            statusbar = new Statusbar();
            statusbar.Push(0, "Welcome!");
            statusbar.HasResizeGrip = true;

            // Create the menu
            menubar = new MenuBar();

            // Back everything into place.
            box.PackStart(CreateGuiMenu(), false, false, 0);
            box.PackStart(notebook, true, true, 0);
            box.PackStart(statusbar, false, false, 0);
        }
Exemplo n.º 27
0
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets(Manager simiasManager)
        {
            this.SetDefaultSize(480, 550);

            // Create an extra vbox to add the spacing
            EventBox prefsWindow = new EventBox();

            prefsWindow.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
            VBox winBox = new VBox();

            //this.Add (winBox);
            prefsWindow.Add(winBox);
            this.Add(prefsWindow);
            winBox.BorderWidth = 7;
            winBox.Spacing     = 7;

            this.Icon           = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
            this.WindowPosition = Gtk.WindowPosition.Center;

            //-----------------------------
            // Set up the Notebook (tabs)
            //-----------------------------
            PrefNoteBook = new Notebook();

            generalPage = new PrefsGeneralPage(this, ifws);
            PrefNoteBook.AppendPage(generalPage,
                                    new Label(Util.GS("General")));

            accountsPage = new PrefsAccountsPage(this);
            PrefNoteBook.AppendPage(accountsPage,
                                    new Label(Util.GS("Accounts")));

            /*migrationPage =*/ new MigrationPage(this, ifws);
//			PrefNoteBook.AppendPage( migrationPage, new Label(Util.GS("Migration")));

            PrefNoteBook.SwitchPage +=
                new SwitchPageHandler(OnSwitchPageEvent);

            winBox.PackStart(PrefNoteBook, true, true, 0);

            HButtonBox buttonBox = new HButtonBox();

            buttonBox.BorderWidth = 10;
            buttonBox.Spacing     = 10;
            buttonBox.Layout      = ButtonBoxStyle.Edge;
            winBox.PackStart(buttonBox, false, false, 0);

            Button helpButton = new Button(Gtk.Stock.Help);

            buttonBox.PackStart(helpButton);
            helpButton.Clicked += new EventHandler(HelpEventHandler);

            Button closeButton = new Button(Gtk.Stock.Close);

            buttonBox.PackStart(closeButton);
            closeButton.Clicked += new EventHandler(CloseEventHandler);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SwitchPageAction"/>
        /// class and configures it to switch to the given page.
        /// </summary>
        /// <param name="notebook">The notebook.</param>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="label">The label.</param>
        public SwitchPageAction(
			Notebook notebook,
			int pageNumber,
			string label)
            : base("SwitchPage" + pageNumber, label)
        {
            this.notebook = notebook;
            this.pageNumber = pageNumber;
        }
Exemplo n.º 29
0
        string g_selection; // ^ together with the path

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="libTerminus.cPool"/> class.
        /// </summary>
        /// <param name='_nb'>
        /// _nb.
        /// </param>
        public cPool(ref Notebook _nb)
        {
            this.Build ();
            cTerminus.isLibTabOpen = true;
            appendColumns ();
            appendItems ();
            g_notebook = _nb;
            treeview1.CursorChanged += HandleCursorChanged;
        }
Exemplo n.º 30
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)
                );
        }
Exemplo n.º 31
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ManagerView(ViewBase owner)
     : base(owner)
 {
     notebook = new Notebook();
     _mainWidget = notebook;
     Grid = new GridView(this);
     ScriptEditor = new EditorView(this);
     notebook.AppendPage(Grid.MainWidget, new Label("Properties"));
     notebook.AppendPage(ScriptEditor.MainWidget, new Label("Script"));
 }
Exemplo n.º 32
0
        private Notebook notebook; //TODO switch to notebook mode

        #endregion Fields

        #region Constructors

        public DockContainer(DockFrame dockframe)
            : base(Orientation.Vertical)
        {
            //dockItemAlignment = new Box();
            //dockItemAlignment.Orientation = Orientation.Vertical;
            frame = dockframe;
            //items = new List<DockItemContainer>(10);
            notebook = new Notebook();
            notebook.Visible = false;
        }
Exemplo n.º 33
0
        public CombinedDesignView(IViewContent content)
        {
            this.content = content;
            if (content is IEditableTextBuffer)
            {
                ((IEditableTextBuffer)content).CaretPositionSet += delegate {
                    ShowPage(0);
                };
            }
            content.ContentChanged += new EventHandler(OnTextContentChanged);
            content.DirtyChanged   += new EventHandler(OnTextDirtyChanged);

            notebook = new Gtk.Notebook();

            // Main notebook

            notebook.TabPos     = Gtk.PositionType.Bottom;
            notebook.ShowTabs   = false;
            notebook.ShowBorder = false;
            notebook.Show();
            box = new VBox();

            // Bottom toolbar

            toolbar              = new Toolbar();
            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            toolbar.ShowArrow    = false;

            CommandRouterContainer crc = new CommandRouterContainer(content.Control, content, true);

            crc.Show();
            AddButton(GettextCatalog.GetString("Source Code"), crc).Active = true;

            toolbar.ShowAll();

            box.PackStart(notebook, true, true, 0);
            box.PackStart(toolbar, false, false, 0);

            box.Show();

            IdeApp.Workbench.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
            content.Control.Realized += delegate {
                if (content != null && content.WorkbenchWindow != null)
                {
                    content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
                }
            };
            notebook.SwitchPage += delegate {
                if (content != null && content.WorkbenchWindow != null)
                {
                    content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
                }
            };
        }
Exemplo n.º 34
0
        public static CloserTabLabel InsertTabPage (Notebook book, Widget page, string label)
        {
            var tab = new CloserTabLabel () { Text = label };
            tab.Closer.Pressed += (sender, e) => {
                MainWindow.OnCloseSourceFile (tab.CloseKeyData);
                book.Remove (page); };
            book.InsertPage (page, tab, book.NPages);
            tab.ShowAll ();

            return tab;
        }
Exemplo n.º 35
0
		public DialogPreferencesBase(Window parent) : base("Preferences", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok, Stock.Cancel, ResponseType.Cancel)
		{
			notebook = new Notebook();
			
			dbForm = new FormDatabasePreferences();
			dbForm.BorderWidth = 6;
			notebook.AppendPage(dbForm, new Label("Database") );
			
			this.VBox.PackStart(notebook, true, true, 6);
			this.ShowAll();
		}
Exemplo n.º 36
0
        //        Entry sipServerAddressEntry;
        //        Entry sipUsernameEntry;
        //        Entry sipPasswordEntry;
        public PreferencesDialog()
            : base()
        {
            SetDefaultSize (600, 600);
            WindowPosition = WindowPosition.Center;
            IconName = "rtc";
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = true;
            Title = Catalog.GetString ("Banter Preferences");

            VBox.Spacing = 5;
            ActionArea.Layout = ButtonBoxStyle.End;

            // Notebook Tabs (General, Messages)...
            Gtk.Notebook notebook = new Notebook ();
            notebook.TabPos = PositionType.Top;
            notebook.BorderWidth = 5;
            notebook.Show ();

            //			notebook.AppendPage (MakeGeneralPage (),
            //									new Label (Catalog.GetString ("General")));
            notebook.AppendPage (MakeAccountsPage (),
                                    new Label (Catalog.GetString ("Accounts")));
            notebook.AppendPage (MakeMessagesPage (),
                                    new Label (Catalog.GetString ("Messages")));

            VBox.PackStart (notebook, true, true, 0);

            // Close button...
            Button button = new Button (Stock.Close);
            button.CanDefault = true;
            button.Show ();

            AccelGroup accelGroup = new AccelGroup ();
            AddAccelGroup (accelGroup);

            button.AddAccelerator ("activate",
                                    accelGroup,
                                    (uint) Gdk.Key.Escape,
                                    0,
                                    0);

            AddActionWidget (button, ResponseType.Close);
            DefaultResponse = ResponseType.Close;

            Realized += DialogRealized;

            Preferences.PreferenceChanged += PreferenceChanged;

            ShowAll ();
        }
Exemplo n.º 37
0
 public DockNotebook()
 {
     Child = new Notebook ();
     Child.Parent = this;
     ((Notebook)Child).TabPos = PositionType.Bottom;
     // FIXME: enable these if we do a DockTabLabel
     //((Notebook)Child).SwitchPage += new SwitchPageHandler (SwitchPageCb);
     //((Notebook)Child).ButtonPressEvent += new ButtonPressEvent (ButtonPressCb);
     //((Notebook)Child).ButtonReleaseEvent += new ButtonReleaseEvent (ButtonReleaseCb);
     ((Notebook)Child).Scrollable = true;
     Child.Show ();
     DockObjectFlags &= ~(DockObjectFlags.Automatic);
 }
Exemplo n.º 38
0
        public NotebookPage (Page page)
        {
            this.page = page;

            BorderWidth = 5;
            Spacing = 10;

            tab_widget = new Label (page.Name);
            tab_widget.Show ();

            Widget page_widget = page.DisplayWidget as Widget;
            if (page_widget != null) {
                page_widget.Show ();
                PackStart (page_widget, true, true, 0);
            } else {
                foreach (Section section in page) {
                    AddSection (section);
                }

                if (page.ChildPages.Count > 0) {
                    Notebook notebook = new Notebook ();
                    notebook.ShowBorder = false;
                    notebook.ShowTabs = false;
                    notebook.Show ();

                    var hbox = new HBox () { Spacing = 6 };
                    // FIXME this shouldn't be hard-coded to 'Source:', but this is the only
                    // user of this code atm...
                    var page_label = new Label (Mono.Unix.Catalog.GetString ("Source:"));
                    var page_combo = new PageComboBox (page.ChildPages, notebook);
                    hbox.PackStart (page_label, false, false, 0);
                    hbox.PackStart (page_combo, true, true, 0);
                    hbox.ShowAll ();

                    PackStart (hbox, false, false, 0);

                    HSeparator sep = new HSeparator ();
                    sep.Show ();
                    PackStart (sep, false, false, 0);

                    foreach (Page child_page in page.ChildPages) {
                        NotebookPage page_ui = new NotebookPage (child_page);
                        page_ui.BorderWidth = 0;
                        page_ui.Show ();
                        notebook.AppendPage (page_ui, null);
                    }

                    PackStart (notebook, true, true, 0);
                }
            }
        }
Exemplo n.º 39
0
		public MainView()
		{
			MainWindow = new Window("Сервер приложений ГЛОБАЛ");
			statusView = new StatusView();

			MainWindow.DeleteEvent += Window_Delete;
			gkNode = new NodeView();
			gkNode.AppendColumn("Время", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			gkNode.AppendColumn("Адрес", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			gkNode.AppendColumn("Название", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 2);
			gkNode.AppendColumn("Прогресс", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 3);
			logNode = new NodeView();
			logNode.AppendColumn("Название", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			logNode.AppendColumn("Время", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			logNode.NodeStore = new NodeStore(typeof(LogTreeNode));
			connectionNode = new NodeView();
			connectionNode.AppendColumn("Тип", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			connectionNode.AppendColumn("Адрес", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			connectionNode.AppendColumn("Пользователь", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 2);
			connectionNode.ButtonPressEvent += new ButtonPressEventHandler(OnItemButtonPressed);
			pollingNode = new NodeView();
			pollingNode.AppendColumn("Клиент", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			pollingNode.AppendColumn("Идентификатор", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 1);
			pollingNode.AppendColumn("Первый поллинг", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 2);
			pollingNode.AppendColumn("Последний поллинг", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 3);
			pollingNode.AppendColumn("Индекс", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 4);
			pollingNode.NodeStore = new NodeStore(typeof(PollingTreeNode));
			operationNode = new NodeView();
			operationNode.AppendColumn("Название", new CellRendererText { MaxWidthChars = 80, Height = 20 }, "text", 0);
			operationNode.NodeStore = new NodeStore(typeof(OperationTreeNode));
			Notebook notepadControl = new Notebook();
			notepadControl.AppendPage(connectionNode, new Label("Соединения"));
			notepadControl.AppendPage(logNode, new Label("Лог"));
			notepadControl.AppendPage(statusView.Create(), new Label("Статус"));
			notepadControl.AppendPage(gkNode, new Label("ГК"));
			notepadControl.AppendPage(pollingNode, new Label("Поллинг"));
			notepadControl.AppendPage(operationNode, new Label("Операции"));
			notepadControl.AppendPage(new LicenseView().Create(), new Label("Лицензирование"));
			MainWindow.Add(notepadControl);
			MainWindow.SetDefaultSize(700, 500);
			MainWindow.ShowAll();
			GKLifecycleManager.GKLifecycleChangedEvent += On_GKLifecycleChangedEvent;
			LicenseManager.LicenseChanged += On_LicenseChanged;

			GKLifecycles = new List<KeyValuePair<GKLifecycleInfo, DateTime>>();
			Clients = new List<ClientCredentials>();
			ClientPolls = new List<ClientPoll>();
			ServerTasks = new List<ServerTask>();
			Current = this;
		}
Exemplo n.º 40
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();
        }
		public CombinedDesignView (IViewContent content)
		{
			this.content = content;
			if (content is IEditableTextBuffer) {
				((IEditableTextBuffer)content).CaretPositionSet += delegate {
					ShowPage (0);
				};
			}
			content.ContentChanged += new EventHandler (OnTextContentChanged);
			content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
			
			notebook = new Gtk.Notebook ();
			
			// Main notebook
			
			notebook.TabPos = Gtk.PositionType.Bottom;
			notebook.ShowTabs = false;
			notebook.ShowBorder = false;
			notebook.Show ();
			box = new VBox ();
			
			// Bottom toolbar
			
			toolbar = new Toolbar ();
			toolbar.IconSize = IconSize.SmallToolbar;
			toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			toolbar.ShowArrow = false;
			
			CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
			crc.Show ();
			AddButton (GettextCatalog.GetString ("Source Code"), crc).Active = true;
			
			toolbar.ShowAll ();
			
			box.PackStart (notebook, true, true, 0);
			box.PackStart (toolbar, false, false, 0);
			
			box.Show ();
			
			IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged);
			content.Control.Realized += delegate {
				if (content != null && content.WorkbenchWindow != null) 
					content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
			};
			notebook.SwitchPage += delegate {
				if (content != null && content.WorkbenchWindow != null) 
					content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
			};
		}
Exemplo n.º 42
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;
        }
Exemplo n.º 43
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public ViewerWindow() : base("Download/Upload Viewer")
        {
            // Initialize Window
            SetDefaultSize(440, 300);

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

            // Initialize Notebook
            this.notebook            = new Gtk.Notebook();
            this.notebook.ShowTabs   = true;
            this.notebook.Scrollable = true;
            this.vbox.PackStart(this.notebook, true, true, 2);

            // Add Download Viewer
            this.tabDownloads = new TabLabel("<b>Downloads</b>", StockIcons.GetImage("Download", 22));
            this.tabDownloads.Button.Sensitive = false;
            this.downloadViewer = new DownloadViewer();
            this.notebook.AppendPage(this.downloadViewer, this.tabDownloads);

            // Add Uploads Viewer
            this.tabUploads = new TabLabel("<b>Uploads</b>", StockIcons.GetImage("Upload", 22));
            this.tabUploads.Button.Sensitive = false;
            this.uploadViewer = new UploadViewer();
            this.notebook.AppendPage(this.uploadViewer, this.tabUploads);

            // HButton Box
            this.hButtonBox             = new Gtk.HButtonBox();
            this.hButtonBox.Spacing     = 4;
            this.hButtonBox.Layout      = ButtonBoxStyle.End;
            this.hButtonBox.LayoutStyle = ButtonBoxStyle.End;
            this.vbox.PackStart(this.hButtonBox, false, false, 2);

            Gtk.Button button;

            button          = new Gtk.Button(Gtk.Stock.Clear);
            button.Clicked += new EventHandler(OnButtonClear);
            this.hButtonBox.PackStart(button, false, false, 2);

            // Show All
            this.ShowAll();
        }
Exemplo n.º 44
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;
        }
Exemplo n.º 45
0
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets()
        {
            VBox dialogBox = new VBox();

            this.VBox.PackStart(dialogBox);
            dialogBox.BorderWidth = 10;
            dialogBox.Spacing     = 10;

            this.SetDefaultSize(480, 480);
            this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));

            //-----------------------------
            // Create iFolder Conflict
            //-----------------------------
            ConflictHolder = new HBox();
            dialogBox.PackStart(ConflictHolder, false, true, 0);

            //-----------------------------
            // Create iFolder Notebook
            //-----------------------------
            propNoteBook = new Gtk.Notebook();

            SettingsPage = new iFolderPropSettingsPage(this, ifws);

            propNoteBook.AppendPage(SettingsPage,
                                    new Label(Util.GS("_General")));

            SharingPage = new iFolderPropSharingPage(this, ifws, simws);

            propNoteBook.AppendPage(SharingPage,
                                    new Label(Util.GS("_Sharing")));

            dialogBox.PackStart(propNoteBook);

            this.VBox.ShowAll();

            this.AddButton(Stock.Close, ResponseType.Ok);
            this.AddButton(Stock.Help, ResponseType.Help);
        }
Exemplo n.º 46
0
        static void gtml_activate()
        {
            icons = new Gtk.IconFactory();
            icons.AddDefault();

            window              = new Gtk.Window(PN);
            window.DeleteEvent += new DeleteEventHandler(Window_Delete);
            window.SetDefaultSize(800, 120);
            window.Decorated = true;

            grid = new Gtk.Grid();
            grid.ColumnHomogeneous = true;

            Gtk.Image icon = new Gtk.Image();
            icon.IconName          = ("list-add-symbolic");
            import_button          = new Gtk.Button(icon);
            import_button.Clicked += new EventHandler(gtml_import_full);
            Gtk.Box naw = new Gtk.Box(Gtk.Orientation.Horizontal, 1);
            naw.PackStart(import_button, true, true, 1);
            naw.ShowAll();

            stack             = new Gtk.Notebook();
            stack.EnablePopup = true;
            stack.GroupName   = "Mozilla Programs";
            stack.Scrollable  = true;

            stack.SetActionWidget(naw, Gtk.PackType.End);

            stack.Hexpand = true;
            stack.Vexpand = true;

            grid.Attach(stack, 1, 1, 1, 1);
            gtml_reload();

            window.Add(grid);

            window.ShowAll();
        }
Exemplo n.º 47
0
        private void Build()
        {
            this.titleLabel = new Label("");
            var fontDescription = new Pango.FontDescription();

            fontDescription.Size = Convert.ToInt32(17 * Pango.Scale.PangoScale);
            this.titleLabel.ModifyFont(fontDescription);
            this.PackStart(this.titleLabel, false, true, 10);

            this.monthNotesComponent     = new MonthNotes();
            this.monthExercisesComponent = new MonthExercises();
            this.monthMeasuresComponent  = new MonthMeasures();

            this.monthExercisesComponentG = new MonthExercisesGraph();
            this.monthMeasuresComponentG  = new MonthMeasuresGraph();

            var nbLibro     = new Gtk.Notebook();
            var nbEjercicio = new Gtk.Notebook();
            var nbMedidas   = new Gtk.Notebook();

            nbEjercicio.AppendPage(
                this.monthExercisesComponent,
                new Gtk.Label("List")
                );
            nbEjercicio.AppendPage(
                this.monthExercisesComponentG,
                new Gtk.Label("Graphic")
                );


            nbMedidas.AppendPage(
                this.monthMeasuresComponent,
                new Gtk.Label("List")
                );
            nbMedidas.AppendPage(
                this.monthMeasuresComponentG,
                new Gtk.Label("Graphic")
                );

            nbLibro.AppendPage(
                this.monthNotesComponent,
                new Gtk.Label("Notes")
                );

            VBox ex = new VBox();

            ex.Add(nbEjercicio);
            nbLibro.AppendPage(
                ex,
                new Gtk.Label("Exercises")
                );

            VBox ey = new VBox();

            ey.Add(nbMedidas);
            nbLibro.AppendPage(
                ey,
                new Gtk.Label("Measures")
                );


            this.Add(nbLibro);

            //Update state and render
            this.OnViewBuilt();
        }
Exemplo n.º 48
0
    public MainWindow(string directory)
    {
        log.Debug("Beginning Program");

        Gtk.Window.DefaultIcon = new Gdk.Pixbuf(Helper.GetResourceStream("LynnaLab.icon.ico"));

        Gtk.Builder builder = new Builder();
        builder.AddFromString(Helper.ReadResourceFile("LynnaLab.Glade.MainWindow.ui"));
        builder.Autoconnect(this);

        mainWindow                 = (builder.GetObject("mainWindow") as Gtk.Window);
        menubar1                   = (Gtk.MenuBar)builder.GetObject("menubar1");
        editMenuItem               = (Gtk.MenuItem)builder.GetObject("editMenuItem");
        actionMenuItem             = (Gtk.MenuItem)builder.GetObject("actionMenuItem");
        debugMenuItem              = (Gtk.MenuItem)builder.GetObject("debugMenuItem");
        minimapNotebook            = (Gtk.Notebook)builder.GetObject("minimapNotebook");
        contextNotebook            = (Gtk.Notebook)builder.GetObject("contextNotebook");
        worldSpinButton            = (Gtk.SpinButton)builder.GetObject("worldSpinButton");
        viewObjectsCheckButton     = (Gtk.CheckButton)builder.GetObject("viewObjectsCheckButton");
        viewWarpsCheckButton       = (Gtk.CheckButton)builder.GetObject("viewWarpsCheckButton");
        darkenDungeonRoomsCheckbox = (Gtk.CheckButton)builder.GetObject("darkenDungeonRoomsCheckbox");
        dungeonSpinButton          = (Gtk.SpinButton)builder.GetObject("dungeonSpinButton");
        floorSpinButton            = (Gtk.SpinButton)builder.GetObject("floorSpinButton");
        roomVreHolder              = (Gtk.Box)builder.GetObject("roomVreHolder");
        chestAddHolder             = (Gtk.Box)builder.GetObject("chestAddHolder");
        chestEditorBox             = (Gtk.Box)builder.GetObject("chestEditorBox");
        chestVreHolder             = (Gtk.Box)builder.GetObject("chestVreHolder");
        treasureVreHolder          = (Gtk.Box)builder.GetObject("treasureVreHolder");
        nonExistentTreasureHolder  = (Gtk.Box)builder.GetObject("nonExistentTreasureHolder");
        overallEditingContainer    = (Gtk.Box)builder.GetObject("overallEditingContainer");
        treasureDataFrame          = (Gtk.Widget)builder.GetObject("treasureDataFrame");
        treasureDataLabel          = (Gtk.Label)builder.GetObject("treasureDataLabel");

        editTilesetButton          = new Gtk.Button("Edit");
        editTilesetButton.Clicked += OnTilesetEditorButtonClicked;

        roomSpinButton        = new SpinButtonHexadecimal();
        roomSpinButton.Digits = 3;
        objectgroupeditor1    = new ObjectGroupEditor();
        tilesetViewer1        = new TilesetViewer();
        roomeditor1           = new RoomEditor();
        worldMinimap          = new HighlightingMinimap();
        dungeonMinimap        = new Minimap();
        warpEditor            = new WarpEditor(this);
        statusbar1            = new PriorityStatusbar();
        seasonComboBox        = new ComboBoxFromConstants(showHelp: false);
        seasonComboBox.SpinButton.Adjustment.Upper = 3;

        ((Gtk.Box)builder.GetObject("roomSpinButtonHolder")).Add(roomSpinButton);
        ((Gtk.Box)builder.GetObject("objectGroupEditorHolder")).Add(objectgroupeditor1);
        ((Gtk.Box)builder.GetObject("tilesetViewerHolder")).Add(tilesetViewer1);
        ((Gtk.Box)builder.GetObject("roomEditorHolder")).Add(roomeditor1);
        ((Gtk.Box)builder.GetObject("worldMinimapHolder")).Add(worldMinimap);
        ((Gtk.Box)builder.GetObject("dungeonMinimapHolder")).Add(dungeonMinimap);
        ((Gtk.Box)builder.GetObject("warpEditorHolder")).Add(warpEditor);
        ((Gtk.Box)builder.GetObject("statusbarHolder")).Add(statusbar1);
        ((Gtk.Box)builder.GetObject("seasonComboBoxHolder")).Add(seasonComboBox);

        mainWindow.Title = "LynnaLab " + Helper.ReadResourceFile("LynnaLab.version.txt");

        roomeditor1.Scale             = 2;
        roomeditor1.TilesetViewer     = tilesetViewer1;
        roomeditor1.ObjectGroupEditor = objectgroupeditor1;
        roomeditor1.WarpEditor        = warpEditor;

        eventGroup.Lock();


        // Event handlers from widgets

        roomSpinButton.ValueChanged += eventGroup.Add(OnRoomSpinButtonValueChanged);

        worldSpinButton.ValueChanged   += eventGroup.Add(OnWorldSpinButtonValueChanged);
        dungeonSpinButton.ValueChanged += eventGroup.Add(OnDungeonSpinButtonValueChanged);
        floorSpinButton.ValueChanged   += eventGroup.Add(OnFloorSpinButtonValueChanged);
        seasonComboBox.Changed         += eventGroup.Add(OnSeasonComboBoxChanged);
        minimapNotebook.SwitchPage     += new SwitchPageHandler(eventGroup.Add <SwitchPageArgs>(OnMinimapNotebookSwitchPage));
        contextNotebook.SwitchPage     += new SwitchPageHandler(eventGroup.Add <SwitchPageArgs>(OnContextNotebookSwitchPage));

        roomeditor1.RoomChangedEvent += eventGroup.Add <RoomChangedEventArgs>((sender, args) => {
            eventGroup.Lock();
            OnRoomChanged();

            // Only update minimap if the room editor did a "follow warp". Otherwise, we'll decide
            // whether to update the minimap from whatever code changed the room.
            if (args.fromFollowWarp)
            {
                UpdateMinimapFromRoom(args.fromFollowWarp);
            }

            eventGroup.Unlock();
        });

        dungeonMinimap.AddTileSelectedHandler(eventGroup.Add <int>(delegate(object sender, int index) {
            OnMinimapTileSelected(sender, dungeonMinimap.SelectedIndex);
        }));
        worldMinimap.AddTileSelectedHandler(eventGroup.Add <int>(delegate(object sender, int index) {
            OnMinimapTileSelected(sender, worldMinimap.SelectedIndex);
        }));

        tilesetViewer1.HoverChangedEvent += eventGroup.Add <int>((sender, tile) => {
            if (tilesetViewer1.HoveringIndex != -1)
            {
                statusbar1.Set((uint)StatusbarMessage.TileHovering,
                               "Hovering Tile: 0x" + tilesetViewer1.HoveringIndex.ToString("X2"));
            }
            else
            {
                statusbar1.RemoveAll((uint)StatusbarMessage.TileHovering);
            }
        });
        tilesetViewer1.AddTileSelectedHandler(eventGroup.Add <int>(delegate(object sender, int index) {
            statusbar1.RemoveAll((uint)StatusbarMessage.TileHovering);
            statusbar1.Set((uint)StatusbarMessage.TileSelected, "Selected Tile: 0x" + index.ToString("X2"));
        }));

        roomeditor1.HoverChangedEvent += eventGroup.Add <int>((sender, tile) => {
            if (roomeditor1.HoveringIndex != -1)
            {
                statusbar1.Set((uint)StatusbarMessage.TileHovering, string.Format(
                                   "Hovering Pos: {0},{1} (${1:X}{0:X})", roomeditor1.HoveringX, roomeditor1.HoveringY));
            }
            else
            {
                statusbar1.RemoveAll((uint)StatusbarMessage.TileHovering);
            }
        });
        roomeditor1.WarpDestEditModeChangedEvent += eventGroup.Add <bool>((sender, activated) => {
            if (activated)
            {
                statusbar1.Set((uint)StatusbarMessage.WarpDestEditMode,
                               "Entered warp destination editing mode. To exit this mode, right-click on the warp destination and select \"Done\".");
            }
            else
            {
                statusbar1.RemoveAll((uint)StatusbarMessage.WarpDestEditMode);
            }
        });
        statusbar1.Set((uint)StatusbarMessage.TileSelected, "Selected Tile: 0x00");

        OnDarkenDungeonRoomsCheckboxToggled(null, null);


        // Event handlers from underlying data

        chestEventWrapper.Bind <ValueModifiedEventArgs>("ModifiedEvent", (sender, args) => UpdateChestData());
        chestEventWrapper.Bind <EventArgs>("DeletedEvent", (sender, args) => UpdateChestData());


        // Load "plugins"

        pluginCore = new PluginCore(this);
        LoadPlugins();

        mainWindow.ShowAll();

        eventGroup.UnlockAndClear();


        overallEditingContainer.Sensitive = false;

        if (directory != "")
        {
            OpenProject(directory);
        }
    }
Exemplo n.º 49
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.º 50
0
        private void InitializeComponent()

        {
            if (Common.IsWindows)

            {
                this.Title = "Options";

                this.AddButton(Stock.Ok, Gtk.ResponseType.Ok);

                this.AddButton(Stock.Cancel, Gtk.ResponseType.Cancel);
            }

            else

            {
                this.Title = Stock.Lookup(Stock.Preferences).Label.Replace("_", "");

                this.AddButton(Stock.Cancel, Gtk.ResponseType.Cancel);

                this.AddButton(Stock.Ok, Gtk.ResponseType.Ok);
            }



            this.Modal = true;

            this.WindowPosition = Gtk.WindowPosition.CenterOnParent;

            this.Resizable = false;

            this.SetDefaultSize(518, 399);

            this.Response += new ResponseHandler(frmOptions_Response);

            this.IconName = Stock.Preferences;



            optionTabs = new Notebook();

            optionTabs.ShowTabs = true;

            optionTabs.BorderWidth = 5;

            optionTabs.TabPos = PositionType.Top;

            optionTabs.SetSizeRequest(515, 300);



            GenerateTabs();



            this.VBox.PackStart(optionTabs, true, true, 0);

            this.VBox.ShowAll();



            LoadSettings();
        }
Exemplo n.º 51
0
        private void build()
        {
            this.Title = "New Battlelords Character";
            {
                // page 1 - intro
                Gtk.TextView   tv = new Gtk.TextView();
                Gtk.TextBuffer tb;
                tb = tv.Buffer;
                //tb.Text = MediaManager.GetHtml("intro.html");
                tb.Text = "Welcome to the Battlelords Character Asistant.\n" +
                          "\nThis will guide you thru the initial player character generation. " +
                          "You will be presented with some initial options that can not change " +
                          "once the character is created. " +
                          "\nStep 1" +
                          "\nStep 2" +
                          "\nStep 3" +
                          "\nStep 4" +
                          "\nConculsion";
                tv.WrapMode = WrapMode.Word;
                tv.Editable = false;

                this.AppendPage(tv);
                this.SetPageTitle(tv, "Introduction");
                this.SetPageType(tv, AssistantPageType.Intro);
                this.SetPageComplete(tv, true);
            }
            {
                // page 2 - rolling method
                string method1 = "Percentile dice are rolled and marked down in order of the given visual statistics. " +
                                 "Eight rolls are initially made. The player then makes three additional dice rolls. " +
                                 "He has the option of replacing any three previously rolled statistics with one of these number. " +
                                 "Players may not move rolls around! First roll is Strength, second roll is Manual Dexterity, etc.";
                Gtk.VBox     vb      = new Gtk.VBox();
                Gtk.HBox     hb1     = new Gtk.HBox();
                Gtk.Label    lb1     = new Gtk.Label("Rolling Method");
                string[]     entries = { "Method 1", "Method 2", "Method 3", "Fill In" };
                Gtk.ComboBox cb1     = new Gtk.ComboBox(entries);
                hb1.PackStart(lb1, true, false, 0);
                hb1.PackEnd(cb1, true, false, 0);
                cb1.Active = 0;
                Gtk.HBox        hb2 = new Gtk.HBox();
                Gtk.CheckButton b1  = new Gtk.CheckButton("Max Body Points");
                Gtk.CheckButton b2  = new Gtk.CheckButton("Max Starting Money");
                b1.Active = true;
                b2.Active = true;
                hb2.PackStart(b1, true, false, 1);
                hb2.PackEnd(b2, true, false, 1);
                Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
                Gtk.TextView       tv = new Gtk.TextView();
                tv.WrapMode = WrapMode.Word;
                tv.Editable = false;
                Gtk.TextBuffer tb = tv.Buffer;
                tb.Text = method1;
                sw.Add(tv);
                //vb.PackStart(hb1, false, false, 0);
                vb.PackStart(hb2, false, false, 0);
                //vb.PackEnd(sw, true, true, 0);

                this.AppendPage(vb);
                this.SetPageTitle(vb, "Rolling Options");
                this.SetPageType(vb, AssistantPageType.Content);
                this.SetPageComplete(vb, true);
            }
            {
                // page 3 - race
                TreeStore ts = new TreeStore(typeof(string), typeof(string));
                foreach (BattlelordsRace r in this.session.Races)
                {
                    ts.AppendValues(r.Name, r.Name);
                }
                TreeView tv = new TreeView(ts);
                tv.HeadersVisible = true;
                tv.AppendColumn("Battlelords Race", new CellRendererText(), "text", 0);

                this.AppendPage(tv);
                this.SetPageTitle(tv, "Select Race");
                this.SetPageType(tv, AssistantPageType.Content);
                this.SetPageComplete(tv, true);
            }
            {
                // page 4 - Basics page

                /*
                 * 1 char name
                 * 2 player name
                 * 3 height
                 * 4 weight
                 * 5 body pts
                 * 6 start money
                 */
                Gtk.VBox vb2 = new Gtk.VBox();

                Gtk.HBox  hb1 = new Gtk.HBox();
                Gtk.Label lb1 = new Gtk.Label("Player's Name:");
                Gtk.Entry en1 = new Gtk.Entry();
                hb1.PackStart(lb1, false, false, 0);
                hb1.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb1.PackEnd(en1, true, true, 0);

                Gtk.HBox  hb2 = new Gtk.HBox();
                Gtk.Label lb2 = new Gtk.Label("Character's Name:");
                Gtk.Entry en2 = new Gtk.Entry();
                hb2.PackStart(lb2, false, false, 0);
                hb2.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb2.PackEnd(en2, true, true, 0);

                Gtk.HBox  hb3 = new Gtk.HBox();
                Gtk.Label lb3 = new Gtk.Label("Height (ft):");
                Gtk.Entry en3 = new Gtk.Entry();
                en3.Sensitive = false;
                Gtk.Button b3 = new Gtk.Button();
                //b3.Label = "roll";
                b3.TooltipText = "Click here to roll height.";
                b3.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb3.PackStart(lb3, false, false, 0);
                hb3.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb3.PackStart(en3, true, true, 0);
                hb3.PackEnd(b3, false, false, 0);

                Gtk.HBox  hb4 = new Gtk.HBox();
                Gtk.Label lb4 = new Gtk.Label("Weight (lbs):");
                Gtk.Entry en4 = new Gtk.Entry();
                en4.Sensitive = false;
                Gtk.Button b4 = new Gtk.Button();
                //b4.Label = "roll";
                b4.TooltipText = "Click here to roll for weight.";
                b4.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb4.PackStart(lb4, false, false, 0);
                hb4.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb4.PackStart(en4, true, true, 0);
                hb4.PackEnd(b4, false, false, 0);

                Gtk.HBox  hb5 = new Gtk.HBox();
                Gtk.Label lb5 = new Gtk.Label("Body Points:");
                Gtk.Entry en5 = new Gtk.Entry();
                en5.Sensitive = false;
                Gtk.Button b5 = new Gtk.Button();
                b5.TooltipText = "Click here to roll for body points.";
                b5.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb5.PackStart(lb5, false, false, 0);
                hb5.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb5.PackStart(en5, true, true, 0);
                hb5.PackEnd(b5, false, false, 0);

                Gtk.HBox  hb6 = new Gtk.HBox();
                Gtk.Label lb6 = new Gtk.Label("Starting Money:");
                Gtk.Entry en6 = new Gtk.Entry();
                en6.Sensitive = false;
                Gtk.Button b6 = new Gtk.Button();
                b6.TooltipText = "Click here to roll for starting money.";
                b6.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb6.PackStart(lb6, false, false, 0);
                hb6.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb6.PackStart(en6, true, true, 0);
                hb6.PackEnd(b6, false, false, 0);

                vb2.PackStart(hb1, false, false, 0);
                vb2.PackStart(hb2, false, false, 0);
                vb2.PackStart(hb3, false, false, 0);
                vb2.PackStart(hb4, false, false, 0);
                vb2.PackStart(hb5, false, false, 0);
                vb2.PackStart(hb6, false, false, 0);

                this.AppendPage(vb2);
                this.SetPageTitle(vb2, "Enter Basic Information");
                this.SetPageType(vb2, AssistantPageType.Content);
                this.SetPageComplete(vb2, true);
            }
            {
                // page 5 - vitals
                VBox         vb5 = new VBox();
                Gtk.Notebook nb  = new Gtk.Notebook();
                //Battle.Gui.VitalsControl stvc = new Battle.Gui.VitalsControl(this.session);
                //stvc.Sensitive = false;
                VitalsControl m1vitals   = new VitalsControl(this.session);
                VitalsControl m2vitals   = new VitalsControl(this.session);
                VitalsControl m3vitals   = new VitalsControl(this.session);
                VitalsControl fillvitals = new VitalsControl(this.session);

                m1vitals.Enabled = false;
                m2vitals.Enabled = false;
                m3vitals.Enabled = false;

                nb.AppendPage(m1vitals, new Gtk.Label("Method 1"));
                nb.AppendPage(m2vitals, new Gtk.Label("Method 2"));
                nb.AppendPage(m3vitals, new Gtk.Label("Method 3"));
                nb.AppendPage(fillvitals, new Gtk.Label("Fill In"));

                HButtonBox bb5     = new HButtonBox();
                Button     rollBtn = new Button(Stock.Execute);
                rollBtn.Clicked += delegate(object sender, EventArgs e) {
                    Console.WriteLine("{0}", sender.GetType().ToString());
                };
                rollBtn.Label = "Roll";
                Button saveBtn = new Button(Stock.Save);
                saveBtn.Label = "Save";
                bb5.PackStart(rollBtn);
                bb5.PackEnd(saveBtn);
                nb.SwitchPage += delegate(object o, SwitchPageArgs args) {
                    if (args.PageNum == 3)
                    {
                        rollBtn.Sensitive = false;
                    }
                    else
                    {
                        rollBtn.Sensitive = true;
                    }
                };

                vb5.Add(nb);
                vb5.Add(bb5);

                this.AppendPage(vb5);
                this.SetPageTitle(vb5, "Enter Vitals");
                this.SetPageType(vb5, AssistantPageType.Content);
                this.SetPageComplete(vb5, true);
            }
            {
                // page 6 - secondaries
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Enter Secondary Attributes");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 7 - fate
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Determine Fate");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 8 - social
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Social Status");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 9 - skills
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Choose Initial Skills");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 10 - matrixes
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Choose Initial Matrixes");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 11 - confirm
                TextView   tv11 = new TextView();
                TextBuffer b11  = tv11.Buffer;
                b11.Text      = "Confirm this new character.";
                tv11.Editable = false;
                this.AppendPage(tv11);
                this.SetPageTitle(tv11, "Confirm New Character");
                this.SetPageType(tv11, AssistantPageType.Confirm);
                this.SetPageComplete(tv11, true);
            }
            this.Close  += HandleHandleClose;
            this.Cancel += HandleHandleCancel;
            this.ShowAll();
        }
Exemplo n.º 52
0
        private void Init()
        {
            Logger.Debug("Called Preferences Init");
            this.Icon = Utilities.GetIcon("tasque", 16);
            // Update the window title
            this.Title = string.Format(Catalog.GetString("Tasque Preferences"));

            this.VBox.Spacing     = 0;
            this.VBox.BorderWidth = 0;
            this.Resizable        = false;

            this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
            this.DefaultResponse = ResponseType.Ok;

            notebook          = new Gtk.Notebook();
            notebook.ShowTabs = true;

            //
            // General Page
            //
            generalPage = MakeGeneralPage();
            generalPage.Show();
            generalPageId =
                notebook.AppendPage(generalPage,
                                    new Label(Catalog.GetString("General")));

            //
            // Appearance Page
            //
            appearancePage = MakeAppearancePage();
            appearancePage.Show();
            notebook.AppendPage(appearancePage,
                                new Label(Catalog.GetString("Appearance")));

            //
            // Backend Page
            //
            backendPage   = null;
            backendPageId = -1;

            var backendType = application.BackendManager.CurrentBackend;

            if (backendType != null)
            {
                backendPage = (Widget)application.BackendManager.GetBackendPreferencesWidget();
                if (backendPage != null)
                {
                    backendPage.Show();
                    var l = new Label(GLib.Markup.EscapeText(
                                          application.BackendManager.AvailableBackends [backendType]));
                    l.UseMarkup    = false;
                    l.UseUnderline = false;
                    l.Show();
                    backendPageId = notebook.AppendPage(backendPage, l);
                }
            }

            notebook.Show();
            this.VBox.PackStart(notebook, true, true, 0);

            DeleteEvent += WindowDeleted;
        }
Exemplo n.º 53
0
        /// <summary>Crea las hojas de las opciones, la parte central
        /// del diálogo.</summary>
        /// <returns>El notebook de las opciones.</returns>

        private Gtk.Widget CrearNotebook()
        {
            Gtk.Notebook notebook = new Gtk.Notebook();
            notebook.BorderWidth = 10;

            // Panel de configuración del ensamblador.

            cbAdvertencias = new Gtk.CheckButton(
                Ventana.GetText("D_Conf_MostrarAdv"));

            Gtk.Frame frmEnsamblador =
                new Gtk.Frame(Ventana.GetText("D_Conf_Ensamblador"));
            VBox panelEnsamblador = new VBox(false, 5);

            panelEnsamblador.PackStart(cbAdvertencias);
            frmEnsamblador.Add(panelEnsamblador);

            // Panel de Memoria de control.

            rbMemoriaDef = new RadioButton(null,
                                           Ventana.GetText("D_Conf_MemDef"));
            rbMemoriaUsu = new RadioButton(rbMemoriaDef,
                                           Ventana.GetText("D_Conf_MemUsu"));

            rbMemoriaDef.Toggled   += new EventHandler(rbToggled1);
            rbMemoriaUsu.Toggled   += new EventHandler(rbToggled2);
            lblMemoriaAlt           = new Gtk.Entry("");
            lblMemoriaAlt.Sensitive = false;
            btnFichero          = new Gtk.Button(Ventana.GetText("D_Conf_Explorar"));
            btnFichero.Clicked += new EventHandler(btnFicheroClicked);

            Gtk.Frame frmMemoria =
                new Gtk.Frame(Ventana.GetText("D_Conf_Memoria"));
            VBox panelMemoria = new Gtk.VBox(false, 5);

            panelMemoria.PackStart(rbMemoriaDef);
            panelMemoria.PackStart(rbMemoriaUsu);
            panelMemoria.PackStart(lblMemoriaAlt);
            panelMemoria.PackStart(btnFichero);
            frmMemoria.Add(panelMemoria);


            // Panel del simulador.

            Gtk.Frame frmSimulador =
                new Gtk.Frame(Ventana.GetText("D_Conf_Simulador"));
            VBox panelSimulador = new VBox(false, 5);

            panelSimulador.PackStart(
                new Gtk.Label(Ventana.GetText("D_Conf_Tiempo")));

            sbTiempo = new Gtk.SpinButton(
                new Adjustment(1000.0, 50.0, 5000.0, 10.0, 100.0, 1.0),
                1.0,
                0);
            sbTiempo.Numeric = true;

            panelSimulador.PackStart(sbTiempo);
            frmSimulador.Add(panelSimulador);


            //  ----

            notebook.AppendPage(
                frmSimulador,
                new Gtk.Label(Ventana.GetText("D_Conf_Simulador")));

            notebook.AppendPage(
                frmEnsamblador,
                new Gtk.Label(Ventana.GetText("D_Conf_Ensamblador")));

            notebook.AppendPage(
                frmMemoria,
                new Gtk.Label(Ventana.GetText("D_Conf_Memoria")));

            return(notebook);
        }
Exemplo n.º 54
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.º 55
0
        void IPlugin.Init(object context)
        {
            solidIDE   = context as ISolidIDE;
            mainWindow = solidIDE.GetMainWindow();

            // Notebook
            noteBook = new Gtk.Notebook();

            designerDockItem          = mainWindow.DockFrame.AddItem("Designer");
            designerDockItem.Behavior =
                DockItemBehavior.CantAutoHide |
                DockItemBehavior.CantClose |
                DockItemBehavior.NeverFloating;
            designerDockItem.Expand         = true;
            designerDockItem.DrawFrame      = true;
            designerDockItem.Label          = "Designer";
            designerDockItem.Content        = noteBook;
            designerDockItem.DefaultVisible = true;
            designerDockItem.Visible        = true;

            // Menu
            var fileMenuItem = solidIDE.GetMenuItem <Gtk.ImageMenuItem>("File");
            var saveMenuItem = solidIDE.GetMenuItem <Gtk.ImageMenuItem>("File", "Save");

            saveMenuItem.Activated += HandleSaveActivated;
            var viewMenuItem     = solidIDE.GetMenuItem <Gtk.ImageMenuItem>("View");
            var designerMenuItem = solidIDE.GetMenuItem <Gtk.ImageMenuItem>("View", "Designer");

            designerMenuItem.Activated += HandleShowDesignerActivated;

            // Test
            var                   model       = new Model();
            ShapesModel           scene       = new ShapesModel();
            SelectionModel        selection   = new SelectionModel();
            InteractionStateModel interaction = new InteractionStateModel();
            var                   view        = new View <Cairo.Context, Model>();

            controller = new CompositeController <Gdk.Event, Cairo.Context, Model>();

            model.RegisterSubModel <ShapesModel>(scene);
            model.RegisterSubModel <SelectionModel>(selection);
            model.RegisterSubModel <InteractionStateModel>(interaction);
            model.ModelChanged += HandleModelChanged;

            //TODO: Scan plugins for shapes and viewers
            view.Viewers.Add(typeof(Model), new ModelViewer <Cairo.Context>());
            view.Viewers.Add(typeof(ShapesModel), new ShapeModelViewer());
            view.Viewers.Add(typeof(RectangleShape), new RectangleShapeViewer());
            view.Viewers.Add(typeof(EllipseShape), new EllipseShapeViewer());
            view.Viewers.Add(typeof(ArrowShape), new ArrowShapeViewer());
            view.Viewers.Add(typeof(BezierCurvedArrowShape), new BezierCurvedArrowShapeViewer());
            view.Viewers.Add(typeof(TextBlockShape), new TextBlockShapeViewer());
            view.Viewers.Add(typeof(SelectionModel), new SelectionModelViewer());
            view.Viewers.Add(typeof(Glue), new GlueViewer());
            view.Viewers.Add(typeof(InteractionStateModel), new InteractionStateModelViewer());
            view.Viewers.Add(typeof(FocusRectangleShape), new FocusRectangleShapeViewer());

            //scene.Shapes.Add(new RectangleShape(new Rectangle(0,0,100,50)));

            controller.SubControllers.Add(new ShapeSelectionController(model, view));
            chainController = new ChainController <Gdk.Event, Cairo.Context, Model>();
            chainController.SubControllers.Add(new ConnectorDragController(model, view));
            chainController.SubControllers.Add(new ShapeDragController(model, view));
            controller.SubControllers.Add(chainController);

            IDesigner designer = this;

            designer.AddSheet("Sheet", new Sheet <Gdk.Event, Cairo.Context, Model>(model, view, controller));
        }
Exemplo n.º 56
0
        static int RunApp(string[] args, int n)
        {
            Project = SteticApp.CreateProject();

            Project.WidgetAdded     += OnWidgetAdded;
            Project.WidgetRemoved   += OnWidgetRemoved;
            Project.ModifiedChanged += OnProjectModified;
            Project.ProjectReloaded += OnProjectReloaded;

            Palette      = SteticApp.PaletteWidget;
            widgetTree   = SteticApp.WidgetTreeWidget;
            Signals      = SteticApp.SignalsWidget;
            propertyTree = SteticApp.PropertiesWidget;
            ProjectView  = new WindowListWidget();

            UIManager = new Stetic.UIManager(Project);

            Glade.XML.CustomHandler = CustomWidgetHandler;
            Glade.XML glade = new Glade.XML("stetic.glade", "MainWindow");
            glade.Autoconnect(typeof(SteticMain));

            if (ProjectView.Parent is Gtk.Viewport &&
                ProjectView.Parent.Parent is Gtk.ScrolledWindow)
            {
                Gtk.Viewport       viewport = (Gtk.Viewport)ProjectView.Parent;
                Gtk.ScrolledWindow scrolled = (Gtk.ScrolledWindow)viewport.Parent;
                viewport.Remove(ProjectView);
                scrolled.Remove(viewport);
                scrolled.AddWithViewport(ProjectView);
            }

            foreach (Gtk.Widget w in glade.GetWidgetPrefix(""))
            {
                Gtk.Window win = w as Gtk.Window;
                if (win != null)
                {
                    win.AddAccelGroup(UIManager.AccelGroup);
                    win.ShowAll();
                }
            }
            MainWindow                      = (Gtk.Window)Palette.Toplevel;
            WidgetNotebook                  = (Gtk.Notebook)glade ["notebook"];
            WidgetNotebook.SwitchPage      += OnPageChanged;
            ProjectView.ComponentActivated += OnWidgetActivated;
            widgetTree.SelectionChanged    += OnSelectionChanged;

#if GTK_SHARP_2_6
            // This is needed for both our own About dialog and for ones
            // the user constructs
            Gtk.AboutDialog.SetUrlHook(ActivateUrl);
#endif

            if (n < args.Length)
            {
                LoadProject(args [n]);
            }

            ReadConfiguration();

            foreach (string s in Configuration.WidgetLibraries)
            {
                SteticApp.AddWidgetLibrary(s);
            }
            SteticApp.UpdateWidgetLibraries(false);

            ProjectView.Fill(Project);

            Program.Run();
            return(0);
        }