Example #1
0
        public PopoverWindow(Gtk.WindowType type) : base(type)
        {
            SkipTaskbarHint = true;
            SkipPagerHint   = true;
            AppPaintable    = true;
            TypeHint        = WindowTypeHint.Tooltip;
            CheckScreenColormap();

            alignment = new Alignment(0, 0, 1f, 1f);
            alignment.Show();
            Add(alignment);

            disableSizeCheck = false;

            SizeRequested += (object o, SizeRequestedArgs args) => {
                if (this.AnimationIsRunning("Resize") && !disableSizeCheck)
                {
                    Gtk.Requisition result = new Gtk.Requisition();
                    result.Width     = Math.Max(args.Requisition.Width, Math.Max(Allocation.Width, targetSize.Width));
                    result.Height    = Math.Max(args.Requisition.Height, Math.Max(Allocation.Height, targetSize.Height));
                    args.Requisition = result;
                }
            };

            UpdatePadding();
        }
Example #2
0
        public ListWindow(Gtk.WindowType type) : base(type)
        {
            vbox = new VBox();
            list = new ListWidget(this);
            list.SelectionChanged += new EventHandler(OnSelectionChanged);
            list.ScrollEvent      += new ScrollEventHandler(OnScrolled);

            scrollbar              = new MonoDevelop.Components.CompactScrolledWindow();
            scrollbar.Name         = "CompletionScrolledWindow";     // use a different gtkrc style for GtkScrollBar
            scrollbar.Child        = list;
            list.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress)
                {
                    DoubleClick();
                }
            };
            vbox.PackEnd(scrollbar, true, true, 0);
            var colorBox = new EventBox();

            colorBox.Add(vbox);
            ContentBox.Add(colorBox);
            this.AutoSelect    = true;
            this.TypeHint      = WindowTypeHint.Menu;
            Theme.CornerRadius = 0;
            Theme.Padding      = 0;

            UpdateStyle();
            Gui.Styles.Changed += HandleThemeChanged;
            IdeApp.Preferences.ColorScheme.Changed += HandleThemeChanged;
        }
Example #3
0
        public ListWindow(Gtk.WindowType type)
            : base(type)
        {
            vbox = new VBox ();
            list = new ListWidget (this);
            list.SelectionChanged += new EventHandler (OnSelectionChanged);
            list.ScrollEvent += new ScrollEventHandler (OnScrolled);

            scrollbar = new MonoDevelop.Components.CompactScrolledWindow ();
            scrollbar.Child = list;
            list.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress)
                    DoubleClick ();
            };
            vbox.PackEnd (scrollbar, true, true, 0);
            ContentBox.Add (vbox);
            this.AutoSelect = true;
            this.TypeHint = WindowTypeHint.Menu;
            Theme.CornerRadius = 4;
        }
Example #4
0
        public ListWindow(Gtk.WindowType type) : base(type)
        {
            vbox = new VBox();
            list = new ListWidget(this);
            list.SelectionChanged += new EventHandler(OnSelectionChanged);
            list.ScrollEvent      += new ScrollEventHandler(OnScrolled);

            scrollbar              = new MonoDevelop.Components.CompactScrolledWindow();
            scrollbar.Child        = list;
            list.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress)
                {
                    DoubleClick();
                }
            };
            vbox.PackEnd(scrollbar, true, true, 0);
            ContentBox.Add(vbox);
            this.AutoSelect    = true;
            this.TypeHint      = WindowTypeHint.Menu;
            Theme.CornerRadius = 4;
            var style = SyntaxModeService.GetColorStyle(IdeApp.Preferences.ColorScheme);

            Theme.SetFlatColor(style.CompletionText.Background);
        }
 CompletionListWindow(Gtk.WindowType type)
 {
     window = new CompletionListWindowGtk(this, type);
 }
Example #6
0
 public PlatformHandleAwareWindow(WindowType type) : base(type)
 {
     Events = EventMask.AllEventsMask;
 }
Example #7
0
 public Window(Gtk.WindowType windowType) :
     base(windowType)
 {
     this.Build();
 }
Example #8
0
 public PlatformHandleAwareWindow(WindowType type) : base(type)
 {
     Events = EventMask.AllEventsMask;
 }
