Beispiel #1
0
        public FindInBrowserForm()
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.BrowserFind.glade");

            window1         = (Window)builder.GetObject("window1");
            chkMatchCase    = (CheckButton)builder.GetObject("chkMatchCase");
            chkHighlightAll = (CheckButton)builder.GetObject("chkHighlightAll");
            txtLookFor      = (Entry)builder.GetObject("txtLookFor");
            btnCancel       = (Button)builder.GetObject("btnCancel");
            btnFindPrevious = (Button)builder.GetObject("btnFindPrevious");
            btnFindNext     = (Button)builder.GetObject("btnFindNext");

            txtLookFor.Changed       += TxtLookFor_Changed;
            btnFindNext.Clicked      += BtnFindNext_Click;
            btnFindPrevious.Clicked  += BtnFindPrevious_Click;
            btnCancel.Clicked        += BtnCancel_Click;
            chkHighlightAll.Clicked  += ChkHighlightAll_Click;
            chkHighlightAll.Visible   = false;           // Hide this for now...
            chkHighlightAll.NoShowAll = true;
            window1.DeleteEvent      += Window1_DeleteEvent;
            window1.Destroyed        += Window1_Destroyed;
            AccelGroup agr = new AccelGroup();

            btnCancel.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.Escape, Gdk.ModifierType.None, AccelFlags.Visible));
            window1.AddAccelGroup(agr);
        }
Beispiel #2
0
        public BansheeDialog(string title, Window parent) : base()
        {
            Title        = title;
            BorderWidth  = 5;
            Visible      = false;
            HasSeparator = false;

            if (parent == null)
            {
                GtkElementsService service = ServiceManager.Get <GtkElementsService> ();
                if (service != null)
                {
                    TransientFor = service.PrimaryWindow;
                }
            }
            else
            {
                TransientFor = parent;
            }

            WindowPosition    = WindowPosition.CenterOnParent;
            DestroyWithParent = true;

            accel_group = new AccelGroup();
            AddAccelGroup(accel_group);
        }
Beispiel #3
0
        public App(Settings set, DebugManager mgr, string argsOverride)
        {
            settings  = set;
            debugPane = new DebugPane(set, mgr);

            AccelGroup agr = new AccelGroup();

            menu = new AppMenu(mgr, agr, set, mainWin, debugPane,
                               argsOverride);
            toolbar = new AppToolbar(mgr, debugPane);

            VBox vb = new VBox(false, 3);

            mainWin.Resize(settings.WindowWidth, settings.WindowHeight);
            mainWin.DeleteEvent += (obj, evt) => Application.Quit();
            mainWin.AddAccelGroup(agr);

            vb.PackStart(menu.View, false, false, 0);
            vb.PackStart(toolbar.View, false, false, 0);
            vb.PackEnd(debugPane.View, true, true, 0);
            mainWin.Add(vb);

            mainWin.DeleteEvent += OnDeleteEvent;
            mainWin.ShowAll();
        }
Beispiel #4
0
        /// <summary>Populate the main menu tool strip.</summary>
        /// <param name="menuDescriptions">Descriptions for each item.</param>
        public void Populate(List <MenuDescriptionArgs> menuDescriptions)
        {
            accelerators = new AccelGroup();
            foreach (Widget child in toolStrip.Children)
            {
                toolStrip.Remove(child);
                child.Dispose();
            }
            foreach (MenuDescriptionArgs description in menuDescriptions)
            {
                Gtk.Image            image  = null;
                Gdk.Pixbuf           pixbuf = null;
                ManifestResourceInfo info   = Assembly.GetExecutingAssembly().GetManifestResourceInfo(description.ResourceNameForImage);

                if (info != null)
                {
                    pixbuf = new Gdk.Pixbuf(null, description.ResourceNameForImage, 20, 20);
                    image  = new Gtk.Image(pixbuf);
                }
                ToolItem item = new ToolItem();
                item.Expand = true;

                if (description.OnClick == null)
                {
                    Label toolbarlabel = new Label();
                    if (description.RightAligned)
                    {
                        toolbarlabel.Xalign = 1.0F;
                    }
                    toolbarlabel.Xpad        = 10;
                    toolbarlabel.Text        = description.Name;
                    toolbarlabel.TooltipText = description.ToolTip;
                    toolbarlabel.Visible     = !String.IsNullOrEmpty(toolbarlabel.Text);
                    item.Add(toolbarlabel);
                    toolStrip.Add(item);
                    toolStrip.ShowAll();
                }
                else
                {
                    ToolButton button = new ToolButton(image, description.Name);
                    button.Homogeneous = false;
                    button.LabelWidget = new Label(description.Name);
                    button.Clicked    += description.OnClick;
                    if (!string.IsNullOrWhiteSpace(description.ShortcutKey))
                    {
                        Gtk.Accelerator.Parse(description.ShortcutKey, out uint key, out Gdk.ModifierType modifier);
                        button.AddAccelerator("clicked", accelerators, key, modifier, AccelFlags.Visible);
                    }
                    item = button;
                }
                toolStrip.Add(item);
            }
            Window mainWindow = GetMainWindow();

            if (mainWindow != null)
            {
                mainWindow.AddAccelGroup(accelerators);
            }
            toolStrip.ShowAll();
        }
