Beispiel #1
0
 private void on_ClearButton_clicked(object o, EventArgs args)
 {
     eventsEnabled            = false;
     EditPhbCompanyEntry.Text = "";
     EditPhbNumberEntry.Text  = "";
     EditPhbNameEntry.Text    = "";
     UpdateButton.Sensitive   = false;
     ItemTreeview.Selection.UnselectAll();
     ClearButton.Sensitive = false;
     AddButton.Sensitive   = false;
     Statusbar.Pop(id);
     Statusbar.Push(id, " ");
 }
Beispiel #2
0
 private void OnHoveringOverLink(object o, HoveringOverLinkArgs args)
 {
     statusbar.Pop(1);
     if (args.Link != null)
     {
         statusbar.Push(1, args.Link);
     }
 }
Beispiel #3
0
 private void OnOnUrl(object o, OnUrlArgs args)
 {
     if (lastUrlId != 0)
     {
         statusBar.Remove(statusBar.GetContextId("OnOnUrl"), lastUrlId);
     }
     if (args.Url != null)
     {
         lastUrlId = statusBar.Push(statusBar.GetContextId("OnOnUrl"), args.Url);
     }
 }
        public seleccion_folio(string LoginEmp, string NomEmpleado, string AppEmpleado, string ApmEmpleado, string _nombrebd_)
        {
            LoginEmpleado = LoginEmp;
            nombrebd      = _nombrebd_;

            Glade.XML gxml = new Glade.XML(null, "imp_prot.glade", "busqueda_folio", null);
            gxml.Autoconnect(this);

            // Muestra ventana de Glade
            busqueda_folio.Show();

            entry_fecha_admision.Sensitive    = false;
            entry_hora_registro.Sensitive     = false;
            entry_fechahora_alta.Sensitive    = false;
            entry_nombre_paciente.Sensitive   = false;
            entry_pid_paciente.Sensitive      = false;
            entry_telefono_paciente.Sensitive = false;
            entry_cirugia.Sensitive           = false;
            entry_doctor.Sensitive            = false;
            entry_especialidad.Sensitive      = false;
            entry_tipo_paciente.Sensitive     = false;
            entry_aseguradora.Sensitive       = false;
            entry_poliza.Sensitive            = false;

            // Activacion de boton de busqueda
            button_buscar_paciente.Clicked += new EventHandler(on_button_buscar_paciente_clicked);
            // Voy a buscar el folio que capturo
            button_selec_folio.Clicked += new EventHandler(on_selec_folio_clicked);
            // Imprimir
            button_imprimir_protocolo.Clicked += new EventHandler(on_button_imprimir_protocolo_clicked);
            // Sale de la ventana
            button_salir.Clicked += new EventHandler(on_cierraventanas_clicked);

            statusbar_caja.Pop(0);
            statusbar_caja.Push(1, "login: "******"  |Usuario: " + NomEmpleado + " " + AppEmpleado + " " + ApmEmpleado);
            statusbar_caja.HasResizeGrip = false;


            // convierte un string a numero
            //string  prueba;
            //prueba=this.folioservicio.ToString();
            //prueba=int.Parse("787878");
        }
Beispiel #5
0
        /// <summary>
        /// Loads the dictionary (take lot of time - use own thread).
        /// </summary>
        protected void LoadDictionary()
        {
            lock ( dicLoc ) {
                this.dic = new Scrabble.Lexicon.GADDAG();
                if (!File.Exists(Scrabble.Game.InitialConfig.dicPath))
                {
                    DicPathError();
                }
                else
                {
                    StreamReader sr = new StreamReader(Scrabble.Game.InitialConfig.dicPath);
                    this.dic = new Scrabble.Lexicon.GADDAG(sr);
                }
            }

            if (Scrabble.Game.InitialConfig.log)
            {
                Console.Out.WriteLine("[INFO]\tSlovník obsahuje {0} slov.", dic.WordCount);
            }

            statusb.Push(statusb.GetContextId("Slovník"), "Slovník načten");
        }
Beispiel #6
0
        public analisis_devoluciones(string LoginEmp, string NomEmpleado_, string AppEmpleado_, string ApmEmpleado_, string nombrebd_, string numeroatencion_)
        {
            LoginEmpleado    = LoginEmp;
            NomEmpleado      = NomEmpleado_;
            AppEmpleado      = AppEmpleado_;
            ApmEmpleado      = ApmEmpleado_;
            connectionString = conexion_a_DB._url_servidor + conexion_a_DB._port_DB + conexion_a_DB._usuario_DB + conexion_a_DB._passwrd_user_DB;
            nombrebd         = conexion_a_DB._nombrebd;

            //Console.WriteLine("antes de abrir venmtana");
            Glade.XML gxml = new Glade.XML(null, "almacen_costos_compras.glade", "resumen_devoluciones", null);
            gxml.Autoconnect(this);
            // Muestra ventana de Glade
            resumen_devoluciones.Show();
            resumen_devoluciones.Title = "Analisis de Devoluciones";
            statusbar_analisisdevol.Pop(0);
            statusbar_analisisdevol.Push(1, "login: "******"  |Usuario: " + NomEmpleado + " " + AppEmpleado + " " + ApmEmpleado);
            statusbar_analisisdevol.HasResizeGrip = false;

            entry_folio_servicio.ModifyBase(StateType.Normal, new Gdk.Color(54, 180, 221));
            // Validando que sen solo numeros
            entry_folio_servicio.KeyPressEvent += onKeyPressEvent_enter_folio;
            button_selecciona_folio.Clicked    += new EventHandler(on_button_selecciona_folio_clicked);
            button_buscar_paciente.Clicked     += new EventHandler(on_button_buscar_paciente_clicked);
            button_imprimir_mov.Clicked        += new EventHandler(on_button_imprimir_mov_clicked);
            // Sale de la ventana
            button_salir.Clicked += new EventHandler(on_cierraventanas_clicked);

            crea_treeview_analisis();

            if (numeroatencion_ != "")
            {
                entry_folio_servicio.Text = numeroatencion_;
                llenado_de_devoluciones();
            }
        }
