Exemple #1
0
    public static void Main(string[] args)
    {
        Application.Init();

        //Create the Window
        Window myWin = new Window("GtkSpell# Sample App");
        myWin.Resize(200,200);

        //Create a TextView
        TextView myTextView = new TextView();

        SpellCheck mySpellCheck;

        //Bind GtkSpell to our textview
        if (args.Length > 0)
          mySpellCheck = new SpellCheck(myTextView, args[0]);
        else
          mySpellCheck = new SpellCheck(myTextView, "en-us");

        //spellCheck.Detach();
        //spellCheck.();

        //Add the TextView to the form
        myWin.Add(myTextView);

        //Show Everything
        myWin.ShowAll();

        myWin.DeleteEvent += new DeleteEventHandler(delete);

        Application.Run();
    }
Exemple #2
0
    public static void Main(string[] args)
    {
        Gtk.Window window;
          EventBox eventbox;
          Label label;

          Application.Init();

          window = new Gtk.Window ("Eventbox");
          window.DeleteEvent += new DeleteEventHandler (delete_event);

          window.BorderWidth = 10;
          window.Resize(400,300);

          eventbox = new EventBox ();
          window.Add (eventbox);
          eventbox.Show();

          label = new Label ("Click here to quit");
          eventbox.Add(label);
          label.Show();

          label.SetSizeRequest(110, 20);

          eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);

          eventbox.Realize();

          window.Show();

          Application.Run();
    }
Exemple #3
0
            private void UpdatePopupPosition()
            {
                int         x = 0, y = 0;
                Rectangle   bounds      = Bounds();
                Requisition requisition = popup_window.SizeRequest();

                popup_window.Resize(requisition.Width, requisition.Height);
                selector.GdkWindow.GetOrigin(out x, out y);
                x += bounds.X + (bounds.Width - requisition.Width) / 2;
                y += bounds.Y - requisition.Height;
                x  = Math.Max(x, 0);
                x  = Math.Min(x, selector.Screen.Width - requisition.Width);
                popup_window.Move(x, y);
            }
Exemple #4
0
        public static void RunIt()
        {
            Application.Init();

            // Create the Window
            window = new Gtk.Window("Memorize");
            window.DeleteEvent += delegate { Application.Quit(); };
            window.Resize(800, 600);

            // Status bar ...
            icon = new StatusIcon(new Pixbuf("res/icon.png"));
            icon.Visible = true;
            icon.Activate += delegate { window.Visible = !window.Visible; };
            icon.Tooltip = "Yo imma let you finish";

            // Table view
            Table table1 = new Table(2, 2, false);
            Label top = new Label();
            top.Text = "Buttons shortcuts, statuses, etc...";
            Label bottomLeft= new Label();
            bottomLeft.Text = "A \"cardboard\" of memos will be hung here.";
            Label bottomRight = new Label();
            bottomRight.Text = "Menu for creating memo \nlists, projects, memos...";

            // Here I could attach some informations, buttons
            // something that is general to all memos ?
            table1.Attach(top, 0, 2, 0, 1, Gtk.AttachOptions.Expand,
                    Gtk.AttachOptions.Fill, 10, 10);

            // Here I would create a specific widget that specializes
            // in displaying memos
            /*
            BoardDisplay mBoard = new BoardDisplay();
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("1", "one")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("2", "two")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("3", "three is an incredibly long text blah blah blah")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("4", "four")));
            mBoard.DrawBoard();
            table1.Attach(mBoard.Board, 0, 1, 1, 2, Gtk.AttachOptions.Expand,
                    Gtk.AttachOptions.Expand, 10, 10);
            */
            // Ideally here I would attach something that inherits a widget
            // and is a menu for creating new memos
            table1.Attach(bottomRight, 1, 2, 1, 2, Gtk.AttachOptions.Fill,
                    Gtk.AttachOptions.Fill, 1, 1);

            window.Add(table1);
            window.ShowAll();
            Application.Run();
        }
        private void btnChooseMoney_Toggled(object sender, EventArgs e)
        {
            if (pnlChooseMoney == null)
            {
                pnlChooseMoney = new ChooseMoneyPanel(priceType);
                pnlChooseMoney.TotalChanged += pnlChooseMoney_TotalChanged;
                pnlChooseMoney.Show();
                algChooseMoney.Add(pnlChooseMoney);
            }

            bool chooseMoney = btnChooseMoney.Active;

            BusinessDomain.AppConfiguration.LastChooseMoneyVisible = chooseMoney;
            vspMoneySelection.Visible = chooseMoney;
            pnlChooseMoney.Visible    = chooseMoney;
            if (selectedPayment != null)
            {
                RefreshChooseMoneyPanel();
            }
            if (!chooseMoney)
            {
                parentWindow.Resize(10, 10);
            }
        }
    public static void Main()
    {
        Application.Init ();

        Button button = new Button ("Test");
        button.Clicked += new EventHandler (ButtonClickedHandler);

        Window myWin = new Window ("GTK# Test Application");
        myWin.Add (button);
        myWin.Resize (400, 250);
        myWin.DeleteEvent += WindowDeleteEventHandler;
        myWin.ShowAll ();

        Application.Run ();
    }
Exemple #7
0
	static void Main ()
	{		
		Application.Init ();
		Gtk.Window w = new Gtk.Window ("Mono.Cairo Circles demo");

		a = new CairoGraphic ();	
		
		Box box = new HBox (true, 0);
		box.Add (a);
		w.Add (box);
		w.Resize (500,500);		
		w.ShowAll ();		
		
		Application.Run ();
	}
Exemple #8
0
    static void Main()
    {
        Gtk.Application.Init();
        Gtk.Window w = new Gtk.Window("RoadMap gridlines");

        a = new CairoGraphic();

        Box box = new HBox(true, 0);

        box.Add(a);
        w.Add(box);
        w.Resize(500, 500);
        w.ShowAll();

        Gtk.Application.Run();
    }
Exemple #9
0
    static void Main()
    {
        Application.Init();
        Gtk.Window w = new Gtk.Window("Mono.Cairo Circles demo");

        a = new CairoGraphic();

        Box box = new HBox(true, 0);

        box.Add(a);
        w.Add(box);
        w.Resize(500, 500);
        w.ShowAll();

        Application.Run();
    }
Exemple #10
0
    public static void Main()
    {
        Application.Init();

        //Create the Window
        Window myWin = new Window("My First GTK# Application");
        myWin.Resize(200,200);

        //Create a label and put some text in it.
        Label myLabel = new Label();
        myLabel.Text = "Hello World!!!";

        //add the label to the form
        myWin.Add(myLabel);
        myWin.ShowAll();
        Application.Run();
    }
        public void Start()
        {
            currentStep = 0;

            window = new Window(WindowType.Toplevel);
            window.Move(10, 10);
            window.KeepAbove = true;
            window.Resize(400, 30);
            window.AcceptFocus = false;
            window.Title = "Progress Bar";

            progressBar = new ProgressBar();
            progressBar.Fraction = 0;

            window.Add(progressBar);
            window.ShowAll();
        }
Exemple #12
0
        internal void AddTopLevel(DockFrameTopLevel w, int x, int y, int width, int height)
        {
            w.X = x;
            w.Y = y;

            if (UseWindowsForTopLevelFrames)
            {
                var win = new Gtk.Window(Gtk.WindowType.Toplevel);
                win.SkipTaskbarHint = true;
                win.Decorated       = false;
                win.TypeHint        = Gdk.WindowTypeHint.Toolbar;
                w.ContainerWindow   = win;
                w.Size = new Size(width, height);
                win.Add(w);
                w.Show();
                var p = this.GetScreenCoordinates(new Gdk.Point(x, y));
                win.Opacity = 0.0;
                win.Move(p.X, p.Y);
                win.Resize(width, height);
                win.Show();
                Ide.DesktopService.AddChildWindow((Gtk.Window)Toplevel, win);
                win.AcceptFocus = true;
                win.Opacity     = 1.0;

                /* When we use real windows for frames, it's possible for pads to be over other
                 * windows. For some reason simply presenting or raising those dialogs doesn't
                 * seem to work, so we hide/show them in order to force them above the pad. */
                var toplevels = Gtk.Window.ListToplevels().Where(t => t.IsRealized && t.Visible && t.TypeHint == WindowTypeHint.Dialog);                   // && t.TransientFor != null);
                foreach (var t in toplevels)
                {
                    t.Hide();
                    t.Show();
                }

                MonoDevelop.Ide.IdeApp.CommandService.RegisterTopWindow(win);
            }
            else
            {
                w.Parent = this;
                w.Size   = new Size(width, height);
                Requisition r = w.SizeRequest();
                w.Allocation = new Gdk.Rectangle(Allocation.X + x, Allocation.Y + y, r.Width, r.Height);
                topLevels.Add(w);
            }
        }
Exemple #13
0
    static void Main()
    {
        Application.Init();
        Gtk.Window w = new Gtk.Window("Mono-Cairo Truchet Tile");

        DrawingArea a = new CairoGraphic();

        Box box = new HBox(true, 0);

        box.Add(a);

        w.Add(box);
        w.Resize(500, 500);
        w.DeleteEvent += close_window;
        w.ShowAll();

        Application.Run();
    }
Exemple #14
0
    static void Main()
    {
        Application.Init ();

                    // Set up a button object.
                        Button btn = new Button ("Hello World");
                        // when this button is clicked, it'll run hello()
                        btn.Clicked += new EventHandler (hello);

                        Window window = new Window ("helloworld");
            window.Resize(400,300);
                    // when this window is deleted, it'll run delete_event()
                        window.DeleteEvent += delete_event;

                    // Add the button to the window and display everything
                    window.Add (btn);
                        window.ShowAll ();

                        Application.Run ();
    }
Exemple #15
0
    public static void Main()
    {
        Application.Init();

        // creating components
        Window myWin = new Window("My First Gtk# Application");
        Label myLabel = new Label();

        myWin.Resize(200,200);
        myLabel.Text = "Hello World";
        myWin.Add(myLabel);

        // event handlers
        //		myWin.DeleteEvent += new DeleteEventHandler(Window_Delete);
        myWin.DeleteEvent += Window_Delete;

        myWin.ShowAll();

        Application.Run();
    }
Exemple #16
0
        public FeaturesDialog()
        {
            Glade.XML app = new Glade.XML("./MapDesigner.glade", "featurewindow", "");
            app.Autoconnect(this);

            int numfeatures = Directory.GetFiles("objects3d").GetLength(0);

            featuretable.Resize((uint)numfeatures, 1);
            int featurenumber = 1;

            foreach (string file in Directory.GetFiles("objects3d"))
            {
                LogFile.GetInstance().WriteLine(file);
                AddFeature(file, featurenumber);
                featurenumber++;
            }
            //featuretable.ResizeMode = ResizeMode.Immediate;
            featurewindow.ShowAll();
            featurewindow.Resize(picturewidth * 2 + 20, numfeatures * (pictureheight * 2 + 20));
        }
Exemple #17
0
    public void initSelector()
    {
        Gdk.Window rW = Gdk.Global.DefaultRootWindow;

        Gtk.Window w = new Gtk.Window(null);
        w.Opacity   = 0.0;
        w.KeepAbove = true;

        DrawingArea da = new DrawingArea();

        w.Add(da);

        da.MotionNotifyEvent  += new MotionNotifyEventHandler(ScribbleMotionNotify);
        da.ButtonPressEvent   += new ButtonPressEventHandler(ScribbleButtonPress);
        da.ButtonReleaseEvent += new ButtonReleaseEventHandler(ScribbleButtonRelease);

        da.Events |= EventMask.LeaveNotifyMask | EventMask.ButtonReleaseMask | EventMask.ButtonPressMask |
                     EventMask.PointerMotionMask | EventMask.PointerMotionHintMask;

        w.Resize(rW.Screen.Width, rW.Screen.Height);
        w.ShowAll();
    }
        internal void SetFloatMode(Gdk.Rectangle rect)
        {
            if (floatingWindow == null)
            {
                ResetMode();
                SetRegionStyle(frame.GetRegionStyleForItem(this));

                floatingWindow = new DockFloatingWindow((Window)frame.Toplevel, GetTitle());
                floatingWindow.DefaultWidth  = 640;
                floatingWindow.DefaultHeight = 480;

                VBox box = new VBox();
                box.Show();
                box.PackStart(TitleTab, false, false, 0);
                box.PackStart(Widget, true, true, 0);
                floatingWindow.Add(box);
                floatingWindow.DeleteEvent += delegate(object o, DeleteEventArgs a)
                {
                    if (behavior == DockItemBehavior.CantClose)
                    {
                        Status = DockItemStatus.Dockable;
                    }
                    else
                    {
                        Visible = false;
                    }
                    a.RetVal = true;
                };
            }
            floatingWindow.Move(rect.X, rect.Y);
            floatingWindow.Resize(rect.Width, rect.Height);
            floatingWindow.Show();
            if (titleTab != null)
            {
                titleTab.UpdateBehavior();
            }
            Widget.Show();
        }
    void showHideSide(sideModes newSideMode)
    {
        /*
         * Window size A
         * Store window size just before showing side content store gui size.
         */
        if (sideMode == sideModes.HIDDEN)
        {
            encoder_configuration.GetSize(out windowWidth, out windowHeight);
        }

        //update sideMode value
        sideMode = newSideMode;

        //change gui
        if (sideMode == sideModes.MANAGE)
        {
            notebook_side.CurrentPage = 0;
        }
        else if (sideMode == sideModes.CAPTUREINERTIAL)
        {
            notebook_side.CurrentPage = 1;
        }

        notebook_side.Visible = (sideMode != sideModes.HIDDEN);

        button_encoder_capture_inertial_cancel.Sensitive = (sideMode != sideModes.CAPTUREINERTIAL);
        //button_encoder_capture_inertial_finish.Sensitive = (sideMode != sideModes.CAPTUREINERTIAL);

        /*
         * Window size B
         * Retrieve window size when side content is hided again
         */
        if (sideMode == sideModes.HIDDEN)
        {
            encoder_configuration.Resize(windowWidth, windowHeight);
        }
    }
        public static void Main(string[] args)
        {
            Application.Init();

                        /* Create a new window */
                        Window window = new Window ("Pixmap'd Buttons!");

                        /* It's a good idea to do this for all windows. */
                        window.DeleteEvent += delete_event;

                        /* Sets the border width of the window. */
                        window.BorderWidth = 10;

            window.Resize(400,300);

                        /* Create a new button */
                        Button button = new Button();

                        /* Connect the "clicked" signal of the button to our callback */
                        button.Clicked += callback;

                        /* This calls our box creating function */
                        Widget box = xpm_label_box ("info.xpm", "cool button");

                        /* Pack and show all our widgets */
                        box.Show();

                        button.Add(box);

                        button.Show();

                        window.Add(button);

                        window.ShowAll();

                        /* Rest in gtk_main and wait for the fun to begin! */
                        Application.Run();
        }