Beispiel #5
0
        public AppMenu(DebugManager mgr, AccelGroup agr,
                       Settings set, Window parent,
                       DebugPane pane, string argsOverride)
        {
            settings     = set;
            debugPane    = pane;
            debugManager = mgr;
            menuBar      = new MenuBar();
            preferences  = new PreferencesDialog(set, parent, argsOverride);

            menuBar.Append(CreateFileMenu(agr));
            menuBar.Append(CreateEditMenu(agr));
            menuBar.Append(CreateViewMenu(agr));
            menuBar.Append(CreateDebuggerMenu(agr));
            menuBar.Append(CreateHelpMenu(agr));

            debugManager.DebuggerBusy    += OnDebuggerBusy;
            debugManager.DebuggerReady   += OnDebuggerReady;
            debugManager.DebuggerStarted += OnDebuggerStarted;
            debugManager.DebuggerExited  += OnDebuggerExited;

            menuBar.Destroyed += OnDestroy;

            debuggerStop.Sensitive      = false;
            debuggerInterrupt.Sensitive = false;

            foreach (MenuItem m in commandMacros)
            {
                m.Sensitive = false;
            }
        }
Beispiel #6
0
        /// <summary>
        /// Creates the GUI from code elements.
        /// </summary>
        private void CreateGui()
        {
            // Hook up the accelerator group.
            accelerators = new AccelGroup();
            AddAccelGroup(accelerators);

            // The main frame has a VBox to arrange all the components. The VBox
            // contains the menu, the primary text editor, and a status bar.
            var vertical = new VBox(false, 0);

            Add(vertical);

            // The center part of the area has a horizontal separator with the
            // bulk of the text editor on the left.
            var pane = new HPaned
            {
                Position    = 1024 - 256,
                BorderWidth = 0,
            };

            // Create the various components and add them to the vertical box.
            Widget menuBarWidget    = CreateGuiMenubar();
            Widget panelsWidget     = CreatePanelArea();
            Widget textEditorWidget = CreateGuiEditor();
            Widget statusBarWidget  = CreateGuiStatusbar();

            pane.Pack1(textEditorWidget, true, true);
            pane.Pack2(panelsWidget, true, true);
            vertical.PackStart(menuBarWidget, false, false, 0);
            vertical.PackStart(pane, true, true, 0);
            vertical.PackStart(statusBarWidget, false, false, 0);
        }
            public PGNFileLoader()
                : base("file-loader",
						      Catalog.
						      GetString
						      ("PGN File Loader"),
						      Catalog.
						      GetString
						      ("Loads games from a PGN file"))
            {
                accel = new AccelGroup ();
                ImageMenuItem item =
                    new ImageMenuItem (Catalog.
                               GetString
                               ("_Open File"));
                  item.Image =
                    new Image (Stock.Open, IconSize.Menu);
                  menuItem = item;
                  menuItem.Activated += on_open_file_activate;
                  menuItem.Show ();
                  menuItem.AddAccelerator ("activate", accel,
                               new AccelKey (Gdk.
                                     Key.
                                     o,
                                     Gdk.
                                     ModifierType.
                                     ControlMask,
                                     AccelFlags.
                                     Visible));
            }