Beispiel #7
0
        public requisicion_materiales_compras(string LoginEmp_, string NomEmpleado_, string AppEmpleado_, string ApmEmpleado_, string _nombrebd_)
        {
            LoginEmpleado = LoginEmp_;
            NomEmpleado   = NomEmpleado_;
            AppEmpleado   = AppEmpleado_;
            ApmEmpleado   = ApmEmpleado_;
            nombrebd      = _nombrebd_;

            Glade.XML gxml = new Glade.XML(null, "almacen_costos_compras.glade", "requisicion_materiales", null);
            gxml.Autoconnect(this);
            ////// Muestra ventana de Glade
            requisicion_materiales.Show();

            // Creacion de una Nueva Requisicion
            entry_requisicion.KeyPressEvent += onKeyPressEvent_enter_requisicion;

            checkbutton_nueva_requisicion.Clicked += new EventHandler(on_checkbutton_nueva_requisicion_clicked);

            // Asignando valores de Fechas
            this.entry_fecha_solicitud.Text = (string)DateTime.Now.ToString("yyyy-MM-dd");
            this.entry_fecha_requerida.Text = (string)DateTime.Now.ToString("yyyy-MM-dd");

            // Llenado de combobox1
            combobox_tipo_admision.Clear();
            CellRendererText cell1 = new CellRendererText();

            combobox_tipo_admision.PackStart(cell1, true);
            combobox_tipo_admision.AddAttribute(cell1, "text", 0);

            combobox_tipo_admision2.Clear();
            CellRendererText cell2 = new CellRendererText();

            combobox_tipo_admision2.PackStart(cell2, true);
            combobox_tipo_admision2.AddAttribute(cell2, "text", 0);

            ListStore store2 = new ListStore(typeof(string), typeof(int));

            combobox_tipo_admision.Model  = store2;
            combobox_tipo_admision2.Model = store2;

            // lleno de la tabla de his_tipo_de_admisiones
            NpgsqlConnection conexion;

            conexion = new NpgsqlConnection(connectionString + nombrebd);
            // Verifica que la base de datos este conectada
            try{
                conexion.Open();
                NpgsqlCommand comando;
                comando             = conexion.CreateCommand();
                comando.CommandText = "SELECT * FROM hscmty_his_tipo_admisiones " +
                                      //"WHERE cuenta_mayor = 4000  "+
                                      " ORDER BY descripcion_admisiones;";

                NpgsqlDataReader lector = comando.ExecuteReader();
                while (lector.Read())
                {
                    store2.AppendValues((string)lector["descripcion_admisiones"], (int)lector["id_tipo_admisiones"]);
                }
            }catch (NpgsqlException ex) {
                MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent,
                                                              MessageType.Error, ButtonsType.Close, "PostgresSQL error: {0}", ex.Message);
                msgBoxError.Run();                             msgBoxError.Destroy();
            }
            conexion.Close();

            TreeIter iter2;

            if (store2.GetIterFirst(out iter2))
            {
                //Console.WriteLine(iter2);
                combobox_tipo_admision.SetActiveIter(iter2);
            }
            combobox_tipo_admision.Changed  += new EventHandler(onComboBoxChanged_tipo_admision);
            combobox_tipo_admision2.Changed += new EventHandler(onComboBoxChanged_tipo_admision2);

            // Sale de la ventana
            button_salir.Clicked += new EventHandler(on_cierraventanas_clicked);

            // Activacion de boton de busqueda
            button_busca_producto.Clicked += new EventHandler(on_button_busca_producto_clicked);

            // Desactivando Entrys y Combobox
            this.entry_fecha_solicitud.Sensitive      = false;
            this.entry_fecha_requerida.Sensitive      = false;
            this.combobox_tipo_admision.Sensitive     = false;
            this.combobox_tipo_admision2.Sensitive    = false;
            this.entry_observaciones.Sensitive        = false;
            this.button_guardar_requisicion.Sensitive = false;

            statusbar_almacen_requi.Pop(0);
            statusbar_almacen_requi.Push(1, "login: "******"  |Usuario: " + NomEmpleado + " " + AppEmpleado + " " + ApmEmpleado);
            statusbar_almacen_requi.HasResizeGrip = false;

            // Creacion del treeview
            crea_treeview_requisicion();
        }
