Exemple #1
0
        Widget CreateExceptionInfoHeader()
        {
            ExceptionMessageLabel = new Label {
                UseMarkup = true, Selectable = true, Wrap = true, WidthRequest = 500, Xalign = 0.0f, Yalign = 0.0f
            };
            ExceptionTypeLabel = new Label {
                UseMarkup = true, Xalign = 0.0f
            };

            ExceptionMessageLabel.Show();
            ExceptionTypeLabel.Show();

            var alignment = new Alignment(0.0f, 0.0f, 0.0f, 0.0f);

            alignment.Child       = ExceptionMessageLabel;
            alignment.BorderWidth = 6;
            alignment.Show();

            var frame = new InfoFrame(alignment);

            frame.Show();

            var vbox = new VBox(false, 12);

            vbox.PackStart(ExceptionTypeLabel, false, true, 0);
            vbox.PackStart(frame, true, true, 0);
            vbox.Show();

            return(vbox);
        }
Exemple #2
0
        void CheckCreateSubViewContents()
        {
            if (subViewNotebook != null)
            {
                return;
            }

            // The view may call AttachViewContent when initialized, and this
            // may happen before the main content is added to 'box', so we
            // have to check if the content is already parented or not

            Gtk.Widget viewWidget = ViewContent.Control;
            if (viewWidget.Parent != null)
            {
                box.Remove(viewWidget);
            }

            subViewNotebook            = new Notebook();
            subViewNotebook.TabPos     = PositionType.Bottom;
            subViewNotebook.ShowTabs   = false;
            subViewNotebook.ShowBorder = false;
            subViewNotebook.Show();

            //add existing ViewContent
            AddButton(this.ViewContent.TabPageLabel, this.ViewContent);

            //pack them in a box
            subViewNotebook.Show();
            box.PackStart(subViewNotebook, true, true, 1);
            box.Show();
        }
Exemple #3
0
        public SdiWorkspaceWindow(IViewContent content, Pinta.Docking.DockNotebook.DockNotebook tabControl, DockNotebookTab tabLabel) : base()
        {
            this.tabControl = tabControl;
            this.content    = content;
            this.tab        = tabLabel;
            this.tabPage    = content.Control;

            box = new VBox();

            viewContents.Add(content);

            //this fires an event that the content uses to access this object's ExtensionContext
            content.WorkbenchWindow = this;

            // The previous WorkbenchWindow property assignement may end with a call to AttachViewContent,
            // which will add the content control to the subview notebook. In that case, we don't need to add it to box
            if (subViewNotebook == null)
            {
                box.PackStart(content.Control);
            }

            content.ContentNameChanged += new EventHandler(SetTitleEvent);
            content.DirtyChanged       += HandleDirtyChanged;
            content.BeforeSave         += new EventHandler(BeforeSave);
            content.ContentChanged     += new EventHandler(OnContentChanged);
            box.Show();
            Add(box);

            SetTitleEvent(null, null);
        }
Exemple #4
0
        public SdiWorkspaceWindow(DefaultWorkbench workbench, ViewContent content, DockNotebook tabControl, DockNotebookTab tabLabel) : base()
        {
            this.workbench  = workbench;
            this.tabControl = tabControl;
            this.content    = content;
            this.tab        = tabLabel;

            fileTypeCondition.SetFileName(content.ContentName ?? content.UntitledName);
            extensionContext = AddinManager.CreateExtensionContext();
            extensionContext.RegisterCondition("FileType", fileTypeCondition);

            box = new VBox();
            box.Accessible.SetShouldIgnore(true);

            viewContents.Add(content);

            //this fires an event that the content uses to access this object's ExtensionContext
            content.WorkbenchWindow = this;

            // The previous WorkbenchWindow property assignement may end with a call to AttachViewContent,
            // which will add the content control to the subview notebook. In that case, we don't need to add it to box
            content.ContentNameChanged += SetTitleEvent;
            content.DirtyChanged       += HandleDirtyChanged;
            box.Show();
            Add(box);

            SetTitleEvent(false);
        }
