Beispiel #1
0
    /// <summary>
    /// Creates the GUI interface.
    /// </summary>
    private void CreateGui()
    {
        // Create a window
        SetDefaultSize(1000, 800);
        DeleteEvent += OnWindowDelete;

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

        Add(box);

        // Add the menu
        box.PackStart(CreateGuiMenu(), false, false, 0);

        // Create a notebook
        box.PackStart(demoSprites, true, true, 0);

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

        // Show everything as the final
        ShowAll();
    }
        /// <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;

            // Hook up the accelerator group.
            accelerators = new AccelGroup();
            AddAccelGroup(accelerators);

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

            Add(box);

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

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

            // Create the editor widget.
            Widget editorWidget = CreateEditorWidget();

            // Back everything into place.
            box.PackStart(CreateGuiMenu(), false, false, 0);
            box.PackStart(editorWidget, true, true, 0);
            box.PackStart(statusbar, false, false, 0);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        public void CreateStatusBar(Statusbar statusbar)
        {
            // Document zoom widget
            View.CreateStatusBar(statusbar);

            // Selection size widget
            var SelectionSize = new ToolBarLabel("  0, 0");

            statusbar.AppendItem(SelectionSize);
            statusbar.AppendItem(new ToolBarImage(Resources.Icons.ToolSelectRectangle));

            PintaCore.Workspace.SelectionChanged += delegate {
                var bounds = PintaCore.Workspace.HasOpenDocuments ? PintaCore.Workspace.ActiveDocument.Selection.GetBounds() : new Cairo.Rectangle();
                SelectionSize.Text = string.Format("  {0}, {1}", bounds.Width, bounds.Height);
            };

            statusbar.AppendItem(new SeparatorToolItem {
                Margin = 6
            }, 6);

            // Cursor position widget
            var cursor = new ToolBarLabel("  0, 0");

            statusbar.AppendItem(cursor);
            statusbar.AppendItem(new ToolBarImage(Resources.Icons.CursorPosition));

            PintaCore.Chrome.LastCanvasCursorPointChanged += delegate {
                var pt = PintaCore.Chrome.LastCanvasCursorPoint;
                cursor.Text = string.Format("  {0}, {1}", pt.X, pt.Y);
            };
        }
Beispiel #5
0
        private void build()
        {
            this.vbox1 = new VBox();

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

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

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

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

            this.DeleteEvent += HandleDeleteEvent;
        }
Beispiel #6
0
        protected void build()
        {
            this.SetDefaultSize(1000, 600);
            this.Title        = "Battle";
            this.DeleteEvent += HandleDeleteEvent;

            this.vbox = new VBox();

            this.tbar = new Toolbar();
            this.tbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            this.about             = new ToolButton(Stock.About);
            this.about.IsImportant = false;
            this.about.Label       = "About";
            this.about.TooltipText = "About this application";
            this.tbar.Add(this.about);

            this.hpaned = new HPaned();
            this.frame  = new Frame("Battle Map");
            this.map    = new MapControl();
            this.frame.Add(this.map);
            Label a = new Label("Welcome");

            this.hpaned.Pack1(a, false, false);
            this.hpaned.Pack2(this.frame, true, true);

            this.sbar = new Statusbar();

            this.vbox.PackStart(this.tbar, false, true, 0);
            this.vbox.PackStart(this.hpaned, true, true, 0);
            this.vbox.PackEnd(this.sbar, false, true, 0);


            this.Add(this.vbox);
        }
        public DemoApplicationWindow() : base("Application Window")
        {
            SetDefaultSize(200, 200);

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

            AddActions();

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

            ScrolledWindow sw = new ScrolledWindow();

            sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw.ShadowType = ShadowType.In;
            vbox.PackEnd(sw, true, true, 0);

            TextView textview = new TextView();

            textview.Buffer.MarkSet += new MarkSetHandler(MarkSet);
            sw.Add(textview);

            textview.GrabFocus();

            ShowAll();
        }