Example #9
0
 public SyntheticWindow(Gtk.WindowType type) : base(type)
 {
     lastHoveredWidgets = new List <Gtk.Widget> ();
 }
Example #10
0
        // private MenuButton languageSelectorButton;


        public RoboPad(WindowType type, String[] args) : base(type)
        {
            noOfWindows++;
            SetDefaultSize(500, 500);
            Maximize();
            DeleteEvent += (sender, s) =>
            {
                if (!isChangeSaved)
                {
                    MessageDialog dialog = new MessageDialog(this, DialogFlags.DestroyWithParent,
                                                             MessageType.Warning, ButtonsType.OkCancel, "Changes Unsaved Are You Sure You Want To Exit ");
                    // Dialog dialog=new Dialog()
                    var response = dialog.Run();
                    noOfWindows--;
                    if (response == (int)Gtk.ResponseType.Ok)
                    {
                        if (noOfWindows <= 0)
                        {
                            Gtk.Application.Quit();
                        }
                    }
                    else
                    {
                        s.RetVal = true;
                    }
                    dialog.Dispose();
                }
                else
                {
                    noOfWindows--;
                    if (noOfWindows <= 0)
                    {
                        Gtk.Application.Quit();
                    }
                }
            };
            VBox vBox = new VBox();

            List <String> newTextList = new();
            var           lm          = LanguageManager.Default;

            sourceView = new();
            sourceView.Buffer.HighlightSyntax = true;
            sourceView.WrapMode        = WrapMode.Word;
            sourceView.AutoIndent      = true;
            sourceView.ShowLineNumbers = true;
            StyleSchemeManager schemeManager = StyleSchemeManager.Default;

            // StyleScheme styleScheme = schemeManager.GetScheme("pop-light");

            // sourceView.Buffer.StyleScheme = styleScheme;

            sourceView.KeyPressEvent += (o, eventArgs) =>
            {
                if (Keyval.Name(eventArgs.Event.KeyValue) == "s")
                {
                    saveFile(o, eventArgs);
                }
                else if (Keyval.Name(eventArgs.Event.KeyValue) == "S")
                {
                    saveAsFile(o, eventArgs);
                }
                else if (Keyval.Name(eventArgs.Event.KeyValue) == "o")
                {
                    openFile(o, eventArgs);
                }
            };


            headerBar = new HeaderBar();
            ScrolledWindow scrolledWindow = new ScrolledWindow();

            scrolledWindow.Add(sourceView);

            headerBar.ShowCloseButton = true;
            headerBar.Title           = "RoboPad";
            headerBarOringalText      = headerBar.Title;

            sourceView.Buffer.Changed += (sender, eventArgs) =>
            {
                headerBar.Title = "*" + headerBarOringalText;
                if (sourceView.Buffer.Text != previousText)
                {
                    isChangeSaved = false;
                }
                else
                {
                    isChangeSaved   = true;
                    headerBar.Title = headerBarOringalText;
                }
            };
            ToolButtonHandler toolbar = new ToolButtonHandler(this, sourceView);



            // Menu menu = new Menu();
            // MenuItem openItem = new RadioMenuItem("test");
            // menu.Add(openItem);
            //
            // menu.ShowAll();
            //



            PopOverMenuHandler popoverMenu = new(this);
            MenuButton         menuButton  = new MenuButton();

            menuButton.Popover = popoverMenu;
            Image image = Gtk.Image.NewFromIconName("view-more-symbolic", IconSize.LargeToolbar);

            menuButton.Image = image;
            headerBar.PackEnd(menuButton);

            Statusbar statusbar = new Statusbar();

            statusBarLabel = new("");
            statusbar.PackStart(statusBarLabel, false, false, 5);
            languageSelectorButton = new LanguageSelectorButton(sourceView);
            statusbar.PackEnd(languageSelectorButton, false, false, 5);



            // Box box = new Box(Gtk.Orientation.Vertical,2);

            Titlebar = headerBar;

            vBox.PackStart(toolbar, false, false, 0);
            vBox.PackStart(scrolledWindow, true, true, 0);
            vBox.PackStart(statusbar, false, false, 0);
            Add(vBox);

            ShowAll();

            Show();
            if (args != null)
            {
                if (args.Length >= 1)
                {
                    if (!String.IsNullOrWhiteSpace(args[0]))
                    {
                        openFileWithArgs(args[0]);
                    }
                }
            }
        }