Beispiel #8
0
        //Contains all of the components which are on the window
        private void setupWindow()
        {
            //Vertical box (3 sections) which is the main container
            VBox MainVBox = new VBox(false, 6);

            /*********************Start of menu bar components*********************/

            //Note: Flow of menus are:
            //Menubar contains MenuItems (e.g. File, Edit, About, etc...)
            //MenuItems contains one Menu (i.e. a Submenu)
            //Menu contains multiple MenuItems (e.g. Save, Save As, Load, etc...)
            MenuBar MainMenuBar = new MenuBar ();

            Menu FileMenu = new Menu ();
            MenuItem File = new MenuItem ("File");
            File.Submenu = FileMenu;

            MenuItem ExitItem = new MenuItem ("Exit");
            ExitItem.Activated += quitProgram;
            FileMenu.Append (ExitItem);

            Menu GestureMenu = new Menu ();
            MenuItem Gesture = new MenuItem ("Gestures");
            Gesture.Submenu = GestureMenu;

            MenuItem LoadGesture = new MenuItem ("Load Gesture");
            LoadGesture.Activated += openGesture;
            GestureMenu.Append (LoadGesture);

            MenuItem SaveGestureItem = new MenuItem ("Save Gesture");
            SaveGestureItem.Activated += createGesture;
            GestureMenu.Append (SaveGestureItem);

            Menu PointsMenu = new Menu ();
            MenuItem Points = new MenuItem ("Data Points");
            Points.Submenu = PointsMenu;

            MenuItem LoadPointsItem = new MenuItem ("Load Points");
            LoadPointsItem.Activated += loadDataPoints;
            PointsMenu.Append (LoadPointsItem);

            MenuItem RecordPointsItem = new MenuItem ("Record Points");
            RecordPointsItem.Activated += recordPoints;
            PointsMenu.Append (RecordPointsItem);

            MenuItem BatchRecognizeItem = new MenuItem ("Batch Recognize");
            BatchRecognizeItem.Activated += batchRecognize;
            PointsMenu.Append (BatchRecognizeItem);

            Menu HelpMenu = new Menu ();
            MenuItem Help = new MenuItem ("Help");
            Help.Submenu = HelpMenu;

            MenuItem AboutMenuItem = new MenuItem("About");
            HelpMenu.Append (AboutMenuItem);

            MainMenuBar.Append (File);
            MainMenuBar.Append (Gesture);
            MainMenuBar.Append (Points);
            MainMenuBar.Append (Help);

            /*********************End of menu bar components*********************/

            //Drawing area which is the core component of the application
            dArea = new DrawingArea ();
            dArea.SetSizeRequest (500, 500);

            //Horizontal box (4 sections) which contains all of the buttons along the
            //bottom of the window
            HBox ButtonHBox = new HBox (false, 6);

            /*********************Start of Buttons*********************/

            Button BtnCreateGesture = new Button ("Create");
            Button BtnRecognizeGesture = new Button ("Recognize");
            Button BtnClearScreen = new Button ("Clear");
            Button BtnRecordPoints = new Button ("Record points");
            Button BtnChangeColour = new Button ("Change colour");

            //Button functions
            BtnCreateGesture.Clicked += new EventHandler (createGesture);
            BtnRecognizeGesture.Clicked += new EventHandler (recognizeGesture);
            BtnClearScreen.Clicked += new EventHandler (clearScreen);
            BtnRecordPoints.Clicked += new EventHandler (recordPoints);
            BtnChangeColour.Clicked += changeColour;

            //Adding buttons to the current horizontal box
            ButtonHBox.PackStart (BtnCreateGesture, true, false, 0);
            ButtonHBox.PackStart (BtnRecognizeGesture, true, false, 0);
            ButtonHBox.PackStart (BtnClearScreen, true, false, 0);
            ButtonHBox.PackStart (BtnRecordPoints, true, false, 0);
            ButtonHBox.PackStart (BtnChangeColour, true, false, 0);
            /*********************End of Buttons*********************/

            //Status bar which shows the score and recognized gesture
            sBar = new Statusbar ();
            sBar.Push (1, "Ready");

            //Entry box for batch function name to be used on the files
            batchFunctionName = new Entry ("Recorded points function name");
            batchFunctionName.AddEvents (
                (int)Gdk.EventMask.ButtonPressMask
            );
            batchFunctionName.ButtonPressEvent += clearTextBox;

            //Adding all components to the Vertical box
            MainVBox.PackStart (MainMenuBar, false, false, 0);
            MainVBox.PackStart (dArea, false, false, 0);
            MainVBox.PackStart (ButtonHBox, false, false, 0);
            MainVBox.PackStart (batchFunctionName, false, false, 0);
            MainVBox.PackStart (sBar, false, false, 0);

            Add (MainVBox);

            ShowAll ();

            //Surface 'pattern' for area to be covered
            surface = new ImageSurface(Format.Argb32, 500, 500);

            //Adding mouse events to the drawing area and assigning functions
            dArea.AddEvents(
                //Mouse Related Events
                (int)Gdk.EventMask.PointerMotionMask
                |(int)Gdk.EventMask.ButtonPressMask
                |(int)Gdk.EventMask.ButtonReleaseMask
            );

            //Repaint the Canvas Internally.
            dArea.ExposeEvent += OnDrawingAreaExposed;
            //Do this on MousePress inside Area
            dArea.ButtonPressEvent += OnMousePress;
            //Do this on MouseReleased inside Area
            dArea.ButtonReleaseEvent += OnMouseRelease;
            //Do this if a Motion Occurs inside the Drawing Area
            dArea.MotionNotifyEvent += OnMouseMotion2;

            //Assigning close function to the window
            DeleteEvent += delegate { Application.Quit(); };

            //Checking to see if bool for using the dot function is true
            //And assigning the required function as the delegate's operation
            //Note: This will always be true, no current way to switch while
            //application is running, has not been needed as of yet
            if (isDot) {
                Painter = new DrawShape (DrawDot);
                myoPainter = new DrawShape (DrawDot);
            } else {
                Painter = new DrawShape (DrawLine);
            }
        }