Beispiel #8
0
        // Create "Debugger" menu
        MenuItem CreateDebuggerMenu(AccelGroup agr)
        {
            MenuItem dbg     = new MenuItem("_Debugger");
            Menu     dbgMenu = new Menu();

            dbg.Submenu = dbgMenu;

            debuggerStart            = new MenuItem("_Start debugger");
            debuggerStart.Activated += OnDebuggerStart;
            debuggerStart.AddAccelerator("activate", agr,
                                         new AccelKey(Gdk.Key.F5, Gdk.ModifierType.None,
                                                      AccelFlags.Visible));
            dbgMenu.Append(debuggerStart);

            debuggerStop            = new MenuItem("_Stop debugger");
            debuggerStop.Activated += OnDebuggerStop;
            debuggerStop.AddAccelerator("activate", agr,
                                        new AccelKey(Gdk.Key.F6, Gdk.ModifierType.None,
                                                     AccelFlags.Visible));
            dbgMenu.Append(debuggerStop);

            debuggerInterrupt = new ImageMenuItem(Stock.Cancel, agr);
            ((Label)debuggerInterrupt.Children[0]).Text = "Interrupt execution";
            debuggerInterrupt.AddAccelerator("activate", agr,
                                             new AccelKey(Gdk.Key.F9, Gdk.ModifierType.None,
                                                          AccelFlags.Visible));
            debuggerInterrupt.Activated += OnDebuggerInterrupt;
            dbgMenu.Append(debuggerInterrupt);

            dbgMenu.Append(CreateCommandsMenu(agr));

            return(dbg);
        }
        Gtk.MenuBar CreateMenus()
        {
            AccelGroup group = new AccelGroup();
            MenuBar    bar   = new MenuBar();

            Menu     file_menu      = new Menu();
            MenuItem file_menu_item = new MenuItem("_File");

            file_menu_item.Submenu = file_menu;

            ImageMenuItem file_exit = new ImageMenuItem(Gtk.Stock.Quit, group);

            file_exit.Activated += new EventHandler(exit_cb);
            file_menu.Append(file_exit);
            bar.Append(file_menu_item);

            Menu          help_menu      = new Menu();
            ImageMenuItem help_menu_item = new ImageMenuItem(Gtk.Stock.Help, group);

            help_menu_item.Submenu = help_menu;

            ImageMenuItem file_help = new ImageMenuItem(Gnome.Stock.About, group);

            file_help.Activated += new EventHandler(about_cb);
            help_menu.Append(file_help);
            bar.Append(help_menu_item);
            bar.ShowAll();

            return(bar);
        }
        private MenuBar CreateMenuBar()
        {
            var ag = new AccelGroup();

            this.AddAccelGroup(ag);

            var           fileMenu    = new Menu();
            ImageMenuItem newMenuItem = new ImageMenuItem(Stock.New, ag);

            newMenuItem.Activated += NewMenuItem_Activated;
            fileMenu.Append(newMenuItem);
            ImageMenuItem openMenuItem = new ImageMenuItem(Stock.Open, ag);

            openMenuItem.Activated += OpenMenuItem_Activated;
            fileMenu.Append(openMenuItem);
            fileMenu.Append(new SeparatorMenuItem());
            ImageMenuItem quitMenuItem = new ImageMenuItem(Stock.Quit, ag);

            quitMenuItem.Activated += QuitMenuItem_Activated;
            fileMenu.Append(quitMenuItem);

            var menu = new MenuBar();

            menu.Append(new ImageMenuItem(Stock.File, null)
            {
                Submenu = fileMenu
            });
            ImageMenuItem generateMenuItem = new ImageMenuItem("Generate");

            generateMenuItem.Activated += GenerateMenuItem_Activated;
            menu.Append(generateMenuItem);
            menu.Append(new ImageMenuItem(Stock.About, ag));
            return(menu);
        }
Beispiel #11
0
        public ImportDialog(bool doNotShowAgainVisible) : base("ImportDialog")
        {
            accel_group = new AccelGroup();

            if (ServiceManager.Contains("GtkElementsService"))
            {
                Dialog.TransientFor = ServiceManager.Get <GtkElementsService> ().PrimaryWindow;
            }

            Dialog.WindowPosition = WindowPosition.CenterOnParent;
            Dialog.AddAccelGroup(accel_group);
            Dialog.DefaultResponse = ResponseType.Ok;
            import_button          = (Glade["ImportButton"] as Button);

            DoNotShowAgainVisible = doNotShowAgainVisible;

            PopulateSourceList();

            ServiceManager.SourceManager.SourceAdded   += OnSourceAdded;
            ServiceManager.SourceManager.SourceRemoved += OnSourceRemoved;
            ServiceManager.SourceManager.SourceUpdated += OnSourceUpdated;

            Glade["MessageLabel"].Visible = ServiceManager.SourceManager.DefaultSource.Count == 0;

            import_button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible);

            Dialog.StyleSet += delegate {
                UpdateIcons();
            };
        }
Beispiel #12
0
    public MandelaWindow() : base("Mandela")
    {
        this._ApplicationLogFile = new LogFile("Mandela");
        this._ApplicationLogFile.EchoToConsole = true;

        this.WriteToLog("Loading and starting Mandela");

        this.tmpChaosDisplay                   = new ChaosDisplay(1000, 650);
        this.tmpChaosDisplay.WriteLog         += new WriteLogEventHandler(this.ChainedWriteLog);
        this.tmpChaosDisplay.RenderChaosImage += new EventHandler(this.StartImageRender);

        this.Resizable = false;

        this.DeleteEvent += new DeleteEventHandler(OnMyWindowDelete);

        this._ComputationProgressBar          = new ProgressBar();
        this._ComputationProgressBar.BarStyle = ProgressBarStyle.Continuous;

        _AcceleratorGroup = new AccelGroup();

        this.Add(UserInterface());

        this.AddAccelGroup(_AcceleratorGroup);

        this.RenderImage();

        this.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);
        }
        public FindAndReplaceForm()
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.FindAndReplace.glade");

            window1           = (Window)builder.GetObject("window1");
            chkMatchCase      = (CheckButton)builder.GetObject("chkMatchCase");
            chkMatchWholeWord = (CheckButton)builder.GetObject("chkMatchWholeWord");
            txtLookFor        = (Entry)builder.GetObject("txtLookFor");
            txtReplaceWith    = (Entry)builder.GetObject("txtReplaceWith");
            btnReplace        = (Button)builder.GetObject("btnReplace");
            btnReplaceAll     = (Button)builder.GetObject("btnReplaceAll");
            btnHighlightAll   = (Button)builder.GetObject("btnHighlightAll");
            btnCancel         = (Button)builder.GetObject("btnCancel");
            btnFindPrevious   = (Button)builder.GetObject("btnFindPrevious");
            btnFindNext       = (Button)builder.GetObject("btnFindNext");
            lblReplaceWith    = (Label)builder.GetObject("lblReplaceWith");

            btnFindNext.Clicked     += BtnFindNext_Click;
            btnFindPrevious.Clicked += BtnFindPrevious_Click;
            btnCancel.Clicked       += BtnCancel_Click;
            btnReplace.Clicked      += BtnReplace_Click;
            btnReplaceAll.Clicked   += BtnReplaceAll_Click;
            btnHighlightAll.Clicked += BtnHighlightAll_Click;
            window1.DeleteEvent     += Window1_DeleteEvent;
            window1.Destroyed       += Window1_Destroyed;
            AccelGroup agr = new AccelGroup();

            btnCancel.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.Escape, Gdk.ModifierType.None, AccelFlags.Visible));
            window1.AddAccelGroup(agr);
        }