Example #11
0
        public Menu(Gtk.WindowType s = Gtk.WindowType.Toplevel) : base(s)
        {
            this.SetDefaultSize(300, 400);
            this.DeleteEvent += delegate { Application.Quit(); };
            containerbox      = new VBox(homogeneous: false, spacing: 3);
            controlbox        = new VBox(homogeneous: false, spacing: 3);
            systemscrollbox   = new ScrolledWindow();
            systembox         = new VBox(homogeneous: false, spacing: 3);
            donebox           = new HBox(homogeneous: false, spacing: 3);

            var l1 = new Label("Mechanics Timestep");
            var l2 = new Label("Planetary Radii Multiplier");
            var l3 = new Label("Orbit Trail Length");

            TimestepScale       = new Scale(Orientation.Horizontal, 0.1, 1000, 0.1);
            TimestepScale.Value = 50;
            RScale          = new Scale(Orientation.Horizontal, 1, 1000, 1);
            RScale.Value    = 100;
            LineScale       = new Scale(Orientation.Horizontal, 50, 1000, 1);
            LineScale.Value = 100;

            var addBox    = new HBox();
            var addButton = new Button("Add");

            addButton.Clicked += new EventHandler(OnAddClick);
            var filenameText = new Label("Save File: ");

            filename = new Entry();
            var saveButton = new Button("Save");

            saveButton.Clicked += new EventHandler(OnSaveClick);
            loadButton          = new Button("Load");
            loadButton.Clicked += new EventHandler(OnLoadClick);
            var helpButton = new Button("?");

            helpButton.Clicked += new EventHandler(OnHelpClick);
            BodyCombo           = new ComboBoxText();
            BodyCombo.AppendText("Custom");
            foreach (Body b in Examples.solar_system_bodies)
            {
                BodyCombo.AppendText(b.name);
            }
            BodyCombo.Active = 0; // Default to Custom body
            addBox.PackStart(BodyCombo, true, false, 3);
            addBox.PackStart(addButton, true, false, 3);
            addBox.PackStart(filenameText, true, false, 3);
            addBox.PackStart(filename, true, false, 3);
            addBox.PackStart(saveButton, true, false, 3);
            addBox.PackStart(loadButton, true, false, 3);
            addBox.PackStart(helpButton, true, false, 3);
            var doneButton = new Button("Done");

            doneButton.Clicked += new EventHandler(OnDoneClick);
            var exitButton = new Button("Exit");

            exitButton.Clicked += new EventHandler(delegate {
                Application.Quit();
            });

            var optionsbox = new HBox(homogeneous: false, spacing: 3);
            var optionbox1 = new VBox(homogeneous: false, spacing: 3);
            var optionbox2 = new VBox(homogeneous: false, spacing: 3);
            var optionbox3 = new VBox(homogeneous: false, spacing: 3);

            optionbox1.PackStart(l1, true, true, 3);
            optionbox1.PackStart(TimestepScale, true, true, 3);
            optionbox2.PackStart(l2, true, true, 3);
            optionbox2.PackStart(RScale, true, true, 3);
            optionbox3.PackStart(l3, true, true, 3);
            optionbox3.PackStart(LineScale, true, true, 3);
            optionsbox.PackStart(optionbox1, true, true, 3);
            optionsbox.PackStart(optionbox2, true, true, 3);
            optionsbox.PackStart(optionbox3, true, true, 3);

            controlbox.PackStart(optionsbox, false, false, 3);
            controlbox.PackStart(addButton, false, false, 3);
            controlbox.PackStart(addBox, false, false, 3);
            systemscrollbox.Add(systembox);
            donebox.PackStart(doneButton, true, true, 3);
            donebox.PackStart(exitButton, true, true, 3);


            containerbox.PackStart(controlbox, false, false, 3);
            containerbox.PackStart(systemscrollbox, true, true, 3);
            containerbox.PackStart(donebox, false, false, 3);
            this.Add(containerbox);
            this.ShowAll();
        }