Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
Arquivo: Window.cs Projeto: MrJoe/lat
        void LoadPreference(String key)
        {
            object val = Preferences.Get(key);

            if (val == null)
            {
                if (key == Preferences.MAIN_WINDOW_HPANED)
                {
                    hpaned1.Position = 250;
                }

                return;
            }

            Log.Debug("Setting {0} to {1}", key, val);

            switch (key)
            {
            case Preferences.MAIN_WINDOW_MAXIMIZED:
                if ((bool)val)
                {
                    mainWindow.Maximize();
                }
                else
                {
                    mainWindow.Unmaximize();
                }
                break;

            case Preferences.MAIN_WINDOW_X:
            case Preferences.MAIN_WINDOW_Y:
                mainWindow.Move((int)Preferences.Get(Preferences.MAIN_WINDOW_X),
                                (int)Preferences.Get(Preferences.MAIN_WINDOW_Y));
                break;

            case Preferences.MAIN_WINDOW_WIDTH:
            case Preferences.MAIN_WINDOW_HEIGHT:
                mainWindow.SetDefaultSize((int)Preferences.Get(Preferences.MAIN_WINDOW_WIDTH),
                                          (int)Preferences.Get(Preferences.MAIN_WINDOW_HEIGHT));

                mainWindow.ReshowWithInitialSize();
                break;

            case Preferences.MAIN_WINDOW_HPANED:
                hpaned1.Position = (int)Preferences.Get(Preferences.MAIN_WINDOW_HPANED);
                break;

            case Preferences.BROWSER_SELECTION:
                ldapTreeView.BrowserSelectionMethod = (int)val;
                break;
            }
        }
Exemplo n.º 3
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();
            }
        }
Exemplo n.º 4
0
        public void InitInterface()
        {
            mainwindow.Icon = new Gdk.Pixbuf(null, "lPhant.png");
            mainwindow.Maximize();
            imgDownloads.Pixbuf   = new Gdk.Pixbuf(null, "down.gif");
            imgUploads.Pixbuf     = new Gdk.Pixbuf(null, "up.gif");
            imgSearch.Pixbuf      = new Gdk.Pixbuf(null, "viewmag.gif");
            imgServers.Pixbuf     = new Gdk.Pixbuf(null, "network.gif");
            imgFriends.Pixbuf     = new Gdk.Pixbuf(null, "kdmconfig.gif");
            imgPreferences.Pixbuf = new Gdk.Pixbuf(null, "configure.gif");
            imgConnect.Pixbuf     = new Gdk.Pixbuf(null, "connect_no.gif");
            imgAbout.Pixbuf       = new Gdk.Pixbuf(null, "help.gif");

            downloads   = new TDownloads(tvDownloads, krnGateway);
            uploads     = new TUploads(tvUploads, krnGateway);
            comments    = new TComments(tvComments, krnGateway);
            servers     = new TServers(krnGateway, gxml, txtServerLog);
            sharedFiles = new TSharedFiles(tvSharedFiles, krnGateway);
            search      = new TSearch(krnGateway, gxml);
            trayicon    = new TIcon(krnGateway, mainwindow);

            tvFileNames.AppendColumn("File name", new CellRendererText(), "text", 0);
            tvFileNames.AppendColumn("Sources", new CellRendererText(), "text", 1);

            tvSources.AppendColumn("Name", new CellRendererText(), "text", 0);
            tvSources.AppendColumn("File name", new CellRendererText(), "text", 1);
            tvSources.AppendColumn("Speed", new CellRendererText(), "text", 2);
            tvSources.AppendColumn("Status", new CellRendererText(), "text", 3);
            tvSources.AppendColumn("Position", new CellRendererText(), "text", 4);
            tvSources.AppendColumn("Downloaded", new CellRendererText(), "text", 5);
            tvSources.AppendColumn("Uploaded", new CellRendererText(), "text", 6);
            tvSources.AppendColumn("Progress", new CellRendererText(), "text", 7);
            tvSources.AppendColumn("Software", new CellRendererText(), "text", 8);
            tvSources.AppendColumn("Version", new CellRendererText(), "text", 9);

            tvFriends.AppendColumn("Friend", new CellRendererText(), "text", 0);
        }
Exemplo n.º 5
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 ();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initialize the user interface of the KeyboardCode app; in other words,
        /// place all of the components/widgets that are part of the user interface
        /// to the user interface. This method does not show the user interface;
        /// it only places the components. Call the <see cref="Gtk.Window.ShowAll"/> method
        /// to show the user interface 
        /// </summary>
        private void InitGUI()
        {
            window = new Window ("KeyboardCode");
            window.DeleteEvent += OnDeleteEvent;

            window.SetSizeRequest(600, 500);
            window.Maximize ();
        }