Beispiel #15
0
        private void ShowWindow()
        {
            Application.Init();

            Glade.XML gxml = new Glade.XML(null, "ImLogViewer.glade", "imviewer", null);
            gxml.Autoconnect(this);

            imviewer.Icon = IconTheme.Default.LoadIcon("system-search", 16, IconLookupFlags.NoSvg);

            conversation.PixelsAboveLines = 3;
            conversation.LeftMargin       = 4;
            conversation.RightMargin      = 4;

            TextTag boldtag = new TextTag("bold");

            boldtag.Weight = Pango.Weight.Bold;
            conversation.Buffer.TagTable.Add(boldtag);

            TextTag highlight = new TextTag("highlight");

            highlight.Background = "yellow";
            conversation.Buffer.TagTable.Add(highlight);

            tree_store = new TreeStore(new Type[] { typeof(string), typeof(string), typeof(object) });

            timelinetree.Model = tree_store;
            timelinetree.AppendColumn("Date", new CellRendererText(), "markup", 0);
            timelinetree.AppendColumn("Snippet", new CellRendererText(), "text", 1);
            timelinetree.Selection.Changed += OnConversationSelected;

            if (highlight_text != null)
            {
                search_entry.Text = highlight_text;
            }

            if (search_text != null)
            {
                Search(search_text);
            }

            search_entry.Activated += OnSearchClicked;
            search_button.Clicked  += OnSearchClicked;
            clear_button.Clicked   += OnClearClicked;
            imviewer.DeleteEvent   += new DeleteEventHandler(OnWindowDelete);

            AccelGroup      accel_group = new AccelGroup();
            GlobalKeybinder global_keys = new GlobalKeybinder(accel_group);

            global_keys.AddAccelerator(OnWindowClose, (uint)Gdk.Key.Escape, 0, Gtk.AccelFlags.Visible);
            imviewer.AddAccelGroup(accel_group);

            // Index the logs
            index_thread_notify = new ThreadNotify(new ReadyEvent(RepopulateTimeline));
            Thread t = new Thread(new ThreadStart(IndexLogs));

            t.Start();

            Application.Run();
        }