Exemple #21
0
        void OnActivateToolbar(object sender, System.EventArgs args)
        {
            int         width, height;
            Requisition minimum_size, natural_size;

            toolbar.GetPreferredSize(out minimum_size, out natural_size);
            app_window.GetSize(out width, out height);
            toolbar.Visible = !toolbar.Visible;

            if (toolbar.Visible)
            {
                toolbar.ShowArrow = false;
            }

            toolbar_orientation_menuitem.Sensitive = toolbar.Visible;

            if (Preferences.Get <bool> (Preferences.ToolbarShowKey) != toolbar.Visible)
            {
                Preferences.Set <bool> (Preferences.ToolbarShowKey, toolbar.Visible);
                Preferences.Save();
            }
            app_window.Resize(width, height - natural_size.Height);
        }
Exemple #22
0
        void OnActivateToolbar(object sender, System.EventArgs args)
        {
            int         width, height;
            Requisition requisition;

            requisition = toolbar.SizeRequest();
            app_window.GetSize(out width, out height);
            toolbar.Visible = !toolbar.Visible;

            if (toolbar.Visible)
            {
                toolbar.ShowArrow = false;
            }

            toolbar_orientation_menuitem.Sensitive = toolbar.Visible;

            if (Preferences.Get <bool> (Preferences.ToolbarShowKey) != toolbar.Visible)
            {
                Preferences.Set <bool> (Preferences.ToolbarShowKey, toolbar.Visible);
                Preferences.Save();
            }
            app_window.Resize(width, height - requisition.Height);
        }
Exemple #23
0
        public static void Main()
        {
            Application.Init ();

            //Create the new window
            Window myWindow = new Window ("");
            myWindow.Resize (300, 300);
            myWindow.SetPosition (WindowPosition.Center);
            myWindow.ModifyBg (StateType.Normal, new Gdk.Color (174, 229, 218));

            //Creamos una etiqueta

            Label label = new Label ();
            label.Text = "Mi 1.º aplicación con GTK";

            //Añadimos la etiqueta al formulario
            myWindow.Add (label);

            //Ver todo
            myWindow.ShowAll ();

            Application.Run ();
        }
        public static void Main(string[] args)
        {
            Application.Init();

            //Create the Window
            Window myWin = new Window("My first GTK# Application! ");
            myWin.Resize(500,500);

            myLabel = new Label();
            userInputField = new TextView();

            Button runCommand = new Button("run_command");
            runCommand.Clicked += HandleRunCommandClicked;

            MenuBar mainBar = new MenuBar();
            MenuItem exitItem = new MenuItem("File");

            MenuBar subMenu = new MenuBar();
            MenuItem subItem = new MenuItem("File");

            subMenu.Add(subItem);
            mainBar.Add(exitItem);

            VBox testBox = new VBox(false, 3);

            testBox.PackStart(mainBar);
            testBox.PackStart(userInputField);
            testBox.PackStart(myLabel);
            testBox.PackStart(runCommand);

            myWin.Add(testBox);

            //Show Everything
            myWin.ShowAll();

            Application.Run();
        }
        public void DetachPlayer()
        {
            bool isPlaying = Player.Playing;

            /* Pause the player here to prevent the sink drawing while the windows
             * are beeing changed */
            Player.Pause();
            if (!detachedPlayer)
            {
                Log.Debug("Detaching player");

                ExternalWindow playerWindow = new ExternalWindow();
                this.playerWindow  = playerWindow;
                playerWindow.Title = Constants.SOFTWARE_NAME;
                int player_width  = playercapturer.Allocation.Width;
                int player_height = playercapturer.Allocation.Height;
                playerWindow.SetDefaultSize(player_width, player_height);
                playerWindow.DeleteEvent += (o, args) => DetachPlayer();
                playerWindow.Show();
                playercapturer.Reparent(playerWindow.Box);
                // Hack to reposition video window in widget for OSX
                playerWindow.Resize(player_width + 10, player_height);
                videowidgetsbox.Visible = false;
            }
            else
            {
                Log.Debug("Attaching player again");
                videowidgetsbox.Visible = true;
                playercapturer.Reparent(this.videowidgetsbox);
                playerWindow.Destroy();
            }
            if (isPlaying)
            {
                Player.Play();
            }
            detachedPlayer = !detachedPlayer;
        }
Exemple #26
0
        static void ReadConfiguration()
        {
            string file = Path.Combine(SteticMain.ConfigDir, "configuration.xml");

            Configuration = null;

            if (File.Exists(file))
            {
                try {
                    using (StreamReader sr = new StreamReader(file)) {
                        XmlSerializer ser = new XmlSerializer(typeof(Configuration));
                        Configuration = (Configuration)ser.Deserialize(sr);
                    }
                } catch {
                    // Ignore exceptions while reading the recents file
                }
            }

            if (Configuration != null)
            {
                MainWindow.Move(Configuration.WindowX, Configuration.WindowY);
                MainWindow.Resize(Configuration.WindowWidth, Configuration.WindowHeight);
                if (Configuration.WindowState == Gdk.WindowState.Maximized)
                {
                    MainWindow.Maximize();
                }
                else if (Configuration.WindowState == Gdk.WindowState.Iconified)
                {
                    MainWindow.Iconify();
                }
                SteticApp.ShowNonContainerWarning = Configuration.ShowNonContainerWarning;
            }
            else
            {
                Configuration = new Configuration();
            }
        }
    public static void Main()
    {
        Application.Init ();

                Window win = new Window ("Test");
                win.Resize (200, 200);

                Label label = new Label ();
                label.Text = "Hello, world!";

                win.Add (label);

                ApplicationIndicator indicator = new ApplicationIndicator ("Example",
                                                                           "applications-microblogging-panel",
                                                                           AppIndicatorCategory.ApplicationStatus);

                indicator.AppIndicatorStatus = AppIndicatorStatus.Attention;

                Menu menu = new Menu ();
                var foo = new MenuItem ("Foo");
                menu.Append (foo);
                foo.Activated += delegate {
                        System.Console.WriteLine ("Foo item has been activated");
                };

                menu.Append (new MenuItem ("Bar"));

                indicator.Menu = menu;
                indicator.Menu.ShowAll ();

                indicator.SecondaryActivateTarget = foo;

                win.ShowAll ();

                Application.Run ();
    }
        public WindowBuilder()
        {
            _columnFilter = 0;
            _textToFilter = "";

            _processIdToKill = new List <int>();
            _listStore       = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string),
                                             typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));

            Application.Init();

            _window = new Window("Label sample");
            _window.Resize(1300, 600);
            _window.Title = "Process Watch";
            _window.SetIconFromFile("icons/processIconSmall.png");
            _window.BorderWidth  = 5;
            _window.DeleteEvent += OnWindowClose;

            var aboutButton = new Button();
            var aboutIcon   = new Image();

            aboutIcon.Pixbuf        = new Pixbuf("icons/information.png");
            aboutButton.Image       = aboutIcon;
            aboutButton.TooltipText = "About Process Watch";
            aboutButton.Clicked    += (sender, args) =>
            {
                _aboutDialog.Show();
            };

            _aboutDialog = CreateAboutDialog();

            var filterButton = new Button();

            filterButton.Image       = new Image(Stock.Find, IconSize.Button);
            filterButton.TooltipText = "Filtration utilities";
            filterButton.Clicked    += (sender, args) =>
            {
                if (_filtrationHBox.IsVisible)
                {
                    _filtrationHBox.Hide();
                }
                else
                {
                    _filtrationHBox.ShowAll();
                }
            };

            var windowHBox = new HBox(false, 5);

            windowHBox.PackEnd(aboutButton, false, false, 0);
            windowHBox.PackEnd(filterButton, false, false, 0);

            _processNameEntry          = new Entry();
            _processNameEntry.Changed += OnChanged;

            _processIdEntry               = new Entry();
            _processIdEntry.Changed      += OnChanged;
            _processIdEntry.TextInserted += OnlyNumerical;

            // String values for the combobox - filtration direction
            _filtrationDirectionOptions = new[]
            {
                ">",
                "≥",
                "=",
                "≤",
                "<"
            };

            // String values for the combobox - memory usage units
            _memoryFiltrationDirectionUnits = new[]
            {
                "B",
                "KB",
                "MB",
                "GB"
            };


            _memoryFiltrationEntry = new Entry();
            _memoryFiltrationEntry.MaxWidthChars = 7;
            _memoryFiltrationEntry.WidthChars    = 7;
            _memoryFiltrationEntry.Changed      += OnChanged;
            _memoryFiltrationEntry.TextInserted += OnlyNumerical;

            _memoryFiltrationDirectionComboBox          = new ComboBox(_filtrationDirectionOptions);
            _memoryFiltrationDirectionComboBox.Changed += OnChanged;

            _memoryFiltrationUnitsComboBox          = new ComboBox(_memoryFiltrationDirectionUnits);
            _memoryFiltrationUnitsComboBox.Changed += OnChanged;

            _memoryFiltrationHbox = new HBox();
            _memoryFiltrationHbox.PackStart(_memoryFiltrationDirectionComboBox, false, false, 0);
            _memoryFiltrationHbox.PackStart(_memoryFiltrationEntry, false, false, 0);
            _memoryFiltrationHbox.PackStart(_memoryFiltrationUnitsComboBox, false, false, 0);


            _cpuFiltrationEntry = new Entry();
            _cpuFiltrationEntry.MaxWidthChars = 7;
            _cpuFiltrationEntry.WidthChars    = 7;
            _cpuFiltrationEntry.Changed      += OnChanged;
            _cpuFiltrationEntry.TextInserted += OnlyNumerical;

            _cpuFiltrationDirectionComboBox          = new ComboBox(_filtrationDirectionOptions);
            _cpuFiltrationDirectionComboBox.Changed += OnChanged;

            var cpuFiltrationLabel = new Label("%");

            _cpuFiltrationHbox = new HBox();
            _cpuFiltrationHbox.PackStart(_cpuFiltrationDirectionComboBox, false, false, 0);
            _cpuFiltrationHbox.PackStart(_cpuFiltrationEntry, false, false, 0);
            _cpuFiltrationHbox.PackStart(cpuFiltrationLabel, false, false, 0);


            _filtrationOptions = new[]
            {
                "All processes",
                "Filter by PID",
                "Filter by Process Name",
                "Filter by Memory Usage",
                "Filter by CPU usage",
            };

            var filtrationCombo = new ComboBox(_filtrationOptions);

            filtrationCombo.Changed += ComboOnChanged;

            _filtrationHBox = new HBox(false, 5);
            _filtrationHBox.PackStart(filtrationCombo, false, false, 0);


            string[] columnLabels =
            {
                "PID",
                "Process name",
                "Memory usage",
                "Priority",
                "User CPU Time",
                "Privileged CPU Time",
                "Total CPU Time",
                "CPU usage",
                "Threads",
                "Start Time"
            };


            _treeModelFilter             = new TreeModelFilter(_listStore, null);
            _treeModelFilter.VisibleFunc = Filter;

            var treeModelSort = new TreeModelSort(_treeModelFilter);

            treeModelSort.SetSortFunc(0, WindowBuilderHelper.IdSortFunc);
            treeModelSort.SetSortFunc(1, WindowBuilderHelper.ProcessNameSortFunc);
            treeModelSort.SetSortFunc(2, WindowBuilderHelper.MemoryUsageSortFunc);
            treeModelSort.SetSortFunc(3, WindowBuilderHelper.PrioritySortFunc);
            treeModelSort.SetSortFunc(4, WindowBuilderHelper.UserCpuTimeSortFunc);
            treeModelSort.SetSortFunc(5, WindowBuilderHelper.PrivilegedCpuTimeSortFunc);
            treeModelSort.SetSortFunc(6, WindowBuilderHelper.TotalCpuTimeSortFunc);
            treeModelSort.SetSortFunc(7, WindowBuilderHelper.CpuUsageSortFunc);
            treeModelSort.SetSortFunc(8, WindowBuilderHelper.ThreadCountSortFunc);
            treeModelSort.SetSortFunc(9, WindowBuilderHelper.StartTimeSortFunc);

            var treeView = new TreeView();

            treeView.Model              = treeModelSort;
            treeView.Selection.Mode     = SelectionMode.Multiple;
            treeView.Selection.Changed += OnSelectionChanged;
            treeView.TooltipColumn      = 1;

            // Create a scrollable window
            var scrolledWindow = new ScrolledWindow();

            scrolledWindow.Add(treeView);

            // Create a CellRendererText responsible for proper rendering cell data
            var cellRendererText = new CellRendererText();

            cellRendererText.Alignment = Pango.Alignment.Right;
            cellRendererText.Xalign    = 0.5f;

            // Load the _treeView with TreeViewColumns
            for (int i = 0; i < 10; i++)
            {
                var treeViewColumn = new TreeViewColumn();
                treeViewColumn.Clickable     = true;
                treeViewColumn.Resizable     = true;
                treeViewColumn.Title         = columnLabels[i];
                treeViewColumn.SortIndicator = true;
                treeViewColumn.Alignment     = 0.5f;
                treeViewColumn.Expand        = true;
                treeViewColumn.SortColumnId  = i;
                treeViewColumn.PackStart(cellRendererText, true);
                treeViewColumn.AddAttribute(cellRendererText, "text", i);

                switch (i)
                {
                case 0:
                    break;

                case 1:
                    _window.GetSize(out int width, out int height);
                    treeViewColumn.MaxWidth = Math.Abs(width / 2);
                    break;

                case 2:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.MemoryUsageFormatter);
                    break;

                case 3:
                    break;

                case 4:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.UserCpuTimeFormatter);
                    break;

                case 5:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.PrivilegedCpuTimeFormatter);
                    break;

                case 6:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.TotalCpuTimeFormatter);
                    break;

                case 7:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.CpuUsageFormatter);
                    break;

                case 8:
                    break;

                case 9:
                    treeViewColumn.SetCellDataFunc(cellRendererText, WindowBuilderHelper.StartTimeFormatter);
                    break;
                }

                treeView.AppendColumn(treeViewColumn);
            }

            var killButton = new Button("Kill process");

            killButton.Clicked += KillProcess;

            var windowVBox = new VBox(false, 5);

            windowVBox.PackStart(windowHBox, false, false, 0);
            windowVBox.PackStart(_filtrationHBox, false, false, 0);
            windowVBox.PackStart(scrolledWindow, true, true, 0);
            windowVBox.PackStart(killButton, false, false, 0);

            _window.Add(windowVBox);

            // Create an instance of the object Updater
            _processGrabber = new ProcessGrabber();
            // Add a callback executed when _processGrabber takes process data.
            // The callback clears the _treeView content and loads new data
            // Before clearing the _treeView content the callback saves the current scroll position
            _processGrabber.OnResult += (sender, processList) =>
            {
                Application.Invoke(delegate
                {
                    _currentScrollPosition = treeView.Vadjustment.Value;
                    StoreClear();
                    LoadStore(processList);

                    treeView.ShowAll();
                });
            };

            // Add a callback executed after 'Changed' event raised after changing the position of the _treeView
            // When the _treeView content is reloaded the previous scroll position is updated
            treeView.Vadjustment.Changed += (sender, args) =>
            {
                treeView.Vadjustment.Value = _currentScrollPosition;
            };

            // Start the Timer process responsible for grabbing process data periodically
            _processGrabber.Run();

            treeView.ShowAll();
            _window.ShowAll();

            // Hide widgets related to process filtration
            _filtrationHBox.Hide();
        }