Beispiel #9
0
 /// <summary>Write message on main windows's statusbar</summary>
 public void PrintStatus(string message)
 {
     sbMain.Remove(printStatusContextID, printStatusMessageID);
     sbMain.Push(printStatusContextID, message);
 }
Beispiel #10
0
 private static void on_save_clicked(object o, EventArgs args)
 {
     Contributor.SaveToFile(subject_entry.Text, textbuffer.Text.Replace('\n', ' '), contrib_entry.Text);
     statusbar.Push(0, "File saved");
 }
Beispiel #11
0
    public MindFire(string[] args)
    {
        Application.Init();
        Glade.XML gxml = new Glade.XML(null, "gui.glade", "mindFire", null);
        gxml.Autoconnect(this);

        playButtonPixbuf       = new Gdk.Pixbuf(null, "media-play.png");
        playButtonImage        = new Gtk.Image();
        playButtonImage.Pixbuf = playButtonPixbuf;
        startButton.Add(playButtonImage);
        startButton.Sensitive = false;
        startButton.Clicked  += new EventHandler(StartRsvp);
        startButton.ShowAll();

        stopButtonPixbuf       = new Gdk.Pixbuf(null, "media-stop.png");
        stopButtonImage        = new Gtk.Image();
        stopButtonImage.Pixbuf = stopButtonPixbuf;
        stopButton.Add(stopButtonImage);
        stopButton.Sensitive = false;
        stopButton.Clicked  += new EventHandler(StopRsvp);
        stopButton.ShowAll();

        prevButtonPixbuf       = new Gdk.Pixbuf(null, "media-prev.png");
        prevButtonImage        = new Gtk.Image();
        prevButtonImage.Pixbuf = prevButtonPixbuf;
        prevButton.Add(prevButtonImage);
        prevButton.Sensitive = false;
        prevButton.Clicked  += new EventHandler(PreviousWord);
        prevButton.ShowAll();

        nextButtonPixbuf       = new Gdk.Pixbuf(null, "media-next.png");
        nextButtonImage        = new Gtk.Image();
        nextButtonImage.Pixbuf = nextButtonPixbuf;
        nextButton.Add(nextButtonImage);
        nextButton.Sensitive = false;
        nextButton.Clicked  += new EventHandler(NextWord);
        nextButton.ShowAll();

        speedUp.Clicked   += new EventHandler(SpeedUp);
        speedDown.Clicked += new EventHandler(SpeedDown);

        startMenuItem.Sensitive = false;
        stopMenuItem.Sensitive  = false;
        slider.ValueChanged    += new EventHandler(SliderMoved);
        noteBook.SwitchPage    += new SwitchPageHandler(NoteBookChanged);
        icon          = new Gdk.Pixbuf(null, "mindFireMonkey.png");
        mindFire.Icon = icon;

        dateTime = System.DateTime.Now;

        config = new Config();

        noteBook.SetTabLabelPacking(noteBook.GetNthPage(0), true, true, Gtk.PackType.Start);
        ftLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));
        riLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));
        sgLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));
        mlLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));

        statusBar.Push(0, "Ready");
        ShowWord(curWord);
        Application.Run();
    }
Beispiel #12
0
    /// <summary>
    /// Creates the GUI interface.
    /// </summary>
    private void CreateGui()
    {
        // Create a window
        SetDefaultSize(1000, 800);
        DeleteEvent += OnWindowDelete;

        // Create the window frame
        VBox box = new VBox();
        Add(box);

        // Add the menu
        box.PackStart(CreateGuiMenu(), false, false, 0);

        // Create a notebook
        box.PackStart(demoSprites, true, true, 0);

        // Add the status bar
        statusbar = new Statusbar();
        statusbar.Push(0, "Welcome!");
        statusbar.HasResizeGrip = true;
        box.PackStart(statusbar, false, false, 0);

        // Show everything as the final
        ShowAll();
    }