Exemple #5
0
        public NewSearchPage() : base(0.5f, 0.5f, 0f, 0f)
        {
            base.SetPadding(36, 36, 36, 36);
            base.FocusGrabbed += base_FocusGrabbed;

            mainVBox = new VBox();

            Label label = new Label();

            label.Xalign = 0;
            label.Markup = "<span size=\"x-large\" weight=\"bold\">Search for files...</span>";
            mainVBox.PackStart(label, false, false, 0);
            label.Show();

            searchEntry = new FileSearchEntry();
            searchEntry.WidthRequest = 400;
            mainVBox.PackStart(searchEntry, false, false, 6);
            searchEntry.Show();

            searchButton          = new Button("_Search");
            searchButton.Image    = new Image(Stock.Find, IconSize.Button);
            searchButton.Clicked += searchButton_Clicked;
            searchButton.Show();

            HButtonBox buttonBox = new HButtonBox();

            buttonBox.Layout = ButtonBoxStyle.End;
            buttonBox.PackStart(searchButton, false, false, 0);
            mainVBox.PackStart(buttonBox, false, false, 0);
            buttonBox.Show();

            base.Add(mainVBox);
            mainVBox.Show();
        }
Exemple #6
0
        private Widget BuildShowPage()
        {
            VBox vbox = new VBox(false, 3);

            string[,] names = new string[, ] {
                { "ShowBox", "Bounding box" },
                { "ShowAxis", "Axis" },
                { "ShowXTicks", "Ticks on x-axis" },
                { "ShowYTicks", "Ticks on y-axis" },
                { "ShowXTicksLabels", "Tick labels on x-axis" },
                { "ShowYTicksLabels", "Tick labels on y-axis" },
                { "ShowGrid", "Grid" },
                { "ShowRuler", "Ruler" },
                { "ShowRulerAxis", "Ruler axis" },
                { "SnapRulerToData", "Snap ruler to data" }
            };

            for (int i = 0; i <= names.GetUpperBound(0); ++i)
            {
                vbox.PackStart(BoolButton(names[i, 1], names[i, 0]), false, false, 0);
            }

            vbox.Show();

            return(vbox);
        }
Exemple #7
0
        public AudioView()
        {
//			this.WidthRequest = 500; //250;
//			this.HeightRequest = 375; //187;

            Frame frame = new Frame();

            frame.BorderWidth = 5;
            frame.Show();

            VBox vbox = new VBox(false, 0);

            frame.Add(vbox);
            vbox.Show();

            Label label = new Label(Catalog.GetString("Audio Chat in progress..."));

            label.Show();
            vbox.PackStart(label, false, true, 5);

            Button button = new Button(Catalog.GetString("End Call"));

            button.Clicked += OnCloseAudioClicked;
            button.Show();
            vbox.PackStart(button, false, true, 5);

            this.Add(frame);
        }
Exemple #8
0
        public TileView()
        {
            CanFocus      = true;
            VisibleWindow = false;

            box.Show();
            Add(box);
        }
Exemple #9
0
        ///<summary>
        ///	InitWindow
        /// Sets up the widgets and events in the chat window
        ///</summary>
        void InitWindow()
        {
            this.Icon = Utilities.GetIcon("giver-48", 48);
            // Update the window title
            Title = string.Format("Giver Recipients");

            this.DefaultSize = new Gdk.Size(300, 500);

            // Start with an event box to paint the background white
            EventBox eb = new EventBox();

            eb.BorderWidth = 0;
            eb.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
            eb.ModifyBase(StateType.Normal, new Gdk.Color(255, 255, 255));

            VBox mainVBox = new VBox();

            mainVBox.BorderWidth = 0;
            mainVBox.Show();
            eb.Add(mainVBox);
            this.Add(eb);

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

            // Add a second Event box in the scrolled window so it will also be white
            EventBox innerEb = new EventBox();

            innerEb.BorderWidth = 0;
            innerEb.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
            innerEb.ModifyBase(StateType.Normal, new Gdk.Color(255, 255, 255));

            targetVBox             = new VBox();
            targetVBox.BorderWidth = 0;
            targetVBox.Show();
            innerEb.Add(targetVBox);

            scrolledWindow.AddWithViewport(innerEb);

            //mainVBox.PackStart (targetVBox, false, false, 0);
            manualTarget = new TargetService();
            manualTarget.Show();
            mainVBox.PackStart(manualTarget, false, false, 0);

            Shown       += OnWindowShown;
            DeleteEvent += WindowDeleted;

            Application.Instance.TransferStarted += TransferStartedHandler;
        }