Exemple #29
0
 static void Refresh(string new_filename, Gdk.Pixbuf p)
 {
     window.Resize(p.Width + 25, p.Height + 75);
     window.Title = String.Format("Image Viewer: {0}", new_filename);
 }
Exemple #30
0
        static void Main()
        {
            Application.Init ();

            Gtk.Window w = new Gtk.Window ("Mono-Cairo Rounded Rectangles");
            DrawingArea a = new CairoGraphic ();

            Box box = new HBox (true, 0);
            box.Add (a);
            w.Add (box);

            w.Resize (500, 500);
            w.DeleteEvent += close_window;
            w.ShowAll ();
            w.KeyPressEvent += KeyPress;

            Application.Run ();
        }
        public void Start()
        {
            window = new Window(WindowType.Toplevel);
            window.SetPosition(WindowPosition.Mouse);
            window.KeepAbove = true;
            window.Resize(200, 150);
            window.Title = "Dimensions";
            window.Deletable = false;

            Fixed fix = new Fixed();

            // width
            widthLabel = new Label();
            widthLabel.Text = "Width";
            fix.Put(widthLabel, 15, 25);

            widthInputEntry = new Entry();
            widthInputEntry.SetSizeRequest(100, 25);
            widthInputEntry.TextInserted += OnlyNumber;
            widthInputEntry.TextInserted += ChangeWidth;
            widthInputEntry.TextDeleted += ChangeWidth;
            fix.Put(widthInputEntry, 80, 20);

            // height
            heightLabel = new Label();
            heightLabel.Text = "Height";
            fix.Put(heightLabel, 15, 75);

            heightInputEntry = new Entry();
            heightInputEntry.SetSizeRequest(100, 25);
            heightInputEntry.TextInserted += OnlyNumber;
            heightInputEntry.TextInserted += ChangeHeight;
            heightInputEntry.TextDeleted += ChangeHeight;
            fix.Put(heightInputEntry, 80, 70);

            // Buttons
            okButton = new Button();
            okButton.Label = "OK";
            okButton.SetSizeRequest(80, 30);
            okButton.Clicked += okButton_Clicked;
            fix.Put(okButton, 10, 110);

            cancelButton = new Button();
            cancelButton.Label = "Cancel";
            cancelButton.SetSizeRequest(80, 30);
            cancelButton.Clicked += cancelButton_Clicked;
            fix.Put(cancelButton, 110, 110);

            window.Add(fix);
            window.ShowAll();

            widthInputEntry.Text = "" + width;
            heightInputEntry.Text = "" + height;
        }
    static void Main()
    {
        Application.Init ();
        Gtk.Window w = new Gtk.Window ("RotarCuadrado");

        DrawingArea da = new CairoGraphic ();
        Box box = new VBox (true, 0);
        box.Add (da);

        w.Add (box);
        w.Resize (256, 256);

        w.DeleteEvent += closeWindow;
        w.ShowAll ();

        Application.Run ();
    }
    public GnomeArtNgApp(string[] args)
    {
        Application.Init();
        //i18n
        Catalog.Init("gnomeartng","./locale");
        config=new CConfiguration();
        //initialize Glade
        string mainW = "MainWindow";
        Glade.XML gxml = new Glade.XML (null, "gui.glade", mainW, null);
        mainWindow = (Gtk.Window) gxml.GetWidget (mainW);
        gxml.Autoconnect (this);

        //Connect all events
        mainWindow.DeleteEvent+=new DeleteEventHandler(OnWindowDeleteEvent);
        ExtInfoPreviewButton.Clicked += new EventHandler(OnPreviewButtonClicked);
        InstallButton.Clicked  += new EventHandler(OnInstallButtonClicked);
        RevertButton.Clicked  += new EventHandler(OnRevertButtonClicked);
        RefreshButton.Clicked += new EventHandler(OnRefreshButtonClicked);
        SaveButton.Clicked  += new EventHandler(OnSaveButtonClicked);
        MainNotebook.SwitchPage += new SwitchPageHandler(OnSwitchPage);
        FilterEntry.Changed += new EventHandler(OnFilterEntriesChanged);
        //		SortKindCb.Changed += new EventHandler(OnSortKindEntryChanged);
        //		SortDirectionCb.Changed += new EventHandler(OnSortDirectionEntryChanged);
        //		SortCloseButton.Clicked += new EventHandler(OnSortCloseClicked);
        FilterEntry.KeyReleaseEvent += new KeyReleaseEventHandler(OnFilterbarKeyReleased);
        FilterCloseButton.Clicked += new EventHandler(OnFilterbarCloseClicked);

        //Menuitems
        QuitMenuItem.Activated += new EventHandler(OnQuitItemSelected);
        UpdateMenuItem.Activated += new EventHandler(OnUpdateItemSelected);
        DonateMenuItem.Activated += new EventHandler(CUpdateWindow.onDonateButtonClicked);
        FilterMenuItem.Activated += new EventHandler(OnFilterItemSelected);
        //		SortMenuItem.Activated += new EventHandler(OnSortItemSelected);
        InfoMenuItem.Activated += new EventHandler(OnInfoItemSelected);
        PreferencesMenuItem.Activated += new EventHandler(OnPreferencesItemSelected);
        FTAItem.Activated += new EventHandler(onFtaItemSelected);

        //First, download all thumbs...but don't bother the user with the update message, even if there is one
        bool RestartApp= false;
        if (config.NeverStartedBefore)
            new CFirstTimeAssistant(config);
        else if (config.DontBotherForUpdates==false) {
            if (config.UpdateAvailable) {
                Console.WriteLine("An update is available, newest version is: "+config.NewestVersionNumberOnServer);
                RestartApp = ShowUpdateWindow();
            }
        }

        if (!RestartApp) {
            //Application placement - doesn't work properly with compiz (is it the window placement plugin?)
            if (config.SettingsLoadOk) {
                mainWindow.Resize(config.Window.Width, config.Window.Height);
                mainWindow.Move(config.Window.X, config.Window.Y);
                //Console.WriteLine(config.Window.X+" "+ config.Window.Y);
            }

            //ArtManager erzeugen
            man = new CArtManager(config);

            //Stores anlegen und IconViews anlegen
            for(int i=0;i<ListStoreCount;i++){
                sWins[i] = (Gtk.ScrolledWindow)(gxml.GetWidget("swin"+i));
                stores[i]= new ListStore (typeof(Pixbuf),typeof (string), typeof (string), typeof(int));
                IconViews[i] = new Gtk.IconView(stores[i]);
                IconViews[i].SelectionChanged += new System.EventHandler(OnSelChanged);
                IconViews[i].ItemActivated += new ItemActivatedHandler(OnItemActivated);
                IconViews[i].PixbufColumn = 0;
                CurrentIconView = IconViews[0];

                sWins[i].Add(IconViews[i]);
                IconViews[i].Show();
            }

            //Create the comboboxes
            imageTypeBox = ComboBox.NewText();
            imageResolutionsBox = ComboBox.NewText();
            imageStyleBox = ComboBox.NewText();

            //Verschiedene Styles hinzufügen
            imageStyleBox.AppendText(Catalog.GetString("Centered"));
            imageStyleBox.AppendText(Catalog.GetString("Filled"));
            imageStyleBox.AppendText(Catalog.GetString("Scaled"));
            imageStyleBox.AppendText(Catalog.GetString("Zoomed"));
            imageStyleBox.AppendText(Catalog.GetString("Tiled"));
            imageStyleBox.Active=0;
            imageStyleBox.Changed += new EventHandler(OnImageStyleBoxChanged);

            LowerTable.Attach(imageTypeBox,1,2,2,3);
            LowerTable.Attach(imageResolutionsBox,1,2,3,4);
            LowerTable.Attach(imageStyleBox,1,2,4,5);

            OnSwitchPage(MainNotebook,new SwitchPageArgs());
            Gtk.Application.Run ();

        }
    }
Exemple #34
0
        public static void Main(string[] args)
        {
            Application.Init ();

            client = new AgarioClient ();

            w = new Gtk.Window ("Agario gtk client");
            w.Decorated = false;
            w.Maximize ();
            w.SetSizeRequest (1024, 768);

            darea = new CairoGraphic (client);
            darea.DoubleBuffered = true;
            darea.SetSizeRequest (800, 800);

            Box box = new HBox (false, 0);
            box.Add (darea);
            w.Add (box);
            w.Resize (500, 500);
            w.DeleteEvent += close_window;
            w.ShowAll ();

            w.KeyPressEvent += OnKeyPressEvent;

            //Timer loop for ui display
            new Timer (TimerCallback, null, 0, 20);
            //Timer loop for mouse events
            new Timer (UIControl, null, 0, 100);

            Application.Run ();
        }