Beispiel #8
0
        public MainWindow()
            : base(WindowType.Toplevel)
        {
            Console.WriteLine("MainWindow...");
            this.Title = "GefGlue Demo (Gtk#)";
            this.SetSizeRequest(800, 600);

            var vBox = new VBox();

            vBox.Visible     = true;
            vBox.Homogeneous = false;

            var hBox = new HBox();

            hBox.Visible = true;

            var backButton = new Button();

            backButton.Visible = true;
            backButton.Label   = "Back";

            var forwardButton = new Button();

            forwardButton.Visible = true;
            forwardButton.Label   = "Forward";

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

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

            var statusBar = new Statusbar();

            statusBar.Visible = true;

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

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

            vw1.Expand = false;
            vw1.Fill   = false;

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

            vw3.Expand = false;
            vw3.Fill   = false;

            //Show Everything
            Console.WriteLine("ShowAll()...");
            // this.ShowAll();
            Console.WriteLine("ShowAll()... done");
        }
Beispiel #9
0
        internal void ReportNuGetSourceProcessingProgress(uint prog, string path, string name)
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var resName = string.Format("ProcessingNugetSource_0_As_1_{0}_MessageFormat", m_mwProc);
            var msg     = string.Format(PrigResources.GetString(resName), path, name);

            Statusbar.ReportProgress(msg, prog);
        }
Beispiel #10
0
        internal void ReportEnvironmentVariableProcessingProgress(uint prog, string name, string value)
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var resName = string.Format("ProcessingEnvironmentVariable_0_As_1_{0}_MessageFormat", m_mwProc);
            var msg     = string.Format(PrigResources.GetString(resName), value, name);

            Statusbar.ReportProgress(msg, prog);
        }
Beispiel #11
0
 virtual protected void Awake()
 {
     health = maxHealth;
     if (healthBar == null)
     {
         healthBar = GetComponentInChildren <Statusbar>();
     }
 }
Beispiel #12
0
        internal void ReportEnvironmentVariableProcessedProgress(uint prog)
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var resName = string.Format("ProcessedEnvironmentVariable_{0}_Message", m_mwProc);
            var msg     = PrigResources.GetString(resName);

            Statusbar.ReportProgress(msg, prog);
        }
Beispiel #13
0
        internal void ReportProfilerProcessingProgress(uint prog, ProfilerLocation profLoc)
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var resName = string.Format("ProcessingProfiler_0_ToRegistry_{0}_MessageFormat", m_mwProc);
            var msg     = string.Format(PrigResources.GetString(resName), profLoc.PathOfInstalling);

            Statusbar.ReportProgress(msg, prog);
        }
Beispiel #14
0
        internal void ReportPrigSourceProcessingProgress(uint prog, string pkgName, string src)
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var resName = string.Format("ProcessingDefaultSource_0_AsPackage_1_{0}_MessageFormat", m_mwProc);
            var msg     = string.Format(PrigResources.GetString(resName), src, pkgName);

            Statusbar.ReportProgress(msg, prog);
        }
Beispiel #15
0
        internal void ReportProcessingProjectWideProcessProgress(uint prog, string include)
        {
            Debug.Assert(m_pwProc != ProjectWideProcesses.None);
            var resName = string.Format("ProcessingProjectWideProcess_0_{0}_MessageFormat", m_pwProc);
            var msg     = string.Format(PrigResources.GetString(resName), include);

            Statusbar.ReportProgress(msg, prog);
        }
Beispiel #16
0
 public MainWindow(Server s) : base(Gtk.WindowType.Toplevel)
 {
     //Nastavení referencí
     this.server = s;
     Build();
     this.statbar = this.statusbar;
     buildNodeView();
 }
Beispiel #17
0
 public void CreateStatusBar(Statusbar statusbar)
 {
     statusbar.AppendItem(ZoomIn.CreateToolBarItem());
     statusbar.AppendItem(ZoomComboBox);
     statusbar.AppendItem(ZoomOut.CreateToolBarItem());
     statusbar.AppendItem(new SeparatorToolItem {
         Margin = 6
     }, 6);
 }
