예제 #1
0
        private void Build()
        {
            var vb         = new VBox();
            var toolbar    = new Toolbar();
            var tbiRefresh = new ToolButton(Stock.Refresh);

            toolbar.Insert(tbiRefresh, -1);
            vb.PackStart(toolbar, false, false, 0);

            var hpaned = new HPaned();

            this.nbDataType = new Notebook();
            this.tvDataType = new TreeView();
            this.nbDataType.Add(this.tvDataType);
            this.nbDataType.SetTabLabelText(this.tvDataType, "Data Type");
            hpaned.Add1(this.nbDataType);

            this.nbTypeDetail = new Notebook();
            this.tvTypeDetail = new TreeView();
            this.nbTypeDetail.Add(this.tvTypeDetail);
            this.nbTypeDetail.SetTabLabelText(this.tvTypeDetail, "Data Type Details");
            hpaned.Add2(nbTypeDetail);

            vb.PackStart(hpaned);
            AddWithViewport(vb);
            ShowAll();
        }
예제 #2
0
        public CairoSnippetsGtk()
        {
            Window w = new Window("Cairo snippets");

            w.SetDefaultSize(width, height);
            w.DeleteEvent += delegate { Application.Quit(); };

            HPaned         hpane = new HPaned();
            ScrolledWindow sw    = new ScrolledWindow();
            TreeView       tv    = new TreeView();

            tv.HeadersVisible = false;
            tv.AppendColumn("snippets", new CellRendererText(), "text", 0);
            tv.Model              = GetModel();
            tv.Selection.Changed += OnSelectionChanged;
            sw.Add(tv);
            hpane.Add1(sw);
            da              = new DrawingArea();
            da.ExposeEvent += OnExposed;
            hpane.Add2(da);
            hpane.Position = width / 2;
            w.Add(hpane);

            w.ShowAll();
        }
예제 #3
0
        void InitializeComponent()
        {
            DefaultSize = new Gdk.Size(900, 500);

            var mainVbox = new VBox(false, 0);

            MainMenubar = new MenuBar();
            InitMenu(MainMenubar);

            MainToolbar = new Toolbar();
            InitToolbar(MainToolbar);

            var splitCont = new HPaned();

            // list of downloads
            downloadList = new DownloadList();
            var scrolledWindow = new ScrolledWindow();

            scrolledWindow.Child = downloadList;
            splitCont.Add2(scrolledWindow);
            nodeModel = downloadList.Model;

            // categories list
            catList = new CategoryTreeView();
            splitCont.Add1(catList);

            catList.Selection.Changed += CategorySelectionOnChanged;

            mainVbox.PackStart(MainMenubar, false, true, 0);
            mainVbox.PackStart(MainToolbar, false, false, 0);
            mainVbox.PackStart(splitCont);

            Add(mainVbox);
            ShowAll();
        }
예제 #4
0
        public GtkMain() : base("Toves")
        {
            MenuBar    menubar = GtkMenu.Create(this, windowModel);
            GtkToolbar toolbar = new GtkToolbar(this, windowModel.ToolbarModel);
            GtkToolbox toolbox = new GtkToolbox(windowModel.ToolboxModel);

            canvas             = new GtkCanvas.GtkCanvas();
            canvas.CanvasModel = windowModel.LayoutCanvas;

            HPaned hbox = new HPaned();

            hbox.Add1(toolbox);
            hbox.Add2(canvas);

            VBox vbox = new VBox(false, 0);

            vbox.PackStart(menubar, false, false, 0);
            vbox.PackStart(toolbar, false, false, 0);
            vbox.PackEnd(hbox, true, true, 0);

            this.Add(vbox);
            this.SetDefaultSize(980, 600);
            this.ShowAll();
            canvas.GrabFocus();
        }