Exemple #35
0
    static int LoadXap(string file, List <string> args)
    {
        string [] test = { "" };

        if (sync)
        {
            test [0] = "--sync";
        }

        Application.Init("mopen", ref test);
        MoonlightRuntime.Init();
        window = new Gtk.Window(file);
        window.SetDefaultSize(400, 400);

        if (transparent)
        {
            CompositeHelper.SetRgbaColormap(window);
            window.AppPaintable = true;
            window.ExposeEvent += HandleExposeEvent;
        }

        if (desklet)
        {
            ConfigureDeskletWindow(window);
        }

        window.DeleteEvent += delegate {
            Application.Quit();
        };

        moon_host = new MoonlightHost();

        try {
            moon_host.LoadXap(file);
        } catch (Exception e) {
            Console.Error.WriteLine("mopen: Could not load xaml: {0}", e.Message);
            return(1);
        }

        System.Windows.Application app = moon_host.Application;
        FrameworkElement           top = (FrameworkElement)app.RootVisual;

        if (top is Moon.Windows.Desktop.Window)
        {
            var moonwindow = ((Moon.Windows.Desktop.Window)top);
            /* special window handling mode */
            moonwindow.IsActive = window.IsActive;

            Wnck.Screen.Default.ActiveWindowChanged += delegate {
                moonwindow.IsActive = window.IsActive;
            };

            moonwindow.PositionChanged += delegate {
                window.Move((int)moonwindow.Position.X, (int)moonwindow.Position.Y);
            };

            moonwindow.SizeChanged += delegate {
                window.Resize((int)moonwindow.Size.Width, (int)moonwindow.Size.Height);
            };

            moonwindow.WindowOpacityChanged += delegate {
                moon_host.QueueDraw();
            };

            if (!transparent)
            {
                CompositeHelper.SetRgbaColormap(window);
                window.AppPaintable = true;
                window.ExposeEvent += HandleExposeEvent;

                moon_host.AppPaintable = true;
                moon_host.Transparent  = true;
            }
        }

        if (parse_only)
        {
            return(0);
        }

        if (width == -1)
        {
            width = (int)top.Width;
        }
        if (height == -1)
        {
            height = (int)top.Height;
        }

        if (width > 0 && height > 0)
        {
            moon_host.SetSizeRequest(width, height);
            window.Resize(width, height);
        }

        if (transparent)
        {
            moon_host.AppPaintable = true;
            moon_host.Transparent  = true;
        }

        if (desklet)
        {
            top.MouseLeftButtonDown += new MouseButtonEventHandler(HandleMouseLeftButtonDown);
            top.MouseLeftButtonUp   += new MouseButtonEventHandler(HandleMouseLeftButtonUp);
            top.MouseMove           += new MouseEventHandler(HandleMouseMove);
        }

        window.Add(moon_host);

        window.ShowAll();

        if (story_names != null)
        {
            storyboards = new List <Storyboard> ();

            foreach (string story in story_names)
            {
                object     o  = top.FindName(story);
                Storyboard sb = o as Storyboard;

                if (sb == null)
                {
                    Console.Error.WriteLine("mopen: there is no Storyboard object named {0} in the XAML file", story);
                    return(1);
                }
                sb.Completed += delegate {
                    window.Title = String.Format("Storyboard {0} completed", current_storyboard - 1);
                };

                storyboards.Add(sb);
            }
            ;

            top.MouseLeftButtonUp += delegate {
                if (current_storyboard == storyboards.Count)
                {
                    current_storyboard = 0;
                }
                if (current_storyboard == storyboards.Count)
                {
                    return;
                }

                window.Title = String.Format("Storyboard {0} running", current_storyboard);
                storyboards [current_storyboard++].Begin();
            };
        }

        if (timeout > 0)
        {
            GLib.Timeout.Add((uint)(timeout * 1000), new TimeoutHandler(Quit));
        }

        Application.Run();
        return(0);
    }
Exemple #36
0
        public void DetachPlayer()
        {
            bool isPlaying = Player.Playing;

            /* Pause the player here to prevent the sink drawing while the windows
             * are beeing changed */
            Player.Pause ();
            if (!detachedPlayer) {
                Log.Debug ("Detaching player");

                ExternalWindow playerWindow = new ExternalWindow ();
                this.playerWindow = playerWindow;
                playerWindow.Title = Constants.SOFTWARE_NAME;
                int player_width = playercapturer.Allocation.Width;
                int player_height = playercapturer.Allocation.Height;
                playerWindow.SetDefaultSize (player_width, player_height);
                playerWindow.DeleteEvent += (o, args) => DetachPlayer ();
                playerWindow.Show ();
                playercapturer.Reparent (playerWindow.Box);
                // Hack to reposition video window in widget for OSX
                playerWindow.Resize (player_width + 10, player_height);
                videowidgetsbox.Visible = false;
            } else {
                Log.Debug ("Attaching player again");
                videowidgetsbox.Visible = true;
                playercapturer.Reparent (this.videowidgetsbox);
                playerWindow.Destroy ();
            }
            if (isPlaying) {
                Player.Play ();
            }
            detachedPlayer = !detachedPlayer;
        }
Exemple #37
0
 public GraphWin(string title, int width, int height)
 {
     this.window = new Gtk.Window(title);
     this.canvas = new Gnome.Canvas();
     // expand, fill, padding
     canvas.SetSizeRequest(width, height);
     canvas.SetScrollRegion(0.0, 0.0,
            (double) width, (double) height);
     window.Resize(width, height);
     window.Add(canvas);
     window.ShowAll();
 }
Exemple #38
0
        public MainWindow()
        {
            ToolItem        spacerItem;
            FileSearchEntry searchEntry;
            ToolItem        searchEntryItem;
            Alignment       searchEntryBox;

            object[] attrs= Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), true);
            AssemblyTitleAttribute attr = (AssemblyTitleAttribute)attrs[0];
            AssemblyName asmName = Assembly.GetExecutingAssembly().GetName();

            string title = String.Format ("{0} (BETA) {1} (Protocol Version: {2})",
                                      attr.Title, asmName.Version,
                                      Core.ProtocolVersion);

            // Create the interface
            window = new Window (title);
            window.SetDefaultSize (850, 550);
            window.DeleteEvent += on_win_delete;
            window.ConfigureEvent += on_MainWindow_configure_event;
            window.FocusInEvent += window_FocusInEvent;

            ((ToggleAction)Runtime.BuiltinActions["ToggleMainToolbar"]).Active = Gui.Settings.ShowToolbar;
            Runtime.BuiltinActions["ToggleMainToolbar"].Activated += ToggleMainToolbar_Activated;

            ((ToggleAction)Runtime.BuiltinActions["ToggleMainStatusbar"]).Active = Gui.Settings.ShowStatusBar;
            Runtime.BuiltinActions["ToggleMainStatusbar"].Activated += ToggleMainStatusbar_Activated;
            window.AddAccelGroup (Runtime.UIManager.AccelGroup);

            mainVBox = new VBox ();
            window.Add (mainVBox);
            mainVBox.Show ();

            if (Common.OSName == "Darwin") {
                MenuBar menubar = (MenuBar) Runtime.UIManager.GetWidget ("/OSXAppMenu");

                Imendio.MacIntegration.Menu.SetMenuBar(menubar);

                MenuItem preferencesItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/Preferences");
                MenuItem aboutItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/About");

                IntPtr group = Imendio.MacIntegration.Menu.AddAppMenuGroup();

                Imendio.MacIntegration.Menu.AddAppMenuItem(group, aboutItem, "About Meshwork");

                group = Imendio.MacIntegration.Menu.AddAppMenuGroup();

                Imendio.MacIntegration.Menu.AddAppMenuItem(group, preferencesItem, "Preferences");

                MenuItem quitItem = (MenuItem) Runtime.UIManager.GetWidget ("/OSXAppMenu/NetworkMenu/Quit");
                Imendio.MacIntegration.Menu.SetQuitMenuItem(quitItem);
            } else {
                MenuBar menubar = (MenuBar) Runtime.UIManager.GetWidget ("/MainWindowMenuBar");
                mainVBox.PackStart (menubar, false, false, 0);
                menubar.Show ();
            }

            toolbar = (Toolbar) Runtime.UIManager.GetWidget ("/MainWindowToolbar");
            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            toolbar.IconSize = IconSize.LargeToolbar;

            spacerItem = new ToolItem();
            spacerItem.Expand = true;
            toolbar.Insert(spacerItem, -1);
            spacerItem.Show();

            searchEntry = new FileSearchEntry();

            searchEntryBox = new Alignment(0.5f, 0.5f, 0, 0);
            searchEntryBox.LeftPadding = 4;
            searchEntryBox.RightPadding = 1;
            searchEntryBox.Add(searchEntry);

            searchEntryItem = new ToolItem();
            searchEntryItem.Add(searchEntryBox);

            toolbar.Insert(searchEntryItem, -1);
            searchEntryItem.ShowAll();

            mainVBox.PackStart (toolbar, false, false, 0);

            mainPaned = new HPaned();
            mainPaned.Mapped += delegate (object sender, EventArgs args) {
                // XXX: Remember the user's last setting instead
                mainPaned.Position = 190;

                // Set some colors
                //infoBoxSeparator.ModifyBg(StateType.Normal, GtkHelper.DarkenColor (mainbar.Style.Background(StateType.Normal), 2));
                //infoSwitcherTree.ModifyBase(StateType.Normal, infoSwitcherTree.Style.Base(StateType.Active));
                //infoSwitcherTree.ModifyBase(StateType.Active, infoBoxSeparator.Style.Base(StateType.Selected));
            };
            mainPaned.Show();
            mainVBox.PackStart (mainPaned, true, true, 0);

            // Create page notebook
            pageNotebook = new Notebook();
            pageNotebook.ShowTabs = false;
            pageNotebook.ShowBorder = false;
            mainPaned.Pack2(pageNotebook, true, true);
            pageNotebook.ShowAll();

            // Create sidebar
            sidebar = new MainSidebar();
            sidebar.ItemAdded += sidebar_ItemAdded;
            sidebar.SelectedItemChanged += sidebar_SelectedItemChanged;
            sidebar.AddBuiltinItems();

            mainPaned.Pack1(sidebar, false, false);
            sidebar.ShowAll();

            CreateStatusbar ();

            // Apply "view" settings
            toolbar.Visible = Gui.Settings.ShowToolbar;
            statusBar.Visible = Gui.Settings.ShowStatusBar;

            // Hook up Core events
            Core.ShareBuilder.StartedIndexing  += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_StartedIndexing));
            Core.ShareBuilder.FinishedIndexing += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_FinishedIndexing));
            Core.ShareBuilder.StoppedIndexing  += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sb_StoppedIndexing));
            Core.ShareBuilder.ErrorIndexing    += (ErrorEventHandler)DispatchService.GuiDispatch(new ErrorEventHandler(sb_ErrorIndexing));
            Core.ShareHasher.StartedHashingFile += (ShareHasherTaskEventHandler)DispatchService.GuiDispatch(new ShareHasherTaskEventHandler(sh_StartedFinished));
            Core.ShareHasher.FinishedHashingFile += (ShareHasherTaskEventHandler)DispatchService.GuiDispatch(new ShareHasherTaskEventHandler(sh_StartedFinished));
            Core.ShareHasher.QueueChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(sh_QueueChanged));

            Core.FileSearchManager.SearchAdded   += (FileSearchEventHandler)DispatchService.GuiDispatch(new FileSearchEventHandler(FileSearchManager_SearchAdded));
            Core.FileSearchManager.SearchRemoved += (FileSearchEventHandler)DispatchService.GuiDispatch(new FileSearchEventHandler(FileSearchManager_SearchRemoved));

            window.Resize (Gui.Settings.WindowSize.Width, Gui.Settings.WindowSize.Height);
            window.Move (Gui.Settings.WindowPosition.X, Gui.Settings.WindowPosition.Y);

            SelectedPage = NetworkOverviewPage.Instance;
        }