Beispiel #16
0
        //build menubar
        void BuildMenuBar()
        {
            //create new menu bar
            menuBar = new MenuBar();

            //create 'file' dropdown
            filemenu     = new Gtk.Menu();
            file         = new Gtk.MenuItem("File");
            file.Submenu = filemenu;


            agr = new AccelGroup();
            mainWindowTracker.AddAccelGroup(agr);

            //add new button to file dropdown
            newi = new ImageMenuItem(Stock.New, agr);
            newi.AddAccelerator("activate", agr, new AccelKey(
                                    Gdk.Key.n, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            newi.Activated += NewCrop;
            filemenu.Append(newi);

            //add hr line
            sep = new SeparatorMenuItem();
            filemenu.Append(sep);

            //add close button
            exit = new ImageMenuItem(Stock.Quit, agr);
            exit.AddAccelerator("activate", agr, new AccelKey(
                                    Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible));

            //set up exit button
            exit.Activated += OnActivated;
            filemenu.Append(exit);

            //add to menu bar
            menuBar.Append(file);

            //add new vbox
            vbox = new VBox(false, 2);
            vbox.PackStart(menuBar, true, true, 0);

            //add our event box that contains our image
            vbox.PackStart(toCropBox);

            //add our upload button
            hbox                  = new HBox();
            uploadButton          = new Gtk.Button();
            uploadButton.Label    = "Upload Image";
            uploadButton.Clicked += UploadCroppedImage;
            hbox.PackEnd(uploadButton, false, false, 2);
            vbox.PackEnd(hbox, false, false, 5);

            //finally add to main window
            mainWindowTracker.Add(vbox);

            mainWindowTracker.ShowAll();
        }
Beispiel #17
0
        // Create "View" menu
        MenuItem CreateViewMenu(AccelGroup agr)
        {
            MenuItem view     = new MenuItem("_View");
            Menu     viewMenu = new Menu();

            view.Submenu = viewMenu;

            powerVisible            = new CheckMenuItem("Show power _graph");
            powerVisible.Active     = settings.PowerGraphVisible;
            powerVisible.Activated += OnShowPowerGraph;
            powerVisible.AddAccelerator("activate", agr,
                                        new AccelKey(Gdk.Key.F3, Gdk.ModifierType.None,
                                                     AccelFlags.Visible));
            viewMenu.Append(powerVisible);

            viewMenu.Append(new SeparatorMenuItem());

            MenuItem zoomIn = new ImageMenuItem(Stock.ZoomIn, agr);

            zoomIn.Activated += (obj, evt) =>
                                debugPane.PowerView.ZoomIn();
            zoomIn.AddAccelerator("activate", agr,
                                  new AccelKey(Gdk.Key.plus, Gdk.ModifierType.ControlMask,
                                               AccelFlags.Visible));
            viewMenu.Append(zoomIn);

            MenuItem zoomOut = new ImageMenuItem(Stock.ZoomOut, agr);

            zoomOut.Activated += (obj, evt) =>
                                 debugPane.PowerView.ZoomOut();
            zoomOut.AddAccelerator("activate", agr,
                                   new AccelKey(Gdk.Key.minus, Gdk.ModifierType.ControlMask,
                                                AccelFlags.Visible));
            viewMenu.Append(zoomOut);

            MenuItem zoomFit = new ImageMenuItem(Stock.ZoomFit, agr);

            zoomFit.Activated += (obj, evt) =>
                                 debugPane.PowerView.ZoomFit();
            zoomFit.AddAccelerator("activate", agr,
                                   new AccelKey(Gdk.Key.Key_0, Gdk.ModifierType.ControlMask,
                                                AccelFlags.Visible));
            viewMenu.Append(zoomFit);

            MenuItem zoomFull = new ImageMenuItem(Stock.Zoom100, agr);

            zoomFull.Activated += (obj, evt) =>
                                  debugPane.PowerView.ZoomFull();
            zoomFull.AddAccelerator("activate", agr,
                                    new AccelKey(Gdk.Key.Key_1, Gdk.ModifierType.ControlMask,
                                                 AccelFlags.Visible));
            viewMenu.Append(zoomFull);

            return(view);
        }
Beispiel #18
0
        public BOBaseDialog(Window pSourceWindow, GenericTreeViewXPO pTreeView, DialogFlags pFlags, DialogMode pDialogMode, XPGuidObject pDataSourceRow)
            : base("", pSourceWindow, pFlags)
        {
            //Parameters
            _treeView      = pTreeView;
            _dialogMode    = pDialogMode;
            _dataSourceRow = pDataSourceRow;

            //TODO: try to prevent NULL Error
            //_dataSourceRow = GlobalFramework.SessionXpo.GetObjectByKey<XPGuidObject>(_dataSourceRow.Oid);
            //TODO: Validar se o erro de editar dá erro de acesso objecto eliminado.
            //APPEAR when we Try to ReEdit Terminal, after assign Printer
            //An exception of type 'System.NullReferenceException' occurred in logicpos.exe but was not handled in user code
            _dataSourceRow.Reload();

            //Defaults
            //Modal = true; //< Problems in Ubuntu, TitleBar Disapear
            WindowPosition = WindowPosition.CenterAlways;
            GrabFocus();
            SetSize(400, 400);
            _widgetMaxWidth = WidthRequest - (_dialogPadding * 2) - 16;

            //Grey Window : Luis|Muga
            //this.Decorated = false;
            //White Window : Mario
            this.Decorated      = true;
            this.Resizable      = false;
            this.WindowPosition = WindowPosition.Center;
            //Grey Window : Luis|Muga
            //this.ModifyBg(StateType.Normal, Utils.StringToGTKColor(GlobalFramework.Settings["colorBackOfficeContentBackground"]));

            //Accelerators
            AccelGroup accelGroup = new AccelGroup();

            AddAccelGroup(accelGroup);

            //Init WidgetList
            _crudWidgetList = new GenericCRUDWidgetListXPO(_dataSourceRow.Session);

            //Icon
            string fileImageAppIcon = FrameworkUtils.OSSlash(string.Format("{0}{1}", GlobalFramework.Path["images"], SettingsApp.AppIcon));

            if (File.Exists(fileImageAppIcon))
            {
                Icon = Utils.ImageToPixbuf(System.Drawing.Image.FromFile(fileImageAppIcon));
            }

            //Init StatusBar
            InitStatusBar();
            //InitButtons
            InitButtons();
            //InitUi
            InitUI();
        }
        public static void SetAccelPath(Widget widget, AccelGroup accelGroup, string accelPath)
        {
            widget.SetAccelPath(GetAccelPath(accelPath), accelGroup);
            AccelKey key         = LookupEntry(accelPath);
            string   keyToString = KeyToString(key.Key, key.AccelMods, true);

            if (!string.IsNullOrWhiteSpace(keyToString))
            {
                widget.TooltipText = string.Format(" {0} ", keyToString);
            }
        }
        public VersionInformationDialog() : base()
        {
            var accel_group = new AccelGroup();

            AddAccelGroup(accel_group);
            Modal = true;

            var button = new Button("gtk-close")
            {
                CanDefault = true,
                UseStock   = true
            };

            button.Show();
            DefaultResponse = ResponseType.Close;
            button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Escape,
                                  0, Gtk.AccelFlags.Visible);

            AddActionWidget(button, ResponseType.Close);

            Title       = Catalog.GetString("Assembly Version Information");
            BorderWidth = 10;

            version_tree = new TreeView {
                RulesHint = true
            };
            version_tree.AppendColumn(Catalog.GetString("Assembly Name"),
                                      new CellRendererText(), "text", 0);
            version_tree.AppendColumn(Catalog.GetString("Version"),
                                      new CellRendererText(), "text", 1);

            version_tree.Model          = FillStore();
            version_tree.CursorChanged += OnCursorChanged;

            var scroll = new ScrolledWindow();

            scroll.Add(version_tree);
            scroll.ShadowType = ShadowType.In;
            scroll.SetSizeRequest(420, 200);

            VBox.PackStart(scroll, true, true, 0);
            VBox.Spacing = 5;

            path_label = new Label {
                Ellipsize = Pango.EllipsizeMode.End
            };
            path_label.Hide();
            path_label.Xalign = 0.0f;
            path_label.Yalign = 1.0f;
            VBox.PackStart(path_label, false, true, 0);

            scroll.ShowAll();
        }
Beispiel #21
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();
        }