예제 #5
0
        private void Build()
        {
            _container.PackStart(_menu, false, false, 0);
            _container.Add(_pane);
            _container.PackEnd(Statusbar, false, false, 0);
            Add(_container);

            // Menubar
            _fileMenu.Add(_sync);
            _sync.Activated += OnSync;
            _fileMenu.Add(_settings);
            _settings.Activated += OnSettings;
            _fileMenu.Add(_close);
            _close.Activated += delegate { Visible = false; };
            _fileMenu.Add(new SeparatorMenuItem());
            _fileMenu.Add(_quit);
            _quit.Activated += delegate { Application.Quit(); };
            _menu.Add(_file);
            _file.Submenu = _fileMenu;
            _helpMenu.Add(_updates);
            _helpMenu.Add(_about);
            _about.Activated += OnAbout;
            _menu.Add(_help);
            _help.Submenu = _helpMenu;

            // Sidebar
            _pane.Add1(_sidebar);
            _sidebar.CursorChanged += OnSidebarActivated;
            var crp = new CellRendererPixbuf();
            var crt = new CellRendererText();

            _column.PackStart(crp, true);
            _column.PackEnd(crt, true);
            _column.AddAttribute(crp, "pixbuf", 0);
            _column.AddAttribute(crt, "text", 1);
            _sidebar.AppendColumn(_column);
            _sidebar.HeadersVisible = false;
            //TODO find icons
            _store.AppendValues(Pixbuf.LoadFromResource("Trackr.Gui.Gtk.Resources.icons.anime.png"), "Anime");
            _store.AppendValues(Pixbuf.LoadFromResource("Trackr.Gui.Gtk.Resources.icons.manga.png"), "Manga");
            var i = _store.AppendValues(Pixbuf.LoadFromResource("Trackr.Gui.Gtk.Resources.icons.find.png"), "Search");

            _store.AppendValues(i, Pixbuf.LoadFromResource("Trackr.Gui.Gtk.Resources.icons.search.png"), "Anime ");             // the extra space means search!
            _store.AppendValues(i, Pixbuf.LoadFromResource("Trackr.Gui.Gtk.Resources.icons.search.png"), "Manga ");

            // Notebook
            _pane.Add2(_nb);
            _nb.ShowTabs = false;
            _nb.Add(AnimeBox);
            _nb.Add(_mangaBox);
            _nb.Add(_nullAccountBox);
            _nb.Add(_defaultSearch);
            _nb.Add(AnimeSearch);
            _nb.Add(_mangaSearch);

            // toolbar buttons
            AnimeBox.SettingsItem.Clicked += OnSettings;
            AnimeBox.SyncItem.Clicked     += OnSync;
        }