Exemple #39
0
        public void Start()
        {
            window = new Window(WindowType.Toplevel);
            window.Move(10, 60);
            window.Resize(230, 700);
            window.Title = "Toolbar";
            window.Deletable = false;
            window.ModifyBg(StateType.Normal, new Gdk.Color(182, 195, 205));

            Fixed fix = new Fixed();

            openButton = new Button();
            openButton.Label = "Open Images";
            openButton.SetSizeRequest(100, 30);
            openButton.TooltipText = "Shortcut: " + keymap["open images"].ToString();
            openButton.Name = "open images";
            openButton.Clicked += OperatorButtonClicked;

            saveButton = new Button();
            saveButton.Label = "Save Collage";
            saveButton.SetSizeRequest(100, 30);
            saveButton.TooltipText = "Shortcut: " + keymap["save collage"].ToString();
            saveButton.Name = "save collage";
            saveButton.Clicked += OperatorButtonClicked;

            deleteButton = new Button();
            deleteButton.Label = "Delete";
            deleteButton.SetSizeRequest(100, 30);
            deleteButton.TooltipText = "Shortcut: " + keymap["delete images"].ToString();
            deleteButton.Name = "delete images";
            deleteButton.Clicked += OperatorButtonClicked;

            changeAspectRatioButton = new Button();
            changeAspectRatioButton.Label = "Aspect Ratio";
            changeAspectRatioButton.SetSizeRequest(100, 30);
            changeAspectRatioButton.TooltipText = "Shortcut: " + keymap["change aspect ratio"].ToString();
            changeAspectRatioButton.Name = "change aspect ratio";
            changeAspectRatioButton.Clicked += OperatorButtonClicked;

            autoPositionButton = new Button();
            autoPositionButton.Label = "Auto Position";
            autoPositionButton.SetSizeRequest(100, 30);
            autoPositionButton.TooltipText = "Shortcut: " + keymap["auto position"].ToString();
            autoPositionButton.Name = "auto position";
            autoPositionButton.Clicked += OperatorButtonClicked;

            changeBackgroundColorButton = new Button();
            changeBackgroundColorButton.Label = "Background";
            changeBackgroundColorButton.SetSizeRequest(100, 30);
            changeBackgroundColorButton.TooltipText = "Shortcut: " + keymap["change background color"].ToString();
            changeBackgroundColorButton.Name = "change background color";
            changeBackgroundColorButton.Clicked += OperatorButtonClicked;

            setBackwardButton = new Button();
            setBackwardButton.Label = "Set Backward";
            setBackwardButton.SetSizeRequest(100, 30);
            setBackwardButton.TooltipText = "Shortcut: " + keymap["set backward"].ToString();
            setBackwardButton.Name = "set backward";
            setBackwardButton.Clicked += OperatorButtonClicked;

            setForwardButton = new Button();
            setForwardButton.Label = "Set Forward";
            setForwardButton.SetSizeRequest(100, 30);
            setForwardButton.TooltipText = "Shortcut: " + keymap["set forward"].ToString();
            setForwardButton.Name = "set forward";
            setForwardButton.Clicked += OperatorButtonClicked;

            setAsBackgroundButton = new Button();
            setAsBackgroundButton.Label = "Set Background";
            setAsBackgroundButton.SetSizeRequest(100, 30);
            setAsBackgroundButton.TooltipText = "Shortcut: " + keymap["set as background"].ToString();
            setAsBackgroundButton.Name = "set as background";
            setAsBackgroundButton.Clicked += OperatorButtonClicked;

            setToFrontButton = new Button();
            setToFrontButton.Label = "Set to Front";
            setToFrontButton.SetSizeRequest(100, 30);
            setToFrontButton.TooltipText = "Shortcut: " + keymap["set to front"].ToString();
            setToFrontButton.Name = "set to front";
            setToFrontButton.Clicked += OperatorButtonClicked;

            clearButton = new Button();
            clearButton.Label = "Clear Collage";
            clearButton.SetSizeRequest(100, 30);
            clearButton.TooltipText = "Shortcut: " + keymap["clear collage"].ToString();
            clearButton.Name = "clear collage";
            clearButton.Clicked += OperatorButtonClicked;

            selectAllButton = new Button();
            selectAllButton.Label = "Select All";
            selectAllButton.SetSizeRequest(100, 30);
            selectAllButton.TooltipText = "Shortcut: " + keymap["select all"].ToString();
            selectAllButton.Name = "select all";
            selectAllButton.Clicked += OperatorButtonClicked;

            undoButton = new Button();
            undoButton.Label = "Undo";
            undoButton.SetSizeRequest(100, 30);
            undoButton.TooltipText = "Shortcut: " + keymap["undo"].ToString();
            undoButton.Name = "undo";
            undoButton.Clicked += OperatorButtonClicked;

            redoButton = new Button();
            redoButton.Label = "Redo";
            redoButton.SetSizeRequest(100, 30);
            redoButton.TooltipText = "Shortcut: " + keymap["redo"].ToString();
            redoButton.Name = "redo";
            redoButton.Clicked += OperatorButtonClicked;

            stayOnTopCheckbutton = new CheckButton();
            stayOnTopCheckbutton.Label = "Stay on Top";
            stayOnTopCheckbutton.Toggled += StayOnTopToogled;

            // place objects in window
            fix.Put(openButton, 10, 20); fix.Put(saveButton, 120, 20);
            fix.Put(deleteButton, 10, 55); fix.Put(changeAspectRatioButton, 120, 55);
            fix.Put(autoPositionButton, 10, 90); fix.Put(changeBackgroundColorButton, 120, 90);

            fix.Put(setBackwardButton, 10, 140); fix.Put(setForwardButton, 120, 140);
            fix.Put(setAsBackgroundButton, 10, 175); fix.Put(setToFrontButton, 120, 175);
            fix.Put(clearButton, 10, 210); fix.Put(selectAllButton, 120, 210);

            fix.Put(undoButton, 10, 260); fix.Put(redoButton, 120, 260);

            fix.Put(stayOnTopCheckbutton, 10, 300);

            window.Add(fix);
            window.ShowAll();
        }
		internal void AddTopLevel (DockFrameTopLevel w, int x, int y, int width, int height)
		{
			w.X = x;
			w.Y = y;

			if (UseWindowsForTopLevelFrames) {
				var win = new Gtk.Window (Gtk.WindowType.Toplevel);
				win.SkipTaskbarHint = true;
				win.Decorated = false;
				win.TypeHint = Gdk.WindowTypeHint.Toolbar;
				w.ContainerWindow = win;
				w.Size = new Size (width, height);
				win.Add (w);
				w.Show ();
				var p = this.GetScreenCoordinates (new Gdk.Point (x, y));
				win.Opacity = 0.0;
				win.Move (p.X, p.Y);
				win.Resize (width, height);
				win.Show ();
				Ide.DesktopService.AddChildWindow ((Gtk.Window)Toplevel, win);
				win.AcceptFocus = true;
				win.Opacity = 1.0;

				/* When we use real windows for frames, it's possible for pads to be over other
				 * windows. For some reason simply presenting or raising those dialogs doesn't
				 * seem to work, so we hide/show them in order to force them above the pad. */
				var toplevels = Gtk.Window.ListToplevels ().Where (t => t.IsRealized && t.Visible && t.TypeHint == WindowTypeHint.Dialog); // && t.TransientFor != null);
				foreach (var t in toplevels) {
					t.Hide ();
					t.Show ();
				}

				MonoDevelop.Ide.IdeApp.CommandService.RegisterTopWindow (win);
			} else {
				w.Parent = this;
				w.Size = new Size (width, height);
				Requisition r = w.SizeRequest ();
				w.Allocation = new Gdk.Rectangle (Allocation.X + x, Allocation.Y + y, r.Width, r.Height);
				topLevels.Add (w);
			}
		}
Exemple #41
0
		internal void AddTopLevel (DockFrameTopLevel w, int x, int y, int width, int height)
		{
			w.X = x;
			w.Y = y;

			if (UseWindowsForTopLevelFrames) {
				var win = new Gtk.Window (Gtk.WindowType.Toplevel);
				win.AcceptFocus = false;
				win.SkipTaskbarHint = true;
				win.Decorated = false;
				win.TypeHint = Gdk.WindowTypeHint.Toolbar;
				w.ContainerWindow = win;
				w.Size = new Size (width, height);
				win.Add (w);
				w.Show ();
				var p = this.GetScreenCoordinates (new Gdk.Point (x, y));
				win.Opacity = 0.0;
				win.Move (p.X, p.Y);
				win.Resize (width, height);
				win.Show ();
				Ide.DesktopService.AddChildWindow ((Gtk.Window)Toplevel, win);
				win.AcceptFocus = true;
				win.Opacity = 1.0;
			} else {
				w.Parent = this;
				w.Size = new Size (width, height);
				Requisition r = w.SizeRequest ();
				w.Allocation = new Gdk.Rectangle (Allocation.X + x, Allocation.Y + y, r.Width, r.Height);
				topLevels.Add (w);
			}
		}
Exemple #42
0
 // Pinta TODO: This may need to be overridden for Mac?
 private void PlaceWindow(Gtk.Window window, int x, int y, int width, int height)
 {
     window.Move(x, y);
     window.Resize(width, height);
 }