Beispiel #22
0
 public EditQuickItems(MenuItemCollection mainMenu, AccelGroup accelGroup)
 {
     this.mainMenu   = mainMenu;
     this.accelGroup = accelGroup;
     itemShortcuts   = new BindList <ItemShortcut> ();
     changedMenus    = new List <string> ();
     AccelMap.Foreach(IntPtr.Zero, AddItemShortcut);
     if (itemShortcuts.Count == 0)
     {
         itemShortcuts.Add(new ItemShortcut());
     }
     Initialize();
 }
Beispiel #23
0
        public ActionManager()
        {
            AccelGroup = new AccelGroup();

            File        = new FileActions();
            Edit        = new EditActions();
            View        = new ViewActions();
            Image       = new ImageActions();
            Layers      = new LayerActions();
            Adjustments = new AdjustmentsActions();
            Effects     = new EffectsActions();
            Window      = new WindowActions();
            Help        = new HelpActions();
        }
Beispiel #24
0
        // Create "Help" menu
        MenuItem CreateHelpMenu(AccelGroup agr)
        {
            MenuItem help     = new MenuItem("_Help");
            Menu     helpMenu = new Menu();

            help.Submenu = helpMenu;

            MenuItem about = new ImageMenuItem(Stock.About, agr);

            about.Activated += OnHelpAbout;
            helpMenu.Append(about);

            return(help);
        }
Beispiel #25
0
        public BansheeDialog(string title, Window parent) : base()
        {
            Title = title ?? String.Empty;

            // The BorderWidth situation here is a bit nuts b/c the
            // ActionArea's is set to 5.  So we work everything else out
            // so it all totals to 12.
            //
            // WIDGET           BorderWidth
            // Dialog           5
            //   VBox           2
            //     inner_vbox   5 => total = 12
            //     ActionArea   5 => total = 12
            BorderWidth           = 5;
            base.VBox.BorderWidth = 0;

            // This spacing is 2 b/c the inner_vbox and ActionArea should be
            // 12 apart, and they already have BorderWidth 5 each
            base.VBox.Spacing = 2;

            inner_vbox = new VBox()
            {
                Spacing = 12, BorderWidth = 5, Visible = true
            };
            base.VBox.PackStart(inner_vbox, true, true, 0);

            Visible      = false;
            HasSeparator = false;

            if (parent == null)
            {
                GtkElementsService service = ServiceManager.Get <GtkElementsService> ();
                if (service != null)
                {
                    TransientFor = service.PrimaryWindow;
                }
            }
            else
            {
                TransientFor = parent;
            }

            WindowPosition = TransientFor == null || !TransientFor.Visible
                ? WindowPosition.Center
                : WindowPosition.CenterOnParent;
            DestroyWithParent = true;

            accel_group = new AccelGroup();
            AddAccelGroup(accel_group);
        }
        public ErrorListDialog() : base("ErrorListDialog")
        {
            accel_group = new AccelGroup();
            Dialog.AddAccelGroup(accel_group);

            list_view.SetSizeRequest(-1, 120);
            details_expander.Activated += delegate {
                ConfigureGeometry();
            };

            Dialog.Realized += delegate {
                ConfigureGeometry();
            };
        }