Beispiel #13
0
 private void SceneGLWidgetOnFpsChange(object sender, EventArgs eventArgs)
 {
     _appStatusbar.RemoveAll(_fpsStatusbarContextID);
     _appStatusbar.Push(_fpsStatusbarContextID, $"{_sceneGLWidget.FPS} FPS");
 }
        /// <summary>
        /// Constructs a demo object with the appropriate gui.
        /// </summary>
        public DemoWindow()
            : base("Moonfire Games' Gtk Demo")
        {
            // Create a window
            SetDefaultSize(1000, 800);
            DeleteEvent += OnWindowDelete;

            demoComponents = new DemoComponents();

            // Create a user action manager.
            var actionManager = new ActionManager(this);
            actionManager.Add(GetType().Assembly);

            demoConfiguratorsTab = new DemoConfiguratorsTab(this);

            actionManager.Add(demoConfiguratorsTab);

            demoActions = new DemoActions(actionManager);

            // Load the layout from the file system.
            layout = new ActionLayout(new FileInfo("ActionLayout1.xml"));
            actionManager.SetLayout(layout);

            // Load the keybinding from a file.
            keybindings = new ActionKeybindings(new FileInfo("ActionKeybindings1.xml"));
            actionManager.SetKeybindings(keybindings);

            // Create the window frame
            var box = new VBox();
            Add(box);

            // Create the components we need before the menu.
            notebook = new Notebook();

            actionManager.Add(new SwitchPageAction(notebook, 0, "Components"));
            actionManager.Add(new SwitchPageAction(notebook, 1, "Text Editor"));
            actionManager.Add(new SwitchPageAction(notebook, 2, "Actions"));
            actionManager.Add(new SwitchPageAction(notebook, 3, "Configurators"));

            // Create a notebook
            notebook.BorderWidth = 5;

            notebook.AppendPage(demoComponents, new Label("Components"));
            notebook.AppendPage(demoActions, new Label("Actions"));
            notebook.AppendPage(demoConfiguratorsTab, new Label("Configurators"));

            // Add the status bar
            statusbar = new Statusbar();
            statusbar.Push(0, "Welcome!");
            statusbar.HasResizeGrip = true;

            // Create the menu
            menubar = new MenuBar();

            // Back everything into place.
            box.PackStart(CreateGuiMenu(), false, false, 0);
            box.PackStart(notebook, true, true, 0);
            box.PackStart(statusbar, false, false, 0);
        }
Beispiel #15
0
 public void SetStatusMessage(string message)
 {
     Statusbar.Pop(0);
     Statusbar.Push(0, message);
 }
Beispiel #16
0
    /// <summary>
    /// Creates the GUI interface.
    /// </summary>
    private void CreateGui()
    {
        // Create a window
        SetDefaultSize(512, 512);
        DeleteEvent += OnWindowDelete;

        // Create the window frame
        VBox box = new VBox();
        Add(box);

        // Add the menu
        box.PackStart(CreateGuiMenu(), false, false, 0);

        // Create a notebook
        box.PackStart(new Viewer(), true, true, 0);

        // Add the status bar
        statusbar = new Statusbar();
        statusbar.Push(0, "Welcome!");
        statusbar.HasResizeGrip = true;
        box.PackStart(statusbar, false, false, 0);
    }