Exemple #10
0
        private void BuildPrimaryLayout()
        {
            primary_vbox = new VBox();

            BuildHeader();
            BuildViews();
            BuildFooter();

            primary_vbox.Show();
            Add(primary_vbox);
        }
Exemple #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        /// <param name="title">Title.</param>
        public MainWindow(string title) : base(title)
        {
            //Placeholder widgets.
            var newsLabel = new Label("News label.");

            newsLabel.Show();

            newsTabel = new NewsMessageView();
            //newsTabel.Sensitive = false;
            newsTabel.Show();

            var weatherLabel = new Label("Weather label.");

            weatherLabel.Show();

            this.clockLabel = new ClockLabel();
            this.clockLabel.Show();

            var birthdayLabel = new Label("Birthdays label.");

            birthdayLabel.Show();

            var traficLabel = new Label("Trafic label.");

            traficLabel.Show();

            //widget grid initialisation.
            var mainHbox = new HBox();  //divides the window vertically into n parts. (for our application two parts).

            mainHbox.Add(newsTabel);
            mainHbox.Show();
            var rightSideVbox = new VBox();  //divides the right part horizontally into n rows.

            rightSideVbox.Show();
            mainHbox.Add(rightSideVbox);
            mainHbox.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0));
            mainHbox.ModifyFg(StateType.Normal, new Gdk.Color(0, 0, 0));
            var weatherAndTimeHbox = new HBox();

            weatherAndTimeHbox.Add(weatherLabel);
            weatherAndTimeHbox.Add(this.clockLabel);
            weatherAndTimeHbox.Show();
            rightSideVbox.Add(weatherAndTimeHbox);
            rightSideVbox.Add(birthdayLabel);
            rightSideVbox.Add(traficLabel);

            //Add the grid to the window.
            this.Add(mainHbox);

            base.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0));

            newsTabel.newsMessageListStore.AppendValues("Klaas", "12-11-2017", "Ik neem een maandje vrij.");
            newsTabel.newsMessageListStore.AppendValues("Henkie", "11-11-2017", "Ik ben het helemaal beu, ik stop.");
        }
Exemple #12
0
        private Widget MakeAccountsPage()
        {
            VBox vbox = new VBox(false, 0);

            vbox.BorderWidth = 8;

            vbox.PackStart(MakeGoogleTalkPreferences(), false, false, 0);
            //vbox.PackStart (MakeSipPreferences (), false, false, 0);

            vbox.Show();
            return(vbox);
        }