Beispiel #27
0
        public MarkdownFindView()
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.FindAndReplace.glade");

            window1           = (Window)builder.GetObject("window1");
            chkMatchCase      = (CheckButton)builder.GetObject("chkMatchCase");
            chkMatchWholeWord = (CheckButton)builder.GetObject("chkMatchWholeWord");
            txtLookFor        = (Entry)builder.GetObject("txtLookFor");
            txtReplaceWith    = (Entry)builder.GetObject("txtReplaceWith");
            btnReplace        = (Button)builder.GetObject("btnReplace");
            btnReplaceAll     = (Button)builder.GetObject("btnReplaceAll");
            btnHighlightAll   = (Button)builder.GetObject("btnHighlightAll");
            btnCancel         = (Button)builder.GetObject("btnCancel");
            btnFindPrevious   = (Button)builder.GetObject("btnFindPrevious");
            btnFindNext       = (Button)builder.GetObject("btnFindNext");
            lblReplaceWith    = (Label)builder.GetObject("lblReplaceWith");

            // We use the same glade form as the FindAndReplaceForm, but we don't
            // allow for replacing text (the view is readonly). Therefore we need
            // to hide the controls related to the text replace functionality.
            btnReplace.Visible      = btnReplaceAll.Visible = false;
            lblReplaceWith.Visible  = txtReplaceWith.Visible = false;
            btnHighlightAll.Visible = false;  // !value;

            btnFindNext.Clicked     += BtnFindNext_Click;
            btnFindPrevious.Clicked += BtnFindPrevious_Click;
            btnCancel.Clicked       += BtnCancel_Click;
            btnHighlightAll.Clicked += BtnHighlightAll_Click;
            window1.DeleteEvent     += Window1_DeleteEvent;
            window1.Destroyed       += Window1_Destroyed;
            AccelGroup agr = new AccelGroup();

            // Allow the text input widget to activate the default widget and make
            // the 'find next instance' button the default widget for its toplevel.
            // This means that when the user presses return while the text input
            // has focus, it will activate the default widget (the 'find next' button).
            btnFindNext.HasDefault      = true;
            txtLookFor.ActivatesDefault = true;

            // Add some extra keyboard shortcuts for the various buttons:
            // F3                               - find next
            // Shift + F3, Shift + Return       - find previous
            // Escape                           - Close the dialog
            btnFindNext.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.F3, Gdk.ModifierType.None, AccelFlags.Visible));
            btnFindPrevious.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.F3, Gdk.ModifierType.ShiftMask, AccelFlags.Visible));
            btnFindPrevious.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.Return, Gdk.ModifierType.ShiftMask, AccelFlags.Visible));
            btnCancel.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.Escape, Gdk.ModifierType.None, AccelFlags.Visible));
            window1.AddAccelGroup(agr);
        }
Beispiel #28
0
        /* Private members */

        private void Init()
        {
            this.accelGroup = new AccelGroup();
            this.hiddenMenu = new Menu();

            Base.Ui.Window.AddAccelGroup(this.accelGroup);

            AddAccelerator((uint)Gdk.Key.KP_Add, Gdk.ModifierType.ControlMask, AccelFlags.Visible, Base.Handlers.OnGlobalSubtitleStartIncrease);
            AddAccelerator((uint)Gdk.Key.KP_Subtract, Gdk.ModifierType.ControlMask, AccelFlags.Visible, Base.Handlers.OnGlobalSubtitleStartDecrease);

            AddAccelerator((uint)Gdk.Key.KP_Add, Gdk.ModifierType.Mod1Mask, AccelFlags.Visible, Base.Handlers.OnGlobalSubtitleEndIncrease);
            AddAccelerator((uint)Gdk.Key.KP_Subtract, Gdk.ModifierType.Mod1Mask, AccelFlags.Visible, Base.Handlers.OnGlobalSubtitleEndDecrease);

            AddAccelerator((uint)Gdk.Key.KP_Add, Gdk.ModifierType.ShiftMask, AccelFlags.Visible, Base.Handlers.OnGlobalSelectionShiftIncrease);
            AddAccelerator((uint)Gdk.Key.KP_Subtract, Gdk.ModifierType.ShiftMask, AccelFlags.Visible, Base.Handlers.OnGlobalSelectionShiftDecrease);
        }
Beispiel #29
0
        void AddMenu()
        {
            var mb = new MenuBar();

            var filemenu = new Menu();
            var file     = new MenuItem("文件")
            {
                Submenu = filemenu
            };

            var agr = new AccelGroup();

            AddAccelGroup(agr);

            var newi = new ImageMenuItem(Stock.New, agr);

            newi.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.n, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            filemenu.Append(newi);

            var open = new ImageMenuItem(Stock.Open, agr);

            open.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.n, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            filemenu.Append(open);

            var sep = new SeparatorMenuItem();

            filemenu.Append(sep);

            var exit = new ImageMenuItem(Stock.Quit, agr);

            exit.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible));

            //var exit = new MenuItem("退出");
            exit.Activated += (sender, args) =>
            {
                Application.Quit();
            };
            filemenu.Append(exit);

            mb.Append(file);

            //var _windowBox = new VBox(false, 2);
            _windowBox.PackStart(mb, false, false, 0);
            //_windowBox.PackStart(new Label("2333"), false, false, 0);

            //Add(_windowBox);
        }
Beispiel #30
0
    private MenuItem MakeHelpMenu()
    {
        Menu       menu  = new Menu();
        AccelGroup group = new AccelGroup();

        window.AddAccelGroup(group);

        ImageMenuItem about = new ImageMenuItem(Stock.About, group);

        about.Activated += new EventHandler(OnHelpAbout);
        menu.Append(about);

        MenuItem label = new MenuItem("_Help");

        label.Submenu = menu;
        return(label);
    }