Beispiel #17
0
    // This requires that the perl program autorestart wraps this....
    public DialBOT()
        : base("DialBOT")
    {
        SetDefaultSize(800, 600);
        SetPosition(WindowPosition.Center);
        DeleteEvent += delegate { Application.Quit(); };

        // Top level container. This vertically divides the window into 3 sections:
        // Top is the 2 windows (balls-deep items and console output
        VBox topvbox = new VBox(false, 5);

        // Lets build the top 1/3rd here.
        Frame ballsdeepframe = new Frame("Balls-Deep Items");
        Frame consoleframe = new Frame("Console Output");
        // HBox mainhbox = new HBox(true,2);

        ballsdeeptree = new TreeView();

        bdstore = new TreeStore (typeof(string), typeof (string), typeof (string), typeof (string));
        LoadBalls();
        fillStore();

        // Put the TreeStore into a TreeModelSort so we can sort columns...
        // Sort by score for now
        bdsorted = new TreeModelSort(bdstore);
        bdsorted.SetSortColumnId(1,SortType.Descending);

        // Put the TreeModelSort into a TreeModelFilter so we can implement the filtering
        filterEntry = new Entry();
        // filter = new TreeModelFilter(bdsorted,null);
        // filter.VisibleFunc = FilterTreeFunc;   // Use this as the filter function.

        // And then set the visible TreeView to use the filter as it's store.
        ballsdeeptree.Model = bdsorted;

        ballsdeeptree.HeadersVisible = true;
        ballsdeeptree.HeadersClickable=true;
        ballsdeeptree.AppendColumn ("Added By", new CellRendererText (), "text", 0);
        ballsdeeptree.AppendColumn ("Score", new CellRendererText (), "text", 1);
        CellRendererText ballRenderer = new CellRendererText();
        ballsdeeptree.AppendColumn ("Text", ballRenderer, "text", 2);
        CellRendererText voteRenderer = new CellRendererText();
        voteRenderer.Editable=true;
        voteRenderer.Edited+=editVotes;
        ballsdeeptree.AppendColumn ("Votes", voteRenderer, "text", 3);

        TreeViewColumn col = ballsdeeptree.GetColumn(0);
        col.Clickable=true;
        col.Resizable = true;
        col.Clicked += new EventHandler (col_clicked0);

        col = ballsdeeptree.GetColumn(1);
        col.Resizable = true;
        col.Clickable=true;
        col.Clicked += new EventHandler (col_clicked1);

        col = ballsdeeptree.GetColumn(2);
        col.Resizable = true;
        col.Clickable=true;
        col.Clicked += new EventHandler (col_clicked2);

        col = ballsdeeptree.GetColumn(3);
        col.Clickable=true;
        col.Resizable = true;
        col.Clicked += new EventHandler (col_clicked3);

        ScrolledWindow ballsdeepscroll = new ScrolledWindow();

        ballsdeepscroll.Add(ballsdeeptree);

        Button deleteentry = new Button("Remove Entry");
        deleteentry.SetSizeRequest(70, 30);
        deleteentry.Clicked += new EventHandler(deleteBallMsg);

        ballsdeepframe.Add(ballsdeepscroll);
        ballsdeepframe.Add(deleteentry);

        // Entry box and label to filter on message as well as an HBox to put them next to each other
        filterEntry.Changed += OnFilterEntryTextChanged;
        Label filterLabel = new Label("Ball Message Search: ");
        HBox filterBox = new HBox();
        filterBox.PackStart(filterLabel,false,false,5);
        filterBox.PackStart(filterEntry,true,true,5);

        VBox ballvbox = new VBox(false,5);
        ballvbox.Add(ballsdeepframe);
        //ballvbox.PackStart(filterBox,false,false,1);

        topvbox.Add(ballvbox);

        consoleview = new TextView();
        consolebuffer=consoleview.Buffer;
        consolebuffer.Text = consoletext;

        ScrolledWindow consolescroll = new ScrolledWindow();
        consolescroll.SetPolicy(PolicyType.Automatic,PolicyType.Always);
        consolescroll.Add(consoleview);

        consoleframe.Add(consolescroll);

        followConsole = new CheckButton("Tail Console");
        followConsole.SetSizeRequest(70,30);

        VBox consolevbox = new VBox(false,5);
        consolevbox.Add(consoleframe);
        consolevbox.PackStart(followConsole,false,false,1);

        topvbox.Add(consolevbox);

        //        topvbox.PackStart(mainhbox, true,true,4);

        // Now the 2nd 3rd. This contains 2 buttons. A start/stop, and a close.
        HBox buttonhbox = new HBox(true, 3);
        startstop = new Button("Stop");
        startstop.SetSizeRequest(70, 30);
        startstop.Clicked += new EventHandler(startstopEvent);
        Button close = new Button("Close");
        close.Clicked += new EventHandler(quitEvent);

        buttonhbox.Add(startstop);
        buttonhbox.Add(close);

        Alignment halign = new Alignment(1, 0, 0, 0);
        halign.Add(buttonhbox);

        topvbox.PackStart(halign, false, false, 3);

        // Now the bottom 3rd. A status bar
        statusbar = new Statusbar();
        statusbar.Push(1,"Hey, it's a status");
        topvbox.PackStart(statusbar,false,false,0);

        // Add our top level container to the window
        Add(topvbox);

        ShowAll();
    }
Beispiel #18
0
 public void UpdateStatusBar()
 {
     statusbar.Push(0, session.StatusText);
 }