Exemple #43
0
        public void initComponents()
        {
            ActionPanelLocation       = new Alignment(0, 1, 0, 0);
            MainWindow                = new Window("Game");
            mainPanel                 = new Layout(null, null);
            defaultFontBold           = Pango.FontDescription.FromString("Microsoft Sans Serif 10");
            defaultFontBold.Weight    = Pango.Weight.Bold;
            defaultFontRegular        = Pango.FontDescription.FromString("Microsoft Sans Serif 10");
            defaultFontRegular.Weight = Pango.Weight.Normal;
            labelLibido               = new Label();
            labelSpeed                = new Label();
            this.labelToughness       = new Label();
            this.labelStrenght        = new Label();
            this.label6               = new Label();
            this.label5               = new Label();
            this.label4               = new Label();
            this.label3               = new Label();
            this.label2               = new Label();
            this.label1               = new Label();
            this.btnOptions           = new Button();

            this.btnNewGame = new Button();

            this.btnLoad = new Button();

            this.btnSave = new Button();

            this.buttonCmd5 = new Button();

            this.buttonCmd4 = new Button();
            this.buttonCmd1 = new Button();

            this.buttonCmd2 = new Button();

            this.buttonCmd3 = new Button();

            this.button8 = new Button();

            this.button9 = new Button();

            this.button7 = new Button();

            this.button6 = new Button();

            this.button5 = new Button();

            this.button10 = new Button();

            this.button4 = new Button();

            this.button3 = new Button();

            this.button2 = new Button();

            this.button1 = new Button();

            this.label11              = new Label();
            this.label10              = new Label();
            this.label9               = new Label();
            this.label8               = new Label();
            this.label7               = new Label();
            this.labelHP              = new Label();
            this.labelLust            = new Label();
            this.progressBarHP        = new ProgressBar();
            this.progressBarLust      = new ProgressBar();
            this.labelLevel           = new Label();
            this.labelDay             = new Label();
            this.labelHour            = new Label();
            this.labelCoins           = new Label();
            this.labelExp             = new Label();
            this.progressBarExp       = new ProgressBar();
            this.MainStoryTextPanel   = new Layout(null, null);
            this.richTextBoxMain      = new TextView();
            this.ActionbuttonHolder   = new Layout(null, null);
            this.button12             = new Button();
            this.button14             = new Button();
            this.button11             = new Button();
            this.button13             = new Button();
            this.button15             = new Button();
            this.panel3               = new Layout(null, null);
            this.richTextBoxSub       = new TextView();
            this.PlayerStatsPanel     = new Layout(null, null);
            this.AdditionalStatsPanel = new Layout(null, null);
            this.MainActionsPanel     = new Table(2, 2, true);

            //
            // labelLibido
            //
            ////this.labelLibido.AutoSize = true;
            this.labelLibido.ModifyFont(defaultFontBold);
            // //this.labelLibido.Location = new System.Drawing.Point(93, 69);
            this.labelLibido.Name = "labelLibido";
            this.labelLibido.SetSizeRequest(16, 16);
            // //this.labelLibido.TabIndex = 9;
            this.labelLibido.Text = "0";
            //
            // labelSpeed
            //
            // //this.labelSpeed.AutoSize = true;
            this.labelSpeed.ModifyFont(defaultFontBold);
            // //this.labelSpeed.Location = new System.Drawing.Point(93, 47);
            this.labelSpeed.Name = "labelSpeed";
            this.labelSpeed.SetSizeRequest(16, 16);
            ////this.labelSpeed.TabIndex = 8;
            this.labelSpeed.Text = "0";
            //
            // labelToughness
            //
            // //this.labelToughness.AutoSize = true;
            this.labelToughness.ModifyFont(defaultFontBold);
            // //this.labelToughness.Location = new System.Drawing.Point(93, 27);
            this.labelToughness.Name = "labelToughness";
            this.labelToughness.SetSizeRequest(16, 16);
            // //this.labelToughness.TabIndex = 7;
            this.labelToughness.Text = "0";
            // this.labelToughness.Click += new System.EventHandler(this.label14_Click);
            //
            // labelStrenght
            //
            ////this.labelStrenght.AutoSize = true;
            this.labelStrenght.ModifyFont(defaultFontBold);
            ////this.labelStrenght.Location = new System.Drawing.Point(93, 7);
            this.labelStrenght.Name = "labelStrenght";
            this.labelStrenght.SetSizeRequest(16, 16);
            ////this.labelStrenght.TabIndex = 6;
            this.labelStrenght.Text = "0";
            //
            // label6
            //
            // //this.label6.AutoSize = true;
            this.label6.ModifyFont(defaultFontBold);
            // //this.label6.Location = new System.Drawing.Point(200, 47);
            this.label6.Name = "label6";
            this.label6.SetSizeRequest(36, 16);
            // //this.label6.TabIndex = 5;
            this.label6.Text = "Lust";
            //
            // label5
            //
            // //this.label5.AutoSize = true;
            this.label5.ModifyFont(defaultFontBold);
            // //this.label5.Location = new System.Drawing.Point(200, 7);
            this.label5.Name = "label5";
            this.label5.SetSizeRequest(29, 16);
            // //this.label5.TabIndex = 4;
            this.label5.Text = "HP";
            //
            // label4
            //
            ////this.label4.AutoSize = true;
            this.label4.ModifyFont(defaultFontBold);
            ////this.label4.Location = new System.Drawing.Point(8, 69);
            this.label4.Name = "label4";
            this.label4.SetSizeRequest(51, 16);
            // //this.label4.TabIndex = 3;
            this.label4.Text = "Libido";
            //
            // label3
            //
            // //this.label3.AutoSize = true;
            this.label3.ModifyFont(defaultFontBold);
            // //this.label3.Location = new System.Drawing.Point(8, 47);
            this.label3.Name = "label3";
            this.label3.SetSizeRequest(54, 16);
            // //this.label3.TabIndex = 2;
            this.label3.Text = "Speed";
            //
            // label2
            //
            ////this.label2.AutoSize = true;
            this.label2.ModifyFont(defaultFontBold);
            // //this.label2.Location = new System.Drawing.Point(8, 27);
            this.label2.Name = "label2";
            this.label2.SetSizeRequest(85, 16);
            //  //this.label2.TabIndex = 1;
            this.label2.Text = "Toughness";
            //
            // label1
            //
            ////this.label1.AutoSize = true;
            this.label1.ModifyFont(defaultFontBold);
            ////this.label1.Location = new System.Drawing.Point(8, 7);
            this.label1.Name = "label1";
            this.label1.SetSizeRequest(65, 16);
            // //this.label1.TabIndex = 0;
            this.label1.Text = "Strenght";
            //
            // btnOptions
            //
            ////this.btnOptions.BackColor = System.Drawing.Color.PeachPuff;
            ////this.btnOptions.FlatAppearance.BorderSize = 2;
            // //this.btnOptions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnOptions.ModifyFont(defaultFontBold);
            ////this.btnOptions.Location = new System.Drawing.Point(163, 3);
            //this.btnOptions.Name = "btnOptions";
            // this.btnOptions.SetSizeRequest(140, 33);
            ////this.btnOptions.TabIndex = 18;
            this.btnOptions.Label = "Options";
            ////this.btnOptions.UseVisualStyleBackColor = false;
            // this.btnOptions.Click += new System.EventHandler(this.btnOptions_Click);
            //
            // btnNewGame
            //
            //this.btnNewGame.BackColor = System.Drawing.Color.PeachPuff;
            //this.btnNewGame.FlatAppearance.BorderSize = 2;
            //this.btnNewGame.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnNewGame.ModifyFont(defaultFontBold);
            //this.btnNewGame.Location = new System.Drawing.Point(18, 3);
            this.btnNewGame.Name = "btnNewGame";
            this.btnNewGame.SetSizeRequest(140, 33);
            //this.btnNewGame.TabIndex = 17;
            this.btnNewGame.Label = "New Game";
            //this.btnNewGame.UseVisualStyleBackColor = false;
            //
            // btnLoad
            //
            //this.btnLoad.BackColor = System.Drawing.Color.PeachPuff;
            //this.btnLoad.FlatAppearance.BorderSize = 2;
            //this.btnLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnLoad.ModifyFont(defaultFontBold);
            //this.btnLoad.Location = new System.Drawing.Point(164, 42);
            this.btnLoad.Name = "btnLoad";
            this.btnLoad.SetSizeRequest(140, 33);
            //this.btnLoad.TabIndex = 16;
            this.btnLoad.Label = "Load";
            //this.btnLoad.UseVisualStyleBackColor = false;
            //
            // btnSave
            //
            //this.btnSave.BackColor = System.Drawing.Color.PeachPuff;
            //this.btnSave.FlatAppearance.BorderSize = 2;
            //this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnSave.ModifyFont(defaultFontBold);
            //this.btnSave.Location = new System.Drawing.Point(18, 42);
            this.btnSave.Name = "btnSave";
            this.btnSave.SetSizeRequest(140, 33);
            //this.btnSave.TabIndex = 15;
            this.btnSave.Label = "Save";
            //this.btnSave.UseVisualStyleBackColor = false;
            //
            // buttonCmd5
            //
            //this.buttonCmd5.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd5.FlatAppearance.BorderSize = 2;
            //this.buttonCmd5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd5.ModifyFont(defaultFontBold);
            //this.buttonCmd5.Location = new System.Drawing.Point(718, 126);
            this.buttonCmd5.Name = "buttonCmd5";
            this.buttonCmd5.SetSizeRequest(170, 34);
            //this.buttonCmd5.TabIndex = 10;
            this.buttonCmd5.Label = "buttonCmd5";
            //this.buttonCmd5.UseVisualStyleBackColor = false;
            //
            // buttonCmd4
            //
            //this.buttonCmd4.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd4.FlatAppearance.BorderSize = 2;
            //this.buttonCmd4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd4.ModifyFont(defaultFontBold);
            //this.buttonCmd4.Location = new System.Drawing.Point(542, 126);
            this.buttonCmd4.Name = "buttonCmd4";
            this.buttonCmd4.SetSizeRequest(170, 34);
            //this.buttonCmd4.TabIndex = 11;
            this.buttonCmd4.Label = "buttonCmd4";
            //this.buttonCmd4.UseVisualStyleBackColor = false;
            //
            // buttonCmd1
            //
            //this.buttonCmd1.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd1.FlatAppearance.BorderSize = 2;
            //this.buttonCmd1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd1.ModifyFont(defaultFontBold);
            //this.buttonCmd1.Location = new System.Drawing.Point(14, 126);
            this.buttonCmd1.Name = "buttonCmd1";
            this.buttonCmd1.SetSizeRequest(170, 34);
            //this.buttonCmd1.TabIndex = 14;
            this.buttonCmd1.Label = "Perks";
            //this.buttonCmd1.UseVisualStyleBackColor = false;
            //
            // buttonCmd2
            //
            //this.buttonCmd2.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd2.FlatAppearance.BorderSize = 2;
            //this.buttonCmd2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd2.ModifyFont(defaultFontBold);
            //this.buttonCmd2.Location = new System.Drawing.Point(190, 126);
            this.buttonCmd2.Name = "buttonCmd2";
            this.buttonCmd2.SetSizeRequest(170, 34);
            //this.buttonCmd2.TabIndex = 13;
            this.buttonCmd2.Label = "Inventory";
            //this.buttonCmd2.UseVisualStyleBackColor = false;
            //
            // buttonCmd3
            //
            //this.buttonCmd3.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd3.FlatAppearance.BorderSize = 2;
            //this.buttonCmd3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd3.ModifyFont(defaultFontBold);
            //this.buttonCmd3.Location = new System.Drawing.Point(366, 126);
            this.buttonCmd3.Name = "buttonCmd3";
            this.buttonCmd3.SetSizeRequest(170, 34);
            //this.buttonCmd3.TabIndex = 12;
            this.buttonCmd3.Label = "buttonCmd3";
            //this.buttonCmd3.UseVisualStyleBackColor = false;
            //
            // button8
            //
            //this.button8.BackColor = System.Drawing.Color.Peru;
            //this.button8.FlatAppearance.BorderSize = 2;
            //this.button8.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button8.ModifyFont(defaultFontBold);
            //this.button8.Location = new System.Drawing.Point(366, 41);
            this.button8.Name = "button8";
            this.button8.SetSizeRequest(170, 34);
            //this.button8.TabIndex = 7;
            this.button8.Label = "button8";
            //this.button8.UseVisualStyleBackColor = false;
            //
            // button9
            //
            //this.button9.BackColor = System.Drawing.Color.Peru;
            //this.button9.FlatAppearance.BorderSize = 2;
            //this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button9.ModifyFont(defaultFontBold);
            //this.button9.Location = new System.Drawing.Point(542, 41);
            this.button9.Name = "button9";
            this.button9.SetSizeRequest(170, 34);
            //this.button9.TabIndex = 6;
            this.button9.Label = "button9";
            //this.button9.UseVisualStyleBackColor = false;
            //
            // button7
            //
            //this.button7.BackColor = System.Drawing.Color.Peru;
            //this.button7.FlatAppearance.BorderSize = 2;
            //this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button7.ModifyFont(defaultFontBold);
            //this.button7.Location = new System.Drawing.Point(190, 41);
            this.button7.Name = "button7";
            this.button7.SetSizeRequest(170, 34);
            //this.button7.TabIndex = 8;
            this.button7.Label = "button7";
            //this.button7.UseVisualStyleBackColor = false;
            //
            // button6
            //
            //this.button6.BackColor = System.Drawing.Color.Peru;
            //this.button6.FlatAppearance.BorderSize = 2;
            //this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button6.ModifyFont(defaultFontBold);
            //this.button6.Location = new System.Drawing.Point(14, 41);
            this.button6.Name = "button6";
            this.button6.SetSizeRequest(170, 34);
            //this.button6.TabIndex = 9;
            this.button6.Label = "button6";
            //this.button6.UseVisualStyleBackColor = false;
            //
            // button5
            //
            //this.button5.BackColor = System.Drawing.Color.Peru;
            //this.button5.FlatAppearance.BorderSize = 2;
            //this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button5.ModifyFont(defaultFontBold);
            //this.button5.Location = new System.Drawing.Point(718, 4);
            this.button5.Name = "button5";
            this.button5.SetSizeRequest(170, 34);
            //this.button5.TabIndex = 4;
            this.button5.Label = "button5";
            //this.button5.UseVisualStyleBackColor = false;
            //
            // button10
            //
            //this.button10.BackColor = System.Drawing.Color.Peru;
            //this.button10.FlatAppearance.BorderSize = 2;
            //this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button10.ModifyFont(defaultFontBold);
            //this.button10.Location = new System.Drawing.Point(718, 41);
            this.button10.Name = "button10";
            this.button10.SetSizeRequest(170, 34);
            //this.button10.TabIndex = 5;
            this.button10.Label = "button10";
            //this.button10.UseVisualStyleBackColor = false;
            //
            // button4
            //
            //this.button4.BackColor = System.Drawing.Color.Peru;
            //this.button4.FlatAppearance.BorderSize = 2;
            //this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button4.ModifyFont(defaultFontBold);
            //this.button4.Location = new System.Drawing.Point(542, 4);
            this.button4.Name = "button4";
            this.button4.SetSizeRequest(170, 34);
            //this.button4.TabIndex = 3;
            this.button4.Label = "button4";
            //this.button4.UseVisualStyleBackColor = false;
            //
            // button3
            //
            //this.button3.BackColor = System.Drawing.Color.Peru;
            //this.button3.FlatAppearance.BorderSize = 2;
            //this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button3.ModifyFont(defaultFontBold);
            //this.button3.Location = new System.Drawing.Point(366, 4);
            this.button3.Name = "button3";
            this.button3.SetSizeRequest(170, 34);
            //this.button3.TabIndex = 2;
            this.button3.Label = "button3";
            //this.button3.UseVisualStyleBackColor = false;
            //
            // button2
            //
            //this.button2.BackColor = System.Drawing.Color.Peru;
            //this.button2.FlatAppearance.BorderSize = 2;
            //this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button2.ModifyFont(defaultFontBold);
            //this.button2.Location = new System.Drawing.Point(190, 4);
            this.button2.Name = "button2";
            this.button2.SetSizeRequest(170, 34);
            //this.button2.TabIndex = 1;
            this.button2.Label = "button2";
            //this.button2.UseVisualStyleBackColor = false;
            //
            // button1
            //
            //this.button1.BackColor = System.Drawing.Color.Peru;
            //this.button1.FlatAppearance.BorderSize = 2;
            //this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button1.ModifyFont(defaultFontBold);
            //this.button1.Location = new System.Drawing.Point(14, 4);
            this.button1.Name = "button1";
            this.button1.SetSizeRequest(170, 34);
            //this.button1.TabIndex = 0;
            this.button1.Label = "button1";
            //this.button1.UseVisualStyleBackColor = false;
            //
            // label11
            //
            //this.label11.AutoSize = true;
            this.label11.ModifyFont(defaultFontBold);
            //this.label11.Location = new System.Drawing.Point(172, 38);
            this.label11.Name = "label11";
            this.label11.SetSizeRequest(47, 16);
            //this.label11.TabIndex = 10;
            this.label11.Text = "Coins";
            //
            // label10
            //
            //this.label10.AutoSize = true;
            this.label10.ModifyFont(defaultFontBold);
            //this.label10.Location = new System.Drawing.Point(241, 12);
            this.label10.Name = "label10";
            this.label10.SetSizeRequest(41, 16);
            //this.label10.TabIndex = 9;
            this.label10.Text = "Hour";
            //
            // label9
            //
            //this.label9.AutoSize = true;
            this.label9.ModifyFont(defaultFontBold);
            //this.label9.Location = new System.Drawing.Point(172, 12);
            this.label9.Name = "label9";
            this.label9.SetSizeRequest(36, 16);
            //this.label9.TabIndex = 8;
            this.label9.Text = "Day";
            //
            // label8
            //
            //this.label8.AutoSize = true;
            this.label8.ModifyFont(defaultFontBold);
            //this.label8.Location = new System.Drawing.Point(8, 38);
            this.label8.Name = "label8";
            this.label8.SetSizeRequest(34, 16);
            //this.label8.TabIndex = 7;
            this.label8.Text = "Exp";
            //
            // label7
            //
            //this.label7.AutoSize = true;
            this.label7.ModifyFont(defaultFontBold);
            //this.label7.Location = new System.Drawing.Point(8, 12);
            this.label7.Name = "label7";
            this.label7.SetSizeRequest(46, 16);
            //this.label7.TabIndex = 6;
            this.label7.Text = "Level";
            //
            // labelHP
            //
            //this.labelHP.AutoSize = true;
            this.labelHP.ModifyFont(defaultFontBold);
            //this.labelHP.Location = new System.Drawing.Point(254, 7);
            this.labelHP.Name = "labelHP";
            this.labelHP.SetSizeRequest(16, 16);
            //this.labelHP.TabIndex = 10;
            this.labelHP.Text = "0";
            //
            // labelLust
            //
            //this.labelLust.AutoSize = true;
            this.labelLust.ModifyFont(defaultFontBold);
            //this.labelLust.Location = new System.Drawing.Point(254, 47);
            this.labelLust.Name = "labelLust";
            this.labelLust.SetSizeRequest(16, 16);
            //this.labelLust.TabIndex = 11;
            this.labelLust.Text = "0";
            //
            // progressBarHP
            //
            //this.progressBarHP.ForeColor = System.Drawing.Color.Purple;
            //this.progressBarHP.Location = new System.Drawing.Point(203, 26);
            this.progressBarHP.Name = "progressBarHP";
            this.progressBarHP.SetSizeRequest(100, 10);
            //this.progressBarHP.TabIndex = 12;
            //
            // progressBarLust
            //
            //this.progressBarLust.ForeColor = System.Drawing.Color.DeepPink;
            //this.progressBarLust.Location = new System.Drawing.Point(203, 69);
            this.progressBarLust.Name = "progressBarLust";
            this.progressBarLust.SetSizeRequest(100, 10);
            //this.progressBarLust.TabIndex = 13;
            //
            // labelLevel
            //
            //this.labelLevel.AutoSize = true;
            this.labelLevel.ModifyFont(defaultFontBold);
            //this.labelLevel.Location = new System.Drawing.Point(58, 12);
            this.labelLevel.Name = "labelLevel";
            this.labelLevel.SetSizeRequest(16, 16);
            //this.labelLevel.TabIndex = 14;
            this.labelLevel.Text = "0";
            //
            // labelDay
            //
            //this.labelDay.AutoSize = true;
            this.labelDay.ModifyFont(defaultFontBold);
            //this.labelDay.Location = new System.Drawing.Point(214, 12);
            this.labelDay.Name = "labelDay";
            this.labelDay.SetSizeRequest(16, 16);
            //this.labelDay.TabIndex = 15;
            this.labelDay.Text = "0";
            //
            // labelHour
            //
            //this.labelHour.AutoSize = true;
            this.labelHour.ModifyFont(defaultFontBold);
            //this.labelHour.Location = new System.Drawing.Point(290, 12);
            this.labelHour.Name = "labelHour";
            this.labelHour.SetSizeRequest(16, 16);
            //this.labelHour.TabIndex = 16;
            this.labelHour.Text = "0";
            //
            // labelCoins
            //
            //this.labelCoins.AutoSize = true;
            this.labelCoins.ModifyFont(defaultFontBold);
            //this.labelCoins.Location = new System.Drawing.Point(241, 38);
            this.labelCoins.Name = "labelCoins";
            this.labelCoins.SetSizeRequest(16, 16);
            //this.labelCoins.TabIndex = 17;
            this.labelCoins.Text = "0";
            //
            // labelExp
            //
            //this.labelExp.AutoSize = true;
            this.labelExp.ModifyFont(defaultFontBold);
            //this.labelExp.Location = new System.Drawing.Point(44, 38);
            this.labelExp.Name = "labelExp";
            this.labelExp.SetSizeRequest(16, 16);
            //this.labelExp.TabIndex = 18;
            this.labelExp.Text = "0";
            //
            // progressBarExp
            //
            //this.progressBarExp.ForeColor = System.Drawing.Color.Lime;
            //this.progressBarExp.Location = new System.Drawing.Point(65, 44);
            this.progressBarExp.Name = "progressBarExp";
            this.progressBarExp.SetSizeRequest(95, 10);
            //this.progressBarExp.TabIndex = 14;
            //
            // MainStoryTextPanel
            //
            //this.MainStoryTextPanel.BackColor = System.Drawing.Color.MediumOrchid;
            //this.MainStoryTextPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.MainStoryTextPanel.Add(this.richTextBoxMain);
            //this.MainStoryTextPanel.Location = new System.Drawing.Point(346, 10);
            this.MainStoryTextPanel.Name = "MainStoryTextPanel";
            this.MainStoryTextPanel.SetSizeRequest(906, 495);
            //this.MainStoryTextPanel.TabIndex = 4;
            //
            // richTextBoxMain
            //
            //this.richTextBoxMain.BackColor = System.Drawing.Color.Thistle;
            this.richTextBoxMain.ModifyFont(FontDescription.FromString("Microsoft Sans Serif 10"));
            //this.richTextBoxMain.Location = new System.Drawing.Point(3, 3);
            this.richTextBoxMain.Name = "richTextBoxMain";
            this.richTextBoxMain.SetSizeRequest(898, 487);
            //this.richTextBoxMain.TabIndex = 0;
            this.richTextBoxMain.Buffer.Text = "";
            //
            // panel2
            //
            //this.panel2.BackColor = System.Drawing.Color.MediumSeaGreen;
            //this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.ActionbuttonHolder.Add(this.button12);
            this.ActionbuttonHolder.Add(this.button14);
            this.ActionbuttonHolder.Add(this.button11);
            this.ActionbuttonHolder.Add(this.button13);
            this.ActionbuttonHolder.Add(this.button15);
            this.ActionbuttonHolder.Add(this.button1);
            this.ActionbuttonHolder.Add(this.button3);
            this.ActionbuttonHolder.Add(this.button7);
            this.ActionbuttonHolder.Add(this.buttonCmd5);
            this.ActionbuttonHolder.Add(this.button9);
            this.ActionbuttonHolder.Add(this.button6);
            this.ActionbuttonHolder.Add(this.buttonCmd4);
            this.ActionbuttonHolder.Add(this.button8);
            this.ActionbuttonHolder.Add(this.button2);
            this.ActionbuttonHolder.Add(this.button5);
            this.ActionbuttonHolder.Add(this.buttonCmd1);
            this.ActionbuttonHolder.Add(this.buttonCmd3);
            this.ActionbuttonHolder.Add(this.button4);
            this.ActionbuttonHolder.Add(this.button10);
            this.ActionbuttonHolder.Add(this.buttonCmd2);
            //this.panel2.Location = new System.Drawing.Point(346, 509);
            this.ActionbuttonHolder.Name = "ActionButtonHolder";
            this.ActionbuttonHolder.SetSizeRequest(906, 167);
            //this.panel2.TabIndex = 5;
            //this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
            //
            // button12
            //
            //this.button12.BackColor = System.Drawing.Color.Peru;
            //this.button12.FlatAppearance.BorderSize = 2;
            //this.button12.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button12.ModifyFont(defaultFontBold);
            //this.button12.Location = new System.Drawing.Point(190, 78);
            this.button12.Name = "button12";
            this.button12.SetSizeRequest(170, 34);
            //this.button12.TabIndex = 18;
            this.button12.Label = "button12";
            //this.button12.UseVisualStyleBackColor = false;
            //
            // button14
            //
            //this.button14.BackColor = System.Drawing.Color.Peru;
            //this.button14.FlatAppearance.BorderSize = 2;
            //this.button14.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button14.ModifyFont(defaultFontBold);
            //this.button14.Location = new System.Drawing.Point(542, 78);
            this.button14.Name = "button14";
            this.button14.SetSizeRequest(170, 34);
            //this.button14.TabIndex = 16;
            this.button14.Label = "button14";
            //this.button14.UseVisualStyleBackColor = false;
            //
            // button11
            //
            //this.button11.BackColor = System.Drawing.Color.Peru;
            //this.button11.FlatAppearance.BorderSize = 2;
            //this.button11.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button11.ModifyFont(defaultFontBold);
            //this.button11.Location = new System.Drawing.Point(14, 78);
            this.button11.Name = "button11";
            this.button11.SetSizeRequest(170, 34);
            //this.button11.TabIndex = 19;
            this.button11.Label = "button11";
            //this.button11.UseVisualStyleBackColor = false;
            //
            // button13
            //
            //this.button13.BackColor = System.Drawing.Color.Peru;
            //this.button13.FlatAppearance.BorderSize = 2;
            //this.button13.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button13.ModifyFont(defaultFontBold);
            //this.button13.Location = new System.Drawing.Point(366, 78);
            this.button13.Name = "button13";
            this.button13.SetSizeRequest(170, 34);
            //this.button13.TabIndex = 17;
            //this.button13.Label = "button13";
            this.button13.Label = "button13";
            //this.button13.UseVisualStyleBackColor = false;
            //
            // button15
            //
            // //this.button15.BackColor = System.Drawing.Color.Peru;
            // //this.button15.FlatAppearance.BorderSize = 2;
            ////this.button15.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button15.ModifyFont(defaultFontBold);
            ////this.button15.Location = new System.Drawing.Point(718, 78);
            this.button15.Name = "button15";
            this.button15.SetSizeRequest(170, 34);
            ////this.button15.TabIndex = 15;
            //this.button15.Label = "button15";
            ////this.button15.UseVisualStyleBackColor = false;
            //
            // panel3
            //
            //this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))),
            //    ((int)(((byte)(128)))));
            // //this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel3.Add(this.richTextBoxSub);
            // //this.panel3.Location = new System.Drawing.Point(10, 112);
            this.panel3.Name = "panel3";
            this.panel3.SetSize(330, 408);
            ////this.panel3.TabIndex = 6;
            //
            // richTextBoxSub
            //
            ////this.richTextBoxSub.BackColor = System.Drawing.Color.PeachPuff;
            this.richTextBoxSub.ModifyFont(FontDescription.FromString("Microsoft Sans Serif 10"));

            // //this.richTextBoxSub.Location = new System.Drawing.Point(3, 3);
            this.richTextBoxSub.Name = "richTextBoxSub";
            this.richTextBoxSub.SetSizeRequest(322, 400);
            ////this.richTextBoxSub.TabIndex = 0;
            //this.richTextBoxSub.Text = "";
            // this.richTextBoxSub.TextChanged += new System.EventHandler(this.richTextBoxSub_TextChanged);
            //
            // PlayerStatsPanel
            //
            ////this.PlayerStatsPanel.BackColor = System.Drawing.Color.SteelBlue;
            ////this.PlayerStatsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.PlayerStatsPanel.Add(this.progressBarLust);
            this.PlayerStatsPanel.Add(this.labelLibido);
            this.PlayerStatsPanel.Add(this.labelStrenght);
            this.PlayerStatsPanel.Add(this.progressBarHP);
            this.PlayerStatsPanel.Add(this.label6);
            this.PlayerStatsPanel.Add(this.label1);
            this.PlayerStatsPanel.Add(this.labelToughness);
            this.PlayerStatsPanel.Add(this.labelLust);
            this.PlayerStatsPanel.Add(this.label5);
            this.PlayerStatsPanel.Add(this.label2);
            this.PlayerStatsPanel.Add(this.labelSpeed);
            this.PlayerStatsPanel.Add(this.labelHP);
            this.PlayerStatsPanel.Add(this.label4);
            this.PlayerStatsPanel.Add(this.label3);
            // //this.PlayerStatsPanel.Location = new System.Drawing.Point(10, 10);
            this.PlayerStatsPanel.Name = "PlayerStatsPanel";
            this.PlayerStatsPanel.SetSize(330, 93);
            ////this.PlayerStatsPanel.TabIndex = 7;
            //
            // AdditionalStatsPanel
            //
            // this.AdditionalStatsPanel. = System.Drawing.Color.SteelBlue;
            // //this.AdditionalStatsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.AdditionalStatsPanel.Add(this.progressBarExp);
            this.AdditionalStatsPanel.Add(this.label10);
            this.AdditionalStatsPanel.Add(this.labelDay);
            this.AdditionalStatsPanel.Add(this.label11);
            this.AdditionalStatsPanel.Add(this.labelExp);
            this.AdditionalStatsPanel.Add(this.labelLevel);
            this.AdditionalStatsPanel.Add(this.label7);
            this.AdditionalStatsPanel.Add(this.label9);
            this.AdditionalStatsPanel.Add(this.labelCoins);
            this.AdditionalStatsPanel.Add(this.labelHour);
            this.AdditionalStatsPanel.Add(this.label8);
            ////this.AdditionalStatsPanel.Location = new System.Drawing.Point(10, 524);
            this.AdditionalStatsPanel.Name = "AdditionalStatsPanel";
            this.AdditionalStatsPanel.SetSize(330, 65);
            ////this.AdditionalStatsPanel.TabIndex = 8;
            //
            // MainActionsPanel
            //
            ////this.MainActionsPanel.BackColor = System.Drawing.Color.DarkOrange;
            ////this.MainActionsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.MainActionsPanel.Add(this.btnOptions);
            this.MainActionsPanel.Add(this.btnLoad);
            this.MainActionsPanel.Add(this.btnSave);
            this.MainActionsPanel.Add(this.btnNewGame);
            ////this.MainActionsPanel.Location = new System.Drawing.Point(10, 594);
            this.MainActionsPanel.Name = "MainActionsPanel";
            //this.MainActionsPanel.SetSizeRequest(330, 82);
            this.ActionPanelLocation.Add(MainActionsPanel);
            ////this.MainActionsPanel.TabIndex = 9;
            //
            // TestFormX
            //
            // MainWindow.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            // MainWindow.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            //MainWindow.BackColor = System.Drawing.Color.LightSteelBlue;
            // MainWindow.ClientSize = new System.Drawing.Size(1264, 681);
            MainWindow.Resize(1264, 681);

            mainPanel.Add(this.ActionPanelLocation);
            //mainPanel.Add(this.AdditionalStatsPanel);
            //mainPanel.Add(this.PlayerStatsPanel);
            //mainPanel.Add(this.panel3);
            //mainPanel.Add(this.ActionbuttonHolder);
            //mainPanel.Add(this.MainStoryTextPanel);
            MainWindow.Add(mainPanel);
            MainWindow.Name = "TestFormX";
            MainWindow.ShowAll();
            //MainWindow.Text = "TestFormX";
        }