Beispiel #31
0
    private MenuItem MakeFileMenu()
    {
        Menu       menu  = new Menu();
        AccelGroup group = new AccelGroup();

        window.AddAccelGroup(group);

        ImageMenuItem quit = new ImageMenuItem(Stock.Quit, group);

        quit.AddAccelerator("activate", group, new AccelKey(Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
        quit.Activated += new EventHandler(OnFileQuit);
        menu.Append(quit);

        MenuItem label = new MenuItem("_File");

        label.Submenu = menu;
        return(label);
    }
            public OpeningBrowserUI(OpeningsDb db)
                : base()
            {
                menubar = new AppMenuBar ();
                title = Catalog.GetString ("Opening Browser");
                accel = new AccelGroup ();
                menubar.quitMenuItem.
                    AddAccelerator ("activate", accel,
                            new AccelKey (Gdk.Key.
                                      q,
                                      Gdk.
                                      ModifierType.
                                      ControlMask,
                                      AccelFlags.
                                      Visible));
                toolbutton = new ToolButton (Stock.Info);
                toolbutton.Label =
                    Catalog.GetString ("Openings");
                toolbutton.ShowAll ();

                this.db = db;
                store = new TreeStore (typeof (string),
                               typeof (int),
                               typeof (string));
                this.db.PopulateTree (store);
                view = new TreeView ();
                view.Model = store;
                view.AppendColumn (Catalog.
                           GetString ("Moves"),
                           new CellRendererText (),
                           "text", 0);
                view.AppendColumn (Catalog.
                           GetString ("Variations"),
                           new CellRendererText (),
                           "text", 1);
                view.AppendColumn (Catalog.
                           GetString ("Name"),
                           new CellRendererText (),
                           "markup", 2);

                ScrolledWindow win = new ScrolledWindow ();
                win.SetPolicy (PolicyType.Automatic,
                           PolicyType.Automatic);
                win.Add (view);

                boardWidget = new GameViewerBoard ();
                HPaned split = new HPaned ();
                VBox box = new VBox ();
                box.PackStart (boardWidget, true, true, 2);
                split.Pack1 (box, false, true);	// resize, shrink
                split.Pack2 (win, true, true);
                split.ShowAll ();
                //split.Position = 400;
                int width, height;
                CsBoardApp.Instance.Window.GetSize (out width,
                                    out
                                    height);
                split.Position =
                    (int) Math.Round (width * 0.5f);
                split.PositionSet = true;
                PackStart (split, true, true, 2);

                view.CursorChanged += OnCursorChanged;
                ShowAll ();
            }
            public ICSDetailsWidget()
                : base()
            {
                menubar = new ICSMenuBar ();
                menubar.disconnectMenuItem.Activated +=
                    on_disconnect_activate;
                menubar.connectMenuItem.Activated +=
                    on_connect_activate;
                menubar.ShowAll ();

                Image img = new Image ();
                img.Stock = Stock.Network;
                toolbutton =
                    new ToolButton (img,
                            Catalog.
                            GetString
                            ("Chess Server"));
                toolbutton.ShowAll ();

                client = new ICSClient ();
                title = String.Format (Catalog.GetString
                               ("ICS: {0}@{1}:{2}"),
                               client.User,
                               client.server,
                               client.port);
                book = new Notebook ();
                book.Show ();

                Add (book);

                obManager =
                    new GameObservationManager (client,
                                    this);

                observableGames =
                    new ObservableGamesWidget (obManager);

                graph = new GameAdvertisementGraph (client);
                book.AppendPage (graph,
                         new Label (Catalog.
                                GetString
                                ("Seek Graph")));
                ads = new GameAdvertisements (client);
                book.AppendPage (ads,
                         new Label (Catalog.
                                GetString
                                ("Game Seeks")));

                book.AppendPage (observableGames,
                         new Label (Catalog.
                                GetString
                                ("Watch Games")));

                shell = new ICSShell (client);
                book.AppendPage (shell,
                         new Label (Catalog.
                                GetString
                                ("Shell")));

                client.ChallengeEvent += OnChallengeEvent;

                client.AuthEvent += OnAuth;
                client.ConnectionErrorEvent +=
                    OnConnectionError;

                ShowConfigWidget ();

                menubar.disconnectMenuItem.Sensitive = false;
                GLib.Idle.Add (delegate ()
                           {
                           Authenticate (); return false;}
                );

                accel = new AccelGroup ();
                menubar.quitMenuItem.
                    AddAccelerator ("activate", accel,
                            new AccelKey (Gdk.Key.
                                      q,
                                      Gdk.
                                      ModifierType.
                                      ControlMask,
                                      AccelFlags.
                                      Visible));
                ShowAll ();
                CsBoardApp.Instance.QuitEvent += OnQuitEvent;
            }
 public GameDbBrowser()
     : base()
 {
     accel = new AccelGroup ();
     title = Catalog.GetString ("Game Database");
     menubar = new AppMenuBar ();
     menubar.ShowAll ();
     Image img =
         new Image (Gdk.Pixbuf.
                LoadFromResource
                ("dbicon.png"));
     toolbutton =
         new ToolButton (img, Catalog.
                 GetString
                 ("Database"));
     toolbutton.ShowAll ();
     menubar.quitMenuItem.
         AddAccelerator ("activate", accel,
                 new AccelKey (Gdk.Key.
                           q,
                           Gdk.
                           ModifierType.
                           ControlMask,
                           AccelFlags.
                           Visible));
 }