Beispiel #18
0
        internal void EndSkippedProjectWideProcessProgress(SkippedReasons reason, string include)
        {
            Debug.Assert(m_pwProc != ProjectWideProcesses.None);
            var msg = GetSkippedProjectWideProcessMessage(m_pwProc, reason, include);

            Statusbar.EndProgress();
            Statusbar.Text.Value = msg;
            m_pwProc             = ProjectWideProcesses.None;
        }
Beispiel #19
0
        internal void EndCompletedProjectWideProcessProgress(string include)
        {
            Debug.Assert(m_pwProc != ProjectWideProcesses.None);
            var msg = GetCompletedProjectWideProcessMessage(m_pwProc, include);

            Statusbar.EndProgress();
            Statusbar.Text.Value = msg;
            m_pwProc             = ProjectWideProcesses.None;
        }
Beispiel #20
0
        internal void EndCompletedMachineWideProcessProgress()
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var msg = GetCompletedMachineWideProcessMessage(m_mwProc);

            Statusbar.EndProgress();
            Statusbar.Text.Value = msg;
            m_mwProc             = MachineWideProcesses.None;
        }
Beispiel #21
0
        internal void EndSkippedMachineWideProcessProgress(SkippedReasons reason)
        {
            Debug.Assert(m_mwProc != MachineWideProcesses.None);
            var msg = GetSkippedMachineWideProcessMessage(m_mwProc, reason);

            Statusbar.EndProgress();
            Statusbar.Text.Value = msg;
            m_mwProc             = MachineWideProcesses.None;
        }
Beispiel #22
0
        public Schematic(Statusbar status) : base()
        {
            this.status = status;

            // FIXME hardcoded working space size
            SetSizeRequest(2048, 2048);

            Events |= Gdk.EventMask.PointerMotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask
                      | Gdk.EventMask.LeaveNotifyMask;
        }
Beispiel #23
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;
        }
Beispiel #24
0
 protected void RefreshMsg(string msg, bool IsEnd)
 {
     this.lblMsg.Text = msg;
     if ((this.lblMsg.Text == "") || IsEnd)
     {
         this.progBar.Value        = 0;
         this.progBar.ProgressType = eProgressItemType.Standard;
     }
     else
     {
         this.progBar.Value        = 50;
         this.progBar.ProgressType = eProgressItemType.Marquee;
     }
     Statusbar.Refresh();
 }
Beispiel #25
0
 protected void RefreshMsg(string msg, bool IsEnd)
 {
     lblMsg.Text = msg;
     if ((lblMsg.Text == "") || IsEnd)
     {
         progBar.Value = 0;
         progBar.Style = ProgressBarStyle.Blocks;
     }
     else
     {
         progBar.Value = 50;
         progBar.Style = ProgressBarStyle.Marquee;
     }
     Statusbar.Refresh();
 }
Beispiel #26
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;
    }
Beispiel #27
0
        public MainWindow() : base(WindowType.Toplevel)
        {
            // Setup GUI
            WindowPosition = WindowPosition.Center;
            DefaultSize    = new Gdk.Size(600, 300);

            var provider = new CssProvider();

            provider.LoadFromData(".blue-background { background-image: none; background-color: rgb(240, 248, 255); }");
            Gtk.StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, 1);


            _sikInterface = new SiKInterface();

            _headerBar = new HeaderBar();
            _headerBar.ShowCloseButton = true;
            _headerBar.Title           = "SiK Radio Configurator";

            _boardIdentifiers  = new BoardIdentifierControls();
            _dataTableControls = new DataTableControls();
            _sikInterface.SiKConfig.PropertyChanged += _boardIdentifiers.SiKConfig_PropertyChanged;
            _dataTableControls.CreateBindings(_sikInterface.SiKConfig);

            _pageLabel = new Label(NOT_CONN_LBL);

            Titlebar   = _headerBar;
            Destroyed += (sender, e) => Application.Quit();

            _notebook      = new Notebook();
            _pageContainer = new Box(Orientation.Vertical, 1);
            _notebook.AppendPage(_pageContainer, _pageLabel);
            _notebook.AppendPage(new Box(Orientation.Vertical, 5), new Label("TBD"));

            Add(_notebook);

            CreatePortSelLine();
            CreateDataTable();
            CreateBoardIdLine();
            CreateButtonsLine();

            // TODO: Fix Statusbar at the bottom
            _statusBar = new Statusbar();
            _pageContainer.Add(_statusBar);
            _cxt = _statusBar.GetContextId("Main page");

            ShowAll();
        }