Exemple #13
0
    private static int Main(string[] args)
    {
        // * Init GTK.
        Gtk.Application.Init ("Color", ref args);

        // * Init GtkGLExt.
        GtkGL.Application.Init (ref args);

        // * Display mode.
        GdkGL.ConfigMode mode = GdkGL.ConfigMode.Index;

        for (int i = 0; i < args.Length; i++)
        {
            if (args[i] == "--rgb")
                mode = GdkGL.ConfigMode.Rgb;
        }

        // * Query OpenGL extension version.
        int major, minor;
        Query.Version (out major, out minor);
        Console.WriteLine ("\nOpenGL extension version - {0}.{1}", major, minor);

        // * Configure OpenGL-capable visual.
        // Try double-buffered visual
        GdkGL.Config glconfig = new GdkGL.Config (mode | GdkGL.ConfigMode.Depth | GdkGL.ConfigMode.Double);
        if (glconfig == null) {
          		Console.WriteLine ("*** Cannot find the double-buffered visual.\n*** Trying single-buffered visual.");
            glconfig = new GdkGL.Config (mode | GdkGL.ConfigMode.Depth);
            if (glconfig == null) {
                  Console.WriteLine ("*** Cannot find any OpenGL-capable visual.");
                  return 1;
            }
        }

        GlUtilities.WriteOutConfig (glconfig);
        bool is_rgba = glconfig.IsRgba;

        // Top-level window.
        Window window = new Window (WindowType.Toplevel);
        window.Title = "color";

        // Perform the resizes immediately
        window.ResizeMode = ResizeMode.Immediate;

        // Get automatically redrawn if any of their children changed allocation.
        window.ReallocateRedraws = true;

        window.DeleteEvent += new DeleteEventHandler (Window_Delete);

        // VBox.
        VBox vbox = new VBox (false, 0);
        window.Add (vbox);
        vbox.Show ();

        // Drawing area for drawing OpenGL scene.
        ColorTriangle drawing_area = new ColorTriangle (glconfig);
        drawing_area.SetSizeRequest (200, 200);

        vbox.PackStart (drawing_area, true, true, 0);
        drawing_area.Show ();

        // Simple quit button.
        Button button = new Button ("Quit");
        button.Pressed += new EventHandler (Button_Click);
        vbox.PackStart (button, false, false, 0);
        button.Show ();

        // * Show window.
        window.Show ();

        // * Allocate colors.
        if (!is_rgba) {
            Gdk.Colormap colormap = glconfig.Colormap;
            Console.WriteLine ("\nAllocate colors.");

            // Allocate writable color cells.
            bool[] success = new bool [NUM_COLORS];
            int not_allocated = colormap.AllocColors (colors, NUM_COLORS, false, false, success);
            for (int i = 0; i < NUM_COLORS; i++)
                Console.WriteLine ("{0}", success[i]);

            Console.WriteLine ("Not allocated = {0}", not_allocated);

            for (int i = 0; i < NUM_COLORS; i++)
                Console.WriteLine ("colors[{0}] = [ {1}, {2}, {3}, {4} ]",  i,
                                                                            colors[i].Pixel,
                                                                            colors[i].Red,
                                                                            colors[i].Green,
                                                                            colors[i].Blue
                                                                            );
            Console.WriteLine ("\nQuery colors.");

            for (int i = 0; i < NUM_COLORS; i++) {
                Gdk.Color color = new Gdk.Color ();
                color.Pixel = colors[i].Pixel;
                colormap.QueryColor (colors[i].Pixel, ref color);
                Console.WriteLine ("colors[{0}] = { {1}, {2}, {3}, {4} }",  i,
                                                                            colors[i].Pixel,
                                                                            color.Red,
                                                                            color.Green,
                                                                            color.Blue);
            }
            Console.WriteLine ();
        }

        // * Main loop.
        Gtk.Application.Run ();
        return 0;
    }
Exemple #14
0
    public static int Main(string[] args)
    {
        /*
            * Init GTK.
            */
            Gtk.Application.Init (/*"Gears3D", null*/);

            /*
            * Init GtkGLExt.
            */
            GtkGL.Application.Init (ref args);

            /*
            * Command line options.
            */
            for (int i = 0; i < args.Length; i++)
                if (args[i] ==  "--async")
                    is_sync = false;

            /*
            * Configure OpenGL-capable visual.
            */

            /* Try double-buffered visual */
            GdkGL.Config glconfig = new GdkGL.Config (GdkGL.ConfigMode.Rgb | GdkGL.ConfigMode.Depth | GdkGL.ConfigMode.Double);
            if (glconfig == null) {
          		Console.WriteLine ("*** Cannot find the double-buffered visual.\n*** Trying single-buffered visual.");
                /* Try single-buffered visual */
                glconfig = new GdkGL.Config (GdkGL.ConfigMode.Rgb | GdkGL.ConfigMode.Depth);
                if (glconfig == null) {
                      Console.WriteLine ("*** Cannot find any OpenGL-capable visual.");
                      return 1;
                }
            }

            /*
            * Top-level window.
            */
            Window window = new Window (WindowType.Toplevel);
            window.Title = "gears";

            /* Get automatically redrawn if any of their children changed allocation. */
            window.ReallocateRedraws = true;

            window.DeleteEvent += new DeleteEventHandler (Window_Delete);

            /*
            * VBox.
            */
            VBox vbox = new VBox (false, 0);
            window.Add (vbox);
            vbox.Show ();

            /*
            * Drawing area for drawing OpenGL scene.
            */
            /* Set OpenGL-capability to the widget. */
            GearsArea drawing_area = new GearsArea (glconfig);
            drawing_area.SetSizeRequest (300, 300);

            window.KeyPressEvent += new KeyPressEventHandler (drawing_area.OnKeyPress);

            vbox.PackStart (drawing_area, true, true, 0);
            drawing_area.Show ();

            /*
            * Simple quit button.
            */
            Button button = new Button ("Quit");
            button.Clicked += new EventHandler (Button_Click);
            vbox.PackStart (button, false, false, 0);
            button.Show ();

            /*
            * Show window.
            */
            window.Show ();

            /*
            * Main loop.
            */
            Gtk.Application.Run ();
            return 0;
    }