예제 #6
0
        public ExploreView(ICredentialsProvider credentialsProvider,
                           int stopAfter) : base(false, 1)
        {
            this.credentialsProvider = credentialsProvider;

            HPaned hPaned = new HPaned();

            Add(hPaned);

            {
                ScrolledWindowBase scrolledWindow1 = new ScrolledWindowBase();
                hPaned.Add1(scrolledWindow1);

                repositoryView = new RepositoryView(this, credentialsProvider);
                scrolledWindow1.Add(repositoryView);
            }

            viewChildren = new VPaned();
            {
                ScrolledWindowBase scrolledWindow2 = new ScrolledWindowBase();
                viewChildren.Pack1(scrolledWindow2, true, true);

                directoryView = new DirectoryView(this);
                scrolledWindow2.Add(directoryView);

                ScrolledWindowBase scrolledWindow3 = new ScrolledWindowBase();
                viewChildren.Pack2(scrolledWindow3, true, true);

                changesetView = new ChangesetView(this, stopAfter);
                scrolledWindow3.Add(changesetView);

                int x, y, width, height, depth;
                RootWindow.GetGeometry(out x, out y, out width, out height, out depth);

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

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

            Assembly entry = Assembly.GetEntryAssembly();

            StatusMessage(String.Format("{0} version {1}", entry.GetName().Name,
                                        entry.GetName().Version.ToString()));

            ShowAll();
            repositoryView.Selection.Changed += OnPathSelectionChanged;
        }
예제 #7
0
        public DemoPanes() : base("Panes")
        {
            VBox vbox = new VBox(false, 0);

            Add(vbox);

            VPaned vpaned = new VPaned();

            vbox.PackStart(vpaned, true, true, 0);
            vpaned.BorderWidth = 5;

            HPaned hpaned = new HPaned();

            vpaned.Add1(hpaned);

            Frame frame = new Frame();

            frame.ShadowType = ShadowType.In;
            frame.SetSizeRequest(60, 60);
            hpaned.Add1(frame);

            Gtk.Button button = new Button("_Hi there");
            frame.Add(button);

            frame            = new Frame();
            frame.ShadowType = ShadowType.In;
            frame.SetSizeRequest(80, 60);
            hpaned.Add2(frame);

            frame            = new Frame();
            frame.ShadowType = ShadowType.In;
            frame.SetSizeRequest(60, 80);
            vpaned.Add2(frame);

            // Now create toggle buttons to control sizing
            vbox.PackStart(CreatePaneOptions(hpaned,
                                             "Horizontal",
                                             "Left",
                                             "Right"),
                           false, false, 0);

            vbox.PackStart(CreatePaneOptions(vpaned,
                                             "Vertical",
                                             "Top",
                                             "Bottom"),
                           false, false, 0);

            ShowAll();
        }
예제 #8
0
    public ExploreView(Driver driver, int stopAfter) : base("Explore")
    {
        int x, y, width, height, depth;

        RootWindow.GetGeometry(out x, out y, out width, out height, out depth);
        SetDefaultSize(width - 50, height - 40);

        VBox vBox = new VBox(false, 1);

        Add(vBox);

        HPaned hPaned = new HPaned();

        vBox.Add(hPaned);

        ScrolledWindow scrolledWindow = new ScrolledWindow();

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

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

        viewChildren = new Notebook();

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

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

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

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

        // add status bar
        Statusbar sb = new Statusbar();

        sb.HasResizeGrip = false;
        vBox.PackEnd(sb, false, false, 1);

        ShowAll();

        repositoryView.Selection.Changed += OnPathSelectionChanged;
        viewChildren.SwitchPage          += OnSwitchPage;
    }
        /// <summary>
        /// Initializes the entire widget and lays out the class.
        /// </summary>
        private void InitializeWidget()
        {
            // The configuration area is split horizontally by a resizable pane.
            var pane = new HPaned();

            // On the left is the selector area.
            pane.Add1(CreateSelectorArea());

            // On the right is the configurator area.
            pane.Add2(CreateConfiguratorArea());

            // Set the default position of the pane to 100 px for the selector.
            pane.Position = 100;

            // Pack the widget into ourselves.
            PackStart(pane, true, true, 0);
        }
예제 #10
0
        public LauncherWidget()
        {
            var tb = new Entry("");

            tb.SetIconFromIconName(EntryIconPosition.Secondary, "search");
            tb.Changed += (s, e) => {
                ShowSearch(tb.Text);
            };

            tb.KeyReleaseEvent += (s, e) => {
                if (e.Event.Key == Gdk.Key.Return && appListStore.NColumns != 0)                   //TODO: appListStore.NColumns does not work
                {
                    hpaned.Child1.ChildFocus(DirectionType.TabForward);
                }
                if (e.Event.Key == Gdk.Key.Escape)
                {
                    Parent.Hide();                     //TODO: detect Window
                }
            };

            tb.Margin = 5;
            //tb.BorderWidth = 1;
            PackStart(tb, false, false, 0);

            hpaned = new HPaned();

            Add(hpaned);

            /*Add(CreateList());
            *  Add(CreateList());*/


            var appList = CreateAppList();

            hpaned.Add1(appList);
            hpaned.Add2(CreateCatList());

            ShowAllApps();

            ShowAll();
            allButton.Active = true;
            lastActiveButton = allButton;
        }
예제 #11
0
        private void SetupUI()
        {
            hPaned1 = new HPaned();
            hPaned2 = new HPaned();
            hPaned1.Add1(SetupTypeTree());
            hPaned1.Add2(hPaned2);

            hPaned1.Position = (int)gconf.Get(gconfPath + "hpaned1position");
            hPaned2.Position = (int)gconf.Get(gconfPath + "hpaned2position");

            vbox         = new VBox(true, 2);
            vbox.Spacing = 2;
            Frame frame = new Frame();

            frame.Shadow = ShadowType.In;
            frame.Add(MemberSelector());
            vbox.Add(frame);
            frame        = new Frame();
            frame.Shadow = ShadowType.In;
            frame.Add(ICSelector());
            vbox.Add(frame);
            hPaned2.Add1(vbox);

            memberView = new MemberView();
            memberView.MemberSelectedEvent += new MemberView.MemberSelected(MemberSelected);
            memberView.RecordFactory        = recordFactory [0];

            ScrolledWindow sw = new ScrolledWindow();

            sw.Add(memberView);
            hPaned2.Add2(sw);

            Content = new Notebook();
            findBar = new FindBar(this);
            Content.AppendPage(findBar, new Label("Find"));

            Add1(hPaned1);
            Add2(Content);

            Position = (int)gconf.Get(gconfPath + "vpaned1position");
        }
예제 #12
0
        void CreateControl()
        {
            control = new HPaned();

            store = new Gtk.ListStore(typeof(Gdk.Pixbuf),               // image - type
                                      typeof(bool),                     // read?
                                      typeof(Task));                    // read? -- use Pango weight

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTaskTypes);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            sort = new TreeModelSort(filter);
            sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort);
            sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort);
            sort.SetSortFunc(VisibleColumns.File, FileIterSort);

            view                   = new MonoDevelop.Ide.Gui.Components.PadTreeView(sort);
            view.RulesHint         = true;
            view.PopupMenu        += new PopupMenuHandler(OnPopupMenu);
            view.ButtonPressEvent += new ButtonPressEventHandler(OnButtonPressed);
            AddColumns();
            LoadColumnsVisibility();
            view.Columns[VisibleColumns.Type].SortColumnId    = VisibleColumns.Type;
            view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
            view.Columns[VisibleColumns.File].SortColumnId    = VisibleColumns.File;

            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);
            TaskService.Errors.TasksRemoved += (TaskEventHandler)DispatchService.GuiDispatch(new TaskEventHandler(ShowResults));
            TaskService.Errors.TasksAdded   += (TaskEventHandler)DispatchService.GuiDispatch(new TaskEventHandler(TaskAdded));
            TaskService.Errors.TasksChanged += (TaskEventHandler)DispatchService.GuiDispatch(new TaskEventHandler(TaskChanged));
            TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;

            IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
            IdeApp.Workspace.LastWorkspaceItemClosed  += OnCombineClosed;

            view.RowActivated += new RowActivatedHandler(OnRowActivated);

            iconWarning = sw.RenderIcon(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
            iconError   = sw.RenderIcon(Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
            iconInfo    = sw.RenderIcon(Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");

            control.Add1(sw);

            outputView = new LogView();
            control.Add2(outputView);

            Control.ShowAll();

            sw.SizeAllocated += delegate {
                if (outputView.Visible)
                {
                    PropertyService.Set(logSeparatorPositionPropertyName, (double)((double)control.Position / (double)control.Allocation.Width));
                }
            };

            outputView.Hide();

            CreateMenu();

            // Load existing tasks
            foreach (Task t in TaskService.Errors)
            {
                AddTask(t);
            }

            control.FocusChain = new Gtk.Widget [] { sw };
        }
예제 #13
0
        void CreateControl()
        {
            control = new HPaned();

            store = new Gtk.TreeStore(typeof(Xwt.Drawing.Image),               // image - type
                                      typeof(bool),                            // read?
                                      typeof(Task),                            // read? -- use Pango weight
                                      typeof(string));

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTasks);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            sort = new TreeModelSort(filter);
            sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort);
            sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort);
            sort.SetSortFunc(VisibleColumns.File, FileIterSort);

            view = new PadTreeView(sort);
            view.ShowExpanders = true;
            view.RulesHint     = true;
            view.DoPopupMenu   = (evnt) => IdeApp.CommandService.ShowContextMenu(view, evnt, CreateMenu());
            AddColumns();
            LoadColumnsVisibility();
            view.Columns[VisibleColumns.Type].SortColumnId    = VisibleColumns.Type;
            view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
            view.Columns[VisibleColumns.File].SortColumnId    = VisibleColumns.File;

            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);
            TaskService.Errors.TasksRemoved += DispatchService.GuiDispatch <TaskEventHandler> (ShowResults);
            TaskService.Errors.TasksAdded   += DispatchService.GuiDispatch <TaskEventHandler> (TaskAdded);
            TaskService.Errors.TasksChanged += DispatchService.GuiDispatch <TaskEventHandler> (TaskChanged);
            TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;

            IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
            IdeApp.Workspace.LastWorkspaceItemClosed  += OnCombineClosed;

            view.RowActivated += new RowActivatedHandler(OnRowActivated);

            iconWarning = ImageService.GetIcon(Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
            iconError   = ImageService.GetIcon(Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
            iconInfo    = ImageService.GetIcon(Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
            iconEmpty   = ImageService.GetIcon(Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);

            control.Add1(sw);

            outputView = new LogView();
            control.Add2(outputView);

            Control.ShowAll();

            control.SizeAllocated += HandleControlSizeAllocated;

            bool outputVisible = PropertyService.Get <bool> (outputViewVisiblePropertyName, false);

            if (outputVisible)
            {
                outputView.Visible = true;
                logBtn.Active      = true;
            }
            else
            {
                outputView.Hide();
            }

            sw.SizeAllocated += HandleSwSizeAllocated;

            // Load existing tasks
            foreach (Task t in TaskService.Errors)
            {
                AddTask(t);
            }

            control.FocusChain = new Gtk.Widget [] { sw };
        }
예제 #14
0
    public void ResetForNewData()
    {
        SelectedEntry = null;

        PlantAddButton.Sensitive = false;
        AreaEditButton.Sensitive = false;

        GardenDrawingArea.ActiveInstance = null;

        yearButton.Value  = System.DateTime.Now.Year;
        monthButton.Value = System.DateTime.Now.Month;

        ReloadFamilies();

        RemoveAllChildren(GraphicsSidebarHPaned);

        GraphicsSidebarHPaned.Add1(GardenBedBook);
        GraphicsSidebarHPaned.Add2(PlantSideVPaned);



        while (GardenBedBook.NPages > 0)
        {
            GardenBedBook.RemovePage(0);
        }

        foreach (KeyValuePair <string, Garden> pair in GardenData.LoadedData.Gardens)
        {
            string key    = pair.Key;
            Garden garden = pair.Value;

            GardenDrawingArea gda = new GardenDrawingArea(garden, ZoomButton);

            GardenBedBook.AppendPage(gda, new Label(garden.Name));

            //set first instance in the list to active instance
            if (GardenDrawingArea.ActiveInstance == null)
            {
                GardenDrawingArea.ActiveInstance = gda;
            }
        }
        Child.ShowAll();
        //Build();

        GardenBedBook.SwitchPage += (object o, SwitchPageArgs args) =>
        {
            try
            {
                if (GardenBedBook.GetNthPage(checked ((int)args.PageNum)) is GardenDrawingArea drawingArea)
                {
                    GardenDrawingArea.ActiveInstance = drawingArea;
                    SelectGardenEntry(drawingArea.Garden);
                }
                ;
            }
            catch (System.OverflowException)
            {
                System.Console.WriteLine("Too many garden bed book pages");
            }
        };
    }
예제 #15
0
        void CreateControl()
        {
            control = new HPaned();

            store = new Gtk.TreeStore(typeof(Xwt.Drawing.Image),               // image - type
                                      typeof(bool),                            // read?
                                      typeof(TaskListEntry),                   // read? -- use Pango weight
                                      typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Type", "store__Read", "store__Task", "store__Description");

            TypeDescriptor.AddAttributes(store, modelAttr);

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTasks);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            sort = new TreeModelSort(filter);
            sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort);
            sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort);
            sort.SetSortFunc(VisibleColumns.File, FileIterSort);
            sort.SetSortFunc(VisibleColumns.Category, CategoryIterSort);

            view = new PadTreeView(sort);
            view.Selection.Mode = SelectionMode.Multiple;
            view.ShowExpanders  = true;
            view.RulesHint      = true;

            view.DoPopupMenu += ShowPopup;

            AddColumns();
            LoadColumnsVisibility();
            view.Columns [VisibleColumns.Type].SortColumnId     = VisibleColumns.Type;
            view.Columns [VisibleColumns.Project].SortColumnId  = VisibleColumns.Project;
            view.Columns [VisibleColumns.File].SortColumnId     = VisibleColumns.File;
            view.Columns [VisibleColumns.Category].SortColumnId = VisibleColumns.Category;

            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);
            TaskService.Errors.TasksRemoved += ShowResults;
            TaskService.Errors.TasksAdded   += TaskAdded;
            TaskService.Errors.TasksChanged += TaskChanged;
            TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;

            IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
            IdeApp.Workspace.LastWorkspaceItemClosed  += OnCombineClosed;

            view.RowActivated += OnRowActivated;

            iconWarning = ImageService.GetIcon(Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
            iconError   = ImageService.GetIcon(Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
            iconInfo    = ImageService.GetIcon(Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
            iconEmpty   = ImageService.GetIcon(Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);

            control.Add1(sw);

            logView = new LogView {
                Name = "buildOutput"
            };
            control.Add2(logView);

            control.ShowAll();

            control.SizeAllocated += HandleControlSizeAllocated;
            sw.SizeAllocated      += HandleSwSizeAllocated;

            logView.Visible = OutputViewVisible;
            logBtn.Active   = OutputViewVisible;

            // Load existing tasks
            foreach (TaskListEntry t in TaskService.Errors)
            {
                AddTask(t);
            }

            control.FocusChain = new Gtk.Widget [] { logView };
        }
예제 #16
0
        internal Client(bool loadFiles)
        {
            app_count++;

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

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

            iconview_sw.AddWithViewport(IconView);

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

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

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

            var zoom_slider = new ZoomSlider(this);

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

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

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

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

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

            var vbox = new VBox();

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

            var hbox = new HPaned();

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

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

            Window.ShowAll();

            if (loadFiles)
            {
                RunIdle(LoadFiles);
                Application.Run();
            }
        }
            public ChessGameWidget(GameViewerUI viewer)
                : base()
            {
                gameView = new ChessGameView ();
                gamesListWidget =
                    new
                    SearchableGamesListWidget (viewer);

                gameView.ShowNthMove += OnShowNthMoveEvent;

                boardWidget = new ChessGameBoard ();
                book = new Notebook ();

                splitPane = new HPaned ();

                splitPane.Add1 (boardWidget);
                splitPane.Add2 (GetRightPane ());

                PackStart (splitPane, true, true, 2);

                BoardWidget.Board.highLightMove =
                    App.Session.HighLightMove;

                int pos = App.Session.ViewerSplitPanePosition;
                int height = App.Session.ViewerHeight;
                if (pos > height)
                    pos = height / 2;
                splitPane.Position = pos;

                gamesListWidget.View.GameSelectionEvent +=
                    OnGameSelectionEvent;
                viewer.GamesLoadedEvent += OnGamesLoaded;

                ShowAll ();
            }
예제 #18
0
        //Gtk.Action actOpen = new Gtk.Action("Open", "Open", "Open file", Stock.Open);

        public MainWindow() : base("TikzEdt ")
        {
            (GlobalUI.UI as GlobalUIGTK).MainForm  = this;
            ScintillaDocumentWrapper.TheOneAndOnly = txtCode;
            TheVM = new MainWindowVM <ScintillaDocumentWrapper>(TheCompiler.Instance);

            rasterControl1            = rasterControl1Box.RasterControl;
            rasterControl1.Rasterizer = rasterControl1.TheRasterModel;

            txtStatus.Buffer.TagTable.Add(new TextTag("red")
            {
                Foreground = "red"
            });
            //txtCode.LexerLanguage = "html";
            txtCode.Lexer = 4; // html

            Resize(800, 600);
            Destroyed   += (s, e) => Application.Quit();
            myLabel.Text = "Hello World!!!!";

            CreateMenus();
            CreateToolBars();

            VBox vb = new VBox(false, 0);

            vb.PackStart(mainMenu, false, false, 0);
            vb.PackStart(mainToolbar, false, false, 0);
            vb.PackStart(toolsToolbar, false, false, 0);

            HBox hb = new HBox(false, 0);

            hb.PackStart(toolsPaneBar, false, false, 0);

            ScrolledWindow scrw = txtStatusWnd = new ScrolledWindow();

            scrw.Add(txtStatus);
            statusTabPanel.AppendPage(scrw, new Label("Status"));

            statusTabPanel.AppendPage(lstErrors, new Label("Errors"));
            scrw = new ScrolledWindow();
            scrw.Add(txtTexOut);
            statusTabPanel.AppendPage(scrw, new Label("TeX Output"));

            //txtCode.SetText("This is Scintilla");

            vSplitter1.Add1(txtCode);
            vSplitter1.Add2(statusTabPanel);
            vSplitter1.Position = 400;

            hSplitter1.Add1(vSplitter1);
            var sw = new ScrolledWindow();

            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            //sw.Placement = CornerType.
            //Alignment a = new Alignment(0.5f,0.5f,0,0);
            //var vv = new Table(1,1,false);
            //vv.Attach(rasterControl1, 0, 0, 1,1,AttachOptions.Expand, AttachOptions.Expand, 0,0);

            /*var vv = new VBox();
             * var vh = new HBox();
             * vv.PackStart(rasterControl1, true, false, 0);
             * vh.PackStart(vv, true, false, 0);*/
            Alignment al = new Alignment(.5f, .5f, 0, 0);

            al.Add(rasterControl1Box);
            sw.Add(al);
            hSplitter1.Add2(sw);
            hSplitter1.Position = 350;

            hSplitter2.Add1(new TextView());
            hSplitter2.Add2(hSplitter1);
            hSplitter2.Position = 150;
            hb.PackStart(hSplitter2, true, true, 0);

            vb.PackStart(hb, true, true, 0);


            statusBar.PackStart(new Alignment(.5f, .5f, 1, 1), true, true, 0);
            statusBar.PackStart(lblStandAlone, false, false, 0);
            statusBar.PackStart(new Label("Grid"), false, false, 0);
            statusBar.PackStart(cmbGrid, false, false, 0);
            statusBar.PackStart(new Label("RS"), false, false, 0);
            statusBar.PackStart(txtRadialSteps, false, false, 0);
            statusBar.PackStart(new Label("RO"), false, false, 0);
            statusBar.PackStart(txtRadialOffset, false, false, 0);
            //statusBar.PackStart(new Separator(), false, false, 0);
            Button b = new Button(Stock.ZoomOut);

            //b.Label = "";
            statusBar.PackStart(b);
            statusBar.PackStart(scZoom);
            statusBar.PackStart(new Button(Stock.ZoomIn));
            vb.PackEnd(statusBar, false, false, 0);

            Add(vb);

            SetupBindings();

            ShowAll();
        }
예제 #19
0
        static void Main()
        {
                        #if TRACE
            System.Diagnostics.TextWriterTraceListener listener
                = new System.Diagnostics.TextWriterTraceListener(System.Console.Out);
            System.Diagnostics.Trace.Listeners.Add(listener);
                        #endif

            Application.Init();

            #region Packing and layout

            Window window = new Window("AspNetEdit Host Sample");
            window.SetDefaultSize(1000, 700);
            window.DeleteEvent += new DeleteEventHandler(window_DeleteEvent);

            VBox outerBox = new VBox();
            window.Add(outerBox);

            HPaned leftBox = new HPaned();
            outerBox.PackEnd(leftBox, true, true, 0);
            HPaned rightBox = new HPaned();
            leftBox.Add2(rightBox);

            geckoFrame        = new Frame();
            geckoFrame.Shadow = ShadowType.In;
            rightBox.Pack1(geckoFrame, true, false);

            #endregion

            #region Toolbar

            // * Save/Open

            Toolbar buttons = new Toolbar();
            outerBox.PackStart(buttons, false, false, 0);

            ToolButton saveButton = new ToolButton(Stock.Save);
            buttons.Add(saveButton);
            saveButton.Clicked += new EventHandler(saveButton_Clicked);

            ToolButton openButton = new ToolButton(Stock.Open);
            buttons.Add(openButton);
            openButton.Clicked += new EventHandler(openButton_Clicked);

            buttons.Add(new SeparatorToolItem());

            // * Clipboard

            ToolButton undoButton = new ToolButton(Stock.Undo);
            buttons.Add(undoButton);
            undoButton.Clicked += new EventHandler(undoButton_Clicked);

            ToolButton redoButton = new ToolButton(Stock.Redo);
            buttons.Add(redoButton);
            redoButton.Clicked += new EventHandler(redoButton_Clicked);

            ToolButton cutButton = new ToolButton(Stock.Cut);
            buttons.Add(cutButton);
            cutButton.Clicked += new EventHandler(cutButton_Clicked);

            ToolButton copyButton = new ToolButton(Stock.Copy);
            buttons.Add(copyButton);
            copyButton.Clicked += new EventHandler(copyButton_Clicked);

            ToolButton pasteButton = new ToolButton(Stock.Paste);
            buttons.Add(pasteButton);
            pasteButton.Clicked += new EventHandler(pasteButton_Clicked);

            buttons.Add(new SeparatorToolItem());

            // * Text style

            ToolButton boldButton = new ToolButton(Stock.Bold);
            buttons.Add(boldButton);
            boldButton.Clicked += new EventHandler(boldButton_Clicked);

            ToolButton italicButton = new ToolButton(Stock.Italic);
            buttons.Add(italicButton);
            italicButton.Clicked += new EventHandler(italicButton_Clicked);

            ToolButton underlineButton = new ToolButton(Stock.Underline);
            buttons.Add(underlineButton);
            underlineButton.Clicked += new EventHandler(underlineButton_Clicked);

            ToolButton indentButton = new ToolButton(Stock.Indent);
            buttons.Add(indentButton);
            indentButton.Clicked += new EventHandler(indentButton_Clicked);

            ToolButton unindentButton = new ToolButton(Stock.Unindent);
            buttons.Add(unindentButton);
            unindentButton.Clicked += new EventHandler(unindentButton_Clicked);

            buttons.Add(new SeparatorToolItem());

            // * Toolbox

            ToolButton toolboxAddButton = new ToolButton(Stock.Add);
            buttons.Add(toolboxAddButton);
            toolboxAddButton.Clicked += new EventHandler(toolboxAddButton_Clicked);

            #endregion

            #region Designer services and host

            //set up the services
            ServiceContainer services = new ServiceContainer();
            services.AddService(typeof(INameCreationService), new NameCreationService());
            services.AddService(typeof(ISelectionService), new SelectionService());
            services.AddService(typeof(IEventBindingService), new EventBindingService(window));
            services.AddService(typeof(ITypeResolutionService), new TypeResolutionService());
            ExtenderListService extListServ = new AspNetEdit.Editor.ComponentModel.ExtenderListService();
            services.AddService(typeof(IExtenderListService), extListServ);
            services.AddService(typeof(IExtenderProviderService), extListServ);
            services.AddService(typeof(ITypeDescriptorFilterService), new TypeDescriptorFilterService());
            toolboxService = new ToolboxService();
            services.AddService(typeof(IToolboxService), toolboxService);

            //create our host
            host = new DesignerHost(services);
            host.NewFile();
            host.Activate();

            #endregion

            #region Designer UI and panels

            IRootDesigner    rootDesigner = (IRootDesigner)host.GetDesigner(host.RootComponent);
            RootDesignerView designerView = (RootDesignerView)rootDesigner.GetView(ViewTechnology.Passthrough);
            geckoFrame.Add(designerView);

            PropertyGrid p = new PropertyGrid(services);
            p.WidthRequest = 200;
            rightBox.Pack2(p, false, false);

            Toolbox toolbox = new Toolbox(services);
            leftBox.Pack1(toolbox, false, false);
            toolboxService.PopulateFromAssembly(System.Reflection.Assembly.GetAssembly(typeof(System.Web.UI.Control)));
            toolboxService.AddToolboxItem(new TextToolboxItem("<table><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>", "Table"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<div style=\"width: 100px; height: 100px;\"></div>", "Div"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<hr />", "Horizontal Rule"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<select><option></option></select>", "Select"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<img src=\"\" />", "Image"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<textarea cols=\"20\" rows=\"2\"></textarea>", "Textarea"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"hidden\" />", "Input [Hidden]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"radio\" />", "Input [Radio]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"checkbox\" />", "Input [Checkbox]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"password\" />", "Input [Password]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"file\" />", "Input [File]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"text\" />", "Input [Text]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"submit\" value=\"submit\" />", "Input [Submit]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"reset\" value=\"reset\" />", "Input [Reset]"), "Html");
            toolboxService.AddToolboxItem(new TextToolboxItem("<input type=\"button\" value=\"button\" />", "Input [Button]"), "Html");
            toolbox.Refresh();

            #endregion

            window.ShowAll();
            Application.Run();
        }
            public ICSGameObserverWidget(ICSClient
						      client)
                : base()
            {
                split = new HPaned ();
                this.client = client;
                currentGames = new Hashtable ();
                gamesBook = new Notebook ();
                gamesBook.ShowTabs = false;

                gamesList = new TreeView ();
                gamesStore =
                    new ListStore (typeof (string),
                               typeof (string));
                gamesList.Model = gamesStore;
                gamesList.AppendColumn ("Games",
                            new
                            CellRendererText (),
                            "markup", 0);
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy =
                    scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                scroll.Add (gamesList);

                gamesList.CursorChanged +=
                    OnGamesListCursorChanged;
                split.Add1 (scroll);
                split.Add2 (gamesBook);

                split.ShowAll ();
                PackStart (split, true, true, 2);
                client.GameMessageEvent += OnGameMessage;
            }
예제 #21
0
        ///<summary>
        ///	InitWindow
        /// Sets up the widgets and events in the chat window
        ///</summary>
        void InitWindow()
        {
            hasBeenShown    = false;
            everShown       = false;
            shiftKeyPressed = false;
            notifyUser      = false;

            // Update the window title
            Title = string.Format("Chat with {0}", peerPerson.DisplayName);
            Icon  = Utilities.GetIcon("banter-22", 22);

            this.DefaultSize = new Gdk.Size(400, 700);

            hpaned          = new HPaned();
            hpaned.CanFocus = true;
            hpaned.Position = 300;
            hpaned.Show();

            this.Add(hpaned);

            leftPaneVBox           = new VBox();
            leftPaneVBox.NoShowAll = true;
            leftPaneVBox.Visible   = false;
            hpaned.Add1(leftPaneVBox);

            rightPaneVBox             = new VBox();
            rightPaneVBox.BorderWidth = 8;
            rightPaneVBox.Show();
            hpaned.Add2(rightPaneVBox);

            personControlVBox = new VBox(false, 4);
            personControlVBox.Show();
            rightPaneVBox.PackStart(personControlVBox, false, false, 0);

            PersonCard card = new PersonCard(peerPerson);

            card.Size = PersonCardSize.Medium;
            // Not sure why but we need to call ShowAll on the PersonCard for it to display
            card.ShowAll();
            card.ShowTextChatButton = false;
            personControlVBox.PackStart(card, true, true, 0);

            HBox hbox = new HBox(false, 0);

            hbox.Show();
            personControlVBox.PackStart(hbox, false, false, 0);

            //showPersonDetailsButton = new Button ();
            //showPersonDetailsButton.CanFocus = true;
            //showPersonDetailsButton.Label = Catalog.GetString ("Show Contact _Details");
            //showPersonDetailsButton.UseUnderline = true;
            //showPersonDetailsButton.Image = new Image (Stock.GoBack, IconSize.Menu);
            //showPersonDetailsButton.Show ();
            //hbox.PackStart (showPersonDetailsButton);

            videoVBox = new VBox(false, 0);
            if (this.chatType == ChatType.Video)
            {
                ShowVideoControl(true);
            }
            else
            {
                videoVBox.Visible = false;
            }

            rightPaneVBox.PackStart(videoVBox, false, true, 0);

            audioVBox = new VBox(false, 0);

            if (this.chatType == ChatType.Audio)
            {
                ShowAudioControl(true);
            }
            else
            {
                audioVBox.Visible = false;
            }

            rightPaneVBox.PackStart(audioVBox, false, false, 0);

            messagesVPaned          = new VPaned();
            messagesVPaned.CanFocus = true;
            // This is lame, fix the way this is all calculated
            if (videoView != null)
            {
                messagesVPaned.Position = 100;
            }
            else
            {
                messagesVPaned.Position = 700;
            }
            messagesVPaned.Show();
            rightPaneVBox.PackStart(messagesVPaned, true, true, 0);

            Gtk.ScrolledWindow sw = new ScrolledWindow();
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.HscrollbarPolicy = PolicyType.Never;
            //scrolledWindow.ShadowType = ShadowType.None;
            sw.BorderWidth = 0;
            sw.CanFocus    = true;
            sw.Show();

            messagesView = new MessagesView();
            messagesView.Show();
            sw.Add(messagesView);
            messagesVPaned.Pack1(sw, true, true);

            typingVBox = new VBox(false, 0);
            typingVBox.Show();
            messagesVPaned.Pack2(typingVBox, false, false);

            typingToolbar              = new Toolbar();
            typingToolbar.ShowArrow    = false;
            typingToolbar.ToolbarStyle = ToolbarStyle.Icons;
            typingToolbar.IconSize     = IconSize.SmallToolbar;
            typingToolbar.Show();
            typingVBox.PackStart(typingToolbar, false, false, 0);

            typingScrolledWindow = new ScrolledWindow();
            typingScrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            typingScrolledWindow.HscrollbarPolicy = PolicyType.Automatic;
            typingScrolledWindow.ShadowType       = ShadowType.EtchedIn;
            typingScrolledWindow.CanFocus         = true;
            typingScrolledWindow.Show();
            typingVBox.PackStart(typingScrolledWindow, true, true, 0);

            typingTextView                  = new TextView();
            typingTextView.CanFocus         = true;
            typingTextView.WrapMode         = WrapMode.Word;
            typingTextView.LeftMargin       = 4;
            typingTextView.RightMargin      = 4;
            typingTextView.KeyPressEvent   += OnTypingTextViewKeyPressEvent;
            typingTextView.KeyReleaseEvent += OnTypingTextViewKeyReleaseEvent;
            typingTextView.Show();
            typingScrolledWindow.Add(typingTextView);
            spell_check        = new SpellCheck(typingTextView, "en-us");
            Shown             += OnWindowShown;
            DeleteEvent       += WindowDeleted;
            this.FocusInEvent += FocusInEventHandler;
        }
            public ChessGameWidget()
                : base()
            {
                gameView = new ChessGameView ();
                gameView.ShowNthMove += OnShowNthMoveEvent;

                boardWidget = new ChessGameBoard ();

                splitPane = new HPaned ();

                splitPane.Add1 (boardWidget);
                splitPane.Add2 (GetRightPane ());

                PackStart (splitPane, true, true, 2);

                ShowAll ();
            }