Exemple #44
0
	void Show ()
	{
		zip = new Zip (File);
 
		Application.Init ();

		// Main window
		window = new Window ("munxap: " + File);
		window.Resize (600, 600);
		window.DeleteEvent += delegate (object obj, DeleteEventArgs args)
		{
			Close ();
		};

		// Main vbox
		main = new VBox (false, 10);
		window.Add (main);

		// label with the filename of the xap file on top
		file_label = new Label (File);
		main.PackStart (file_label, false, true, 0);

		// the middle consists of a hbox, leftmost column a list of files in the zip file
		xap = new HBox (false, 10);
		main.PackStart (xap, true, true, 0);

		left = new VBox (false, 10);
		xap.PackStart (left, true, true, 0);
		
		// a list of files in the zip file
		xap_file_store = new ListStore (typeof (String), typeof (String), typeof (ZipContent));		
		xap_file_view = new TreeView ();
		xap_file_view.Model = xap_file_store;
		xap_file_view.HeadersVisible = true;
		xap_file_view.AppendColumn ("Name", new CellRendererText (), "text", 0);
		xap_file_view.AppendColumn ("Type", new CellRendererText (), "text", 1);
		xap_file_view.CursorChanged += HandleCursorChanged;
		xap_file_scrollable = new ScrolledWindow ();
		xap_file_scrollable.Add (xap_file_view);
		left.PackStart (xap_file_scrollable, true, true, 0);
		
		// close button at the bottom
		close_button = new Button ("Close");
		close_button.Clicked += delegate (object obj, EventArgs args)
		{
			Close ();
		};
		main.PackEnd (close_button, false, true, 0);

		// Load zip contents
		foreach (ZipContent f in zip.Files) {
			xap_file_store.AppendValues (f.Filename, f.Type, f);
		}
		
		
		window.ShowAll ();
		
		Application.Run ();
	}
    public GnomeArtNgApp(string[] args)
    {
        Application.Init();
        //i18n
        Catalog.Init("gnomeartng", "./locale");
        config = new CConfiguration();
        //initialize Glade
        string mainW = "MainWindow";

        Glade.XML gxml = new Glade.XML(null, "gui.glade", mainW, null);
        mainWindow = (Gtk.Window)gxml.GetWidget(mainW);
        gxml.Autoconnect(this);

        //Connect all events
        mainWindow.DeleteEvent       += new DeleteEventHandler(OnWindowDeleteEvent);
        ExtInfoPreviewButton.Clicked += new EventHandler(OnPreviewButtonClicked);
        InstallButton.Clicked        += new EventHandler(OnInstallButtonClicked);
        RevertButton.Clicked         += new EventHandler(OnRevertButtonClicked);
        RefreshButton.Clicked        += new EventHandler(OnRefreshButtonClicked);
        SaveButton.Clicked           += new EventHandler(OnSaveButtonClicked);
        MainNotebook.SwitchPage      += new SwitchPageHandler(OnSwitchPage);
        FilterEntry.Changed          += new EventHandler(OnFilterEntriesChanged);
//		SortKindCb.Changed += new EventHandler(OnSortKindEntryChanged);
//		SortDirectionCb.Changed += new EventHandler(OnSortDirectionEntryChanged);
//		SortCloseButton.Clicked += new EventHandler(OnSortCloseClicked);
        FilterEntry.KeyReleaseEvent += new KeyReleaseEventHandler(OnFilterbarKeyReleased);
        FilterCloseButton.Clicked   += new EventHandler(OnFilterbarCloseClicked);

        //Menuitems
        QuitMenuItem.Activated   += new EventHandler(OnQuitItemSelected);
        UpdateMenuItem.Activated += new EventHandler(OnUpdateItemSelected);
        DonateMenuItem.Activated += new EventHandler(CUpdateWindow.onDonateButtonClicked);
        FilterMenuItem.Activated += new EventHandler(OnFilterItemSelected);
//		SortMenuItem.Activated += new EventHandler(OnSortItemSelected);
        InfoMenuItem.Activated        += new EventHandler(OnInfoItemSelected);
        PreferencesMenuItem.Activated += new EventHandler(OnPreferencesItemSelected);
        FTAItem.Activated             += new EventHandler(onFtaItemSelected);

        //First, download all thumbs...but don't bother the user with the update message, even if there is one
        bool RestartApp = false;

        if (config.NeverStartedBefore)
        {
            new CFirstTimeAssistant(config);
        }
//		else if (config.DontBotherForUpdates==false) {
//			if (config.UpdateAvailable) {
//				Console.WriteLine("An update is available, newest version is: "+config.NewestVersionNumberOnServer);
//			RestartApp = ShowUpdateWindow();
//			}
//		}

        if (!RestartApp)
        {
            //Application placement - doesn't work properly with compiz (is it the window placement plugin?)
            if (config.SettingsLoadOk)
            {
                mainWindow.Resize(config.Window.Width, config.Window.Height);
                mainWindow.Move(config.Window.X, config.Window.Y);
                //Console.WriteLine(config.Window.X+" "+ config.Window.Y);
            }

            //ArtManager erzeugen
            man = new CArtManager(config);

            //Stores anlegen und IconViews anlegen
            for (int i = 0; i < ListStoreCount; i++)
            {
                sWins[i]     = (Gtk.ScrolledWindow)(gxml.GetWidget("swin" + i));
                stores[i]    = new ListStore(typeof(Pixbuf), typeof(string), typeof(string), typeof(int));
                IconViews[i] = new Gtk.IconView(stores[i]);
                IconViews[i].SelectionChanged += new System.EventHandler(OnSelChanged);
                IconViews[i].ItemActivated    += new ItemActivatedHandler(OnItemActivated);
                IconViews[i].PixbufColumn      = 0;
                CurrentIconView = IconViews[0];

                sWins[i].Add(IconViews[i]);
                IconViews[i].Show();
            }

            //Create the comboboxes
            imageTypeBox        = ComboBox.NewText();
            imageResolutionsBox = ComboBox.NewText();
            imageStyleBox       = ComboBox.NewText();

            //Verschiedene Styles hinzufügen
            imageStyleBox.AppendText(Catalog.GetString("Centered"));
            imageStyleBox.AppendText(Catalog.GetString("Filled"));
            imageStyleBox.AppendText(Catalog.GetString("Scaled"));
            imageStyleBox.AppendText(Catalog.GetString("Zoomed"));
            imageStyleBox.AppendText(Catalog.GetString("Tiled"));
            imageStyleBox.Active   = 0;
            imageStyleBox.Changed += new EventHandler(OnImageStyleBoxChanged);

            LowerTable.Attach(imageTypeBox, 1, 2, 2, 3);
            LowerTable.Attach(imageResolutionsBox, 1, 2, 3, 4);
            LowerTable.Attach(imageStyleBox, 1, 2, 4, 5);

            UpdateMenuItem.Hide();

            OnSwitchPage(MainNotebook, new SwitchPageArgs());
            Gtk.Application.Run();
        }
    }