Beispiel #19
0
        /// <summary>
        /// Update Gtk objects properties
        /// </summary>
        private void UpdateGraphicObjects()
        {
            // Set dialog icon
            MainWindow.Icon = Gdk.Pixbuf.LoadFromResource("comex_256.png");

            // Set tool tip text for toolbutton
            TbOpen.TooltipText = GlobalObj.LMan.GetString("openact");
            TbOpen.Label       = GlobalObj.LMan.GetString("openlbl");

            TbClose.Label = GlobalObj.LMan.GetString("closelbl");

            TbSettings.Label       = GlobalObj.LMan.GetString("settingslbl");
            TbSettings.TooltipText = GlobalObj.LMan.GetString("settingsmenulbl");

            TbAbout.TooltipText = GlobalObj.LMan.GetString("infoact");
            TbAbout.Label       = GlobalObj.LMan.GetString("infolbl");

            TbExit.TooltipText = GlobalObj.LMan.GetString("exitact");
            TbExit.Label       = GlobalObj.LMan.GetString("exitlbl");

            TbATR.TooltipText = GlobalObj.LMan.GetString("atract");
            TbATR.Label       = GlobalObj.LMan.GetString("atrlbl");

            // Set labels
            ((Label)MenuFileItem.Child).TextWithMnemonic     = GlobalObj.LMan.GetString("filemenulbl");
            ((Label)MenuFileOpen.Child).TextWithMnemonic     = GlobalObj.LMan.GetString("openmenulbl");
            ((Label)MenuFileClose.Child).TextWithMnemonic    = GlobalObj.LMan.GetString("closemenulbl");
            ((Label)MenuFileSettings.Child).TextWithMnemonic = GlobalObj.LMan.GetString("settingsmenulbl");
            ((Label)MenuFileExit.Child).TextWithMnemonic     = GlobalObj.LMan.GetString("exitmenulbl");
            ((Label)MenuReaderItem.Child).TextWithMnemonic   = GlobalObj.LMan.GetString("readermenulbl");
            ((Label)MenuAboutItem.Child).TextWithMnemonic    = GlobalObj.LMan.GetString("helpmenulbl");
            ((Label)MenuAboutInfo.Child).TextWithMnemonic    = GlobalObj.LMan.GetString("infomenulbl");

            LblATR.Markup      = "<b>" + GlobalObj.LMan.GetString("atrframelbl") + "</b>";
            LblCommand.Text    = GlobalObj.LMan.GetString("cmdlbl");
            LblResponse.Text   = GlobalObj.LMan.GetString("resplbl");
            LblSend.Text       = GlobalObj.LMan.GetString("sendlbl");
            LblExchange.Markup = "<b>" + GlobalObj.LMan.GetString("cardframelbl") + "</b>";
            LblFile.Markup     = "<b>" + GlobalObj.LMan.GetString("commandfilelbl") + "</b>";

            Gdk.Color color = new Gdk.Color();
            Gdk.Color.Parse("#0000FF", ref color);
            TxtATR.ModifyText(StateType.Normal, color);
            Gdk.Color.Parse("#0000FF", ref color);
            TxtResp.ModifyText(StateType.Normal, color);

            Gdk.Color.Parse("#1F6D20", ref color);
            TxtCmd.ModifyText(StateType.Normal, color);

            // TreeView (List)
            LstCommands.Selection.Mode = SelectionMode.Single;
            CellRendererText rendererText = new CellRendererText();

            TreeViewColumn column = new TreeViewColumn();

            column.Title     = "Commands";
            column.Resizable = true;
            column.PackStart(rendererText, true);
            column.AddAttribute(rendererText, "text", 0);

            LstCommands.RulesHint = true;
            LstCommands.AppendColumn(column);

            if (GlobalObj.IsWindows())
            {
                LstCommands.ModifyFont(FontDescription.FromString("Courier New Normal 10"));
            }
            else
            {
                LstCommands.ModifyFont(FontDescription.FromString("Fixed Normal 10"));
            }


            // update gui menu
            Gtk.RadioMenuItem rmi;
            // loop for all readers
            List <string> allReaders = new List <string>();

            // loop for each managed readers type
            foreach (IReader rdr in GlobalObj.ReaderManager.Values)
            {
                allReaders.AddRange(rdr.Readers);
            }


            for (int n = 0; n < allReaders.Count; n++)
            {
                // set first as selected
                if (n == 0)
                {
                    rmi = new Gtk.RadioMenuItem(allReaders[n]);
                    GlobalObj.SelectedReader = allReaders[n];
                    StatusBar.Push(1, GlobalObj.LMan.GetString("selreader") + ": " + allReaders[n]);
                }
                else
                {
                    // added others
                    rmi = new Gtk.RadioMenuItem((RadioMenuItem)MenuReader.Children[0], allReaders[n]);
                }

                rmi.ButtonReleaseEvent += ActionChangeReader;
                MenuReader.Add(rmi);
            }

            MenuReader.ShowAll();
        }