Beispiel #28
0
        public static int Main(string[] args)
        {
            Application.Init();
            Window win = new Window("Action Demo");

            win.DefaultSize  = new Gdk.Size(200, 150);
            win.DeleteEvent += new DeleteEventHandler(OnWindowDelete);

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

            group = new ActionGroup("TestActions");
            group.Add(entries);
            group.Add(toggleEntries);
            group.Add(radioEntries, (int)Justify.Left, new ChangedHandler(OnRadio));
            group.Add(toolbarEntries, (int)ToolbarStyle.BothHoriz, new ChangedHandler(OnToolbarStyle));

            uim               = new UIManager();
            uim.AddWidget    += new AddWidgetHandler(OnWidgetAdd);
            uim.ConnectProxy += new ConnectProxyHandler(OnProxyConnect);
            uim.InsertActionGroup(group, 0);
            uim.AddUiFromString(ui_info);

            statusbar = new Statusbar();
            box.PackEnd(statusbar, false, true, 0);

            VBox   vbox   = new VBox(false, 5);
            Button button = new Button("Blah");

            vbox.PackEnd(button, true, true, 0);
            HBox hbox = new HBox(false, 5);

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

            win.ShowAll();
            Application.Run();
            return(0);
        }
        public void UIUpdate(GameData gameData, Preferences preferences)
        {
            SetLocations(GameManager.Instance.CurrentReachableLocations);
            SetMainContent(GameManager.Instance.MainContent);
            SetOptions(GameManager.Instance.CurrentOptions);

            NPCs.Children.Clear();
            foreach (NPC npc in GameManager.Instance.GameData.NpcsPresent)
            {
                NPCButton npcButton = new NPCButton(npc);
                npcButton.Width = 200;
                NPCs.Children.Add(npcButton);
            }

            //Statusbar.StatusTime.Content = gameData.WorldData.DateTime.ToString("F", preferences.CultureInfo);
            Statusbar.Update(gameData, preferences);
        }
Beispiel #30
0
 private void CreateStatusBar()
 {
     this.m_statusBar = new Statusbar();
     this.m_statusBar.Push(1, "Idle");
     this.m_progress = new ProgressBar();
     this.m_statusBar.Add(this.m_progress);
     ApplicationContext.ProgressChanged += (o, e) => {
         Application.Invoke((o1, e1) => {
             this.m_statusBar.Pop(1);
             if (!String.IsNullOrEmpty(e.ProgressText))
             {
                 this.m_statusBar.Push(1, e.ProgressText);
             }
             this.m_progress.Fraction = (double)e.Progress;
         });
     };
 }
            public GameViewerUI()
                : base()
            {
                menubar = new ViewerMenuBar ();
                // this will be enabled as and when
                menubar.moveCommentMenuItem.Sensitive = false;
                chessGameWidget = new ChessGameWidget (this);

                PackStart (chessGameWidget, true, true, 2);
                statusBar = new Statusbar ();
                progressBar = new ProgressBar ();
                progressBar.Stop ();
                HBox box = new HBox ();
                box.PackStart (progressBar, false, false, 2);
                box.PackStart (statusBar, true, true, 2);
                PackStart (box, false, true, 2);
            }