Exemple #46
0
        public static void Main()
        {
            Application.Init();
            var window = new Window("Sharp Test");

            window.Resize(600, 400);
            //window.SetIconFromFile("/home/hubert/SharpTest/SharpTest/images/icon.png");
            window.DeleteEvent += Window_Delete;
            //File choosing components
            var labelOsName = new Label("OS Version: " + OsVersion);

            var labelPyhtonVer = new Label("Python ver: " + PythonVer);

            var labelChoose = new Label("Choose python file.");

            var labelFileStatus = new Label {
                Markup = "<span color=\"red\">Wrong file.</span>"
            };

            var fileButton = new FileChooserButton("Choose file", FileChooserAction.Open);

            var scanButton = new Button("Scan file");

            scanButton.SetSizeRequest(100, 50);

            var boxStart = new VBox();

            boxStart.PackStart(labelOsName, false, false, 5);
            boxStart.PackStart(labelPyhtonVer, false, false, 5);
            boxStart.PackStart(labelChoose, false, false, 5);
            boxStart.PackStart(fileButton, false, false, 5);
            boxStart.PackStart(labelFileStatus, false, false, 5);
            boxStart.PackStart(scanButton, false, false, 100);

            //Scaning window components
            var labelTest = new Label("Error while scanning file");

            labelTest.SetPadding(5, 5);

            var scrolledWin = new ScrolledWindow();

            scrolledWin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            scrolledWin.Add(labelTest);

            var boxScan = new VBox();

            boxScan.PackStart(scrolledWin, true, true, 5);


            scanButton.Clicked += (sender, args) => {
                var result = ScanFile(fileButton.Filename);
                if (result == null)
                {
                    labelFileStatus.Show();
                }
                else
                {
                    labelFileStatus.Hide();
                    var structure = "";
                    var classes   = new List <string>(result.Keys);
                    //Add classes
                    foreach (var _class in classes)
                    {
                        structure += "Class: " + _class + "\n";
                        foreach (var method in result[_class])
                        {
                            //Add method name
                            structure += "|__ Method: " + method["name"] + "\n";
                            //Add params
                            var parameters = "";
                            int i          = 0;
                            foreach (var param in (IEnumerable)method["param"])
                            {
                                if (i > 0)
                                {
                                    parameters += ",";
                                }
                                parameters += " " + param;
                                i++;
                            }
                            structure += "|____ Params: " + parameters + "\n";
                            //Add return
                            structure += "|____ Return: " + method["return"] + "\n";
                        }

                        structure += "\n";
                    }

                    labelTest.Text = structure;
                    window.Remove(boxStart);
                    window.Add(boxScan);
                    window.ShowAll();
                }
            };

            window.Add(boxStart);
            window.ShowAll();
            //Hide some widgets

            labelFileStatus.Hide();
            Application.Run();
        }
Exemple #47
0
	static int LoadXap (string file, List<string> args)
	{
		string [] test = { "" };

		if (sync)
			test [0] = "--sync";

		Application.Init ("mopen", ref test);
		MoonlightRuntime.Init ();
		window = new Gtk.Window (file);
		window.SetDefaultSize (400, 400);

		if (transparent) {
			CompositeHelper.SetRgbaColormap (window);
			window.AppPaintable = true;
			window.ExposeEvent += HandleExposeEvent;
		}    	

		if (desklet) {
			ConfigureDeskletWindow (window);
		}

		window.DeleteEvent += delegate {
			Application.Quit ();
		};

		moon_host = new MoonlightHost ();

		try {
			moon_host.LoadXap (file);
		} catch (Exception e) {
			Console.Error.WriteLine ("mopen: Could not load xaml: {0}", e.Message);
			return 1;
		}

		System.Windows.Application app = moon_host.Application;
		FrameworkElement top = (FrameworkElement)app.RootVisual;

		if (top is Moon.Windows.Desktop.Window) {
			var moonwindow = ((Moon.Windows.Desktop.Window)top);
			/* special window handling mode */
			moonwindow.IsActive = window.IsActive;

			Wnck.Screen.Default.ActiveWindowChanged += delegate {
				moonwindow.IsActive = window.IsActive;
			};

			moonwindow.PositionChanged += delegate {
				window.Move ((int)moonwindow.Position.X, (int)moonwindow.Position.Y);
			};

			moonwindow.SizeChanged += delegate {
				window.Resize ((int)moonwindow.Size.Width, (int)moonwindow.Size.Height);
			};

			moonwindow.WindowOpacityChanged += delegate {
				moon_host.QueueDraw ();
			};

			if (!transparent) {
				CompositeHelper.SetRgbaColormap (window);
				window.AppPaintable = true;
				window.ExposeEvent += HandleExposeEvent;

				moon_host.AppPaintable = true;
				moon_host.Transparent = true;
			}
		}

		if (parse_only)
			return 0;

		if (width == -1)
			width = (int) top.Width;
		if (height == -1)
			height = (int) top.Height;

		if (width > 0 && height > 0) {
			moon_host.SetSizeRequest (width, height);
			window.Resize (width, height);
		} 

		if (transparent){
			moon_host.AppPaintable = true;
			moon_host.Transparent = true;
		}

		if (desklet) {
			top.MouseLeftButtonDown += new MouseButtonEventHandler (HandleMouseLeftButtonDown);
			top.MouseLeftButtonUp += new MouseButtonEventHandler (HandleMouseLeftButtonUp);
			top.MouseMove += new MouseEventHandler (HandleMouseMove);
		}

		window.Add (moon_host);

		window.ShowAll ();

		if (story_names != null){
			storyboards = new List<Storyboard> ();
			
			foreach (string story in story_names){
				object o = top.FindName (story);
				Storyboard sb = o as Storyboard;

				if (sb == null){
					Console.Error.WriteLine ("mopen: there is no Storyboard object named {0} in the XAML file", story);
					return 1;
				}
				sb.Completed += delegate {
					window.Title = String.Format ("Storyboard {0} completed", current_storyboard-1);
				};
				
				storyboards.Add (sb);
			};

			top.MouseLeftButtonUp += delegate {
				if (current_storyboard == storyboards.Count)
					current_storyboard = 0;
				if (current_storyboard == storyboards.Count)
					return;
				
				window.Title = String.Format ("Storyboard {0} running", current_storyboard);
				storyboards [current_storyboard++].Begin ();
			};
		}

		if (timeout > 0)
			GLib.Timeout.Add ((uint)(timeout * 1000), new TimeoutHandler (Quit));

		Application.Run ();
		return 0;
	}