Beispiel #20
0
        /// <summary>
        /// Update Gtk objects properties
        /// </summary>
        private void UpdateGraphicObjects()
        {
            // Set dialog icon
            MainWindow.Icon = Gdk.Pixbuf.LoadFromResource("monosim.png");

            // Set tool tip text for toolbutton
            TbNew.TooltipText      = GlobalObjUI.LMan.GetString("newfileact");
            TbOpen.TooltipText     = GlobalObjUI.LMan.GetString("openfileact");
            TbSaveFile.TooltipText = GlobalObjUI.LMan.GetString("savefileact");
            TbClose.TooltipText    = GlobalObjUI.LMan.GetString("closefileact");

            TbSaveSim.TooltipText = GlobalObjUI.LMan.GetString("savefilesimact");
            TbSaveSim.IconWidget  = new Gtk.Image(Pixbuf.LoadFromResource("chip_24.png"));
            TbSaveSim.ShowAll();

            TbSettings.TooltipText    = GlobalObjUI.LMan.GetString("settingsact");
            TbOpenSim.TooltipText     = GlobalObjUI.LMan.GetString("opensimact");
            TbChangePin.TooltipText   = GlobalObjUI.LMan.GetString("pinsimact");
            TbSaveSimFile.TooltipText = GlobalObjUI.LMan.GetString("savesimfileact");
            TbCloseSim.TooltipText    = GlobalObjUI.LMan.GetString("closesimact");

            TbSaveSimSim.TooltipText = GlobalObjUI.LMan.GetString("savesimact");
            TbSaveSimSim.IconWidget  = new Gtk.Image(Pixbuf.LoadFromResource("chip_24.png"));
            TbSaveSimSim.ShowAll();

            TbAbout.TooltipText = GlobalObjUI.LMan.GetString("infoact");
            TbExit.TooltipText  = GlobalObjUI.LMan.GetString("exitact");

            // change icons for chip
            MenuFileSaveSim.Image = new Gtk.Image(Pixbuf.LoadFromResource("chip_16.png"));
            MenuSimSaveSim.Image  = new Gtk.Image(Pixbuf.LoadFromResource("chip_16.png"));

            // Set labels
            ((Label)MenuFileItem.Child).TextWithMnemonic     = GlobalObjUI.LMan.GetString("filemenulbl");
            ((Label)MenuFileNew.Child).TextWithMnemonic      = GlobalObjUI.LMan.GetString("newfileact");
            ((Label)MenuFileOpen.Child).TextWithMnemonic     = GlobalObjUI.LMan.GetString("openfileact");
            ((Label)MenuFileSaveFile.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("savefileact");
            ((Label)MenuFileSaveSim.Child).TextWithMnemonic  = GlobalObjUI.LMan.GetString("savefilesimact");
            ((Label)MenuFileClose.Child).TextWithMnemonic    = GlobalObjUI.LMan.GetString("closefileact");
            ((Label)MenuFileSettings.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("settingsact");
            ((Label)MenuFileExit.Child).TextWithMnemonic     = GlobalObjUI.LMan.GetString("exitact");

            ((Label)MenuReaderItem.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("readermenulbl");

            ((Label)MenuSimItem.Child).TextWithMnemonic       = GlobalObjUI.LMan.GetString("simmenulbl");
            ((Label)MenuSimConnect.Child).TextWithMnemonic    = GlobalObjUI.LMan.GetString("opensimact");
            ((Label)MenuSimPin.Child).TextWithMnemonic        = GlobalObjUI.LMan.GetString("pinsimact");
            ((Label)MenuSimSaveFile.Child).TextWithMnemonic   = GlobalObjUI.LMan.GetString("savesimfileact");
            ((Label)MenuSimSaveSim.Child).TextWithMnemonic    = GlobalObjUI.LMan.GetString("savesimact");
            ((Label)MenuSimDeleteAll.Child).TextWithMnemonic  = GlobalObjUI.LMan.GetString("deletesimact");
            ((Label)MenuSimDisconnect.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("closesimact");

            ((Label)MenuAboutItem.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("helpmenulbl");
            ((Label)MenuAboutInfo.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("infoact");

            LblFile.Markup = "<b>" + GlobalObjUI.LMan.GetString("framefile") + "</b>";
            LblSim.Markup  = "<b>" + GlobalObjUI.LMan.GetString("framesim") + "</b>";


            // Set Popup menu
            ((Label)PopMenuFileAdd.Child).TextWithMnemonic  = GlobalObjUI.LMan.GetString("addcontacts");
            ((Label)PopMenuFileDel.Child).TextWithMnemonic  = GlobalObjUI.LMan.GetString("delcontacts");
            ((Label)PopMenuFileVSim.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("copycontactstosim");

            ((Label)PopMenuSimAdd.Child).TextWithMnemonic   = GlobalObjUI.LMan.GetString("addcontacts");
            ((Label)PopMenuSimDel.Child).TextWithMnemonic   = GlobalObjUI.LMan.GetString("delcontacts");
            ((Label)PopMenuSimVFile.Child).TextWithMnemonic = GlobalObjUI.LMan.GetString("copycontactstofile");


            // Set ListView
            string[] columnHeaders = new string[] { GlobalObjUI.LMan.GetString("descnumber"),
                                                    GlobalObjUI.LMan.GetString("phonenumber") };

            InitListView(ref lstFileContacts, ref LstFileContacts, columnHeaders);
            InitListView(ref lstSimContacts, ref LstSimContacts, columnHeaders);


            // update gui menu
            Gtk.RadioMenuItem rmi;

            // loop for all readers
            List <string> allReaders = new List <string>();

            // loop for each managed readers type
            foreach (IReader rdr in GlobalObj.ReaderManager.Values)
            {
                allReaders.AddRange(rdr.Readers);
            }


            for (int n = 0; n < allReaders.Count; n++)
            {
                // set first as selected
                if (n == 0)
                {
                    rmi = new Gtk.RadioMenuItem(allReaders[n]);
                    GlobalObj.SelectedReader = allReaders[n];
                    StatusBar.Push(1, GlobalObj.LMan.GetString("selreader") + ": " + allReaders[n]);
                }
                else
                {
                    // added others
                    rmi = new Gtk.RadioMenuItem((RadioMenuItem)MenuReader.Children[0], allReaders[n]);
                }

                rmi.ButtonReleaseEvent += ActionChangeReader;
                MenuReader.Add(rmi);
            }

            MenuReader.ShowAll();
        }